视频编辑:视频 + 参考图 + 指令创建编辑任务
curl --request POST \
--url https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DashScope-Async: <x-dashscope-async>' \
--data '
{
"model": "wan2.7-videoedit",
"input": {
"prompt": "将视频中女孩的衣服替换为图片中的衣服",
"media": [
{
"type": "video",
"url": "https://your-cdn.com/source.mp4"
},
{
"type": "reference_image",
"url": "https://your-cdn.com/new-clothes.png"
}
]
}
}
'{
"output": {
"task_id": "3b216861-6a5f-441d-a438-602ab2c0d103",
"task_status": "PENDING"
},
"request_id": "..."
}Wan2.7 视频生成(阿里云)
Wan2.7 视频编辑 API 参考
Wan2.7-videoedit 视频编辑 API 参考与在线调试:输入视频 + 参考图 + 自然语言指令,做换装、换背景等局部/全局编辑。
POST
/
wan
/
api
/
v1
/
services
/
aigc
/
video-generation
/
video-synthesis
视频编辑:视频 + 参考图 + 指令创建编辑任务
curl --request POST \
--url https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DashScope-Async: <x-dashscope-async>' \
--data '
{
"model": "wan2.7-videoedit",
"input": {
"prompt": "将视频中女孩的衣服替换为图片中的衣服",
"media": [
{
"type": "video",
"url": "https://your-cdn.com/source.mp4"
},
{
"type": "reference_image",
"url": "https://your-cdn.com/new-clothes.png"
}
]
}
}
'{
"output": {
"task_id": "3b216861-6a5f-441d-a438-602ab2c0d103",
"task_status": "PENDING"
},
"request_id": "..."
}Documentation Index
Fetch the complete documentation index at: https://docs.apiyi.com/llms.txt
Use this file to discover all available pages before exploring further.
右侧 Playground 可直接调试:在 Authorization 填
Bearer sk-your-api-key,填好 model / input.media / parameters 后发起请求。提交成功返回 task_id,轮询与下载见下方说明。本页是
wan2.7-videoedit(视频编辑)的创建接口:给一段视频 + 1–5 张参考图 + 自然语言编辑指令,对视频元素做换装、换背景等编辑。注意模型名 无连字符(videoedit)。完整异步流程见 Wan 概览。input.media必须同时包含video(被编辑的视频)与至少 1 张reference_image(参考素材,≤5 张)。- 模型名是
wan2.7-videoedit(无连字符),与 HappyHorse 的happyhorse-1.0-video-edit(有连字符)不同,别写错。 - 创建请求走
/wan/api/v1/...并带X-DashScope-Async: enable,不要用/v1/videos。
代码示例
curl -X POST "https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis" \
-H "X-DashScope-Async: enable" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.7-videoedit",
"input": {
"prompt": "将视频中女孩的衣服替换为图片中的衣服",
"media": [
{"type": "video", "url": "https://your-cdn.com/source.mp4"},
{"type": "reference_image", "url": "https://your-cdn.com/new-clothes.png"}
]
},
"parameters": {"resolution": "720P", "prompt_extend": true, "watermark": true}
}'
参数与媒体速查
| 参数 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
model | string | ✓ | — | 固定 wan2.7-videoedit |
input.prompt | string | ✓ | — | 自然语言编辑指令 |
input.media | array | ✓ | — | 见下方媒体表 |
parameters.resolution | string | 720P | 720P / 1080P | |
parameters.prompt_extend | bool | true | 智能改写 | |
parameters.watermark | bool | false | 「AI 生成」水印 |
media[] 取值
type | 必填 | 张数 | 说明 |
|---|---|---|---|
video | ✓ | 1 | 被编辑的源视频 |
reference_image | ✓ | 1–5 | 参考素材(新服装、新背景等) |
视频编辑的输出时长跟随输入视频,不由
duration 决定,因此本能力通常不传 duration。响应格式
{
"output": { "task_id": "3b216861-6a5f-441d-a438-602ab2c0d103", "task_status": "PENDING" },
"request_id": "..."
}
提交后 轮询
GET /v1/tasks/{task_id} 直到 completed,再从 result_url 下载 mp4(不带 Authorization 头,24 小时过期)。完整循环见 Wan 概览 · 异步调用流程。授权
在 API易控制台获取的 API Key
请求头
异步处理开关,必须设置为 enable
可用选项:
enable 请求体
application/json
此页面对您有帮助吗?
⌘I