Skip to main content
POST
cURL
Sử dụng endpoint này để tạo ảnh virtual try-on 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 sản phẩm quần áo rõ nét hoặc ảnh trang phục nền trắng cho lần thử đầu tiên

Luồng tác vụ

1

Gửi tác vụ try-on

Gửi ảnh người và ảnh trang phục, sau đó lưu task id được trả về.
2

Poll tác vụ

Poll đường dẫn truy vấn ảnh Kling tương ứng cho đến khi tác vụ đạt trạng thái kết thúc và trả về ảnh đã render.
3

Lưu kết quả

Lưu ảnh hoàn tất vào hệ thống lưu trữ của riêng bạn nếu kết quả try-on cần được giữ lại lâu hơn.
Để xem tài liệu tham khảo đầy đủ về tham số, 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.

Tiêu đề

Content-Type
string
mặc định:application/json

Must be application/json.

Nội dung

application/json
human_image
string
bắt buộc

Person image to dress. Image URL or raw Base64 string without a data: prefix. Supported formats: JPG, JPEG, PNG. Maximum 10 MB, minimum 300x300 px, aspect ratio between 1:2.5 and 2.5:1.

cloth_image
string
bắt buộc

Clothing image for the try-on. Image URL or raw Base64 string without a data: prefix. Supported formats: JPG, JPEG, PNG. Maximum 10 MB, minimum 300x300 px, aspect ratio between 1:2.5 and 2.5:1. Supports tops, bottoms, and one-piece dresses.

model_name
enum<string>
mặc định:kolors-virtual-try-on-v1

Virtual try-on model version. Defaults to kolors-virtual-try-on-v1.

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

Webhook URL for task status notifications.

external_task_id
string

Optional user-defined task ID for your own tracking. Must be unique per account.

Phản hồi

200 - application/json

Task request accepted or an error response returned by the API.

code
bắt buộc

Response code. 0 means the task request was accepted.

message
string
bắt buộc

Response message.

data
object
bắt buộc
request_id
string

Request identifier returned when present.