创建参考生视频任务
OpenAPI Specification
yaml
openapi: 3.0.1
info:
title: ''
description: ''
version: 1.0.0
paths:
/ent/v2/reference2video:
post:
summary: 创建参考生视频任务
deprecated: false
description: 官方文档:https://platform.vidu.cn/docs/reference-to-video
tags:
- 官方VIDU视频生成、图片生成、音频生成
parameters:
- name: Authorization
in: header
description: ''
required: false
example: Bearer {{YOUR_API_KEY}}
schema:
type: string
- name: Content-Type
in: header
description: ''
required: false
example: application/json
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
prompt:
type: string
description: |-
文本提示词
生成视频的文本描述。
注:字符长度不能超过 2000 个字符
model:
type: string
description: |-
模型名称
可选值:viduq2 、viduq1
- viduq2:最新模型
- viduq1:画面清晰,平滑转场,运镜稳定
duration:
type: string
description: |-
视频时长参数,默认值依据模型而定:
- viduq2 : 默认5秒,可选:1-10
- viduq1 : 默认5秒,可选:5
seed:
type: string
description: |-
随机种子
当默认不传或者传0时,会使用随机数替代
手动设置则使用设置的种子
movement_amplitude:
type: string
description: |-
分辨率参数,默认值依据模型和视频时长而定:
viduq2 (1-10秒):默认 720p, 可选:540p、720p、1080p
viduq1 (5秒):默认 1080p, 可选:1080p
vidu2.0 (4秒):默认 360p, 可选:360p、720p
payload:
type: string
description: |-
透传参数
不做任何处理,仅数据传输
注:最多 1048576个字符
off_peak:
type: string
description: |-
错峰模式,默认为:false,可选值:
- true:错峰生成视频;
- false:即时生成视频;
注1:错峰模式消耗的积分更低,具体请查看产品定价
注2:错峰模式下提交的任务,会在48小时内生成,未能完成的任务会被自动取消,并返还该任务的积分;
注3:您也可以手动取消错峰任务
watermark:
type: string
description: |-
是否添加水印
- true:添加水印;
- false:不添加水印;
注1:目前水印内容为固定,内容由AI生成,默认不加
注2:您可以通过watermarked_url参数查询获取带水印的视频内容,详情见查询任务接口
wm_position:
type: string
description: |-
水印位置,表示水印出现在图片的位置,可选项为:
1:左上角
2:右上角
3:右下角
4:左下角
默认为:3
wm_url:
type: string
description: |-
水印内容,此处为图片URL
不传时,使用默认水印:内容由AI生成
meta_data:
type: string
description: >-
元数据标识,json格式字符串,透传字段,您可以 自定义格式 或使用 示例格式 ,示例如下:
{
"Label": "your_label","ContentProducer":
"yourcontentproducer","ContentPropagator":
"your_content_propagator","ProduceID": "yourproductid",
"PropagateID": "your_propagate_id","ReservedCode1":
"yourreservedcode1", "ReservedCode2": "your_reserved_code2"
}
该参数为空时,默认使用vidu生成的元数据标识
callback_url:
type: string
description: >-
Callback 协议
需要您在创建任务时主动设置 callback_url,请求方法为 POST,当视频生成任务有状态变化时,Vidu
将向此地址发送包含任务最新状态的回调请求。回调请求内容结构与查询任务API的返回体一致
回调返回的"status"包括以下状态:
- processing 任务处理中
- success 任务完成(如发送失败,回调三次)
- failed 任务失败(如发送失败,回调三次)
Vidu采用回调签名算法进行认证,详情见:回调签名算法
audio:
type: string
description: |-
是否使用音视频直出能力,默认为false,枚举值为:
- false:不需要音视频直出,输出静音视频
- true:需要音视频直出,输出带台词以及背景音的视频
注1:该参数为true时,voice_id参数才生效
注2:该参数为true时,不支持错峰模式
subjects:
type: array
items:
type: object
properties:
id:
type: string
description: 主体id,后续生成时可以通过@主体id的方式使用
images:
type: string
description: |-
该主体对应的图片url,每个主体最多支持3张图片
注1:支持传入图片 Base64 编码或图片URL(确保可访问)
注2:图片支持 png、jpeg、jpg、webp格式
注3:图片像素不能小于 128*128,且比例需要小于1:4或者4:1,且大小不超过50M。
注4:请注意,http请求的post body不超过20MB,且编码必须包含适当的内容类型字符串,例如:
data:image/png;base64,{base64_encode}
voice_id:
type: string
description: >-
音色ID用来决定视频中的声音音色,为空时系统会自动推荐,可选枚举值参考列表:新音色列表:https://shengshu.feishu.cn/sheets/EgFvs6DShhiEBStmjzccr5gonOg
x-apifox-orders:
- id
- images
- voice_id
required:
- id
- images
description: 图片主体信息支持1-7个主体,主体图片共1 ~ 7张
aspect_ratio:
type: string
description: |-
比例默认 16:9,可选值如下:16:9、9:16、4:3、3:4、1:1
注:4:3、3:4仅支持q2模型
required:
- model
- prompt
- subjects
x-apifox-orders:
- model
- subjects
- prompt
- audio
- duration
- seed
- aspect_ratio
- movement_amplitude
- payload
- off_peak
- watermark
- wm_position
- wm_url
- meta_data
- callback_url
example:
model: viduq2
subjects:
- id: cat
images:
- >-
https://imageproxy.zhongzhuan.chat/api/proxy/image/5d53c7fd4263170634f67ec89db55bec.png
prompt: 一只可爱的@cat在草地上奔跑,阳光明媚,画面温馨
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
task_id:
type: string
type:
type: string
state:
type: string
model:
type: string
style:
type: string
prompt:
type: string
images:
type: array
items:
type: string
duration:
type: integer
seed:
type: integer
aspect_ratio:
type: string
resolution:
type: string
movement_amplitude:
type: string
created_at:
type: string
credits:
type: integer
payload:
type: string
cus_priority:
type: integer
off_peak:
type: boolean
watermark:
type: boolean
is_rec:
type: boolean
wm_position:
type: string
wm_url:
type: string
meta_data:
type: string
client_request_id:
type: string
required:
- task_id
- type
- state
- model
- style
- prompt
- images
- duration
- seed
- aspect_ratio
- resolution
- movement_amplitude
- created_at
- credits
- payload
- cus_priority
- off_peak
- watermark
- is_rec
- wm_position
- wm_url
- meta_data
- client_request_id
x-apifox-orders:
- task_id
- type
- state
- model
- style
- prompt
- images
- duration
- seed
- aspect_ratio
- resolution
- movement_amplitude
- created_at
- credits
- payload
- cus_priority
- off_peak
- watermark
- is_rec
- wm_position
- wm_url
- meta_data
- client_request_id
example:
task_id: '911084878697623552'
type: character2video
state: created
model: viduq2
style: general
prompt: 一只可爱的@cat在草地上奔跑,阳光明媚,画面温馨
images:
- >-
https://picx.zhimg.com/v2-4911df093b40ee5511938a1ac2a5cdc4_r.jpg
duration: 5
seed: 1830691647
aspect_ratio: '16:9'
resolution: 720p
movement_amplitude: auto
created_at: '2026-01-20T06:37:57.371761937Z'
credits: 45
payload: ''
cus_priority: 0
off_peak: false
watermark: false
is_rec: false
wm_position: unspecified
wm_url: ''
meta_data: ''
client_request_id: ''
headers: {}
x-apifox-name: 成功
security: []
x-apifox-folder: 官方VIDU视频生成、图片生成、音频生成
x-apifox-status: released
x-run-in-apifox: https://app.apifox.com/web/project/5443236/apis/api-407866241-run
components:
schemas: {}
securitySchemes:
bearer:
type: http
scheme: bearer
servers:
- url: https://www.anyapi.vip
description: 正式环境
security:
- bearer: []