文档版本:v1.0.0 | 最后更新:2026-07-22 本平台已完整适配通义万相(Wan)官方视频生成接口,请求与响应均为透传,参数语义与官方一致。
| 接口 | 模型 | 调用方式 |
|---|---|---|
| 数字人视频生成 | wan2.2-s2v | 异步(创建任务 + 轮询查询) |
| 人脸检测 | wan2.2-s2v-detect | 同步(立即返回结果) |
推荐流程:先调用人脸检测接口确认图片合规( check_pass: true),再提交数字人视频生成任务,可避免因图片不合规导致任务失败。
POST https://platform.shuyanai.com/ali/api/v1/services/aigc/image2video/video-synthesis| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
Content-Type | string | 是 | application/json | 数据交换格式 |
Authorization | string | 是 | 鉴权信息,Bearer {API_KEY} |
官方要求的 X-DashScope-Async: enable头由平台自动补充,调用时无需携带;携带亦兼容。
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
model | string | 是 | 固定为 wan2.2-s2v | |
input.image_url | string | 是 | 人物图片 URL,需公网可访问的 HTTP/HTTPS 链接。要求见下方「图片与音频要求」 | |
input.audio_url | string | 是 | 人声音频 URL,需公网可访问的 HTTP/HTTPS 链接。要求见下方「图片与音频要求」 | |
parameters.resolution | string | 否 | 480P | 输出分辨率档位,可选 480P、720P。输出保持与输入图片相同宽高比,总像素调整至所选档位附近(480P 约 31 万像素,720P 约 92 万像素;例如 4:5 的输入图选 480P 可能输出 480×600) |
parameters.style | string | 否 | 对口型场景,如 speech(说话)。官方描述支持说话、唱歌、表演三种场景,唱歌/表演的枚举值官方未公开,建议以实测为准 |
| 输入 | 要求 |
|---|---|
| 图片 | 格式 jpg/jpeg/png/bmp/webp;宽、高均在 [400, 7000] 像素范围内;建议单人、正面、清晰的人物肖像图(可先用人脸检测接口预检) |
| 音频 | 格式 wav/mp3;文件小于 15MB,时长小于 20 秒;需包含清晰响亮的人声,建议去除环境噪音与背景音乐 |
curl --request POST \
--url 'https://platform.shuyanai.com/ali/api/v1/services/aigc/image2video/video-synthesis' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.2-s2v",
"input": {
"image_url": "https://example.com/portrait.jpg",
"audio_url": "https://example.com/speech.mp3"
},
"parameters": {
"resolution": "480P",
"style": "speech"
}
}'curl --request POST \
--url 'https://platform.shuyanai.com/ali/api/v1/services/aigc/image2video/video-synthesis' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.2-s2v",
"input": {
"image_url": "https://example.com/portrait.jpg",
"audio_url": "https://example.com/sing.wav"
},
"parameters": {
"resolution": "720P",
"style": "speech"
}
}'{
"output": {
"task_status": "PENDING",
"task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
},
"request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}usage 中:usage.duration:生成视频时长(秒),与输入音频时长一致,为计费依据;usage.SR:输出分辨率档位(480 或 720),不同档位单价不同,720P 高于 480P。POST https://platform.shuyanai.com/ali/api/v1/services/aigc/image2video/face-detect本接口为同步接口,检测结果随响应立即返回,不产生 task_id,无需轮询查询。
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
Content-Type | string | 是 | application/json | 数据交换格式 |
Authorization | string | 是 | 鉴权信息,Bearer {API_KEY} |
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
model | string | 是 | 固定为 wan2.2-s2v-detect | |
input.image_url | string | 是 | 待检测图片 URL,需公网可访问的 HTTP/HTTPS 链接。格式 jpg/jpeg/png/bmp/webp;宽、高均在 [400, 7000] 像素范围内 |
curl --request POST \
--url 'https://platform.shuyanai.com/ali/api/v1/services/aigc/image2video/face-detect' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.2-s2v-detect",
"input": {
"image_url": "https://example.com/portrait.jpg"
}
}'{
"output": {
"check_pass": true,
"humanoid": true
},
"usage": {
"image_count": 1
},
"request_id": "c56f62df-xxxx-xxxx-xxxx-xxxxxx"
}{
"output": {
"check_pass": false,
"humanoid": false,
"code": "xxx",
"message": "xxx"
},
"usage": {
"image_count": 1
},
"request_id": "c56f62df-xxxx-xxxx-xxxx-xxxxxx"
}| 字段 | 类型 | 说明 |
|---|---|---|
output.check_pass | boolean | 检测结果:true 通过,可用于数字人视频生成;false 不通过 |
output.humanoid | boolean | 是否检测到人像 |
output.code / output.message | string | 仅检测不通过时返回原因;通过时无此字段 |
usage.image_count | integer | 本次检测的图片数量,固定为 1,为计费依据 |
request_id | string | 本次请求唯一 ID |
人脸检测按检测图片张数计费:请求成功即计费(无论检测是否通过),请求失败不计费。
task_id 轮询状态及结果(人脸检测为同步接口,无需查询):GET https://platform.shuyanai.com/ali/api/v1/tasks/{task_id}