# Vidu Reference-to-Video

> Video Generation

Submit an asynchronous reference-to-video generation task.

## Endpoint

`POST https://api.modelverse.cn/v1/tasks/submit`

## Request Body

## Responses

- **200** — Task submitted successfully.
- **400** — Invalid request parameters.
- **default** — Error response.

## OpenAPI Definition

```json
{
  "openapi": "3.1.0",
  "x-language": "en-US",
  "info": {
    "title": "ModelVerse Vidu/Reference2Video Video Task API",
    "version": "1.0.0",
    "description": "Self-contained OpenAPI 3.1 schema for the ModelVerse Vidu/Reference2Video\nreference-to-video asynchronous task API.\n"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "ModelVerse API endpoint documented for this model."
    }
  ],
  "tags": [
    {
      "name": "Vidu/Reference2Video",
      "description": "Reference-to-video asynchronous task operations for Vidu/Reference2Video."
    }
  ],
  "paths": {
    "/v1/tasks/submit": {
      "post": {
        "tags": [
          "Vidu/Reference2Video"
        ],
        "operationId": "submitViduReference2VideoTask",
        "summary": "Vidu Reference-to-Video",
        "description": "Submit an asynchronous reference-to-video generation task.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ViduReference2VideoSubmitRequest"
              },
              "examples": {
                "documentedSubjects": {
                  "summary": "Source reference-to-video request using subjects",
                  "value": {
                    "model": "viduq2",
                    "input": {
                      "prompt": "让@1与@2一起跑步,一起喊加油",
                      "subjects": [
                        {
                          "id": "1",
                          "images": [
                            "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg"
                          ],
                          "voice_id": ""
                        },
                        {
                          "id": "2",
                          "images": [
                            "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg"
                          ],
                          "voice_id": ""
                        }
                      ]
                    },
                    "parameters": {
                      "vidu_type": "reference2video",
                      "duration": 5,
                      "aspect_ratio": "16:9",
                      "resolution": "720p",
                      "movement_amplitude": "auto",
                      "bgm": false,
                      "audio": true
                    }
                  }
                },
                "legacyImages": {
                  "summary": "Source legacy request using images",
                  "value": {
                    "model": "viduq2",
                    "input": {
                      "images": [
                        "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg"
                      ],
                      "prompt": "make it dance."
                    },
                    "parameters": {
                      "vidu_type": "reference2video",
                      "duration": 5,
                      "aspect_ratio": "16:9",
                      "resolution": "720p",
                      "movement_amplitude": "auto",
                      "bgm": true
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task submitted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViduReference2VideoSubmitResponse"
                },
                "examples": {
                  "submitted": {
                    "summary": "Submitted task",
                    "value": {
                      "output": {
                        "task_id": "task_id"
                      },
                      "request_id": "request_id"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViduReference2VideoErrorResponse"
                },
                "examples": {
                  "paramError": {
                    "$ref": "#/components/examples/ViduReference2VideoParamError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViduReference2VideoErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/ViduReference2VideoParamError"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks/status": {
      "get": {
        "tags": [
          "Vidu/Reference2Video"
        ],
        "operationId": "getViduReference2VideoTaskStatus",
        "summary": "Vidu Reference-to-Video Status",
        "description": "Query the status and result URLs for an asynchronous reference-to-video task.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "query",
            "required": true,
            "description": "Asynchronous task identifier returned by `/v1/tasks/submit`.",
            "schema": {
              "type": "string"
            },
            "example": "task_id"
          }
        ],
        "responses": {
          "200": {
            "description": "Task status response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViduReference2VideoStatusResponse"
                },
                "examples": {
                  "success": {
                    "summary": "Successful task",
                    "value": {
                      "output": {
                        "task_id": "task_id",
                        "task_status": "Success",
                        "urls": [
                          "https://xxxxx/xxxx.mp4"
                        ],
                        "submit_time": 1756959000,
                        "finish_time": 1756959050
                      },
                      "usage": {
                        "duration": 5
                      },
                      "request_id": ""
                    }
                  },
                  "failure": {
                    "summary": "Failed task",
                    "value": {
                      "output": {
                        "task_id": "task_id",
                        "task_status": "Failure",
                        "submit_time": 1756959000,
                        "finish_time": 1756959019,
                        "error_message": "error_message"
                      },
                      "usage": {
                        "duration": 5
                      },
                      "request_id": ""
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid task identifier or request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViduReference2VideoErrorResponse"
                },
                "examples": {
                  "paramError": {
                    "$ref": "#/components/examples/ViduReference2VideoParamError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViduReference2VideoErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/ViduReference2VideoParamError"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "ModelVerse API key sent as `Authorization: Bearer <MODELVERSE_API_KEY>`."
      }
    },
    "schemas": {
      "ViduReference2VideoSubmitRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model",
          "input",
          "parameters"
        ],
        "properties": {
          "model": {
            "type": "string",
            "const": "viduq2",
            "description": "Model name. This schema is pinned to `viduq2`."
          },
          "input": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ViduReference2VideoSubjectInput"
              },
              {
                "$ref": "#/components/schemas/ViduReference2VideoLegacyInput"
              }
            ]
          },
          "parameters": {
            "$ref": "#/components/schemas/ViduReference2VideoParameters"
          }
        }
      },
      "ViduReference2VideoSubjectInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "prompt",
          "subjects"
        ],
        "properties": {
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "Text prompt used to guide video generation. Subject IDs may be referenced as `@id`."
          },
          "subjects": {
            "type": "array",
            "minItems": 1,
            "maxItems": 7,
            "description": "Image subject information. The model supports 1 to 7 subjects.",
            "items": {
              "$ref": "#/components/schemas/ViduReference2VideoSubject"
            }
          }
        }
      },
      "ViduReference2VideoSubject": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "images",
          "voice_id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "Subject ID that can be referenced in the prompt as `@id`."
          },
          "images": {
            "type": "array",
            "minItems": 1,
            "maxItems": 3,
            "description": "Image URLs or Base64 data URIs for this subject. Each subject supports up to 3 images.",
            "items": {
              "type": "string",
              "description": "Publicly accessible image URL or Base64 image data URI."
            }
          },
          "voice_id": {
            "type": "string",
            "description": "Voice ID for the subject. An empty string lets the system automatically recommend a voice."
          }
        }
      },
      "ViduReference2VideoLegacyInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "images",
          "prompt"
        ],
        "properties": {
          "images": {
            "type": "array",
            "minItems": 1,
            "maxItems": 7,
            "description": "Legacy reference image array. The `viduq2` model supports 1 to 7\nreference images. Images may be URL strings or Base64 data URIs in\nthe form `data:image/png;base64,{base64_encode}`. Supported formats\nare png, jpeg, jpg, and webp. Images must be at least 128 x 128\npixels, have an aspect ratio no more extreme than 1:4 or 4:1, and\nbe no larger than 50 MB.\n",
            "items": {
              "type": "string",
              "description": "Publicly accessible image URL or Base64 image data URI."
            }
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "Text prompt used to guide video generation."
          }
        }
      },
      "ViduReference2VideoParameters": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "vidu_type"
        ],
        "properties": {
          "vidu_type": {
            "type": "string",
            "const": "reference2video",
            "description": "Vidu API type. This schema is pinned to `reference2video`."
          },
          "duration": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10,
            "default": 5,
            "description": "Generated video duration in seconds for `viduq2`."
          },
          "seed": {
            "type": "integer",
            "default": 0,
            "description": "Random seed. The default `0` means a random seed is used."
          },
          "aspect_ratio": {
            "type": "string",
            "enum": [
              "16:9",
              "9:16",
              "4:3",
              "3:4",
              "1:1"
            ],
            "default": "16:9",
            "description": "Generated video aspect ratio."
          },
          "resolution": {
            "type": "string",
            "enum": [
              "540p",
              "720p",
              "1080p"
            ],
            "default": "720p",
            "description": "Generated video resolution for `viduq2` durations from 1 to 8 seconds."
          },
          "movement_amplitude": {
            "type": "string",
            "enum": [
              "auto",
              "small",
              "medium",
              "large"
            ],
            "default": "auto",
            "description": "Motion amplitude. The source documentation lists this parameter and\nalso notes that the `viduq2` model does not support it.\n"
          },
          "bgm": {
            "type": "boolean",
            "default": false,
            "description": "Whether to add background music."
          },
          "audio": {
            "type": "boolean",
            "default": false,
            "description": "Whether to use direct audio-video generation."
          }
        }
      },
      "ViduReference2VideoSubmitResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output",
          "request_id"
        ],
        "properties": {
          "output": {
            "$ref": "#/components/schemas/ViduReference2VideoSubmitOutput"
          },
          "request_id": {
            "type": "string",
            "description": "Unique request identifier."
          }
        }
      },
      "ViduReference2VideoSubmitOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "task_id"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "description": "Unique identifier of the asynchronous task."
          }
        }
      },
      "ViduReference2VideoStatusResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output",
          "request_id"
        ],
        "properties": {
          "output": {
            "$ref": "#/components/schemas/ViduReference2VideoStatusOutput"
          },
          "usage": {
            "$ref": "#/components/schemas/ViduReference2VideoUsage"
          },
          "request_id": {
            "type": "string",
            "description": "Unique request identifier."
          }
        }
      },
      "ViduReference2VideoStatusOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "task_id",
          "task_status"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "description": "Unique identifier of the asynchronous task."
          },
          "task_status": {
            "$ref": "#/components/schemas/ViduReference2VideoTaskStatus"
          },
          "urls": {
            "type": "array",
            "description": "Video result URL list.",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "submit_time": {
            "type": "integer",
            "format": "int64",
            "description": "Task submission timestamp."
          },
          "finish_time": {
            "type": "integer",
            "format": "int64",
            "description": "Task completion timestamp."
          },
          "error_message": {
            "type": "string",
            "description": "Error message returned when the task fails."
          }
        }
      },
      "ViduReference2VideoTaskStatus": {
        "type": "string",
        "enum": [
          "Pending",
          "Running",
          "Success",
          "Failure"
        ],
        "description": "Current asynchronous task status."
      },
      "ViduReference2VideoUsage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "duration": {
            "type": "integer",
            "description": "Video duration in seconds."
          }
        }
      },
      "ViduReference2VideoErrorResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ViduReference2VideoErrorObject"
          },
          "request_id": {
            "type": "string",
            "description": "Unique request identifier, if available."
          }
        }
      },
      "ViduReference2VideoErrorObject": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "message",
          "type"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message."
          },
          "type": {
            "type": "string",
            "description": "Error type."
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Error code."
          },
          "param": {
            "type": [
              "string",
              "null"
            ],
            "description": "Request parameter related to the error."
          }
        }
      }
    },
    "examples": {
      "ViduReference2VideoParamError": {
        "summary": "Invalid parameter error",
        "value": {
          "error": {
            "message": "Invalid param",
            "type": "invalid_request_error",
            "code": "param_error",
            "param": "input.prompt"
          },
          "request_id": "request_id"
        }
      }
    }
  }
}
```
