文生视频
POST https://api.vidu.cn/ent/v2/text2video
请求头
字段 | 值 | 描述 |
---|---|---|
Content-Type | application/json | 数据交换格式 |
Authorization | Token {your api key} | 将 {token} 替换为您的 token |
请求体
参数名称 | 类型 | 必填 | 参数描述 |
---|---|---|---|
model | String | 是 | 模型名称 可选值:viduq1 、vidu1.5 |
style | String | 可选 | 风格 默认 general,可选值:general、anime general:通用风格,可以通过提示词来控制风格 anime:动漫风格,仅在动漫风格表现突出,可以通过不同的动漫风格提示词来控制 |
prompt | String | 是 | 文本提示词 生成视频的文本描述。 注:字符长度不能超过 1500 个字符 |
duration | Int | 可选 | 视频时长参数,默认值依据模型而定: - viduq1 : 默认5秒,可选:5 - vidu1.5 : 默认4秒,可选:4、8 |
seed | Int | 可选 | 随机种子 当默认不传或者传0时,会使用随机数替代 手动设置则使用设置的种子 |
aspect_ratio | String | 可选 | 比例 默认 16:9,可选值:16:9、9:16、1:1 |
resolution | String | 可选 | 分辨率参数,默认值依据模型和视频时长而定: - viduq1 5秒:默认 1080p,可选:1080p - 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","style": "general","prompt": "In an ultra-realistic fashion photography style featuring light blue and pale amber tones, an astronaut in a spacesuit walks through the fog. The background consists of enchanting white and golden lights, creating a minimalist still life and an impressive panoramic scene.","duration": "5","seed": "0","aspect_ratio": "16:9","resolution": "1080p","movement_amplitude": "auto"}' https://api.vidu.cn/ent/v2/text2video
响应体
字段 | 类型 | 描述 |
---|---|---|
task_id | String | Vidu 生成的任务ID |
state | String | 处理状态 可选值: created 创建成功 queueing 任务排队中 processing 任务处理中 success 任务成功 failed 任务失败 |
model | String | 本次调用的模型名称 |
prompt | String | 本次调用的提示词参数 |
duration | Int | 本次调用的视频时长参数 |
seed | Int | 本次调用的随机种子参数 |
aspect_ratio | String | 本次调用的 比例 参数 |
resolution | String | 本次调用的分辨率参数 |
bgm | bool | 本次调用的背景音乐参数 |
movement_amplitude | String | 本次调用的镜头动态幅度参数 |
created_at | String | 任务创建时间 |
{"task_id": "your_task_id_here","state": "created","model": "viduq1","style": "general","prompt": "In an ultra-realistic fashion photography style featuring light blue and pale amber tones, an astronaut in a spacesuit walks through the fog. The background consists of enchanting white and golden lights, creating a minimalist still life and an impressive panoramic scene.","duration": 5,"seed": random_number,"aspect_ratio": "16:9","resolution": "1080p","movement_amplitude": "auto","created_at": "2025-01-01T15:41:31.968916Z"}