跳轉到主要內容
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 等區域
  • 使用這些旗標來判斷來源影像是否適合用於 avatar、try-on 或其他資產驅動的工作流程
在 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