跳转到内容

執行 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必需

要執行任務的檔案網址。該網址應可公開存取。

示例:"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" } }