Gemini Omni Flash
Gemini Omni Flash 的文生视频、参考图、横竖屏参数和请求示例
gemini-omni-flash 适合快速生成 720p 横屏或竖屏短视频。它既支持纯文生视频,也支持最多 5 张参考图,适合批量内容、创意草稿和轻量图生视频。
与旧 Omni 页面区分
本页使用模型名 gemini-omni-flash 和 /v1/task/submit。旧模型 omni_flash-10s 使用 /v1/videos,模型名、参数和响应结构都不能与本页混用。
快速了解
| 项目 | 支持范围 |
|---|---|
| 任务流程 | POST /v1/task/submit 提交,GET /v1/task/{task_id} 查询 |
| 视频时长 | 3–10 秒 |
| 清晰度 | 仅 720p |
| 画面比例 | 16:9、9:16 |
| 素材输入 | 纯文字,或最多 5 张参考图 |
| 音频参数 | 无需传 audio |
请求使用 Bearer 认证,生成参数统一放在 input 对象中:
Authorization: Bearer $API_KEYinput 参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
prompt | string | 是 | 提示词,最多 5000 个字符 |
duration | integer | 是 | 3–10 秒 |
aspect_ratio | string | 是 | 16:9 或 9:16 |
resolution | string | 是 | 仅支持 720p |
image_references | array | 否 | 参考图,最多 5 张 |
n | integer | 否 | 生成数量,当前只支持 1 |
不传 image_references 即为文生视频。模型不支持 images、start_frames、end_frames、video_references、audio_references,也不要传 audio。
输出尺寸
| aspect_ratio | 720p |
|---|---|
16:9 | 1280x720 |
9:16 | 720x1280 |
请求示例
curl https://cdn.12ai.org/v1/task/submit \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-flash",
"input": {
"prompt": "一段现代办公室产品展示视频,镜头平稳推进,光线明亮,节奏轻快",
"aspect_ratio": "16:9",
"resolution": "720p",
"duration": 5
}
}'curl https://cdn.12ai.org/v1/task/submit \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-flash",
"input": {
"prompt": "参考图片中的小猪在草地上奔跑,镜头轻快跟随,画面明亮自然",
"image_references": [
{"url": "https://example.com/ref1.jpg"}
],
"aspect_ratio": "16:9",
"resolution": "720p",
"duration": 3
}
}'curl https://cdn.12ai.org/v1/task/submit \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-flash",
"input": {
"prompt": "竖屏短视频,一个咖啡杯放在窗边,晨光照入,镜头缓慢靠近,画面干净",
"aspect_ratio": "9:16",
"resolution": "720p",
"duration": 4
}
}'获取结果
提交成功后保存返回的 id,再用它查询任务:
curl https://cdn.12ai.org/v1/task/task_xxxxxxxxxxxxxxxx \
-H "Authorization: Bearer $API_KEY"当 status 为 completed 时,从 outputs 读取视频 URL:
{
"id": "task_xxxxxxxxxxxxxxxx",
"status": "completed",
"phase": "completed",
"outputs": [
"https://img.12ai.org/videos/task_xxxxxxxxxxxxxxxx_0.mp4"
],
"error": null
}轮询状态、失败处理和回调格式见 异步视频任务。
使用建议
| 场景 | 建议 |
|---|---|
| 快速文生视频 | 不传参考素材,只用 prompt 描述画面、动作和镜头 |
| 参考图视频 | 使用 image_references,最多 5 张 |
| 横屏或竖屏 | 横屏使用 16:9,竖屏使用 9:16;分辨率都固定为 720p |
| 首尾帧或视频修改 | 改用支持相应素材的 Seedance 或 Omni 兼容接口 |
