> ## 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 Reference-to-Video viduq4-preview

> Use Vidu's latest flagship model (preview) viduq4-preview to generate a video based on reference images and reference audio. This model supports referencing 1-15 images and 0-3 audio files. After submitting a task, query its status via `GET /vidu/ent/v2/tasks/{task_id}/creations`. Uses model viduq4-preview.



## OpenAPI

````yaml api-reference/en/zmodelVideo/vidu/viduq4-preview-reference-to-video.json POST /vidu/ent/v2/reference2video
openapi: 3.0.1
info:
  title: Vidu Reference-to-Video (viduq4-preview)
  version: 1.0.0
servers:
  - url: https://baze-api.powerbuyin.top
security: []
paths:
  /vidu/ent/v2/reference2video:
    post:
      summary: Vidu Reference-to-Video (viduq4-preview)
      description: >-
        Use Vidu's latest flagship model (preview) viduq4-preview to generate a
        video based on reference images and reference audio. This model supports
        referencing 1-15 images and 0-3 audio files. After submitting a task,
        query its status via `GET /vidu/ent/v2/tasks/{task_id}/creations`. Uses
        model viduq4-preview.
      operationId: viduReferenceToVideoEnViduq4Preview
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReferenceToVideoRequest'
            examples:
              basic_reference_video:
                summary: Reference-to-video example
                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: >-
                    In the scene of reference image 1, reference image 2 uses
                    reference audio 1 and says to reference image 3: "What are
                    you doing?", reference image 3 excitedly says: "q4 is a big
                    hit!!!"
                  duration: 5
                  seed: 0
                  aspect_ratio: '3:4'
                  resolution: 1080p
              with_4k_resolution:
                summary: 4K resolution example
                value:
                  model: viduq4-preview
                  images:
                    - >-
                      https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/reference2video-1.png
                  prompt: >-
                    Cinematic shot: an astronaut walks slowly on the lunar
                    surface, camera pulls back from close-up to wide shot.
                  audio: true
                  duration: 8
                  resolution: 4K
      responses:
        '200':
          description: Submission successful, returns a video task object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferenceToVideoResponse'
              examples:
                success:
                  summary: Submission successful
                  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: >-
                      In the scene of reference image 1, reference image 2 uses
                      reference audio 1 and says to reference image 3: "What are
                      you doing?", reference image 3 excitedly says: "q4 is a
                      big hit!!!"
                    duration: 5
                    seed: 123456789
                    resolution: 1080p
                    payload: ''
                    credits: 10
                    created_at: '2025-01-01T15:41:31.968916Z'
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_request:
                  summary: Invalid parameters
                  value:
                    code: bad_request_body
                    message: Request body format error or invalid field values
                    data: null
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  summary: Unauthorized
                  value:
                    code: access_denied
                    message: Invalid token
                    data: null
        '429':
          description: Rate limit exceeded or insufficient quota.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                quota_exceeded:
                  summary: Insufficient quota
                  value:
                    code: insufficient_user_quota
                    message: Insufficient account quota, please try again later
                    data: null
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                server_error:
                  summary: Server error
                  value:
                    code: internal_server_error
                    message: Internal server error, please try again later
                    data: null
      security:
        - BearerAuth: []
components:
  schemas:
    ReferenceToVideoRequest:
      type: object
      required:
        - model
        - images
        - prompt
      properties:
        model:
          type: string
          enum:
            - viduq4-preview
          description: >-
            Model name. Available value: viduq4-preview

            - viduq4-preview: Vidu's latest flagship model (preview), supports
            referencing 1-15 images and 0-3 audio files
        images:
          type: array
          minItems: 1
          maxItems: 15
          items:
            type: string
          description: >-
            Supports multiple images. The model generates a video with subject
            consistency based on the subjects in the images provided.
            Requirements:

            Note 1: viduq4-preview model supports uploading 1-15 images;

            Note 2: Supports image Base64 encoding or image URL (ensure
            accessibility);

            Note 3: Supports png, jpeg, jpg, webp formats, max 50MB per image;

            Note 4: http request post body must not exceed 20MB, and encoding
            must include an appropriate content-type string, e.g.:

            data:image/png;base64,{base64_encode}
        sounds:
          type: array
          maxItems: 3
          items:
            type: string
          description: >-
            Supports uploading 0-3 audio files. The model uses the audio
            provided as reference to generate a video with subject consistency.

            Note 1: Each reference audio duration range is 3-12s;

            Note 2: Supports mp3 format;

            Note 3: Each audio file must not exceed 50MB;

            Note 4: http request post body must not exceed 20MB, and encoding
            must include an appropriate content-type string, e.g.:

            data:video/mp3;base64,{base64_encode}
        prompt:
          type: string
          maxLength: 20000
          description: |-
            Text prompt for video generation.
            Note: Character length must not exceed 20000 characters
        audio:
          type: boolean
          default: true
          description: >-
            Whether to use audio-visual direct output

            - false: no audio-visual direct output, outputs a silent video

            - true: requires audio-visual sync, outputs a video with sound
            (including dialogue and sound effects)

            Note: viduq4-preview model default is true
        duration:
          type: integer
          description: |-
            Video duration parameter
            Default: 5
            Enum: 3 - 16
          minimum: 3
          maximum: 16
          default: 5
        seed:
          type: integer
          description: >-
            Random seed. When not provided or set to 0, a random number is used;
            when manually set, the configured seed is used.
        aspect_ratio:
          type: string
          enum:
            - '16:9'
            - '9:16'
            - '1:1'
            - '3:4'
            - '4:3'
          default: '16:9'
          description: |-
            Video aspect ratio parameter
            Default: 16:9
            Enum: 1:1 / 9:16 / 16:9 / 3:4 / 4:3
        resolution:
          type: string
          enum:
            - 540p
            - 720p
            - 1080p
            - 2K
            - 4K
          description: |-
            Video resolution parameter
            Default: 720p
            Enum: 540p / 720p / 1080p / 2K / 4K
            Note: viduq4-preview supports 2K and 4K video output
        payload:
          type: string
          maxLength: 1048576
          description: >-
            Passthrough parameter, no processing, only data transmission. Note:
            maximum 1048576 characters.
        watermark:
          type: boolean
          default: false
          description: >-
            Whether to add watermark

            - true: add watermark

            - false: no watermark

            Note: Currently watermark content is fixed and AI-generated; not
            added by default
        wm_position:
          type: integer
          description: >-
            Watermark position, indicating where the watermark appears on the
            image. Options:

            1: top-left

            2: top-right

            3: bottom-right

            4: bottom-left

            Default: 3
          default: 3
          enum:
            - 1
            - 2
            - 3
            - 4
          minimum: 1
          maximum: 4
          x-options:
            - label: Top-left
              value: 1
            - label: Top-right
              value: 2
            - label: Bottom-right
              value: 3
            - label: Bottom-left
              value: 4
        wm_url:
          type: string
          description: >-
            Watermark content. This is an image URL; when not provided, the
            default watermark (AI-generated content) is used.
        meta_data:
          type: string
          description: >-
            Metadata identifier, a JSON format string passthrough field. You can
            customize the format or use the example format below:

            {

            "Label": "your_label","ContentProducer":
            "your_content_producer","ContentPropagator":
            "your_content_propagator","ProduceID": "your_product_id",
            "PropagateID": "your_propagate_id","ReservedCode1":
            "your_reserved_code1", "ReservedCode2": "your_reserved_code2"

            }

            When this parameter is empty, the Vidu-generated metadata identifier
            is used by default.
        callback_url:
          type: string
          description: >-
            Callback protocol

            You need to actively set callback_url when creating a task. The
            request method is POST. When the video generation task changes
            status, Vidu will send a callback request containing the latest task
            status to this address. The callback request body structure is
            consistent with the query task API response body.

            The "status" returned by the callback includes the following states:

            - processing: task is being processed

            - success: task completed (if sending fails, callback retries three
            times)

            - failed: task failed (if sending fails, callback retries three
            times)

            Vidu uses a callback signature algorithm for authentication, see:
            https://platform.vidu.cn/docs/callback-signature
    ReferenceToVideoResponse:
      type: object
      properties:
        task_id:
          type: string
          description: Task ID generated by Vidu.
        state:
          type: string
          enum:
            - created
            - queueing
            - processing
            - success
            - failed
          description: |-
            Processing state
            Available values:
            created: task created successfully
            queueing: task in queue
            processing: task being processed
            success: task succeeded
            failed: task failed
        model:
          type: string
          description: Model name used for this call.
        prompt:
          type: string
          description: Prompt parameter used for this call.
        images:
          type: array
          items:
            type: string
          description: Image parameter used for this call.
        sounds:
          type: array
          items:
            type: string
          description: The sound parameter for this call
        duration:
          type: integer
          description: Video duration parameter used for this call.
        seed:
          type: integer
          description: Random seed parameter used for this call.
        resolution:
          type: string
          description: Resolution parameter used for this call.
        payload:
          type: string
          description: Passthrough parameter passed in for this call.
        credits:
          type: integer
          description: Number of credits consumed for this call.
        watermark:
          type: boolean
          description: Whether a watermark was used for this task submission.
        created_at:
          type: string
          format: date-time
          description: Task creation time.
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code.
        message:
          type: string
          description: Error description message.
        data:
          type: object
          nullable: true
          description: Additional error data (optional).
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Pass `Authorization: Bearer <token>` in the request header.'

````

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