CometAPI の POST /kling/v1/videos/image-recognize を使用して画像に対して Kling Image Recognize を実行し、動画生成ワークフロー向けの認識結果を返します。
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 などの領域が含まれているかどうかを示しますhead_seg、face_seg、cloth_seg、object_seg に対して positive フラグが付き、SUCCEED が返されました。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
}
]
}
}
}