跳转到内容

執行 AI 2D 戒指虛擬試戴任務。

请求

AI 任務是非同步的。當功能支援 webhook 時,請優先使用以 webhook 為基礎的完成處理。設定您的 webhook 端點、驗證 webhook 簽章,並在收到 success 或 error 通知後,使用收到的 task_id 查詢任務結果。設定與驗證細節請見 webhook 整合指南。

若您的整合不支援 webhook 或無法使用 webhook,請實作輪詢。送出 AI 任務後,以固定間隔(例如每 10 秒)輪詢狀態端點,直到任務狀態為 success 或 error。

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

包含來源照片資訊。

object_infosArray of objects必需
src_file_urlstring必需

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

示例:"https://example.com/selfie.jpg"
srcmsk_file_urlstring

執行任務所用來源遮罩檔案的網址。該網址需可公開存取。

示例:"https://example.com/src_mask.jpg"
ref_file_urlsArray of strings必需

執行任務所用參考檔案的網址。該網址需可公開存取。

示例:
[ "https://example.com/vto_sku.jpg" ]
refmsk_file_urlsArray of strings

執行任務所用參考遮罩檔案的網址。該網址需可公開存取。

示例:
[ "https://example.com/vto_sku_mask.jpg" ]
curl -i -X POST \
  https://yce-api-01.makeupar.com/s2s/v2.0/task/2d-vto/ring \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "src_file_url": "https://example.com/selfie.jpg",
    "srcmsk_file_url": "https://example.com/src_mask.jpg",
    "ref_file_urls": [
      "https://example.com/vto_sku.jpg"
    ],
    "refmsk_file_urls": [
      "https://example.com/vto_sku_mask.jpg"
    ],
    "source_info": {
      "name": "https://example.com/selfie.jpg",
      "mask_name": "https://example.com/src_mask.jpg"
    },
    "object_infos": [
      {
        "name": "https://example.com/vto_sku.jpg",
        "mask_name": "https://example.com/vto_sku_mask.jpg",
        "parameter": {
          "ring_need_remove_background": true,
          "ring_anchor_point": null,
          "ring_wearing_finger": null,
          "ring_wearing_location": null,
          "ring_shadow_intensity": 0.15,
          "ring_ambient_light_intensity": 1
        }
      }
    ]
  }'

响应

任務執行成功

正文application/json
statusinteger

回應狀態

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