跳转到主要内容
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
        }
      ]
    }
  }
}
使用此端点在决定采用哪种下游工作流之前,先运行 Kling 的图像识别检查。

返回内容

  • 此路由为同步接口,直接返回识别标记
  • 当前结果会指示图像是否包含 head_segface_segcloth_segobject_seg 等区域
  • 使用这些标记来判断源图像是否适用于数字人、试衣或其他由素材驱动的工作流
在 2026-03-13 的实时验证中,返回结果为 SUCCEED,且 head_segface_segcloth_segobject_seg 均为正向标记。
完整参数说明请参见官方 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