Skip to main content
POST
cURL
使用此端点,可以通过一张人物图片和一张服装图片生成虚拟试衣图。

调用前准备

  • 提供一张 human_image 和一张 cloth_image
  • kolors-virtual-try-on-v1kolors-virtual-try-on-v1-5 开始
  • 首次测试时,使用干净的服装产品图或白底服装图片

任务流程

1

提交试衣任务

发送人物图片和服装图片,然后保存返回的任务 id。
2

轮询任务

轮询对应的 Kling 图片查询路径,直到任务进入终态并返回渲染后的图片。
3

保存结果

如果试衣结果需要保留更长时间,请将完成的图片保存到你自己的存储中。
有关完整的参数参考,请参阅官方 Kling 文档

授权

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

请求头

Content-Type
string
默认值:application/json

Must be application/json.

请求体

application/json
human_image
string
必填

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
必填

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>
默认值:kolors-virtual-try-on-v1

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

可用选项:
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.

响应

200 - application/json

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

code
必填

Response code. 0 means the task request was accepted.

message
string
必填

Response message.

data
object
必填
request_id
string

Request identifier returned when present.