Gentle seamless cinematic transition inside the sunlit rehearsal room: faded sepia archival tones gradually bloom into rich natural living color as the violinist draws her bow smoothly, the center accordionist gently compresses the bellows, and the conductor lifts her baton to cue the phrase. Natural daylight through the tall window, faithful preservation of all three musicians and instruments. Audio: warm chamber violin and accordion chord.
Gemini Omni 1.2 Flash Image to Video API
google/gemini-omni-1.2-flash/image-to-videoGemini Omni 1.2 Flash Image to Video API 将首帧或首尾帧转化为 3–15 秒 360p–4K 视频。它在保留原图构图与风格的同时,精准执行运镜与关键帧过渡。
拖拽文件、粘贴剪贴板素材,或输入 URL。 必填,1–2 张图片:首帧 + 可选尾帧(含尾帧时最长 10 秒)。
2/2 个素材
示例
REST API
快速开始
三步完成一次 Gemini Omni 1.2 Flash Image to Video 请求,支持 360p 至 4K 多档分辨率。
连接 Vidgo API
在控制台创建 API Key 并仅在服务端通过 Bearer Token 发送。
- 端点
- POST
https://api.vidgo.ai/api/generate/submit - 认证
- Authorization: Bearer VIDGO_API_KEY
提交任务
向 /api/generate/submit 发送模型 ID 与对应模式参数。
curl --request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "google/gemini-omni-1.2-flash/image-to-video",
"input": {
"prompt": "Gentle seamless cinematic transition inside the sunlit rehearsal room: faded sepia archival tones gradually bloom into rich natural living color as the violinist draws her bow smoothly, the center accordionist gently compresses the bellows, and the conductor lifts her baton to cue the phrase. Natural daylight through the tall window, faithful preservation of all three musicians and instruments. Audio: warm chamber violin and accordion chord.",
"image_urls": [
"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/02/input-01.jpg",
"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/02/output.jpg"
],
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
}'等待视频完成
轮询状态接口直至 finished 或 failed,成功后读取 data.files[].file_url。
查询状态
GET https://api.vidgo.ai/api/generate/status/{task_id}在 not_started 或 running 状态继续轮询,finished 后读取 data.files[].file_url。
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "P8Z97PVFRCAVP3A3",
"status": "not_started",
"created_time": "2026-11-25T11:17:28"
}
}{
"code": 200,
"data": {
"task_id": "P8Z97PVFRCAVP3A3",
"status": "finished",
"files": [
{
"file_type": "video",
"file_url": "https://cdn.vidgo.ai/apis/models/google/gemini-omni-1.2-flash/image-to-video/v1/01/output.mp4"
}
],
"created_time": "2026-11-25T11:17:28",
"error_message": null,
"progress": 100
}
}完整可运行示例
包含提交、轮询、终态判断与结果读取的完整脚本。
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "google/gemini-omni-1.2-flash/image-to-video",
"input": {
"prompt": "Gentle seamless cinematic transition inside the sunlit rehearsal room: faded sepia archival tones gradually bloom into rich natural living color as the violinist draws her bow smoothly, the center accordionist gently compresses the bellows, and the conductor lifts her baton to cue the phrase. Natural daylight through the tall window, faithful preservation of all three musicians and instruments. Audio: warm chamber violin and accordion chord.",
"image_urls": [
"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/02/input-01.jpg",
"https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/02/output.jpg"
],
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
}
JSON
)
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
TASK_ID=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.data.task_id // .task_id // empty')
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
while true; do
STATUS_RESPONSE=$(curl --silent --show-error --fail-with-body \
--url "https://api.vidgo.ai/api/generate/status/$TASK_ID" \
--header "Authorization: Bearer $VIDGO_API_KEY")
STATUS=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.data.status // .status // empty')
case "$STATUS" in
finished)
printf '%s' "$STATUS_RESPONSE" | jq -r '(.data.files // .files // [])[]?.file_url'
break
;;
failed)
printf '%s' "$STATUS_RESPONSE" | jq -r '.data.error_message // .error_message // "Generation failed"' >&2
exit 1
;;
not_started|running)
sleep 2
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
done请求参数
顶层传递 model 和可选 callback_url,模式参数放在 input 对象内。
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| model | string | 是 | — | 固定为 google/gemini-omni-1.2-flash/image-to-video。 |
| callback_url | string (URL) | 否 | — | 任务完成或失败后接收结果的公开 HTTP(S) 地址。 |
| input.prompt | string | 是 | — | 动作与转场说明(1–20,000 字符)。 |
| input.image_urls | string[] | 是 | — | 1–2 张公开图片 URL:首帧 + 可选尾帧。 |
| input.duration | integer | 否 | 8 | 3–15 秒(提供 2 张图时上限为 10 秒)。 |
| input.resolution | string | 否 | 720p | 360p、720p、1080p 或 4k。 |
| input.aspect_ratio | string | 否 | 16:9 | 16:9 或 9:16。 |
响应字段
提交响应返回 task_id,状态接口在任务完成后返回视频文件或错误说明。
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | 业务状态码,0 或 200 表示成功。 |
| data.task_id | string | 用于状态轮询的唯一任务 ID。 |
| data.status | string | not_started | running | finished | failed |
| data.progress | number | 0–100 进度值。 |
| data.files[].file_url | string | 生成的视频地址。 |
| data.files[].file_type | string | 视频结果为 video。 |
| data.error_message | string | null | 失败原因。 |
任务生命周期
仅在 not_started 和 running 时轮询,finished 与 failed 为终态。
not_started任务已入队,等待执行。
running视频正在生成,请继续轮询。
finished任务完成,从 data.files[].file_url 读取视频。
failed任务失败,读取 data.error_message 并停止轮询。
轮询与错误处理
- 认证401 表示 Bearer API Key 缺失或无效。
- 参数校验400 表示字段、时长(3–15 秒,带尾帧 ≤10 秒)或输入视频时长(≤15 秒)超限。
- 轮询建议每 5–10 秒查询一次,或通过 callback_url 接收推送。
模型规格
| 规格 | 取值 | 说明 |
|---|---|---|
| 模型 | google/gemini-omni-1.2-flash/image-to-video | 异步视频生成公开模型 ID。 |
| 分辨率 | 360p | 720p | 1080p | 4k | 默认 720p。 |
| 时长 | 3–15 秒(带尾帧时 ≤ 10 秒) | 默认 8 秒。 |
| 画面比例 | 16:9 | 9:16 | 默认 16:9。 |
| 单秒费率 | 5.46 / 16.38 / 24.58 / 49.14 credits/s | 对应 360p / 720p / 1080p / 4k($0.0273 / $0.0819 / $0.1229 / $0.2457 每秒)。 |
Gemini Omni 1.2 Flash Image to Video API 常见问题
Gemini Omni 1.2 Flash Image to Video API 是什么?
Gemini Omni 1.2 Flash Image to Video 是 Google 推出的首帧与首尾帧图生视频模型。Gemini Omni 1.2 Flash Image to Video API 接收 1–2 张关键帧与提示词,生成 3–15 秒(带尾帧最长 10 秒)、360p 至 4K 视频,5.46 积分/秒起。关键帧锚定在保留画面构图与视觉风格的同时实现流畅的镜头与主体过渡。你可以通过 API 进行程序化调用,也可以在上方体验区直接在线试用。
Gemini Omni 1.2 Flash Image to Video API 支持尾帧吗?
支持。在 image_urls 中依次传入首帧与尾帧 2 张图片,并将 duration 设为 3–10 秒即可。
为什么 Gemini Omni 1.2 Flash 带尾帧时最长只能 10 秒?
首尾帧插值在 3–10 秒范围内过渡最自然,单首帧模式仍支持 3–15 秒。
Gemini Omni 1.2 Flash Image to Video 必须填写 prompt 吗?
是的,prompt 为必填字段,长度 1–20,000 字符。
Gemini Omni 1.2 Flash Image to Video API 支持哪些画质?
支持 360p(5.46 积分/秒)、720p(16.38 积分/秒)、1080p(24.58 积分/秒)和 4K(49.14 积分/秒)。
传入尾帧会增加 Gemini Omni 1.2 Flash 的费用吗?
不会,计费仅取决于输出时长与所选分辨率。
Gemini Omni 1.2 Flash Image to Video 可以同时传参考图或参考视频吗?
image_urls 仅用于首尾帧模式;如需多张参考图和参考视频,请切换至 Reference to Video 模式。



