The EMO model generates animated videos of faces using portrait images and voice audio.
This document applies only to the China (Beijing) region. To use the model, you must use an API key from the China (Beijing) region.
Performance showcase
Sample input | Sample output |
Portrait:
Voice audio: | Action style strength: The |
For more examples, see Performance showcase.
Ensure that all uploaded images and audio files are from a legally compliant source and that you have the necessary permissions for their use.
Prerequisites
You must activate the model service and create an API key, and then export the API key as an environment variable.
You can process the input image using the EMO image detection API to obtain the coordinate values for the face area (face_bbox) and dynamic area (ext_bbox). These values are used as request parameters.
HTTP
Step 1: Create a task and get a task ID
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/image2video/video-synthesisAfter you create the task, the system immediately returns a
task_id. You can use this ID in Step 2 to query the task result. Thetask_idis valid for 24 hours after it is created.
Request parameters | |
Headers | |
X-DashScope-Async The asynchronous processing configuration parameter. HTTP requests support only asynchronous processing. You must set this parameter to Important If this request header is missing, the error message "current user api does not support synchronous calls" is returned. | |
Authorization This header is used for identity authentication. The API authenticates requests using a Model Studio API key. Example: Bearer sk-xxxx. | |
Content-Type The content type of the request. Set this parameter to | |
Request Body | |
model The model name. Example: emo-v1. | |
input Specifies the basic input information. | |
parameters |
Response parameters | Sample success responseSample error response |
output Contains the task output information. | |
request_id The unique request ID. You can use this ID to trace and troubleshoot issues. | |
code The error code returned when the request fails. For more information, see Error codes. | |
message The detailed error message returned when the request fails. For more information, see Error codes. |
Step 2: Query the result based on the task ID
Use the task_id from the previous step to poll for the task status and result. Replace {task_id} in the URL with your actual task ID.
GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}`task_id` validity: The ID is valid for 24 hours after it is created. After this period, you can no longer query the result. The API returns a task status of
UNKNOWN.Task status flow: A task that is processed normally transitions through the following statuses: `PENDING`, `RUNNING`, and `SUCCEEDED` or `FAILED`.
Result retrieval: Video generation takes several minutes. The query API has a default limit of 20 QPS. Use a polling mechanism with a reasonable query interval, such as 15 seconds, to retrieve the result.
video_url validity: After the task succeeds, the URL is valid for 24 hours. You must download the video and transfer it to permanent storage immediately after you retrieve the link (such as Object Storage Service (OSS)).
Request parameters | |
Headers | |
Authorization Used for request identity authentication. The API uses Model Studio API key for authentication. Example: Bearer sk-xxxx. | |
URL path parameters | |
task_id The `task_id` of the task to query. Example: a8532587-fa8c-4ef8-82be-xxxxxx. |
Response parameters | Sample success responseSample error response |
request_id The unique request ID. You can use this ID to trace and troubleshoot issues. | |
output Contains the task output information. | |
usage |
Billing and rate limits
Model | Unit price | Task submission QPS limit | Concurrent tasks |
emo-v1 | Pay-as-you-go. You are charged based on the actual duration of the output video:
| 5 | 1 (Excess tasks are queued.) |
Error codes
For common status codes, see Error messages.
This model also has the following specific error codes:
HTTP return code | Code | Message | Description |
400 | InvalidParameter | The request is missing required parameters or in a wrong format, please check the parameters that you send. | The format of the input parameters is incorrect. |
400 | InvalidParameter | The style_level is invalid. | The value of `style_level` is not within the enumeration range. |
400 | InvalidParameter.DataInspection | Unable to download the media resource during the data inspection process. | A timeout occurred when the system downloaded the image or audio file. If you make a call from outside China, a resource download timeout may occur because of unstable cross-border networks. You can store the file in OSS in China and then call the model. You can also use the temporary storage space to upload files. |
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. | Failed to download the input image. Check the network or the input format. The following formats are supported: JPEG, JPG, PNG, BMP, and WEBP. |
400 | InvalidURL | Required URL is missing or invalid, please check the request URL. | The input URL is incorrect or missing. |
400 | InvalidURL | The input audio is longer than 60s! | The input audio file exceeds the maximum duration of 60 seconds. |
400 | InvalidURL | File size is larger than 15MB. | The input audio file exceeds the maximum size of 15 MB. |
400 | InvalidURL | File type is not supported. Allowed types are: .wav, .mp3. | The format of the input audio is invalid. The supported formats are WAV and MP3. |
400 | InvalidFile.Content | The input image has no human body. Please upload other image with single person. | No person is found in the input image. Upload an image that contains a person. |
400 | InvalidFile.Content | The input image has multi human bodies. Please upload other image with single person. | Multiple people are found in the input image. Upload an image that contains only one person. |
400 | InvalidFile.BodyProportion | The proportion of the detected person in the picture is too large or too small, please upload other image. | The proportion of the person in the input image does not meet the requirements. |
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. | The image resolution is invalid. The minimum side length must be at least 400 pixels, and the maximum side length must not exceed 7,000 pixels. |
400 | InvalidFile.Value | The value of the image is invalid, please upload other clearer image. | The input image is too dark and does not meet the requirements. Upload a clearer image. |
400 | InvalidFile.FrontBody | The pose of the detected person is invalid, please upload other image with the front view. | The person in the uploaded image is facing away from the camera, which does not meet the requirements. Upload an image with a front view of the person. |
400 | InvalidFile.FullFace | The pose of the detected face is invalid, please upload other image with whole face. | The facial pose of the person in the uploaded image does not meet the requirements. Upload an image where the face is visible. |
400 | InvalidFile.FacePose | The pose of the detected face is invalid, please upload other image with the expected orientation. | The facial pose of the person in the uploaded image does not meet the requirements. Upload an image where the face does not have a severe orientation offset. |
