Chuyển đến nội dung chính
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>"
        }
      ]
    }
  }
}
Sử dụng endpoint này để tạo ảnh thử đồ ảo từ một ảnh người và một ảnh trang phục.

Trước khi gọi

  • Cung cấp một human_image và một cloth_image
  • Bắt đầu với kolors-virtual-try-on-v1 hoặc kolors-virtual-try-on-v1-5
  • Dùng ảnh chụp sản phẩm quần áo rõ ràng hoặc ảnh trang phục nền trắng cho lần kiểm thử đầu tiên

Luồng tác vụ

1

Gửi tác vụ thử đồ

Gửi ảnh người và ảnh quần áo, sau đó lưu lại task id được trả về.
2

Thăm dò tác vụ

Tiếp tục với Individual Queries cho đến khi tác vụ đạt trạng thái kết thúc và trả về ảnh đã được render.
3

Lưu kết quả

Lưu ảnh hoàn chỉnh vào hệ thống lưu trữ của riêng bạn nếu kết quả thử đồ cần được giữ lại lâu hơn.
Để xem tài liệu tham chiếu tham số đầy đủ, hãy xem tài liệu Kling chính thức.

Ủy quyền

Authorization
string
header
bắt buộc

Bearer token authentication. Use your CometAPI key.

Nội dung

application/json
human_image
string
mặc định:example
bắt buộc

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
mặc định:example
bắt buộc

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>
mặc định:kolors-virtual-try-on-v1

Virtual try-on model version.

Tùy chọn có sẵn:
kolors-virtual-try-on-v1,
kolors-virtual-try-on-v1-5

Phản hồi

200 - application/json

Successful Response

code
integer
bắt buộc

Error code; specifically define the error code

message
string
bắt buộc

error message

request_id
string
bắt buộc

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

data
object
bắt buộc