舞动人像
做什么:让静态人物照片按你指定的动作模板活动起来,产出动作视频。
一条完整链路要用到三个模型:模板提取 → 图片校验 → 动作合成,顺序不能颠倒。
一、生成人物动作视频
curl
curl --location 'https://api.allyang.cn/qwen/api/v1/services/aigc/image2video/video-synthesis/' \
--header 'X-DashScope-Async: enable' \
--header "Authorization: Bearer <API-Key>" \
--header 'Content-Type: application/json' \
--data '{
"model": "animate-anyone-gen2",
"input": {
"image_url": "<人物图片地址>",
"template_id": "<动作模板 ID>"
},
"parameters": {
"use_ref_img_bg": false,
"video_ratio": "9:16"
}
}'
提交后拿到 task_id,再轮询任务接口:
curl
curl -X GET https://api.allyang.cn/qwen/api/v1/tasks/<task_id> \
--header "Authorization: Bearer <API-Key>"
二、人物图片检测(前置步骤)
人物图片需先通过检测:
curl
curl --location --request POST 'https://api.allyang.cn/qwen/api/v1/services/aigc/image2video/aa-detect' \
--header "Authorization: Bearer <API-Key>" \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "animate-anyone-detect-gen2",
"input": {
"image_url": "<人物图片地址>"
},
"parameters": {}
}'
返回如下结构即表示通过:
json
{
"request_id": "7574ee8f-38a3-4b1e-9280-11c33ab46e51",
"output": {
"task_id": "a8532587-fa8c-4ef8-82be-0c46b17950d1",
"task_status": "SUCCEEDED",
"video_url": "<检测输出视频地址>"
},
"usage": {
"video_duration": 10.23,
"video_ratio": "standard"
}
}
三、动作模板生成(前置步骤)
把动作视频转成可复用的模板:
curl
curl --location 'https://api.allyang.cn/qwen/api/v1/services/aigc/image2video/aa-template-generation/' \
--header 'X-DashScope-Async: enable' \
--header "Authorization: Bearer <API-Key>" \
--header 'Content-Type: application/json' \
--data '{
"model": "animate-anyone-template-gen2",
"input": {
"video_url": "<动作视频地址>"
},
"parameters": {}
}'
json
{
"output": {
"task_id": "a8532587-fa8c-4ef8-82be-0c46b17950d1",
"task_status": "PENDING"
},
"request_id": "7574ee8f-38a3-4b1e-9280-11c33ab46e51"
}
同样用 task_id 轮询任务接口取结果。
可用模型
| 模型名 | 职责 | 计费参考 |
|---|---|---|
| animate-anyone-detect-gen2 | 判断输入的图片是否符合要求 | 0.004 元/张 |
| animate-anyone-template-gen2 | 从人物运动视频里抽取动作,产出可复用模板 | 0.08 元/秒 |
| animate-anyone-gen2 | 用人物图片 + 动作模板合成动作视频 | 待补(源文未给出) |
单价口径:数值来自源文档,未核价,正式以「模型广场」为准。