Gemini Omni 1.1 Flash API
Google Gemini Omni 1.1 Flash 影片生成模型的完整 API 參考文件。
模型變體
此 API 支援四種模型變體:
快速比較
共用端點
所有 Gemini Omni 1.1 Flash 變體皆使用影片任務端點:
POST /api/v1/video/task
Gemini Omni 1.1 Flash 文字生成影片
必要參數
請求範例
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.1-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: 8
})
});
const { data } = await response.json();
const taskId = data.task_id;
Gemini Omni 1.1 Flash 圖像生成影片
必要參數
可選參數
請求範例
{
model_name: 'gemini-omni-1.1-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.1 Flash 影片編輯
必要參數
注意: Video Edit 不支援 aspect_ratio 或 duration。請勿在請求中包含這兩個參數。
請求範例
{
model_name: 'gemini-omni-1.1-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.1 Flash 參考素材生成影片
參考圖像和影片均為可選,可單獨使用或同時使用。
必要參數
可選參考輸入
請求範例
{
model_name: 'gemini-omni-1.1-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: 8,
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": {
"videos": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
}
}
狀態值
submitted:任務已接受,正在等待處理
processing:正在生成影片
succeed:影片生成完成
failed:影片生成失敗
最佳實務
- 提示詞指引:清楚描述主體、動作、鏡頭移動、光線和場景發展。
- 必要設定:務必提供支援的解析度;除 Video Edit 外,還需提供支援的長寬比和時長。
- 圖像輸入:為起始圖像、結束圖像和參考圖像使用穩定且可公開存取的 URL。
- 影片編輯輸入:提交前確認來源影片的時長介於 3 到 10 秒之間。
- 參考素材限制:提交的圖像不得超過 10 張,影片不得超過 3 個,並確保每個參考影片的時長不超過 3 秒。