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 秒。