メインコンテンツへスキップ
POST
/
kling
/
v1
/
images
/
kolors-virtual-try-on
Virtual Try-On
curl --request POST \
  --url https://api.cometapi.com/kling/v1/images/kolors-virtual-try-on \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "human_image": "https://assets.christiandior.com/is/image/diorprod/LOOK_F_25_1_LOOK_095_E04?$lookDefault_GH-GHC$&crop=568,0,1864,2000&bfc=on&qlt=85",
  "cloth_image": "https://assets.christiandior.com/is/image/diorprod/511R59A1166X3389_E01?$default_GHC$&crop=501,147,998,1572&bfc=on&qlt=85"
}
'
{
  "code": 123,
  "message": "<string>",
  "request_id": "<string>",
  "data": {
    "task_id": "<string>",
    "task_status": "<string>",
    "task_status_msg": "<string>",
    "created_at": 123,
    "updated_at": 123,
    "task_result": {
      "images": [
        {
          "url": "<string>"
        }
      ]
    }
  }
}
このエンドポイントを使用すると、1枚の人物画像と1枚の衣類画像からバーチャル試着画像を生成できます。

呼び出す前に

  • human_image を1つ、cloth_image を1つ指定します
  • kolors-virtual-try-on-v1 または kolors-virtual-try-on-v1-5 から開始します
  • 最初のテストでは、きれいな衣類の商品画像や白背景の衣類画像を使用します

タスクの流れ

1

試着タスクを送信

人物画像と衣類画像を送信し、返されたタスク id を保存します。
2

タスクをポーリング

タスクが終了状態に到達してレンダリング済み画像を返すまで、個別クエリ を続けます。
3

結果を保存

試着結果をより長く保持する必要がある場合は、完成した画像を自分のストレージに保存します。
完全なパラメータリファレンスについては、Kling の公式ドキュメント を参照してください。

承認

Authorization
string
header
必須

Bearer token authentication. Use your CometAPI key.

ボディ

application/json
human_image
string
デフォルト:example
必須

Person image to dress. Accepts an image URL or raw Base64 string (no data: prefix). Formats: JPG, JPEG, PNG. Max 10 MB, minimum 300×300 px.

cloth_image
string
デフォルト:example
必須

Clothing image for the try-on. Accepts an image URL or raw Base64 string (no data: prefix). Formats: JPG, JPEG, PNG. Max 10 MB, minimum 300×300 px. Supports tops, bottoms, and one-piece dresses. The v1-5 model also accepts a combined top+bottom image stitched together.

callback_url
string

Webhook URL for task status notifications.

model_name
enum<string>
デフォルト:kolors-virtual-try-on-v1

Virtual try-on model version.

利用可能なオプション:
kolors-virtual-try-on-v1,
kolors-virtual-try-on-v1-5

レスポンス

200 - application/json

Successful Response

code
integer
必須

Error code; specifically define the error code

message
string
必須

error message

request_id
string
必須

Request ID, system-generated, for tracking requests, troubleshooting issues

data
object
必須