The LivePortrait-detect model checks whether input images meet LivePortrait specifications. This document describes how to call the detection API.
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 |
The model detects whether input images meet portrait specifications required by the liveportrait model. |
HTTP
Feature description
This feature detects whether input images meet portrait specifications required for LivePortrait video generation.
Prerequisites
-
Create an API key in Alibaba Cloud Model Studio. See Create an API key.
Input limitations
-
Supported image formats: JPEG, JPG, PNG, BMP, and WebP.
-
Image must be <10 MB with aspect ratio ≤2 and max edge ≤4096 pixels.
-
Upload images via HTTP URLs only (local paths are not supported).
Task submission
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/image2video/face-detect
Request parameters
|
Field |
Type |
Parameter passing |
Required |
Description |
Example |
|
Content-Type |
String |
Header |
Yes |
Request content type (set to application/json). |
application/json |
|
Authorization |
String |
Header |
Yes |
API key in Bearer format. |
Bearer d1**2a |
|
model |
String |
Body |
Yes |
Model name (set 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. Local file paths are not supported. |
"image_url": "http://a/a.jpg" |
Response parameters
|
Field |
Type |
Description |
Example |
|
output.pass |
Bool |
Whether the image passed validation. |
"pass":true/false |
|
output.message |
String |
Description of the validation result. |
"message":No human face detected. |
|
request_id |
String |
Unique request identifier. |
7574ee8f-38a3-4b1e-9280-11c33ab46e51 |
Failure reason
|
output.message |
Description |
|
No human face detected |
No face detected. This occurs when 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
See Error messages for common error codes.