Vidu API
工作台
文档
登录

首尾帧

POST https://api.vidu.cn/ent/v2/start-end2video

请求头

字段描述
Content-Typeapplication/json数据交换格式
AuthorizationToken {your api key}{token} 替换为您的 token

请求体

参数名称类型必填参数描述
modelString模型名称
可选值:viduq1viduq1-classicvidu2.0vidu1.5
imagesArray[String]图像
支持输入两张图,上传的第一张图片视作首帧图,第二张图片视作尾帧图,模型将以此参数中传入的图片来生成视频

注1: 首尾帧两张输入图的分辨率需相近,首帧图的分辨率/尾帧图的分辨率要在0.8~1.25之间。且图片比例需要小于1:4或者4:1;
注2: 支持传入图片 Base64 编码或图片URL(确保可访问);
注3: 图片支持 png、jpeg、.jpg、webp格式;
注4: 图片大小不超过50M;
注5:请注意,base64 decode之后的字节长度需要小于50M,且编码必须包含适当的内容类型字符串,例如:
data:image/png;base64,{base64_encode}
promptString可选文本提示词
生成视频的文本描述。
注:字符长度不能超过 1500 个字符
durationInt可选视频时长参数,默认值依据模型而定:
- viduq1 和 viduq1-classic: 默认 5 秒,可选:5
- vidu2.0: 默认 4 秒,可选:4、8
- vidu1.5: 默认 4 秒,可选:4、8
seedInt可选随机种子
当默认不传或者传0时,会使用随机数替代
手动设置则使用设置的种子
resolutionString可选分辨率参数,默认值依据模型和视频时长而定:
- viduq1 和 viduq1-classic 5秒:默认 1080p,可选:1080p
- vidu2.0 4秒:默认 360p,可选:360p、720p、1080p
- vidu2.0 8秒:默认 720p,可选:720p
- vidu1.5 4秒:默认 360p,可选:360p、720p、1080p
- vidu1.5 8秒:默认 720p,可选:720p
movement_amplitudeString可选运动幅度
默认 auto,可选值:autosmallmediumlarge
bgmbool可选是否为生成的视频添加背景音乐。
默认:false,可选值 true 、false
- 传 true 时系统将从预设 BGM 库中自动挑选合适的音乐并添加;不传或为 false 则不添加 BGM。
- 仅当最终生成的视频时长为 4秒 时,支持添加 BGM
callback_urlString可选Callback 协议
需要您在创建任务时主动设置 callback_url,请求方法为 POST,当视频生成任务有状态变化时,Vidu 将向此地址发送包含任务最新状态的回调请求。回调请求内容结构与查询任务API的返回体一致
回调返回的"status"包括以下状态:
- processing 任务处理中
- success 任务完成(如发送失败,回调三次)
- failed 任务失败(如发送失败,回调三次)
curl -X POST -H "Authorization: Token {your_api_key}" -H "Content-Type: application/json" -d '
{
"model": "viduq1",
"images": ["https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-1.jpeg","https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-2.jpeg"],
"prompt": "The camera zooms in on the bird, which then flies to the right. With its flight being smooth and natural, the bird soars in the sky. with a red light effect following and surrounding it from behind.",
"duration": "5",
"seed": "0",
"resolution": "1080p",
"movement_amplitude": "auto"
}' https://api.vidu.cn/ent/v2/start-end2video

响应体

字段类型描述
task_idStringVidu 生成的任务ID
stateString处理状态
可选值:
created 创建成功
queueing 任务排队中
processing 任务处理中
success 任务成功
failed 任务失败
modelString本次调用的模型名称
promptString本次调用的提示词参数
imagesArray[String]本次调用的图像参数
durationInt本次调用的视频时长参数
seedInt本次调用的随机种子参数
resolutionString本次调用的分辨率参数
bgmbool本次调用的背景音乐参数
movement_amplitudeString本次调用的镜头动态幅度参数
created_atString任务创建时间
{
"task_id": "your_task_id_here",
"state": "created",
"model": "viduq1",
"images": ["https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-1.jpeg","https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-2.jpeg"],
"prompt": "The camera zooms in on the bird, which then flies to the right. The bird's flight is smooth and natural, with a red light effect following and surrounding it from behind.",
"duration": 5,
"seed": random_number,
"resolution": "1080p",
"movement_amplitude": "auto",
"created_at": "2025-01-01T15:41:31.968916Z"
}