众扬汇 AI 开放平台 API 文档

灵动人像 LivePortrait

做什么:给一张肖像照加一段人声,快速产出肖像动态视频。定位是「轻量档」:比「悦动人像 EMO」快、便宜,效果略弱。

一、提交任务

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": "liveportrait",
    "input": {
        "image_url": "<人物肖像图片地址>",
        "audio_url": "<人声音频地址>"
    },
    "parameters": {
        "template_id": "normal",
        "eye_move_freq": 0.5,
        "video_fps": 30,
        "mouth_move_strength": 1,
        "paste_back": true,
        "head_move_strength": 0.7
    }
}'

parameters 各键的作用(描述由本页改写,字段名与接口一致):

键 作用
template_id 动作模板,源文示例值 normal
eye_move_freq 眨眼频率
video_fps 输出帧率
mouth_move_strength 嘴部动作幅度
paste_back 是否把结果贴回原图
head_move_strength 头部动作幅度
json
{
    "output": {
        "task_id": "a8532587-fa8c-4ef8-82be-0c46b17950d1",
        "task_status": "PENDING"
    },
    "request_id": "7574ee8f-38a3-4b1e-9280-11c33ab46e51"
}

二、轮询任务

curl
curl -X GET \
--header 'Authorization: Bearer <API-Key>' \
https://api.allyang.cn/qwen/api/v1/tasks/<task_id>
json
{
    "request_id": "7574ee8f-38a3-4b1e-9280-11c33ab46e51",
    "output": {
        "task_id": "a8532587-fa8c-4ef8-82be-0c46b17950d1",
        "task_status": "SUCCEEDED",
        "results": {
            "video_url": "<生成视频地址>"
        }
    },
    "usage": {
        "video_duration": 10.23,
        "video_ratio": "standard"
    }
}

可用模型

模型名称 职责 计费参考
liveportrait-detect 判断输入图片是否满足要求 0.004 元/张
liveportrait 依据肖像图 + 音频产出动态视频 0.02 元/秒

读表须知:计费为源文档数值,未核价,以控制台「模型广场」为准。检测调用方式可参考「悦动人像 EMO」页的 face-detect 写法,把模型名换成 liveportrait-detect。