The LivePortrait-detect model verifies that input portrait images meet the specifications required by the LivePortrait model. This document describes how to call the API for this model's image detection feature.
This document applies only to the China (Beijing) region. To use the model, you must use an API key from the China (Beijing) region.
Model overview
Model | Description |
liveportrait-detect | liveportrait-detect is a specialized image detection model used to check whether an input image meets the portrait image specifications required by the liveportrait model. |
HTTP
Feature description
This model detects whether an input image meets the portrait image specifications required for LivePortrait video generation.
Prerequisites
You have activated Alibaba Cloud Model Studio and created an API key, see Create an API key.
Input limitations
Supported image formats: JPEG, JPG, PNG, BMP, and WebP.
The image file must be smaller than 10 MB, have an aspect ratio of 2 or less, and have a maximum edge length of 4096 pixels.
Images must be uploaded using HTTP links. Local file paths are not supported.
Task submission
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/image2video/face-detectRequest parameters
Field | Type | Parameter passing | Required | Description | Example |
Content-Type | String | Header | Yes | The request type. Set this to application/json. | application/json |
Authorization | String | Header | Yes | The API key. Example: Bearer d1**2a. | Bearer d1**2a |
model | String | Body | Yes | The model to call. Set this to liveportrait-detect. | liveportrait-detect |
input.image_url | String | Body | Yes | The URL of the image to check.
Note File uploads support only HTTP or HTTPS links, not local file paths. | "image_url": "http://a/a.jpg" |
Response parameters
Field | Type | Description | Example |
output.pass | Bool | The check result for the submitted image. | "pass":true/false |
output.message | String | The message that describes the check result for the submitted image. | "message":No human face detected. |
request_id | String | The unique ID of the request. | 7574ee8f-38a3-4b1e-9280-11c33ab46e51 |
Failure reason
output.message | Description |
No human face detected | No human face was detected. This can happen if the face is too small, in profile, or obstructed. |
Sample request
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/image2video/face-detect' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "liveportrait-detect",
"input": {
"image_url":"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250911/ynhjrg/p874909.png"
}
}'Sample response (passed)
{
"output": {
"pass": true,
"message": ""
},
"usage": {
"image_count": 1
},
"request_id": "a92e2ffd-9263-44ba-92c5-xxxxxx"
}Sample response (failed)
{
"output": {
"pass": false,
"message": "No human face detected."
},
"usage": {
"image_count": 1
},
"request_id": "c56f62df-724e-9c19-96bd-xxxxxx"
}Sample response (error)
{
"code": "InvalidParameter.UnsupportedFileFormat",
"message": "Input files format not supported.",
"request_id": "788b30fe-05f6-999f-a0b1-xxxxxx"
}Error codes
For information about common error codes, see Error messages.