cURL - 视频编辑(指令+参考图)
输入视频与参考图,结合文本指令完成风格变换、局部替换等编辑任务。支持 720P/1080P 分辨率,输入视频时长 3~60 秒,输出视频上限 15 秒。
鉴权
string
header
必填
千问云 API Key。详见获取 API Key。
Header 参数
enum<string>
必填
必须设置为 enable,表示异步提交任务。
enable
提交 HappyHorse 视频编辑任务
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
-H 'X-DashScope-Async: enable' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "happyhorse-1.0-video-edit",
"input": {
"prompt": "让视频中的马头人身角色穿上图片中的条纹毛衣",
"media": [
{
"type": "video",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260409/dozxak/Wan_Video_Edit_33_1.mp4"
},
{
"type": "reference_image",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260415/hynnff/wan-video-edit-clothes.webp"
}
]
},
"parameters": {
"resolution": "720P"
}
}'{
"request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx",
"output": {
"task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx",
"task_status": "PENDING"
}
}千问云 API Key。详见获取 API Key。
必须设置为 enable,表示异步提交任务。
模型名称。固定值:happyhorse-1.0-video-edit。
输入的基本信息,包括待编辑的视频、参考图片和提示词。
显示子属性
文本提示词,用来描述对视频的编辑意图,如风格转换、局部替换等。支持任何语言输入,长度不超过5000个非中文字符或2500个中文字符,超过部分会自动截断。
媒体素材列表。必须包含1个 video 类型元素;可选包含 0~5 个 reference_image 类型元素。
显示子属性
媒体素材类型:video(必传,待编辑的视频)或 reference_image(可选,参考图像)。
媒体素材的 URL 地址或 Base64 编码数据。
视频(type=video):MP4、MOV(建议 H.264 编码)。时长:3~60 秒。分辨率:长边不超过 2160 像素,短边不小于 320 像素。宽高比:1:2.5 ~ 2.5:1。文件大小:不超过 100 MB。帧率:大于 8 fps。输出视频时长上限 15 秒(超出部分从头自动截取)。
图像(type=reference_image):JPEG、JPG、PNG、WEBP。分辨率:宽高不小于 300 像素。宽高比:1:2.5 ~ 2.5:1。文件大小:不超过 20 MB。支持公网 URL(HTTP/HTTPS)或 Base64 编码(格式:data:{MIME_type};base64,{base64_data})。
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
-H 'X-DashScope-Async: enable' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "happyhorse-1.0-video-edit",
"input": {
"prompt": "让视频中的马头人身角色穿上图片中的条纹毛衣",
"media": [
{
"type": "video",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260409/dozxak/Wan_Video_Edit_33_1.mp4"
},
{
"type": "reference_image",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260415/hynnff/wan-video-edit-clothes.webp"
}
]
},
"parameters": {
"resolution": "720P"
}
}'{
"request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx",
"output": {
"task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx",
"task_status": "PENDING"
}
}