数字人
做什么:给一张人物照片和一段音频,让照片里的人按这段音频说话、唱歌或表演,口型与表情同步。
一、提交数字人任务
curl
curl '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": "wan2.2-s2v",
"input": {
"image_url": "<人物图片地址>",
"audio_url": "<音频地址>"
},
"parameters": {
"resolution": "480P"
}
}'
json
{
"output": {
"task_status": "PENDING",
"task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
},
"request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}
二、轮询任务
curl
curl -X GET https://api.allyang.cn/qwen/api/v1/tasks/<task_id> \
--header "Authorization: Bearer <API-Key>"
完成后的返回长这样(时间字段与用量字段一并给出):
json
{
"output": {
"task_id": "bcae8761-f242-4775-a11e-xxxxxx",
"task_status": "SUCCEEDED",
"submit_time": "2025-09-01 09:37:27.468",
"scheduled_time": "2025-09-01 09:37:34.885",
"end_time": "2025-09-01 09:40:20.734",
"results": {
"video_url": "<生成视频地址>"
}
},
"usage": {
"duration": 18.13,
"video_count": 1,
"SR": 480
},
"request_id": "28cfedb1-cd60-9e0c-b920-xxxxxx"
}
三、先做图片检测
照片必须先过检测才能用于生成:
curl
curl 'https://api.allyang.cn/qwen/api/v1/services/aigc/image2video/face-detect' \
--header "Authorization: Bearer <API-Key>" \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "wan2.2-s2v-detect",
"input": {
"image_url": "<人物图片地址>"
}
}'
json
{
"output": {
"check_pass": true,
"humanoid": true
},
"usage": {
"image_count": 1
},
"request_id": "c56f62df-724e-9c19-96bd-xxxxxx"
}
只有当 check_pass 为 true 时,同一张图才可用于生成步骤。
可用模型
| 模型名称 | 职责 | 计费参考 |
|---|---|---|
| wan2.2-s2v-detect | 判断图像是否满足要求(清晰度、单人、正面) | 0.004 元/张 |
| wan2.2-s2v | 用检测通过的图 + 一段音频合成人物动态视频 | 480P 档 0.5 元/秒;720P 档 0.9 元/秒 |
读表须知:计费为源文档数值,未核价,以「模型广场」为准。