Gemini Omni 1.2 Flash API
Google の動画生成モデル Gemini Omni 1.2 Flash の API リファレンスです。
モデルの種類
この API は次の 4 種類のモデルに対応しています。
機能比較
共通エンドポイント
Gemini Omni 1.2 Flash の全モデルで、次の動画タスク用エンドポイントを使用します。
POST /api/v1/video/task
Gemini Omni 1.2 Flash Text to Video
必須パラメータ
リクエスト例
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'gemini-omni-1.2-flash-text-to-video',
prompt: 'A cinematic tracking shot follows a sailboat crossing a glowing ocean at sunset',
aspect_ratio: '16:9',
resolution: '1080p',
duration: 12
})
});
const { data } = await response.json();
const taskId = data.task_id;
Gemini Omni 1.2 Flash Image to Video
必須パラメータ
任意のパラメータ
リクエスト例
{
model_name: 'gemini-omni-1.2-flash-image-to-video',
prompt: 'The girl walks toward the camera while the city lights shimmer behind her',
image_url: 'https://example.com/start-frame.jpg',
image_end_url: 'https://example.com/end-frame.jpg',
aspect_ratio: '9:16',
resolution: '1080p',
duration: 8
}
Gemini Omni 1.2 Flash Video Edit
必須パラメータ
注意: 動画編集では aspect_ratio と duration は使用できません。リクエストから両方のパラメータを省いてください。
リクエスト例
{
model_name: 'gemini-omni-1.2-flash-video-edit',
prompt: 'A small ball rolls into the scene and captures the attention of the cat',
video_url: 'https://example.com/source-video.mp4',
resolution: '1080p'
}
Gemini Omni 1.2 Flash Reference to Video
参照画像と参照動画は、どちらか一方でも併用でも構いません。images または videos に、画像か動画を最低 1 点指定してください。
必須パラメータ
任意の参照素材
リクエスト例
{
model_name: 'gemini-omni-1.2-flash-reference-to-video',
prompt: 'Use the references to create a cinematic shot of a small boat approaching from the distance',
aspect_ratio: '16:9',
resolution: '1080p',
duration: 12,
images: ['https://example.com/boat-reference.jpg'],
videos: ['https://example.com/motion-reference.mp4']
}
レスポンス形式
初回レスポンス
すべてのモデルがポーリング用の task_id を返します。
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
ポーリング時のレスポンス
GET /api/v1/video/{taskId} を定期的に呼び出してステータスを確認します。
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"task_result": {
"credit": 0.2,
"videos": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
}
}
ステータスの値
submitted: タスクを受け付け、処理を待機中
processing: 動画を生成中
succeed: 動画の生成が完了
failed: 動画の生成に失敗
ベストプラクティス {#}
- プロンプトの書き方 被写体、動作、カメラの動き、照明、シーンの展開を具体的に記述してください。
- 必須設定 すべてのモデルで対応する解像度を指定してください。動画編集以外では、対応するアスペクト比と長さも指定してください。
- 画像の入力 開始画像、終了画像、参照画像には、安定してアクセスできる公開 URL を使用してください。終了フレーム画像を指定する場合は、
duration を 3~10 秒に設定してください。
- 動画編集の入力 送信前に、元動画の長さが 10 秒以内であることを確認してください。
- 参照素材の制限 画像または動画を最低 1 点指定してください。画像は最大 10 枚、動画は最大 3 本で、各参照動画の長さは 3 秒以内です。