用途
Gemini Omni 是 Google DeepMind 的视频生成与编辑模型系列。OpenMontage 直连适配器 gemini_omni_video 通过 Gemini Interactions API 调用正式版 Gemini Omni 1.1 Flash(gemini-omni-1.1-flash),实现基线能力:生成 3–10 秒、720p/24fps、带合成音频的短视频。其核心差异点是有状态的会话式编辑——每次生成返回 interaction_id,后续调用携带 previous_interaction_id 即可在原视频上就地修改;其他被包装的提供商无法在不重新生成的情况下细化片段。
适配器与 google_imagen、google_tts 共用 GOOGLE_API_KEY/GEMINI_API_KEY。仅支持付费档:输出视频约每秒 0.10 美元(每秒 5,792 个输出 token,按 $17.50/1M 计,另计输入与文本/思考输出)。
替代路由与限制
| 路由 | OpenMontage 调用 | 重要限制 |
|---|---|---|
| fal.ai | gemini_omni_fal | T2V、I2V、参考视频、编辑端点;不返回 Google interaction ID |
| Runway | runway_video, model: "gemini_omni_flash" | T2V/I2V/V2V;视频编辑最多接受五张图像参考 |
| ComfyUI Partner Node | 在此适配器中不是稳定的 1.1 回退 | 现有 GeminiVideoOmni 映射指向旧预览节点,需先迁移到 GeminiVideoOmniV2 |
会话式编辑请使用直连 gemini_omni_video 路由;网关路由返回普通提供商任务,无法保留 previous_interaction_id 工作流。fal 编辑端点可通过把每次输出视频 URL 传入下一次编辑调用来迭代。
适用与不适用
适合:分层迭代细化同一片段;编辑已有/上传的片段(换风格、增删物体、改文字);通过提示词标签绑定参考图主体/风格;从单个提示词按时间码排布多节拍片段;屏幕文字与逐词文字节拍。
不适合:一次性电影级主片段(→ Seedance 2.0);超过 10 秒或高于 720p 的片段;可复现种子的生成(不支持 seed);首尾帧插值(→ veo_video);非英语旁白(仅英语完全支持)。
生成操作走 video_selector;编辑(edit_video)是直接工具操作,需从注册表直接调用 gemini_omni_video,因为多轮交互状态在 selector 模型之外。
计费与时长
duration 只是给调用方的规划/提示,适配器不会发给 Google;请在提示词或时间码中表达时序,由模型决定实际长度,它也不限制计费。ToolResult.cost_usd 在有效 usage 时按输入 $1.50/1M(所有模态)、输出文本 $9.00/1M、输出视频 $17.50/1M 计算;未知/未分类输出及单独报告的思考 token 按较高 $17.50/1M 计,避免低报。无有效 usage 时回退按最大 10 秒输出估算:10 × 5,792 × $17.50/1M = $1.0136,再加提示词和可用媒体输入的保守上限;较短的 duration 提示不会降低该回退值。
生成提示词
描述场景 + 镜头 + 灯光 + 运动 + 音频。官方示例:
Continuous, unbroken handheld shot of a fluffy tabby cat sitting on a sunny windowsill, looking out into a leafy garden. The cat's tail twitches slowly, and its ears rotate slightly toward ambient noises. Sunbeams illuminate dust motes in the air.
- 显式要求单镜头:"In a single continuous shot," / "No scene cuts.",否则模型可能在场景间切换。
- 负向要求写在散文里,没有 negative_prompt 参数:"No dialogue," "No extra sound effects."
- 无采样控制:system instructions、temperature、top_p、seed 均不支持,提示词是唯一杠杆。
- 质量元提示:"Consider micro-detail, expression and timing to create a very rich, detailed but entirely natural scene."
时间码语法
用方括号范围或自然语言排布节拍,可直接对应 OpenMontage 场景计划时序:
[0-3s] A person is walking [3-6s] They stop and turn around
或 "After 3 seconds, a woman enters the scene." / "At 5s the chorus starts in the background audio."
音频与屏幕文字
音频自动合成,可在提示词中引导:"Include calm background music," "The audio is a low tinny radio broadcast in the background." 渲染文字可用并计时:
One word on the screen at a time: 'did, you, know, that, Omni, can, do, awesome, text?' Each word appears for 1s.
参考图(<FIRST_FRAME> / <IMAGE_REF_N>)
通过 reference_image_paths 按顺序传入本地图片,再在提示词中用标签绑定角色。<IMAGE_REF_N> 从 0 开始按提供顺序索引:
in the style of <IMAGE_REF_0> a woman <IMAGE_REF_1> is walking
[0-3s] A studio fashion sequence. Starting with woman <IMAGE_REF_0>, she is holding <IMAGE_REF_1> [3-6s] Then we see the man <IMAGE_REF_2> holding <IMAGE_REF_3>
<FIRST_FRAME> a woman is walking. 可将图片设为开场帧。使用高分辨率图片;具体描述预期动作,而非 "make it move";说明每张图是什么(产品/角色/风格/背景参考)。
会话式编辑
编辑提示词与生成提示词相反:简短、精准。过度描述会导致意外改动。
- 生成基础片段(主体 + 场景 + 运动),结果数据返回 interaction_id。
- 以 previous_interaction_id 传回,operation="edit_video",只描述增量。
- 追加 "Keep everything else the same." 固定未提及元素。
- 分层细化——一轮灯光、一轮镜头、一轮动作、一轮音频。
官方好坏对比:
| 避免 | 改用 |
|---|---|
| "In the video of the man sitting on the sofa, please add a small black cat..." | "Add a cat that jumps onto his lap, he begins to pet it. Keep everything else the same." |
| "Please remove the cell phone... and fill in the background so it looks like..." | "Make the phone invisible. Keep everything else the same." |
其他可用编辑提示:"Make this video anime" / "Put a fashionable hat on this person" / "Change the lighting to be more dramatic" / "Change the text on the sign to say 'Omni Flash'"。
注意:通过 previous_interaction_id 编辑只有在先前调用将交互保留在服务端时才有效(gemini_omni_video 的 store 默认为 true)。只对永不编辑的一次性生成设 store=false。
下载恢复:已接受的付费生成后,Files API 轮询或下载仍可能失败。此时工具返回 output_uri、有效 usage 时的按 usage 计费成本(否则保守回退值)及 resume_download 载荷;把该载荷传回 gemini_omni_video 仅重试现有文件的 GET/轮询流程,不得再提交付费生成。
编辑上传视频:传 input_video_path 而非 previous_interaction_id,工具通过 Files API 上传。欧洲经济区、瑞士、英国不可用(编辑已生成视频在所有地区可用)。
当前适配器限制(正式版模型)
- 输出:3–10 秒、720p、24fps、带音频 MP4;宽高比 16:9 或 9:16;所有输出带不可见 SynthID 水印。
- 无 seed、负向提示词、temperature、top_p 或 system instructions。
- 稳定版 Google 模型支持视频延长、首尾帧插值及更多分辨率,但本 OpenMontage 适配器未实现这些控制,不应宣传为直连工具功能。无语音编辑。
- 不支持音频参考输入;≤3 秒的视频参考虽被 schema 接受但处理不正确,不要依赖。
- 不支持多视频提示,可能降低输出质量。
- 英语完全支持,其他语言未测试。
- 欧洲经济区/瑞士/英国的未成年人图片及某些可识别人物被禁止上传/编辑。
资料来源
- 生成与编辑指南:https://ai.google.dev/gemini-api/docs/omni
- 模型卡:https://ai.google.dev/gemini-api/docs/models/gemini-omni-flash
- 定价:https://ai.google.dev/gemini-api/docs/pricing
- 公告:https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-omni/