> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vidgo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini Omni 1.2 Flash 图生视频

> Gemini Omni 1.2 Flash 图生视频 API 以首帧（可加尾帧）生成 3–15 秒的视频，最高 4K。

> [!TIP]
>
> 1. 提交后会返回 `task_id`。如果提供了 `callback_url`，当任务状态变为 `finished` 或 `failed` 时，系统会向 `callback_url` 发送 POST 请求。
> 2. 无论是否提供 `callback_url`，都可以通过统一的[查询任务状态](https://docs.vidgo.ai/zh/api-manual/task-management/status.md)接口获取结果。

Gemini Omni 1.2 Flash 图生视频把静态图片生成为 3–15 秒的视频，最高 4K。添加第二张图片作为尾帧，可以控制镜头的结束画面。

Gemini Omni 1.2 Flash 属于 Google 的 Gemini Omni 视频模型系列。Vidgo 提供四个模型 ID：[文生视频](https://docs.vidgo.ai/zh/api-manual/video-series/google-gemini-omni-1-2-flash-text-to-video.md)、[图生视频](https://docs.vidgo.ai/zh/api-manual/video-series/google-gemini-omni-1-2-flash-image-to-video.md)、[参考生视频](https://docs.vidgo.ai/zh/api-manual/video-series/google-gemini-omni-1-2-flash-reference-to-video.md)和[视频编辑](https://docs.vidgo.ai/zh/api-manual/video-series/google-gemini-omni-1-2-flash-video-edit.md)。

## 模型

* **google/gemini-omni-1.2-flash/image-to-video** — Gemini Omni 1.2 Flash 图生视频，支持首帧或首尾帧，360p 至 4K。

## 功能

* 通过 `image_urls` 提供首帧，或首帧加尾帧。
* 时长可选 3 到 15 秒之间的任意整数秒（有尾帧时 3 到 10 秒）。
* 四档分辨率：`360p`、`720p`、`1080p`、`4k`。
* 横屏（`16:9`）或竖屏（`9:16`）。

## 输入模式

* **首帧**：`image_urls` 中放一个 URL；`duration` 为 3–15 秒。
* **首尾帧**：`image_urls` 中放两个 URL，先首帧后尾帧；`duration` 为 3–10 秒。

## 必填参数

* `prompt` (string)：动作与场景描述，去除首尾空白后 1–20,000 个字符。
* `image_urls` (string\[])：1–2 个公开的 HTTP(S) 图片 URL。

## 可选参数

* `duration` (integer)：输出时长，`3`–`15` 秒（有尾帧时 `3`–`10`）。默认 `8`。
* `resolution` (string)：`360p`、`720p`、`1080p` 或 `4k`。默认 `720p`。
* `aspect_ratio` (string)：`16:9` 或 `9:16`。默认 `16:9`。

## 输出

任务完成后，[查询任务状态](https://docs.vidgo.ai/zh/api-manual/task-management/status.md)接口和回调内容的 `files` 数组中返回一个 MP4 视频。

## 示例

* **首尾帧**：乐手演奏时，棕褐色的排练老照片逐渐变成全彩画面，5 秒，`720p` ([结果](https://cdn.vidgo.ai/apis/models/google/gemini-omni-1.2-flash/image-to-video/v1/01/output.mp4))。
* **首帧**：潜水员在沉船船舱中用手电照向一只双耳陶罐，5 秒，`720p` ([结果](https://cdn.vidgo.ai/apis/models/google/gemini-omni-1.2-flash/image-to-video/v1/02/output.mp4))。

## 注意事项

* 提供两张图片时，`duration` 超过 10 返回 400。
* 空字符串和空数组视为未提供，使用默认值。
* `model` 和 `callback_url` 放在请求根级，与 `input` 并列。`input` 接收上文列出的字段，其他字段返回 400。
* 积分在提交时预扣，等于输出 `duration` 乘以所选 `resolution` 的每秒费率。任务失败全额退还。当前费率见[定价页](https://vidgo.ai/apis/api-pricing)。


## OpenAPI

````yaml zh/api-manual/video-series/google-gemini-omni-1-2-flash-image-to-video.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Gemini Omni 1.2 Flash 图生视频
  description: Gemini Omni 1.2 Flash 图生视频 API 以首帧（可加尾帧）生成 3–15 秒的视频，最高 4K。
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
    description: 生产环境服务器
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Gemini Omni 1.2 Flash Image to Video
      summary: 提交 Gemini Omni 1.2 Flash 图生视频 任务
      operationId: submitGeminiOmni12FlashImageToVideoTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              first-and-last-frame:
                summary: 首尾帧
                value:
                  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'
              first-frame:
                summary: 仅首帧
                value:
                  model: google/gemini-omni-1.2-flash/image-to-video
                  input:
                    prompt: >-
                      The marine archaeologist glides slowly forward inside the
                      sunken wooden hull, sweeping the compact underwater
                      flashlight beam across the half-buried terracotta amphora
                      as silver bubbles rise toward turquoise sunbeams filtering
                      through broken timbers. Smooth weightless camera drift,
                      realistic water particles and caustics. Audio: muffled
                      underwater bubbles and deep ocean calm.
                    image_urls:
                      - >-
                        https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/02/output.jpg
                    duration: 5
                    resolution: 720p
                    aspect_ratio: '16:9'
      responses:
        '200':
          description: 任务提交结果。任务 ID 标识一项异步任务；生成可能仍在进行中。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: 请求参数无效
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          type: string
          example: google/gemini-omni-1.2-flash/image-to-video
        callback_url:
          type: string
          format: uri
          description: 可选的 Webhook URL，用于接收完成或失败通知。
          example: https://your-domain.com/callback
        input:
          type: object
          required:
            - prompt
            - image_urls
          additionalProperties: false
          properties:
            prompt:
              type: string
              minLength: 1
              maxLength: 20000
              description: 动作与场景描述。去除首尾空白后 1–20,000 个字符。
            image_urls:
              type: array
              minItems: 1
              maxItems: 2
              items:
                type: string
                format: uri
                description: 使用公开可访问的 HTTP(S) 下载链接。
              description: 1–2 张图片：第一张为首帧；可选的第二张为尾帧。
            duration:
              type: integer
              minimum: 3
              maximum: 15
              default: 8
              description: 输出时长（整数秒）：只有首帧时 3–15，首尾帧时 3–10。
            resolution:
              type: string
              enum:
                - 360p
                - 720p
                - 1080p
                - 4k
              default: 720p
              description: 输出分辨率：`360p` 适合快速草稿，`720p`、`1080p` 或 `4k` 适合成片。
            aspect_ratio:
              type: string
              enum:
                - '16:9'
                - '9:16'
              default: '16:9'
              description: 输出宽高比：横屏 `16:9` 或竖屏 `9:16`。
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: P8Z97PVFRCAVP3A3
            status:
              type: string
              example: not_started
            created_time:
              type: string
              format: date-time
              example: '2026-11-25T11:17:28'
    ErrorResponse:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: 错误信息。参见[错误码](/zh/api-manual/error-codes)。
          example: image_urls is required for image-to-video
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: '使用 `Authorization: Bearer VIDGO_API_KEY`。'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.