跳转到内容

V1.0

AI 时装虚拟试穿 Mix & Match API 在单个任务中,让一张用户照片穿上 1 到 9 张单品参考图。每张参考图附上单品类别,用穿法备注说明怎么穿,就能拿到一张完整造型照。

运行 AI 时装虚拟试穿 Mix & Match 任务。

请求

AI 任务是异步处理的。功能支持 Webhook 时,优先用 Webhook 来接收完成通知。配置好您的 Webhook 端点、校验 Webhook 签名,收到 success 或 error 通知后,用收到的 task_id 查询任务结果。配置与校验的细节请见 Webhook 接入指南。

若功能不支持 Webhook,或您的接入方式用不了 Webhook,就请实现轮询。提交 AI 任务后,按固定间隔(例如每 10 秒)轮询状态接口,直到任务状态变为 success 或 error。

安全
BearerAuthenticationV2
正文application/json必需
Any of:
src_file_urlstring必需

用于运行任务的文件 URL,该 URL 需可公开访问。

示例:"https://example.com/selfie.jpg"
ref_file_urlsArray of strings, [ 1 .. 9 ] items必需

1 到 9 张参考图的 URL,每张一个单品。第 n 张图对应 garment_categories 第 n 个类别的单品。URL 必须可公开访问。

示例:
[ "https://example.com/full_body.jpg", "https://example.com/shoes.jpg" ]
garment_categoriesArray of strings, [ 1 .. 9 ] items必需

每张参考图的类别,顺序和长度与 ref_file_urls(或 ref_file_ids)一致。除 accessory 最多 3 个外,每个类别以一个单品为限;full_body 不可与 upper_body 或 lower_body 并用。

Items Enum:"upper_body""lower_body""full_body""outer""shoes""bag""headwear""accessory"
示例:
[ "full_body", "shoes" ]
styling_notestring, <= 300 characters

单品的穿法,例如 "jacket open"(外套敞开)、"top tucked in"(上衣扎进裤腰)、 "bag cross body"(包斜挎)。只改变穿法,不会动单品本身、人物或姿势。无法套用的部分会被跳过, 并列在结果的 not_applied 中。

默认值:""
示例:"top tucked in"
curl -i -X POST \
  https://yce-api-01.makeupar.com/s2s/v2.0/task/cloth-mix-v2 \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "src_file_url": "https://example.com/selfie.jpg",
    "ref_file_urls": [
      "https://example.com/full_body.jpg",
      "https://example.com/shoes.jpg"
    ],
    "garment_categories": [
      "full_body",
      "shoes"
    ],
    "styling_note": "top tucked in"
  }'

响应

任务运行成功

正文application/json
statusinteger

响应状态

示例:200
dataobject
响应
{ "status": 200, "data": { "task_id": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe" } }