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

# Vidu 参考生视频 viduq4-preview

> 使用 Vidu 最新旗舰模型（预览版）viduq4-preview 基于参考图片和参考音频生成视频。该模型支持参考 1-15 张图片，支持参考 0-3 个音频。提交任务后，请通过 `GET /vidu/ent/v2/tasks/{task_id}/creations` 查询状态。 使用模型 viduq4-preview。



## OpenAPI

````yaml api-reference/zh-Hans/zmodelVideo/vidu/viduq4-preview-reference-to-video.json POST /vidu/ent/v2/reference2video
openapi: 3.0.1
info:
  title: Vidu 参考生视频 (viduq4-preview)
  version: 1.0.0
servers:
  - url: https://baze-api.powerbuyin.top
security: []
paths:
  /vidu/ent/v2/reference2video:
    post:
      summary: Vidu 参考生视频 (viduq4-preview)
      description: >-
        使用 Vidu 最新旗舰模型（预览版）viduq4-preview 基于参考图片和参考音频生成视频。该模型支持参考 1-15 张图片，支持参考
        0-3 个音频。提交任务后，请通过 `GET /vidu/ent/v2/tasks/{task_id}/creations` 查询状态。
        使用模型 viduq4-preview。
      operationId: viduReferenceToVideoViduq4Preview
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReferenceToVideoRequest'
            examples:
              basic_reference_video:
                summary: 参考生视频示例
                value:
                  model: viduq4-preview
                  images:
                    - >-
                      https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-1.png
                    - >-
                      https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-2.png
                    - >-
                      https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-3.png
                  sounds:
                    - >-
                      https://scene-aliyun.vidu.zone/media-asset/022634-H3gq7ivRZgfAYKs3.mp3
                  prompt: 在参考图1的场景中，参考图2使用参考音频1，对参考图3说："你在干什么？"，参考图3激动地说："q4大卖！！！"
                  duration: 5
                  seed: 0
                  aspect_ratio: '3:4'
                  resolution: 1080p
              with_4k_resolution:
                summary: 4K 分辨率示例
                value:
                  model: viduq4-preview
                  images:
                    - >-
                      https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-1.png
                  prompt: 电影级镜头：宇航员在月球表面缓慢行走，镜头从特写拉远至全景。
                  audio: true
                  duration: 8
                  resolution: 4K
      responses:
        '200':
          description: 提交成功，返回视频任务对象。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferenceToVideoResponse'
              examples:
                success:
                  summary: 提交成功
                  value:
                    task_id: your_task_id_here
                    state: created
                    model: viduq4-preview
                    images:
                      - >-
                        https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-1.png
                      - >-
                        https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-2.png
                      - >-
                        https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-3.png
                    sounds:
                      - >-
                        https://scene-aliyun.vidu.zone/media-asset/022634-H3gq7ivRZgfAYKs3.mp3
                    prompt: 在参考图1的场景中，参考图2使用参考音频1，对参考图3说："你在干什么？"，参考图3激动地说："q4大卖！！！"
                    duration: 5
                    seed: 123456789
                    resolution: 1080p
                    payload: ''
                    credits: 10
                    created_at: '2025-01-01T15:41:31.968916Z'
        '400':
          description: 请求参数不合法。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_request:
                  summary: 参数错误
                  value:
                    code: bad_request_body
                    message: 请求体格式错误或字段取值非法
                    data: null
        '401':
          description: 鉴权失败。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  summary: 未授权
                  value:
                    code: access_denied
                    message: 无效的令牌
                    data: null
        '429':
          description: 触发速率限制或账户额度不足。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                quota_exceeded:
                  summary: 额度不足
                  value:
                    code: insufficient_user_quota
                    message: 当前账户额度不足，请稍后重试
                    data: null
        '500':
          description: 服务器内部错误。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                server_error:
                  summary: 服务器错误
                  value:
                    code: internal_server_error
                    message: 服务器内部错误，请稍后重试
                    data: null
      security:
        - BearerAuth: []
components:
  schemas:
    ReferenceToVideoRequest:
      type: object
      required:
        - model
        - images
        - prompt
      properties:
        model:
          type: string
          enum:
            - viduq4-preview
          description: |-
            模型名称，可选值：viduq4-preview
            - viduq4-preview：Vidu最新旗舰模型（预览版），支持参考 1 - 15 张图片，支持参考 0-3 个音频
        images:
          type: array
          minItems: 1
          maxItems: 15
          items:
            type: string
          description: |-
            支持多张图片，模型将以此参数中传入的图片中的主题为参考生成具备主体一致的视频，具体要求如下：
            注1：viduq4-preview 模型支持上传 1～15 张图片；
            注2：支持传入图片 Base64 编码或图片URL（确保可访问）；
            注3：图片支持 png、jpeg、jpg、webp格式，图片最大50MB；
            注4：http请求的post body不超过20MB，且编码必须包含适当的内容类型字符串，例如：
            data:image/png;base64,{base64_encode}
        sounds:
          type: array
          maxItems: 3
          items:
            type: string
          description: |-
            支持上传 0～3 个音频，模型将以此参数中传入的音频作为参考，生成具备主体一致的视频。
            注1：每个参考音频的时长范围 3-12s；
            注2：音频支持 mp3格式；
            注3：每个音频文件大小不超过50M；
            注4：http请求的post body不超过20MB，且编码必须包含适当的内容类型字符串，例如：
            data:video/mp3;base64,{base64_encode}
        prompt:
          type: string
          maxLength: 20000
          description: |-
            文本提示词生成视频的文本描述。
            注：字符长度不能超过 20000 个字符
        audio:
          type: boolean
          default: true
          description: |-
            是否使用音视频直出能力
            - false：不需要音视频直出，输出静音视频
            - true：需要音画同步，输出声音的视频（包括台词和音效）
            注：viduq4-preview 模型默认audio为true
        duration:
          type: integer
          description: |-
            视频时长参数
            默认值: 5
            枚举值: 3 - 16
          minimum: 3
          maximum: 16
          default: 5
        seed:
          type: integer
          description: 随机种子当默认不传或者传0时，会使用随机数替代手动设置则使用设置的种子
        aspect_ratio:
          type: string
          enum:
            - '16:9'
            - '9:16'
            - '1:1'
            - '3:4'
            - '4:3'
          default: '16:9'
          description: |-
            视频比例参数
            默认值: 16:9
            枚举值: 1:1 / 9:16 / 16:9 / 3:4 / 4:3
        resolution:
          type: string
          enum:
            - 540p
            - 720p
            - 1080p
            - 2K
            - 4K
          description: |-
            视频分辨率参数
            默认值: 720p
            枚举值: 540p / 720p / 1080p / 2K / 4K
            注：viduq4-preview 支持 2K、4K 规格视频输出
        payload:
          type: string
          maxLength: 1048576
          description: 透传参数不做任何处理，仅数据传输注：最多 1048576个字符
        watermark:
          type: boolean
          default: false
          description: |-
            是否添加水印
            - true：添加水印
            - false：不添加水印
            注：目前水印内容为固定，内容由AI生成，默认不加
        wm_position:
          type: integer
          description: |-
            水印位置，表示水印出现在图片的位置，可选项为：
            1：左上角
            2：右上角
            3：右下角
            4：左下角
            默认值: 3
          default: 3
          enum:
            - 1
            - 2
            - 3
            - 4
          minimum: 1
          maximum: 4
          x-options:
            - label: 左上角
              value: 1
            - label: 右上角
              value: 2
            - label: 右下角
              value: 3
            - label: 左下角
              value: 4
        wm_url:
          type: string
          description: 水印内容，此处为图片URL不传时，使用默认水印：内容由AI生成
        meta_data:
          type: string
          description: >-
            元数据标识，json格式字符串，透传字段，您可以 自定义格式 或使用 示例格式 ，示例如下：

            {

            "Label": "your_label","ContentProducer":
            "yourcontentproducer","ContentPropagator":
            "your_content_propagator","ProduceID": "yourproductid",
            "PropagateID": "your_propagate_id","ReservedCode1":
            "yourreservedcode1", "ReservedCode2": "your_reserved_code2"

            }

            该参数为空时，默认使用vidu生成的元数据标识
        callback_url:
          type: string
          description: >-
            Callback 协议

            需要您在创建任务时主动设置 callback_url，请求方法为 POST，当视频生成任务有状态变化时，Vidu
            将向此地址发送包含任务最新状态的回调请求。回调请求内容结构与查询任务API的返回体一致

            回调返回的"status"包括以下状态：

            - processing 任务处理中

            - success 任务完成（如发送失败，回调三次）

            - failed 任务失败（如发送失败，回调三次）

            Vidu采用回调签名算法进行认证，详情见：https://platform.vidu.cn/docs/callback-signature
    ReferenceToVideoResponse:
      type: object
      properties:
        task_id:
          type: string
          description: Vidu 生成的任务ID
        state:
          type: string
          enum:
            - created
            - queueing
            - processing
            - success
            - failed
          description: |-
            处理状态
            可选值：
            created 创建成功
            queueing 任务排队中
            processing 任务处理中
            success 任务成功
            failed 任务失败
        model:
          type: string
          description: 本次调用的模型名称
        prompt:
          type: string
          description: 本次调用的提示词参数
        images:
          type: array
          items:
            type: string
          description: 本次调用的图像参数
        sounds:
          type: array
          items:
            type: string
          description: 本次调用的声音参数
        duration:
          type: integer
          description: 本次调用的视频时长参数
        seed:
          type: integer
          description: 本次调用的随机种子参数
        resolution:
          type: string
          description: 本次调用的分辨率参数
        payload:
          type: string
          description: 本次调用时传入的透传参数
        credits:
          type: integer
          description: 本次调用使用的积分数
        watermark:
          type: boolean
          description: 本次提交任务是否使用水印
        created_at:
          type: string
          format: date-time
          description: 任务创建时间
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: 错误代码。
        message:
          type: string
          description: 错误描述信息。
        data:
          type: object
          nullable: true
          description: 附加的错误数据（可选）。
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: '在请求头中传入 `Authorization: Bearer <token>`。'

````

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