EMO模型可基于人物肖像图片和人声音频,生成人脸动态视频。
本文档仅适用于“中国大陆(北京)”地域,需使用“中国大陆(北京)”地域的API Key。
效果示例
输入示例 | 输出示例 |
人物肖像: 人声音频: | 使用动作风格强度:参数 |
更多效果示例请参见模型效果示例。
请确保上传的图片、音频文件来源符合相关法律法规,且已获得相应内容的使用许可。
前提条件
输入图像必须先通过EMO图像检测API检测,并获得对应人脸区域(face_bbox)和动态区域(ext_bbox)的范围值作为入参。
HTTP调用
步骤1:创建任务获取任务ID
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/image2video/video-synthesis
创建任务后,系统将立即返回一个
task_id
,用于“步骤2”查询任务结果。task_id
自创建起有效期为24小时。新手指引请参见Postman。
请求参数 |
|
请求头(Headers) | |
X-DashScope-Async 异步处理配置参数。HTTP请求只支持异步,必须设置为 重要 缺少此请求头将报错:“current user api does not support synchronous calls”。 | |
Authorization 请求身份认证。接口使用阿里云百炼API Key进行身份认证。示例值:Bearer sk-xxxx。 | |
Content-Type 请求内容类型。此参数必须设置为 | |
请求体(Request Body) | |
model 模型名称。示例值:emo-v1。 说明 若调用独立部署模型,则填入部署成功的模型名称 | |
input 输入的基本信息。 | |
parameters |
响应参数 | 响应成功示例
响应异常示例
|
output 任务输出信息。 | |
request_id 请求唯一标识。可用于请求明细溯源和问题排查。 | |
code 请求失败时返回的错误码,详情请参见状态码说明。 | |
message 请求失败时返回的详细错误信息,详情请参见状态码说明。 |
步骤2:根据任务ID查询结果
使用上一步获取的 task_id
,轮询任务状态和结果。请将 URL 中的{task_id}
替换为您的实际任务ID。
GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}
task_id 有效期:自创建起有效期24小时,超时后将无法查询结果,接口将返回任务状态为
UNKNOWN
。任务状态流转:一般正常处理的任务流转状态为 PENDING(排队中)→ RUNNING(处理中)→ SUCCEEDED(成功)/ FAILED(失败)。
任务结果获取:视频生成过程约需数分钟,查询接口默认QPS为20。建议配置异步任务回调获取结果,或者采用轮询方式并设置合理的查询间隔(如 15 秒)来获取结果。
video_url 有效期:自任务成功时刻起有效期为 24 小时。建议在获取链接后立即下载并转存至永久存储(如阿里云 OSS)。
更多操作:如需批量查询、取消任务等操作,请参见管理异步任务。
请求参数 |
|
请求头(Headers) | |
Authorization 请求身份认证。接口使用阿里云百炼API Key进行身份认证。示例值:Bearer sk-xxxx。 | |
URL路径参数(Path parameters) | |
task_id 需要查询任务的task_id。示例值:a8532587-fa8c-4ef8-82be-xxxxxx。 |
响应参数 | 响应成功示例
响应异常示例
|
request_id 请求唯一标识。可用于请求明细溯源和问题排查。 | |
output 任务输出信息。 | |
usage |
计费与限流
模式 | 模型名称 | 单价 | 免费额度(查看) | 任务下发接口QPS限制 | 同时处理中任务数量 |
调用百炼模型API | emo-v1 | 后付费,按照输出视频的实际时长计费:
| 1800秒 | 5 | 1 (超出任务将排队) |
独立部署模型 | 独立部署成功后将生成唯一的模型名称 | 预付费:
需部署成功后调用,仅收取部署费用。 | 无 | 5 | 1算力单元支持1并发 |
状态码说明
大模型服务平台通用状态码请查阅:错误信息。
本模型还有如下特定错误码:
HTTP返回码 | 错误码(code) | 错误信息(message) | 含义说明 |
400 | InvalidParameter | The request is missing required parameters or in a wrong format, please check the parameters that you send. | 入参格式不对。 |
400 | InvalidParameter | The style_level is invalid. | style_level不在枚举范围内。 |
400 | InvalidParameter.DataInspection | Unable to download the media resource during the data inspection process. | 下载图片或音频文件超时。 如果您从海外发起调用,由于跨境网络不稳定,可能会导致下载资源超时。您可以将文件存储到国内的 OSS 中,再发起模型调用。您也可以使用临时存储空间上传文件。 |
400 | InvalidURL | The request URL is invalid, please check the request URL is available and the request image format is one of the following types: JPEG, JPG, PNG, BMP, and WEBP. | 输入图片下载失败,请检查网络或者输入格式。支持以下格式:JPEG, JPG, PNG, BMP, and WEBP。 |
400 | InvalidURL | Required URL is missing or invalid, please check the request URL. | 输入的URL不正确或缺失。 |
400 | InvalidURL | The input audio is longer than 60s! | 输入的音频文件超过最大时长60秒。 |
400 | InvalidURL | File size is larger than 15MB. | 输入的音频文件超过最大限制15MB。 |
400 | InvalidURL | File type is not supported. Allowed types are: .wav, .mp3. | 输入的音频格式不合规,当前支持wav、mp3。 |
400 | InvalidFile.Content | The input image has no human body. Please upload other image with single person. | 输入图片中没有人。请输入包含人物的图片。 |
400 | InvalidFile.Content | The input image has multi human bodies. Please upload other image with single person. | 输入图片中有多人。请输入只包含单个人的图片。 |
400 | InvalidFile.BodyProportion | The proportion of the detected person in the picture is too large or too small, please upload other image. | 输入图片中人物占比不符合要求。 |
400 | InvalidFile.Resolution | The image resolution is invalid, please make sure that the largest length of image is smaller than 7000, and the smallest length of image is larger than 400. | 图像分辨率无效。图像要求最小边长≥400像素,最大边长≤7000像素。 |
400 | InvalidFile.Value | The value of the image is invalid, please upload other clearer image. | 输入图片过暗不符合要求。请输入更清晰的图片。 |
400 | InvalidFile.FrontBody | The pose of the detected person is invalid, please upload other image with the front view. | 上传图片中人物背身不符合要求。请上传人物正面视角的图片。 |
400 | InvalidFile.FullFace | The pose of the detected face is invalid, please upload other image with whole face. | 上传图片中人物面部姿态不符合要求,请输入面部可见的图片。 |
400 | InvalidFile.FacePose | The pose of the detected face is invalid, please upload other image with the expected orientation. | 上传图片中人物面部姿态不符合要求,请输入面部朝向无严重偏移的图片。 |