Skip to content

LivePortrait-LivePortrait image detection API reference

The LivePortrait-detect model checks whether input images meet LivePortrait specifications. This document describes how to call the detection API. Important

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

ModelDescription
liveportrait-detectThe 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

HELPCODEESCAPE-http
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/image2video/face-detect

Request parameters

FieldTypeParameter passingRequiredDescriptionExample
Content-TypeStringHeaderYesRequest content type (set to application/json).application/json
AuthorizationStringHeaderYesAPI key in Bearer format.Bearer d1**2a
modelStringBodyYesModel name (set to liveportrait-detect).liveportrait-detect
input.image_urlStringBodyYesThe URL of the image to check. - Image must be <10 MB with aspect ratio ≤2 and max edge ≤4096 pixels. - Supported formats: JPEG, JPG, PNG, BMP, and WebP. ** **Note ** File uploads support only HTTP or HTTPS links. Local file paths are not supported."image_url": "http://a/a.jpg"

Response parameters

FieldTypeDescriptionExample
output.passBoolWhether the image passed validation."pass":true/false
output.messageStringDescription of the validation result."message":No human face detected.
request_idStringUnique request identifier.7574ee8f-38a3-4b1e-9280-11c33ab46e51

Failure reason

output.messageDescription
No human face detectedNo face detected. This occurs when the face is too small, in profile, or obstructed.
Sample request
HELPCODEESCAPE-curl
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)
HELPCODEESCAPE-json
{
    "output": {
        "pass": true,
        "message": ""
    },
    "usage": {
        "image_count": 1
    },
    "request_id": "a92e2ffd-9263-44ba-92c5-xxxxxx"
}
Sample response (failed)
HELPCODEESCAPE-json
{
    "output": {
        "pass": false,
        "message": "No human face detected."
    },
    "usage": {
        "image_count": 1
    },
    "request_id": "c56f62df-724e-9c19-96bd-xxxxxx"
}
Sample response (error)
HELPCODEESCAPE-json
{
    "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.

Mirror of Alibaba Cloud Model Studio docs for reference and RAG. Not affiliated with Alibaba Cloud.