Zum Hauptinhalt springen
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>"
        }
      ]
    }
  }
}
Verwenden Sie diesen Endpoint, um ein virtuelles Try-On-Bild aus einem Personenbild und einem Kleidungsbild zu generieren.

Bevor Sie ihn aufrufen

  • Stellen Sie ein human_image und ein cloth_image bereit
  • Beginnen Sie mit kolors-virtual-try-on-v1 oder kolors-virtual-try-on-v1-5
  • Verwenden Sie für den ersten Test saubere Produktaufnahmen von Kleidung oder Kleidungsbilder mit weißem Hintergrund

Aufgabenablauf

1

Try-On-Aufgabe absenden

Senden Sie das Personenbild und das Kleidungsbild und speichern Sie dann die zurückgegebene task id.
2

Aufgabe abfragen

Fahren Sie mit Individual Queries fort, bis die Aufgabe einen Endzustand erreicht und das gerenderte Bild zurückgibt.
3

Ergebnis speichern

Speichern Sie das fertige Bild in Ihrem eigenen Speicher, wenn das Try-On-Ergebnis länger aufbewahrt werden muss.
Die vollständige Parameterreferenz finden Sie in der offiziellen Kling-Dokumentation.

Autorisierungen

Authorization
string
header
erforderlich

Bearer token authentication. Use your CometAPI key.

Body

application/json
human_image
string
Standard:example
erforderlich

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
Standard:example
erforderlich

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>
Standard:kolors-virtual-try-on-v1

Virtual try-on model version.

Verfügbare Optionen:
kolors-virtual-try-on-v1,
kolors-virtual-try-on-v1-5

Antwort

200 - application/json

Successful Response

code
integer
erforderlich

Error code; specifically define the error code

message
string
erforderlich

error message

request_id
string
erforderlich

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

data
object
erforderlich