使用 CometAPI POST /kling/v1/videos/image-recognize 对图像运行 Kling 图像识别,并返回适用于视频生成工作流的识别结果。
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
}
]
}
}
}head_seg、face_seg、cloth_seg 和 object_seg 等区域SUCCEED,且 head_seg、face_seg、cloth_seg 和 object_seg 均为正向标记。Bearer token authentication. Use your CometAPI key.
Optional content type header.
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.
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
}
]
}
}
}