Перейти к основному содержанию
POST
/
kling
/
v1
/
videos
/
image-recognize
Run Kling image recognition
curl --request POST \
  --url https://api.cometapi.com/kling/v1/videos/image-recognize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "image": "https://cc.tvbs.com.tw/portal/images/2018/anchor21.jpg"
}
'
{
  "code": 0,
  "message": "SUCCEED",
  "data": {
    "task_result": {
      "images": [
        {
          "type": "head_seg",
          "is_contain": true
        },
        {
          "type": "face_seg",
          "is_contain": true
        },
        {
          "type": "cloth_seg",
          "is_contain": true
        },
        {
          "type": "object_seg",
          "is_contain": true
        }
      ]
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt

Use this file to discover all available pages before exploring further.

Используйте этот endpoint, чтобы выполнять проверки распознавания изображений Kling перед тем, как выбирать, какой последующий workflow использовать.

Что возвращает

  • Маршрут является синхронным и сразу возвращает флаги распознавания
  • Текущие результаты показывают, содержит ли изображение такие области, как head_seg, face_seg, cloth_seg и object_seg
  • Используйте эти флаги, чтобы определить, подходит ли исходное изображение для avatar, try-on или других workflow, завязанных на ассетах
Полное описание параметров см. в официальной документации Kling.

Авторизации

Authorization
string
header
обязательно

Bearer token authentication. Use your CometAPI key.

Заголовки

Content-Type
string

Optional content type header.

Тело

application/json
image
string
по умолчанию:https://cc.tvbs.com.tw/portal/images/2018/anchor21.jpg
обязательно

Image to analyze. Accepts an image URL or raw Base64 string (no data: prefix). Supported formats: JPG, JPEG, PNG. Max 10 MB, minimum 300 px per side, aspect ratio between 1:2.5 and 2.5:1.

Ответ

200 - application/json

Recognition result.

code
integer
обязательно
message
string
обязательно
data
object
обязательно
request_id
string