Vidu API
Dashboard
Docs
Sign in

Template

POST https://api.vidu.com/ent/v2/template2video

Request Header

FieldValueDescription
Content-Typeapplication/jsonData Exchange Format
AuthorizationToken {your api key}Replace {} with your API key

Request Body

FieldTypeRequiredDescription
templateStringRequiredAI video template
Different templates have different call parameters.
For details, please visit:Templates
imagesArray[String]RequiredImages
For fields that accept images:
- Images Assets can be provided via URLs or Base64 encode
- You must use one of the following codecs: PNG, JPEG, JPG, WebP
- The pixel density of the images must be at least 128x128 pixels
-- The aspect ratio of the images must be less than 1:4 or 4:1
- All images are limited to 50MB
- The length of the base64 decode must be under 10MB, and it must include an appropriate content type string. For instance,
data:image/png;base64,{base64_encode}
promptStringOptionalText prompt
A textual description for video generation
- when template = subject_3 pubg_winner_hit, you don’t need to input prompt.
seedIntOptionalRandom seed
- Defaults to a random seed number
- Manually set values will override the default random seed
aspect_ratioStringOptionalThe aspect ratio of the output video
Defaults to 16:9, accepted: 16:9 9:16 1:1
- Different templates accepted different aspect ratio
areaStringOptionalExotic Princess style control field
only for templateexotic_princess,
Default:auto, accepts:denmark,uk,africa,china,mexico,switzerland,russia,italy,korea,thailand,india,japan
beastStringOptionalbeast companion style control field
only for template beast_companion
Default auto, accepts:bear,tiger,elk,snake,lion,wolf
bgmboolOptionalWhether to add background music to the generated video.
Default: false. Acceptable values: true, false.
When true, the system will automatically add a suitable BGM.
payloadStringOptionaltransparent transmission parameters
No processing, only data transmission,with a maximum length of 1048576 characters
callback_urlStringOptionalCallback
When creating a task, you need to actively set the callback_url with a POST request. When the video generation task changes its status, Vidu will send a callback request to this URL, containing the latest status of the task. The structure of the callback request content will be the same as the return body of the GET Generation API.
The “status” in the callback response includes the following states:
- processing: Task is being processed.
- success: Task is completed (if sending fails, it will retry the callback three times).
- failed: Task failed (if sending fails, it will retry the callback three times).
We have specifically optimized for various scenarios such as hug and kiss, youth_rewind, love_pose, and hair_swap, achieving a high success rate in generation. You can find more details about all the supported templates, their respective credit consumption, and how to call them in this document.
curl -X POST -H "Authorization: Token {your_api_key}" -H "Content-Type: application/json" -d '
{
"template": "hugging",
"images": ["https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/scene-template/hug.jpeg"],
"prompt": "# Video content\\nThe two subjects in the frame turn towards each other and begin to embrace. \\n# Requirements\\n Set the Motion Level to 'Large'.",
"seed": "0"
}' https://api.vidu.com/ent/v2/template2video

Response Body

FieldTypeDescription
task_idStringTask ID
stateStringIt will be returned to a specific processing state:
- created created task successfully
- queueing task in queue
- processing processing
- success generation successful
- failedtask failed
templateStringThe parameter of the template used for this call
imagesArray[String]The images used for this call
promptStringThe text prompt used for this call
seedIntThe random seed parameter used for this call
aspect_ratioStringThe aspect ratio parameter used for this call
bgmboolThe bgm parameter used for this call
payloadStringThe payload parameter used for this call
created_atStringTask creation time
{
"task_id": "your_task_id_here",
"state": "created",
"template": "hugging",
"images": ["https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/scene-template/hug.jpeg"],
"prompt": "hug",
"seed": random_number,
"payload":"",
"created_at": "2025-01-01T15:41:31.968916Z"
}