跳转到主要内容
POST
/
vidu
/
ent
/
v2
/
start-end2video
Vidu 首尾帧生视频 (viduq3-turbo)
curl --request POST \
  --url https://api.powertokens.ai/vidu/ent/v2/start-end2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "viduq3-pro",
  "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",
  "audio": true,
  "off_peak": false
}
'
{
  "task_id": "your_task_id_here",
  "state": "created",
  "model": "viduq3-pro",
  "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": 0,
  "resolution": "1080p",
  "audio": true,
  "payload": "",
  "off_peak": false,
  "credits": 10,
  "created_at": "2025-01-01T15:41:31.968916Z"
}

授权

Authorization
string
header
必填

在请求头中传入 Authorization: Bearer <token>

请求体

application/json
model
enum<string>
必填

模型名称 可选值:viduq3-turbo

  • viduq3-turbo:对比viduq3-pro,生成速度更快
  • viduq3-pro:高效生成优质音视频内容,让视频内容更生动、更形象、更立体,效果更好
可用选项:
viduq3-turbo
images
string[]
必填

图像 支持输入两张图,上传的第一张图片视作首帧图,第二张图片视作尾帧图,模型将以此参数中传入的图片来生成视频

注1: 首尾帧两张输入图的分辨率需相近,首帧图的分辨率/尾帧图的分辨率要在0.8~1.25之间。且图片比例需要小于1:4或者4:1; 注2: 支持传入图片 Base64 编码或图片URL(确保可访问); 注3: 图片支持 png、jpeg、jpg、webp格式; 注4: 图片大小不超过50M; 注5: 请注意,http请求的post body不超过20MB,且编码必须包含适当的内容类型字符串,例如: data:image/png;base64,{base64_encode}

Required array length: 2 elements
prompt
string

文本提示词 生成视频的文本描述。 注1:字符长度不能超过 5000 个字符 注2:若使用is_rec推荐提示词参数,模型将不考虑此参数所输入的提示词

Maximum string length: 5000
is_rec
boolean
默认值:false

是否使用推荐提示词

  • true:是,由系统自动推荐提示词,并使用提示词内容生成视频,推荐提示词数量=1
  • false:否,根据输入的prompt生成视频 注意:启用推荐提示词后,每个任务多消耗10积分
duration
integer

视频时长参数,默认值依据模型而定:

  • viduq3-pro 、viduq3-turbo默认为 5,可选:1 - 16
seed
integer

随机种子 当默认不传或者传0时,会使用随机数替代 手动设置则使用设置的种子

resolution
enum<string>

分辨率参数,默认值依据模型和视频时长而定:

  • viduq3-pro 、viduq3-turbo1-16秒:默认 720p,可选:540p、720p、1080p
可用选项:
540p,
720p,
1080p
movement_amplitude
enum<string>
默认值:auto

运动幅度 默认 auto,可选值:auto、small、medium、large 注:使用q2、q3系列模型时该参数不生效

可用选项:
auto,
small,
medium,
large
audio
boolean
默认值:true

是否使用音视频直出能力,默认为true,枚举值为:

  • false:不需要音视频直出,输出静音视频
  • true:需要音画同步,输出声音的视频(包括台词和音效) 注1:仅q3系列模型支持该参数
bgm
boolean
默认值:false

是否为生成的视频添加背景音乐。 默认:false,可选值 true 、false

  • 传 true 时系统将从预设 BGM 库中自动挑选合适的音乐并添加;不传或为 false 则不添加 BGM。
  • BGM不限制时长,系统根据视频时长自动适配
  • 该参数在q3系列模型中不生效
payload
string

透传参数 不做任何处理,仅数据传输 注:最多 1048576个字符

Maximum string length: 1048576
off_peak
boolean
默认值:false

错峰模式,默认为:false,可选值:

  • true:错峰生成视频;
  • false:即时生成视频; 注1:错峰模式消耗的积分更低,具体请查看产品定价 注2:错峰模式下提交的任务,会在48小时内生成,未能完成的任务会被自动取消,并返还该任务的积分; 注3:您也可以手动取消错峰任务
watermark
boolean

是否添加水印

  • true:添加水印;
  • false:不添加水印; 注1:目前水印内容为固定,内容由AI生成,默认不加 注2:您可以通过watermarked_url参数查询获取带水印的视频内容,详情见查询任务接口
wm_position
integer
默认值:3

水印位置,表示水印出现在图片的位置,可选项为: 1:左上角 2:右上角 3:右下角 4:左下角 默认为:3

wm_url
string

水印内容,此处为图片URL 不传时,使用默认水印:内容由AI生成

meta_data
string

元数据标识,json格式字符串,透传字段,您可以 自定义格式 或使用 示例格式 ,示例如下: { "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" } 该参数为空时,默认使用vidu生成的元数据标识

callback_url
string

Callback 协议 需要您在创建任务时主动设置 callback_url,请求方法为 POST,当视频生成任务有状态变化时,Vidu 将向此地址发送包含任务最新状态的回调请求。回调请求内容结构与查询任务API的返回体一致 回调返回的"status"包括以下状态:

  • processing 任务处理中
  • success 任务完成(如发送失败,回调三次)
  • failed 任务失败(如发送失败,回调三次) Vidu采用回调签名算法进行认证,详情见:回调签名算法

响应

提交成功,返回视频任务对象。

task_id
string

Vidu 生成的任务ID

state
enum<string>

处理状态 可选值: created 创建成功 queueing 任务排队中 processing 任务处理中 success 任务成功 failed 任务失败

可用选项:
created,
queueing,
processing,
success,
failed
model
string

本次调用的模型名称

prompt
string

本次调用的提示词参数

images
string[]

本次调用的图像参数

duration
integer

本次调用的视频时长参数

seed
integer

本次调用的随机种子参数

resolution
string

本次调用的分辨率参数

bgm
boolean

本次调用的背景音乐参数

movement_amplitude
string

本次调用的镜头动态幅度参数

payload
string

本次调用时传入的透传参数

off_peak
boolean

本次调用时是否使用错峰模式

credits
integer

本次调用使用的积分数

watermark
boolean

本次提交任务是否使用水印

created_at
string<date-time>

任务创建时间