Omni 视频模型与请求示例
Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.
- Base URL:
https://api.4allapi.com;Header:Authorization: Bearer YOUR_API_KEY。 - 本地文件直接用 multipart 上传,平台会自动转存到本站媒体服务,无需自行寻找图床或填写 URL。JSON 示例使用本站公开演示素材;业务请求换成自己的文件。
- 视频:
POST /v1/videos,保存返回的任务 id;查询GET /v1/videos/{id};完成后GET /v1/videos/{id}/content。网络超时先查询已有任务,不直接重发生成。 - 图片:
POST /v1/images/generations;图像编辑使用POST /v1/images/edits的 multipart 文件入口。Gemini 协议另列原生结构示例。 - JSON 的图片数组优先使用
images,顺序有含义。Omni I2V 双图的第二张是尾帧;V2V 源视频用input_reference。同一素材不要重复塞进多个别名字段。 - 本地视频/图片上传使用 multipart,不手填 multipart boundary;不同模型的单文件限制分别列出。公开素材 URL 必须可直接下载,不能是需要登录的网盘页面。
- 分辨率表示最终交付要求,不描述成高分辨率原生直出。平台费用仍按现有计价。
- Nano Banana 2.1 默认 medium,可选 low / medium / high。
thinking_level是兼容别名,Gemini 结构使用generationConfig.thinkingConfig.thinkingLevel。它与最终下载尺寸分开;不更名为 quality。
素材上传例子
Section titled “素材上传例子”curl https://api.4allapi.com/v1/videos \ -H 'Authorization: Bearer YOUR_API_KEY' \ -F 'model=omni-1.2-i2v' -F 'prompt=缓慢移动,保留首尾构图' \ -F 'seconds=8' -F 'resolution=720p' -F 'aspect_ratio=16:9' \ -F 'input_reference=@first.png' -F 'input_reference=@last.png'curl https://api.4allapi.com/v1/images/edits \ -H 'Authorization: Bearer YOUR_API_KEY' \ -F 'model=gemini-nano-banana-2.1' -F 'prompt=将杯子改为蓝色,保留背景' \ -F 'image=@reference.png' -F 'resolution=2k' -F 'thinking_level=medium'Google 将于 2026 年 12 月 5 日下线 Omni Flash 1.1、Veo 3.1 Fast 和 Veo 3.1 Quality。建议迁移到 Omni 1.2;Veo 3.1 Lite 不在本次下线范围。Google 官方公告。
Nano Banana 名称对照
Section titled “Nano Banana 名称对照”| 模型 | 官方 API 名称 | 说明 |
|---|---|---|
| Nano Banana 2.1 | gemini-nano-banana-2.1 | 本文三档 thinking 参数仅用于此模型 |
| Nano Banana 2 Lite | gemini-3.1-flash-lite-image | 独立模型;旧 gemini-3.1-flash-image 按 Lite 兼容,不代表 2.1 |
| Nano Banana Pro | gemini-3-pro-image | 平台兼容名为 gemini-3.0-pro-image;不套用 2.1 的三档 thinking |
实际在售名称以模型广场为准。请求 2.1 时请明确填写 gemini-nano-banana-2.1。
上传本地视频和参考图片
Section titled “上传本地视频和参考图片”不需要预先准备素材 URL。用 -F 上传本地文件,平台会自动处理媒体转存;不要手动设置 multipart 的 Content-Type 或 boundary。
curl https://api.4allapi.com/v1/videos \ -H "Authorization: Bearer $API_KEY" \ -F 'model=omni-1.2-v2v' \ -F 'prompt=参考五张图片调整配色,保留源视频动作和镜头' \ -F 'seconds=8' -F 'resolution=720p' \ -F 'input_reference=@source.mp4;type=video/mp4' \ -F 'images=@ref-1.png;type=image/png' \ -F 'images=@ref-2.png;type=image/png' \ -F 'images=@ref-3.png;type=image/png' \ -F 'images=@ref-4.png;type=image/png' \ -F 'images=@ref-5.png;type=image/png'V2V 接收 1 个源视频与 0–5 张参考图片。图片使用 PNG、JPEG、WEBP 或 GIF,每张不超过 20 MiB;源视频建议使用 MP4/H.264,文件不超过 100 MiB。Omni 1.2 本次编辑范围最长 15 秒,旧 Omni 1.1 最长 10 秒。网页可先裁剪长视频,API 请上传已经裁剪到本次编辑范围的片段;不会把网页原片上传上限当作 API 可编辑时长。超出数量或文件大小会返回参数错误,不会静默截断参考图。
参考图依次用于主体、场景、道具或风格约束,不等同于首尾帧。先完成生成,再用相同 API Key 查询 /v1/videos/{id},状态完成后从 /v1/videos/{id}/content 下载。超时先查已有任务,避免重复提交。
Omni 1.2 · 文生视频
Section titled “Omni 1.2 · 文生视频”API 主模型:omni-1.2-t2v。
| 参数 | 类型 | 范围/默认 | 说明 |
|---|---|---|---|
| prompt | string | 必填 | 画面与动作描述 |
| seconds | integer | 整数 3–15 秒 | 也接受 duration;不要同时传冲突的时长 |
| aspect_ratio | string | 16:9 / 9:16 | 默认 16:9;V2V 按源视频处理 |
| resolution | string | 360p / 720p / 1080p / 4k | 默认 720p;最终交付尺寸,具体以当前插件能力配置为准 |
标准请求:POST /v1/videos
{ "model": "omni-1.2-t2v", "prompt": "镜头缓慢推进,展现阳光下的陶瓷杯与桌面光影。", "seconds": 8, "aspect_ratio": "16:9", "resolution": "720p"}Omni 1.2 · 图生视频
Section titled “Omni 1.2 · 图生视频”API 主模型:omni-1.2-i2v。
| 参数 | 类型 | 范围/默认 | 说明 |
|---|---|---|---|
| prompt | string | 必填 | 画面与动作描述 |
| seconds | integer | 单图 3–15 秒;双图 3–10 秒 | 也接受 duration;不要同时传冲突的时长 |
| aspect_ratio | string | 16:9 / 9:16 | 默认 16:9;V2V 按源视频处理 |
| resolution | string | 360p / 720p / 1080p / 4k | 默认 720p;最终交付尺寸,具体以当前插件能力配置为准 |
| images | string[] | 1 或 2 张;第二张为尾帧 | URL 或受支持的 data URI;本地文件使用 multipart 上传 |
标准请求:POST /v1/videos
{ "model": "omni-1.2-i2v", "prompt": "镜头缓慢推进,展现阳光下的陶瓷杯与桌面光影。", "seconds": 8, "aspect_ratio": "16:9", "resolution": "720p", "images": [ "https://docs.4allapi.com/examples/flow/ref-1.png" ]}首尾双图:POST /v1/videos
{ "model": "omni-1.2-i2v", "prompt": "镜头缓慢推进,展现阳光下的陶瓷杯与桌面光影。", "seconds": 10, "aspect_ratio": "16:9", "resolution": "720p", "images": [ "https://docs.4allapi.com/examples/flow/ref-1.png", "https://docs.4allapi.com/examples/flow/ref-2.png" ]}Omni 1.2 · 参考图生视频
Section titled “Omni 1.2 · 参考图生视频”API 主模型:omni-1.2-r2v。
| 参数 | 类型 | 范围/默认 | 说明 |
|---|---|---|---|
| prompt | string | 必填 | 画面与动作描述 |
| seconds | integer | 整数 3–15 秒 | 也接受 duration;不要同时传冲突的时长 |
| aspect_ratio | string | 16:9 / 9:16 | 默认 16:9;V2V 按源视频处理 |
| resolution | string | 360p / 720p / 1080p / 4k | 默认 720p;最终交付尺寸,具体以当前插件能力配置为准 |
| images | string[] | 1–10 张,按数组顺序保留 | URL 或受支持的 data URI;本地文件使用 multipart 上传 |
标准请求:POST /v1/videos
{ "model": "omni-1.2-r2v", "prompt": "镜头缓慢推进,展现阳光下的陶瓷杯与桌面光影。", "seconds": 8, "aspect_ratio": "16:9", "resolution": "720p", "images": [ "https://docs.4allapi.com/examples/flow/ref-1.png", "https://docs.4allapi.com/examples/flow/ref-2.png", "https://docs.4allapi.com/examples/flow/ref-3.png", "https://docs.4allapi.com/examples/flow/ref-4.png", "https://docs.4allapi.com/examples/flow/ref-5.png", "https://docs.4allapi.com/examples/flow/ref-6.png", "https://docs.4allapi.com/examples/flow/ref-7.png", "https://docs.4allapi.com/examples/flow/ref-8.png", "https://docs.4allapi.com/examples/flow/ref-9.png", "https://docs.4allapi.com/examples/flow/ref-10.png" ]}Omni 1.2 · 视频编辑
Section titled “Omni 1.2 · 视频编辑”API 主模型:omni-1.2-v2v。
| 参数 | 类型 | 范围/默认 | 说明 |
|---|---|---|---|
| prompt | string | 必填 | 画面与动作描述 |
| seconds | integer | 3–15 秒;省略时按源片处理,预扣上限 15 秒 | 也接受 duration;不要同时传冲突的时长 |
| aspect_ratio | string | 16:9 / 9:16 | 默认 16:9;V2V 按源视频处理 |
| resolution | string | 720p / 1080p / 4k | 默认 720p;最终交付尺寸,具体以当前插件能力配置为准 |
| input_reference | string | 1 个源视频,可附带 0–5 张参考图 | URL 或受支持的 data URI;本地文件使用 multipart 上传 |
| images | string[] | 0–5 张,顺序保留 | 可与唯一源视频一起提交 |
标准请求:POST /v1/videos
{ "model": "omni-1.2-v2v", "prompt": "镜头缓慢推进,展现阳光下的陶瓷杯与桌面光影。", "seconds": 8, "aspect_ratio": "16:9", "resolution": "720p", "input_reference": "https://docs.4allapi.com/examples/flow/source.mp4", "images": ["https://docs.4allapi.com/examples/flow/ref-1.png", "https://docs.4allapi.com/examples/flow/ref-2.png"]}- 源片长度、上传 trim 与生成输出时长是不同事实;当前插件没有公开透传 trim 起止字段。
Google 将于 2026 年 12 月 5 日下线 Omni Flash 1.1、Veo 3.1 Fast 和 Veo 3.1 Quality。建议迁移到 Omni 1.2;Veo 3.1 Lite 不在本次下线范围。Google 官方公告。
Omni · 文生视频
Section titled “Omni · 文生视频”API 主模型:omni-t2v。
| 参数 | 类型 | 范围/默认 | 说明 |
|---|---|---|---|
| prompt | string | 必填 | 画面与动作描述 |
| seconds | integer | 4 / 6 / 8 / 10 秒;默认 8 | 也接受 duration;不要同时传冲突的时长 |
| aspect_ratio | string | 16:9 / 9:16 | 默认 16:9;V2V 按源视频处理 |
| resolution | string | 360p / 720p / 1080p / 4k | 默认 720p;最终交付尺寸,具体以当前插件能力配置为准 |
标准请求:POST /v1/videos
{ "model": "omni-t2v", "prompt": "镜头缓慢推进,展现阳光下的陶瓷杯与桌面光影。", "seconds": 8, "aspect_ratio": "16:9", "resolution": "720p"}- 旧模型保留原时长、素材限制。不要把 Omni 1.2 的 15 秒、十图规则套到旧模型。
- 分辨率按插件配置;1080p / 4K 通过生成后下载放大。
Google 将于 2026 年 12 月 5 日下线 Omni Flash 1.1、Veo 3.1 Fast 和 Veo 3.1 Quality。建议迁移到 Omni 1.2;Veo 3.1 Lite 不在本次下线范围。Google 官方公告。
Omni · 图生视频
Section titled “Omni · 图生视频”API 主模型:omni-i2v。
| 参数 | 类型 | 范围/默认 | 说明 |
|---|---|---|---|
| prompt | string | 必填 | 画面与动作描述 |
| seconds | integer | 4 / 6 / 8 / 10 秒;默认 8 | 也接受 duration;不要同时传冲突的时长 |
| aspect_ratio | string | 16:9 / 9:16 | 默认 16:9;V2V 按源视频处理 |
| resolution | string | 360p / 720p / 1080p / 4k | 默认 720p;最终交付尺寸,具体以当前插件能力配置为准 |
| images | string[] | 当前插件 1 张 | 旧版主模型走单图入口;双图使用 Omni 1.2 |
标准请求:POST /v1/videos
{ "model": "omni-i2v", "prompt": "镜头缓慢推进,展现阳光下的陶瓷杯与桌面光影。", "seconds": 8, "aspect_ratio": "16:9", "resolution": "720p", "images": [ "https://docs.4allapi.com/examples/flow/ref-1.png" ]}- 旧模型保留原时长、素材限制。不要把 Omni 1.2 的 15 秒、十图规则套到旧模型。
- 分辨率按插件配置;1080p / 4K 通过生成后下载放大。
Google 将于 2026 年 12 月 5 日下线 Omni Flash 1.1、Veo 3.1 Fast 和 Veo 3.1 Quality。建议迁移到 Omni 1.2;Veo 3.1 Lite 不在本次下线范围。Google 官方公告。
Omni · 参考图生视频
Section titled “Omni · 参考图生视频”API 主模型:omni-r2v。
| 参数 | 类型 | 范围/默认 | 说明 |
|---|---|---|---|
| prompt | string | 必填 | 画面与动作描述 |
| seconds | integer | 固定 8 秒 | 也接受 duration;不要同时传冲突的时长 |
| aspect_ratio | string | 16:9 / 9:16 | 默认 16:9;V2V 按源视频处理 |
| resolution | string | 360p / 720p / 1080p / 4k | 默认 720p;最终交付尺寸,具体以当前插件能力配置为准 |
| images | string[] | 1–3 张 | 更多参考图请使用 Omni 1.2 R2V |
标准请求:POST /v1/videos
{ "model": "omni-r2v", "prompt": "镜头缓慢推进,展现阳光下的陶瓷杯与桌面光影。", "seconds": 8, "aspect_ratio": "16:9", "resolution": "720p", "images": [ "https://docs.4allapi.com/examples/flow/ref-1.png" ]}- 旧模型保留原时长、素材限制。不要把 Omni 1.2 的 15 秒、十图规则套到旧模型。
- 分辨率按插件配置;1080p / 4K 通过生成后下载放大。
Google 将于 2026 年 12 月 5 日下线 Omni Flash 1.1、Veo 3.1 Fast 和 Veo 3.1 Quality。建议迁移到 Omni 1.2;Veo 3.1 Lite 不在本次下线范围。Google 官方公告。
Omni · 视频编辑
Section titled “Omni · 视频编辑”API 主模型:omni-v2v。
| 参数 | 类型 | 范围/默认 | 说明 |
|---|---|---|---|
| prompt | string | 必填 | 画面与动作描述 |
| seconds | integer | 最多 10 秒;可省略 | 也接受 duration;不要同时传冲突的时长 |
| aspect_ratio | string | 16:9 / 9:16 | 默认 16:9;V2V 按源视频处理 |
| resolution | string | 720p / 1080p / 4k | 默认 720p;最终交付尺寸,具体以当前插件能力配置为准 |
| input_reference | string | 1 个源视频 | 当前插件不附带额外图片 |
| images | string[] | 0–5 张,顺序保留 | 可与唯一源视频一起提交 |
标准请求:POST /v1/videos
{ "model": "omni-v2v", "prompt": "镜头缓慢推进,展现阳光下的陶瓷杯与桌面光影。", "seconds": 8, "aspect_ratio": "16:9", "resolution": "720p", "input_reference": "https://docs.4allapi.com/examples/flow/source.mp4", "images": ["https://docs.4allapi.com/examples/flow/ref-1.png", "https://docs.4allapi.com/examples/flow/ref-2.png"]}- 旧模型保留原时长、素材限制。不要把 Omni 1.2 的 15 秒、十图规则套到旧模型。
- 分辨率按插件配置;1080p / 4K 通过生成后下载放大。
Google 将于 2026 年 12 月 5 日下线 Omni Flash 1.1、Veo 3.1 Fast 和 Veo 3.1 Quality。建议迁移到 Omni 1.2;Veo 3.1 Lite 不在本次下线范围。Google 官方公告。
Omni · 40 秒组合视频
Section titled “Omni · 40 秒组合视频”API 主模型:omni-40s。
| 参数 | 类型 | 范围/默认 | 说明 |
|---|---|---|---|
| seconds | integer | 固定 40 | 插件当前只接受 40 秒 |
| images | string[] | 0–9 张 | 可省略 |
| aspect_ratio | string | 16:9 / 9:16 | 默认 16:9;V2V 按源视频处理 |
| resolution | string | 360p / 720p / 1080p / 4k | 默认 720p;最终交付尺寸,具体以当前插件能力配置为准 |
40 秒请求:POST /v1/videos
{ "model": "omni-40s", "prompt": "镜头缓慢推进,展现阳光下的陶瓷杯与桌面光影。", "seconds": 40, "aspect_ratio": "16:9", "resolution": "720p"}- 这是多段编排及拼接,不是单次生成 40 秒。
- 当前注册包含此模型,但本轮未新增长片和各分辨率完整成片验收。