首尾帧
POST https://api.vidu.cn/ent/v2/start-end2video
请求头
字段 | 值 | 描述 |
---|---|---|
Content-Type | application/json | 数据交换格式 |
Authorization | Token {your api key} | 将 {token} 替换为您的 token |
请求体
参数名称 | 类型 | 必填 | 参数描述 |
---|---|---|---|
model | String | 是 | 模型名称 可选值:viduq1 、viduq1-classic、vidu2.0、vidu1.5 |
images | Array[String] | 是 | 图像 支持输入两张图,上传的第一张图片视作首帧图,第二张图片视作尾帧图,模型将以此参数中传入的图片来生成视频 注1: 首尾帧两张输入图的分辨率需相近,首帧图的分辨率/尾帧图的分辨率要在0.8~1.25之间。且图片比例需要小于1:4或者4:1; 注2: 支持传入图片 Base64 编码或图片URL(确保可访问); 注3: 图片支持 png、jpeg、.jpg、webp格式; 注4: 图片大小不超过50M; 注5:请注意,base64 decode之后的字节长度需要小于50M,且编码必须包含适当的内容类型字符串,例如:
|
prompt | String | 可选 | 文本提示词 生成视频的文本描述。 注:字符长度不能超过 1500 个字符 |
duration | Int | 可选 | 视频时长参数,默认值依据模型而定: - viduq1 和 viduq1-classic: 默认 5 秒,可选:5 - vidu2.0: 默认 4 秒,可选:4、8 - vidu1.5: 默认 4 秒,可选:4、8 |
seed | Int | 可选 | 随机种子 当默认不传或者传0时,会使用随机数替代 手动设置则使用设置的种子 |
resolution | String | 可选 | 分辨率参数,默认值依据模型和视频时长而定: - 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_amplitude | String | 可选 | 运动幅度 默认 auto,可选值:auto、small、medium、large |
bgm | bool | 可选 | 是否为生成的视频添加背景音乐。 默认:false,可选值 true 、false - 传 true 时系统将从预设 BGM 库中自动挑选合适的音乐并添加;不传或为 false 则不添加 BGM。 - 仅当最终生成的视频时长为 4秒 时,支持添加 BGM |
callback_url | String | 可选 | 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_id | String | Vidu 生成的任务ID |
state | String | 处理状态 可选值: created 创建成功 queueing 任务排队中 processing 任务处理中 success 任务成功 failed 任务失败 |
model | String | 本次调用的模型名称 |
prompt | String | 本次调用的提示词参数 |
images | Array[String] | 本次调用的图像参数 |
duration | Int | 本次调用的视频时长参数 |
seed | Int | 本次调用的随机种子参数 |
resolution | String | 本次调用的分辨率参数 |
bgm | bool | 本次调用的背景音乐参数 |
movement_amplitude | String | 本次调用的镜头动态幅度参数 |
created_at | String | 任务创建时间 |
{"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"}