Wan首尾帧图生视频
方法: POST路径: /v2/videos/generations
统一接口格式
请求参数
Header 参数
text
Authorization
string
可选
默认值:
Bearer {{YOUR_API_KEY}}Body 参数 application/json
text
prompt
string
必需
model
enum<string>
必需
wanx2.1-kf2v-plus
值:
wanx2.1-kf2v-plus
duration
integer
可选
resolution
string
可选
images
array
[string]
必需
第一张是首帧,第二张是尾帧
使用公网可访问URL
支持 HTTP 或 HTTPS 协议。本地文件可通过上传文件获取临时URL。
示例值:
https://cdn.translate.alibaba.com/r/wanx-demo-1.png。
传入 Base64 编码图像后的字符串
数据格式:data:{MIME_type};base64,{base64_data}。
示例值:data:image/png;base64,GDU7MtCZzEbTbmRZ......。(编码字符串过长,仅展示片段)
watermark
boolean
可选
template
string
可选
negative_prompt
string
可选
prompt_extend
string
可选
seed
integer
可选
示例
{
"prompt"
:
"dance"
,
"model"
:
"wanx2.1-kf2v-plus"
,
"images"
:
[
"https://webstatic.aiproxy.vip/dist/demo.jpg"
,
"https://webstatic.aiproxy.vip/dist/demo.jpg"
]
}请求示例代码
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": "wanx2.1-kf2v-plus",
"images": [
"https://webstatic.aiproxy.vip/dist/demo.jpg",
"https://webstatic.aiproxy.vip/dist/demo.jpg"
]
}'返回响应
🟢 200 成功
内容类型: application/json
响应结构
text
task_id
string
必需示例
json
{
"task_id": "e7bed961-d1b9-4b3f-8ef9-5f441bde28c8"
}