Skip to content
EN

Wan文生视频

方法: POST路径: /v2/videos/generations

通义万相文生视频模型基于文本提示词,生成一段流畅的视频。支持的能力包括:

基础能力:时长灵活(5秒/10秒)、指定视频分辨率(480P/720P/1080P)、智能改写prompt、添加水印。

音频能力:支持自动配音,或传入自定义音频文件,实现音画同步。(仅wan2.5支持)

请求参数

Header 参数

text
Authorization
string
可选
默认值:
Bearer {{YOUR_API_KEY}}

Body 参数 application/json

text
prompt
string
必需
The text prompt supports Chinese and English, with a maximum length of 800 characters. Each Chinese character or letter counts as one character. Content that exceeds this limit will be truncated.
文本提示支持中英文,最大长度为800个字符。每个汉字或字母算作一个字符。超过此限制的内容将被截断。
Example: A kitten running in the moonlight.
示例:一只小猫在月光下奔跑。
model
enum<string>
必需
型号名称。示例:wan2.1-t2v-turbo。
枚举值:
wan2.2-t2v-plus
最新机型
视觉细节和运动稳定性的显着改进Resolution levels: 480P, 1080P 分辨率级别:480P、1080P  Frame rate: 30 fps  帧速率:30 fps  Duration: 5 seconds  持续时间:5 秒
wanx2.1-t2v-turbo
2.1极速版
Resolution levels: 480P, 720P 分辨率级别:480P、720P  Frame rate: 30 fps  帧速率:30 fps  Duration: 5 seconds  持续时间:5 秒
wanx2.1-t2v-plus
2.1 专业版
Resolution level: 720P  分辨率级别:720P  Frame rate: 30 fps  帧速率:30 fps  Duration: 5 seconds  持续时间:5 秒
duration
integer
可选
生成视频的持续时间(以秒为单位)。该参数固定为 5,无法修改。模型始终生成一个 5 秒的视频。
size
string
可选
wan2.2-t2v-plus:支持所有对应 480P 和 1080P 的分辨率。默认分辨率为 1920x1080
wanx2.1-t2v-turbo:支持所有对应 480P 和 720P 的分辨率。默认分辨率为 1280×720 (720P)。
wanx2.1-t2v-plus:仅支持 720P 对应的分辨率。默认分辨率为 1280×720 (720P)。
480P: The optional video resolutions and their corresponding aspect ratios are:
480P:可选的视频分辨率及其相应的宽高比为:
832×480: 16:9.  832×480:16:9。
480×832: 9:16.  480×832:9:16。
624×624: 1:1.  624×624:1。
720P: The optional video resolutions and their corresponding aspect ratios are:
720P:可选的视频分辨率及其相应的宽高比为:
1280×720: 16:9.  1280×720:16:9。
720×1280: 9:16.  720×1280:9:16。
960×960: 1:1.  960×960:1:1。
1088×832: 4:3.  1088×832:4:3。
832×1088: 3:4.  832×1088:3:4。
1080P: The optional video resolutions and their corresponding aspect ratios are:
1080P:可选的视频分辨率及其相应的宽高比为:
1920×1080: 16:9.
1920×1080:16:9。
1080×1920: 9:16.
1080×1920:9:16。
1440×1440: 1:1.  1440×1440:1:1。
1632×1248: 4:3.  1632×1248:4:3。
1248×1632: 3:4.  1248×1632:3:4。
watermark
boolean
可选
指定是否添加水印。水印位于视频的右下角,注明“由人工智能生成”。
template
string
可选
negative_prompt
string
可选
A negative prompt is used to describe content that you do not want to appear in the video, which lets you restrict the video content.
否定提示用于描述您不想出现在视频中的内容,这可以让您限制视频内容。
It supports Chinese and English, with a maximum length of 500 characters. Content that exceeds this limit will be truncated.
它支持中英文,最大长度为 500 个字符。超过此限制的内容将被截断。
Examples: low resolution, error, worst quality, low quality, defects, extra fingers, poor proportions.
例如:低分辨率、错误、质量最差、质量低、缺陷、多余手指、比例差。
prompt_extend
boolean
可选
指定是否启用提示重写。如果启用,则使用大型语言模型 (LLM) 智能重写输入提示。这显着改善了较短提示的生成结果,但增加了处理时间。
seed
integer
可选
一个随机数种子,用于控制模型生成的内容的随机性。该值必须在 [0, 2147483647] 的范围内。
如果不提供此参数,则算法会自动为种子生成一个随机数。如果希望生成的内容保持相对稳定,可以使用相同的种子值。
示例
{
"prompt"
:
"dance"
,
"model"
:
"wan2.2-t2v-plus"
}

请求示例代码

Shell

bash
curl --location --request POST '/v2/videos/generations' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "prompt": "dance",
    "model": "wan2.2-t2v-plus"
}'

返回响应

🟢 200 成功

内容类型: application/json

响应结构

text
task_id
string
必需

示例

json
{
    "task_id": "e7bed961-d1b9-4b3f-8ef9-5f441bde28c8"
}