# Gemini Omni 1.2 Flash API Google の動画生成モデル Gemini Omni 1.2 Flash の API リファレンスです。 ## モデルの種類 この API は次の 4 種類のモデルに対応しています。 | モデル | ID | 説明 | |-------|-----|-------------| | **Gemini Omni 1.2 Flash Text to Video** | `gemini-omni-1.2-flash-text-to-video` | テキストプロンプトから動画を生成 | | **Gemini Omni 1.2 Flash Image to Video** | `gemini-omni-1.2-flash-image-to-video` | 必須の開始フレーム画像を動画化。終了フレーム画像も指定可能 | | **Gemini Omni 1.2 Flash Video Edit** | `gemini-omni-1.2-flash-video-edit` | プロンプトに従って既存の動画を編集 | | **Gemini Omni 1.2 Flash Reference to Video** | `gemini-omni-1.2-flash-reference-to-video` | 参照画像、参照動画、またはその両方から動画を生成 | ## 機能比較 | 機能 | テキストから動画生成 | 画像から動画生成 | 動画編集 | 参照素材から動画生成 | |---------|---------------|----------------|------------|--------------------| | 主な入力 | テキストプロンプト | 開始画像とテキストプロンプト | 元動画とテキストプロンプト | テキストプロンプトと 1 点以上の参照画像または参照動画 | | 長さ | 3~15 秒 | 3~15 秒(終了フレーム指定時は 3~10 秒) | 元動画は 10 秒以内 | 3~15 秒 | | 対応解像度 | 360p, 720p, 1080p, 4k | 360p, 720p, 1080p, 4k | 360p, 720p, 1080p, 4k | 360p, 720p, 1080p, 4k | | アスペクト比 | 16:9, 9:16 | 16:9, 9:16 | 非対応 | 16:9, 9:16 | | 任意の入力 | なし | 終了画像 | なし | 画像は最大 10 枚、動画は最大 3 本。参照素材が最低 1 点必要 | ## 共通エンドポイント Gemini Omni 1.2 Flash の全モデルで、次の動画タスク用エンドポイントを使用します。 ``` POST /api/v1/video/task ``` ## Gemini Omni 1.2 Flash Text to Video ### 必須パラメータ | パラメータ | 型 | 説明 | |-----------|------|-------------| | `model_name` | string | `"gemini-omni-1.2-flash-text-to-video"` を指定 | | `prompt` | string | 生成したい動画の内容を記述するテキスト | | `aspect_ratio` | string | 出力のアスペクト比。`"16:9"` または `"9:16"` | | `resolution` | string | 出力解像度。`"360p"`、`"720p"`、`"1080p"`、`"4k"` のいずれか | | `duration` | integer | 出力動画の長さ(秒)。3~15 の整数 | ### リクエスト例 ```javascript 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` | string | `"gemini-omni-1.2-flash-image-to-video"` を指定 | | `prompt` | string | 動きやシーンの展開を記述するテキスト | | `image_url` | string | 必須の開始フレーム画像の URL | | `aspect_ratio` | string | 出力のアスペクト比。`"16:9"` または `"9:16"` | | `resolution` | string | 出力解像度。`"360p"`、`"720p"`、`"1080p"`、`"4k"` のいずれか | | `duration` | integer | 出力動画の長さ(秒)。終了フレームを指定しない場合は 3~15、`image_end_url` を指定する場合は 3~10 | ### 任意のパラメータ | パラメータ | 型 | 説明 | |-----------|------|-------------| | `image_end_url` | string | 任意の終了フレーム画像の URL。指定する場合、`duration` は 3~10 秒 | ### リクエスト例 ```javascript { 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 ### 必須パラメータ | パラメータ | 型 | 説明 | |-----------|------|-------------| | `model_name` | string | `"gemini-omni-1.2-flash-video-edit"` を指定 | | `prompt` | string | 動画に加えたい編集内容を指示するテキスト | | `video_url` | string | 元動画の URL。元動画の長さは 10 秒以内 | | `resolution` | string | 出力解像度。`"360p"`、`"720p"`、`"1080p"`、`"4k"` のいずれか | **注意:** 動画編集では `aspect_ratio` と `duration` は使用できません。リクエストから両方のパラメータを省いてください。 ### リクエスト例 ```javascript { 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` | string | `"gemini-omni-1.2-flash-reference-to-video"` を指定 | | `prompt` | string | 生成したい動画の内容を記述するテキスト | | `aspect_ratio` | string | 出力のアスペクト比。`"16:9"` または `"9:16"` | | `resolution` | string | 出力解像度。`"360p"`、`"720p"`、`"1080p"`、`"4k"` のいずれか | | `duration` | integer | 出力動画の長さ(秒)。3~15 の整数 | ### 任意の参照素材 | パラメータ | 型 | 説明 | |-----------|------|-------------| | `images` | string[] | 参照画像の URL(最大 10 件)。参照動画を指定する場合は省略可能 | | `videos` | string[] | 参照動画の URL(最大 3 件)。各動画の長さは 3 秒以内。参照画像を指定する場合は省略可能 | ### リクエスト例 ```javascript { 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` を返します。 ```json { "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}` を定期的に呼び出してステータスを確認します。 ```json { "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`: 動画の生成に失敗 ## ベストプラクティス 1. **プロンプトの書き方** 被写体、動作、カメラの動き、照明、シーンの展開を具体的に記述してください。 2. **必須設定** すべてのモデルで対応する解像度を指定してください。動画編集以外では、対応するアスペクト比と長さも指定してください。 3. **画像の入力** 開始画像、終了画像、参照画像には、安定してアクセスできる公開 URL を使用してください。終了フレーム画像を指定する場合は、`duration` を 3~10 秒に設定してください。 4. **動画編集の入力** 送信前に、元動画の長さが 10 秒以内であることを確認してください。 5. **参照素材の制限** 画像または動画を最低 1 点指定してください。画像は最大 10 枚、動画は最大 3 本で、各参照動画の長さは 3 秒以内です。