{"items":[{"type":"link","label":"AI 照片換臉","link":"/zh-tw/reference/ai_face_swap","routeSlug":"/zh-tw/reference/ai_face_swap","content":{"contentType":"overview","meta":{"name":"AI 照片換臉"},"children":[{"nodeType":"container","panels":[{"title":"Download OpenAPI description","titleTranslationKey":"download.description.title","children":[{"kind":"download","label":"ai_face_swap.json","url":"/_bundle/@l10n/zh-TW/reference/ai_face_swap.json?download"},{"kind":"download","label":"ai_face_swap.yaml","url":"/_bundle/@l10n/zh-TW/reference/ai_face_swap.yaml?download"}]},{"title":"Overview","titleTranslationKey":"info.title","children":[{"kind":"email","title":"E-mail","titleTranslationKey":"info.contact.name","email":"YouCamOnlineEditor_API@perfectcorp.com","label":"YouCamOnlineEditor_API@perfectcorp.com","withCopyButton":true,"copyContent":"YouCamOnlineEditor_API@perfectcorp.com"},{"kind":"externallink","title":"License","titleTranslationKey":"info.license","label":"Privacy policy","url":"https://www.makeupar.com/perfectbeauty/youcam/privacy-policy-api"},{"kind":"externallink","label":"Terms of Service","labelTranslationKey":"info.termsOfService","url":"https://www.makeupar.com/perfectbeauty/youcam/terms-of-service-api"}]},{"title":"Languages","titleTranslationKey":"languages.title","children":[{"kind":"languages","options":[{"key":"curl","title":"curl","lang":"curl"},{"key":"javascript","title":"JavaScript","lang":"JavaScript"},{"key":"node","title":"Node.js","lang":"Node.js"},{"key":"python","title":"Python","lang":"Python"},{"key":"java","title":"Java","lang":"Java"},{"key":"csharp","title":"C#","lang":"C#"},{"key":"php","title":"PHP","lang":"PHP"},{"key":"go","title":"Go","lang":"Go"},{"key":"ruby","title":"Ruby","lang":"Ruby"},{"key":"r","title":"R","lang":"R"},{"key":"payload","title":"Payload","lang":"Payload"}]}]},{"title":"Servers","titleTranslationKey":"servers.title","children":[{"kind":"servers","servers":[{"url":"https://yce-api-01.makeupar.com"}],"mode":"default"}]}],"children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"header","level":1,"label":"AI 照片換臉","showPageActions":true},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[]}],"sectionId":"/"}],"sectionId":"/"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{"level":1,"id":"section/概述"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"概述"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用 AI 照片換臉達到極其逼真的效果，並支援多張臉部。我們的人臉交換人工智慧支援交換一或多張臉部。無論是創造有趣的人臉照片，或需要專業工具，我們都能滿足您的需求。"},"children":[],"type":"text"}],"type":"paragraph"}]}],"sectionId":"/section/概述"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{"level":2,"id":"section/概述/整合指南"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"整合指南"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"如何實作 AI 照片換臉"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"步驟 1：上傳來源與參考圖片"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"向 API 請求上傳網址："},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{"content":"POST https://yce-api-01.makeupar.com/s2s/v2.0/file\nAuthorization: Bearer YOUR_API_KEY\nContent-Type: application/json\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"POST https://yce-api-01.makeupar.com/s2s/v2.0/file\nAuthorization: Bearer YOUR_API_KEY\nContent-Type: application/json\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"內容："},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n    \"files\": [\n    {\n        \"file_name\": \"target.jpg\",\n        \"file_size\": 123456,\n        \"content_type\": \"image/jpeg\"\n    }\n    ]\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n    \"files\": [\n    {\n        \"file_name\": \"target.jpg\",\n        \"file_size\": 123456,\n        \"content_type\": \"image/jpeg\"\n    }\n    ]\n}\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應會提供預簽名的"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"上傳網址"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"與 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"file_id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"paragraph"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用 HTTP PUT 請求，將檔案上傳到指定的網址。"},"children":[],"type":"text"}],"type":"paragraph"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"儲存 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"file_id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 以供後續使用。對"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"目標"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"與"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"參考"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"圖片都重複此步驟。"},"children":[],"type":"text"}],"type":"paragraph"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"將實際檔案上傳到"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"上傳網址"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"paragraph"}],"type":"item"}],"type":"list"}],"type":"item"}],"type":"list"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"步驟 2：前處理來源與參考圖片（臉部偵測）"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"建立前處理任務："},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{"content":"POST https://yce-api-01.makeupar.com/s2s/v2.0/task/face-swap/pre-process\nAuthorization: Bearer YOUR_API_KEY\nContent-Type: application/json\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"POST https://yce-api-01.makeupar.com/s2s/v2.0/task/face-swap/pre-process\nAuthorization: Bearer YOUR_API_KEY\nContent-Type: application/json\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"內容："},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n    \"request_id\": 1,\n    \"payload\": {\n    \"file_sets\": {\n        \"src_ids\": [\"TARGET_FILE_ID\"]\n    },\n    \"actions\": [\n        { \"id\": 0 }\n    ]\n    }\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n    \"request_id\": 1,\n    \"payload\": {\n    \"file_sets\": {\n        \"src_ids\": [\"TARGET_FILE_ID\"]\n    },\n    \"actions\": [\n        { \"id\": 0 }\n    ]\n    }\n}\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"API 回傳 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"task_id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"在此輪詢任務狀態："},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{"content":"GET https://yce-api-01.makeupar.com/s2s/v2.0/task/face-swap/pre-process?task_id=TASK_ID\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"GET https://yce-api-01.makeupar.com/s2s/v2.0/task/face-swap/pre-process?task_id=TASK_ID\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"完成後，您會收到帶有邊界框的偵測臉部清單。"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"步驟 3：執行換臉任務"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"定義哪個參考圖片將取代每個來源圖片"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"face_mapping"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 陣列定義"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"來源圖片"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"中的臉部如何被"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"參考圖片"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"中的臉部取代。它就像一個連結清單，將來源中偵測到的臉部連接到特定的參考圖片。"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"結構"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"陣列中的每個元素都是包含兩個屬性的物件："},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{"align":"left"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"參數"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{"align":"left"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"類型"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{"align":"left"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"說明"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{"align":"left"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"position"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{"align":"left"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"integer"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{"align":"left"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"在"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"來源圖片"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"中偵測到的臉部索引（例如 0、1、2）。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{"align":"left"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"index"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{"align":"left"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"integer"},"children":[],"type":"code"}],"type":"td"},{"$$mdtype":"Node","attributes":{"align":"left"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"要交換的"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"參考圖片清單"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"中臉部圖片的索引。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"邏輯規則"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"索引對應："},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"index"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 直接對應您參考清單中提供圖片的順序。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"0"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"：第一張參考圖片。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"1"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"：第二張參考圖片。"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"跳過交換："},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 若要跳過交換來源中某個被偵測到的臉部，請將 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"index"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 與 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"position"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 都設為 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"-1"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"paragraph"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"陣列順序："},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 陣列中物件的順序，應依據 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"position"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 對應。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用範例"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"情境："},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"參考清單："},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 提供 2 張圖片（圖片 A、圖片 B）。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"來源圖片："},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 包含 3 個被偵測到的臉部（臉 0、臉 1、臉 2）。"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"目標："},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"將"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"臉 0"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"（來源）與"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"圖片 1"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"（參考）交換。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"跳過交換"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"臉 1"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"（來源）。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"將"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"臉 2"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"（來源）與"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"圖片 0"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"（參考）交換。"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"設定："},"children":[],"type":"text"}],"type":"strong"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"\"face_mapping\": [\n    {\n        \"index\": 1,  // 使用第二張參考圖片\n        \"position\": 0 // 套用到來源中偵測到的第一張臉部\n    },\n    {\n        \"index\": -1, // 跳過換臉\n        \"position\": -1 // 跳過換臉\n    },\n    {\n        \"index\": 0,  // 使用第一張參考圖片\n        \"position\": 2 // 套用到來源中偵測到的第三張臉部\n    }\n]\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"\"face_mapping\": [\n    {\n        \"index\": 1,  // 使用第二張參考圖片\n        \"position\": 0 // 套用到來源中偵測到的第一張臉部\n    },\n    {\n        \"index\": -1, // 跳過換臉\n        \"position\": -1 // 跳過換臉\n    },\n    {\n        \"index\": 0,  // 使用第一張參考圖片\n        \"position\": 2 // 套用到來源中偵測到的第三張臉部\n    }\n]\n"},"children":[],"type":"text"}],"type":"fence"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"發送主要任務請求："},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{"content":"POST https://yce-api-01.makeupar.com/s2s/v2.0/task/face-swap\nAuthorization: Bearer YOUR_API_KEY\nContent-Type: application/json\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"POST https://yce-api-01.makeupar.com/s2s/v2.0/task/face-swap\nAuthorization: Bearer YOUR_API_KEY\nContent-Type: application/json\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"內容："},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"content":"{\n    \"request_id\": 2,\n    \"payload\": {\n    \"file_sets\": {\n        \"src_ids\": [\"TARGET_FILE_ID\"],\n        \"ref_ids\": [\"REFERENCE_FILE_ID\"]\n    },\n    \"actions\": [\n        {\n        \"id\": 0,\n        \"params\": {\n            \"face_mapping\": [\n            { \"index\": 0, \"position\": 0 },\n            { \"index\": -1, \"position\": -1 }\n            ]\n        }\n        }\n    ]\n    }\n}\n","language":"json"},"children":[{"$$mdtype":"Node","attributes":{"content":"{\n    \"request_id\": 2,\n    \"payload\": {\n    \"file_sets\": {\n        \"src_ids\": [\"TARGET_FILE_ID\"],\n        \"ref_ids\": [\"REFERENCE_FILE_ID\"]\n    },\n    \"actions\": [\n        {\n        \"id\": 0,\n        \"params\": {\n            \"face_mapping\": [\n            { \"index\": 0, \"position\": 0 },\n            { \"index\": -1, \"position\": -1 }\n            ]\n        }\n        }\n    ]\n    }\n}\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應會回傳 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"task_id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"步驟 4：輪詢任務狀態並取得結果"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"必須實作定時迴圈，在允許的輪詢窗口內以固定間隔查詢任務狀態。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"輪詢："},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{"content":"GET https://yce-api-01.makeupar.com/s2s/v2.0/task/face-swap?task_id=TASK_ID\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"GET https://yce-api-01.makeupar.com/s2s/v2.0/task/face-swap?task_id=TASK_ID\n"},"children":[],"type":"text"}],"type":"fence"},{"$$mdtype":"Node","attributes":{"ordered":true,"start":2,"marker":"."},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"當 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"status"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 為 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"success"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 時，回應包含生成影像的網址。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"從該網址下載或顯示圖片。"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"步驟 5：整合到您的平台"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"在"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"網頁前端"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"，您可以直接用 JavaScript 以 fetch 或 Axios 實作。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"在"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"後端"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"（Node.js、Python、Java、PHP 等），您可以使用標準 HTTP 函式庫呼叫相同的端點。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"由於任務以非同步執行，請實作重試與錯誤處理。"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"除錯指南"},"children":[],"type":"text"},{"$$mdtype":"Node","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"Invalid TaskId 錯誤"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"name":"br","attrs":{}},"children":[],"type":"tag","tag":"html"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"原因："},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 若您嘗試查詢已逾時任務的狀態，會收到 InvalidTaskId 錯誤。因此，AI 任務啟動後，您需要在 polling_interval 內輪詢其狀態，直到狀態變為 success 或 error。"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"name":"br","attrs":{}},"children":[],"type":"tag","tag":"html"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"解法："},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 為避免任務失效，必須實作定時迴圈，在允許的輪詢窗口內以固定間隔查詢任務狀態。"},"children":[],"type":"text"}],"type":"paragraph"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"為什麼我的來源圖片中有些臉部未被偵測到"},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"name":"br","attrs":{}},"children":[],"type":"tag","tag":"html"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"原因："},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 臉部必須清晰可見，未被覆蓋或遮擋，且在圖片中足夠大"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"name":"br","attrs":{}},"children":[],"type":"tag","tag":"html"},{"$$mdtype":"Node","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"解法："},"children":[],"type":"text"}],"type":"strong"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 嘗試拍攝臉部看起來更大、且清晰可見無任何覆蓋或遮擋的照片"},"children":[],"type":"text"}],"type":"paragraph"}],"type":"item"}],"type":"list"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"}]}],"sectionId":"/section/概述/整合指南"}],"sectionId":"/section/概述/整合指南"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{"level":2,"id":"section/概述/輸入與輸出"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"輸入與輸出"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"實際範例："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"多人換臉範例："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"alt":"","src":"https://bcw-media.s3.ap-northeast-1.amazonaws.com/dt_yce_face_swap_S2_img_04_d4b747a41d.jpg"},"children":[],"type":"image"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"單人換臉範例："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"alt":"","src":"https://bcw-media.s3.ap-northeast-1.amazonaws.com/dt_yce_face_swap_S2_img_05_8e68faff2c.jpg"},"children":[],"type":"image"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"拍攝建議："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"alt":"","src":"https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/webp_AI%20Skin%20Analysis_camera_f93315b088.png"},"children":[],"type":"image"}],"type":"item"}],"type":"list"}]}],"sectionId":"/section/概述/輸入與輸出"}],"sectionId":"/section/概述/輸入與輸出"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{"level":2,"id":"section/概述/檔案規格與錯誤"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"檔案規格與錯誤"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"支援的格式與尺寸"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"AI 功能"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"支援的尺寸"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"支援的檔案大小"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"支援的格式"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"AI 照片換臉"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"輸入與輸出：長邊必須小於或等於 4096 像素"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"< 10MB"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"jpg/jpeg/png"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"錯誤代碼"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"錯誤代碼"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"說明"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"exceed_max_filesize"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"輸入檔案大小超過上限"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"invalid_parameter"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"參數值無效"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_download_image"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"下載來源圖片時發生錯誤"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_download_mask"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"下載遮罩圖片時發生錯誤"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_decode_image"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"解碼來源圖片時發生錯誤"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_decode_mask"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"解碼遮罩圖片時發生錯誤"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_download_video"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"下載來源影片時發生錯誤"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_decode_video"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"解碼來源影片時發生錯誤"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_nsfw_content_detected"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"在來源圖片中偵測到 NSFW 內容"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_no_face"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"來源圖片中未偵測到臉部"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_pose"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"在來源圖片偵測姿勢失敗"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_face_parsing"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"在來源圖片進行人臉解析失敗"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_inference"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"推論流程發生錯誤"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"exceed_nsfw_retry_limits"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"超過重試上限，以避免生成 NSFW 圖片"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_upload"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"上傳結果圖片時發生錯誤"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_multiple_people"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"人數超過上限"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_no_shoulder"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"來源圖片中肩膀不可見"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_large_face_angle"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"上傳圖片的臉部角度過大"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_unsupport_ratio"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"輸入圖片的長寬比不受支援"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"unknown_internal_error"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"其他內部錯誤"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"}]}],"sectionId":"/section/概述/檔案規格與錯誤"}],"sectionId":"/section/概述/檔案規格與錯誤"},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{"level":2,"id":"section/概述/點數消耗"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"點數消耗"},"children":[],"type":"text"}],"type":"heading"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"AI 功能"},"children":[],"type":"text"}],"type":"th"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"消耗的點數"},"children":[],"type":"text"}],"type":"th"}],"type":"tr"}],"type":"thead"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"AI 照片換臉 V1.0"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"1"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"},{"$$mdtype":"Node","attributes":{},"children":[],"type":"hr"}]}],"sectionId":"/section/概述/點數消耗"}],"sectionId":"/section/概述/點數消耗"}]}]}},{"type":"group","label":"概述","link":"/zh-tw/reference/ai_face_swap/section/概述","routeSlug":"/zh-tw/reference/ai_face_swap/section/概述","items":[{"type":"link","label":"整合指南","link":"/zh-tw/reference/ai_face_swap/section/概述/整合指南","routeSlug":"/zh-tw/reference/ai_face_swap/section/概述/整合指南","content":null},{"type":"link","label":"輸入與輸出","link":"/zh-tw/reference/ai_face_swap/section/概述/輸入與輸出","routeSlug":"/zh-tw/reference/ai_face_swap/section/概述/輸入與輸出","content":null},{"type":"link","label":"檔案規格與錯誤","link":"/zh-tw/reference/ai_face_swap/section/概述/檔案規格與錯誤","routeSlug":"/zh-tw/reference/ai_face_swap/section/概述/檔案規格與錯誤","content":null},{"type":"link","label":"點數消耗","link":"/zh-tw/reference/ai_face_swap/section/概述/點數消耗","routeSlug":"/zh-tw/reference/ai_face_swap/section/概述/點數消耗","content":null}],"content":null},{"type":"group","label":"V1.0","link":"/zh-tw/reference/ai_face_swap/v1.0","routeSlug":"/zh-tw/reference/ai_face_swap/v1.0","items":[{"label":"執行 AI 照片換臉的臉部偵測任務。","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/zh-tw/reference/ai_face_swap/v1.0/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process/post","routeSlug":"/zh-tw/reference/ai_face_swap/v1.0/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process/post","metadata":{"seo":{"title":"執行 AI 照片換臉的臉部偵測任務。","description":"當來源照片可能包含超過一個有效目標，或您的整合需要明確選擇哪個被偵測到的目標接受特效時，請使用前處理任務。對於單一目標的圖片，當功能支援預設的 index 值，且您的應用程式不需要手動選擇目標時，可以跳過前處理。"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"name":"執行 AI 照片換臉的臉部偵測任務。","isWebhook":false,"pointer":"/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"執行 AI 照片換臉的臉部偵測任務。","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"當來源照片可能包含超過一個有效目標，或您的整合需要明確選擇哪個被偵測到的目標接受特效時，請使用前處理任務。對於單一目標的圖片，當功能支援預設的 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"index"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 值，且您的應用程式不需要手動選擇目標時，可以跳過前處理。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"前處理任務會偵測來源照片中的候選目標，並在 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data.results.result"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 中回傳它們的座標。結果陣列中的每個項目代表一個被偵測到的目標。檢視回傳的座標，將它們對應到來源照片中預期的臉部或區域，並在建立特效任務時，將該項目的零基陣列索引作為 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"index"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 值使用。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"對於偵測到多張臉或多個區域的圖片，請不要在未檢查前處理結果的情況下依賴預設的 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"index"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 值。特效只會套用到由 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"index"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 選定的目標，因此整合必須在執行特效任務前，確認對應到預期目標的結果項目。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"這個任務是非同步的。建立任務後，若功能支援，請以 webhook 處理完成，否則輪詢對應的前處理狀態端點，直到 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"data.task_status"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 為 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"success"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 或 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"error"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuthenticationV2","scopes":[],"type":"http","scheme":"bearer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用標準的 'Bearer authentication'。請在標頭中放入您的 'API Key'："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization:Bearer YOUR_API_KEY"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。請注意 'Bearer' 與 'YOUR_API_KEY' 之間有一個空格。"},"children":[],"type":"text"}],"type":"paragraph"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_0"}},"schemaId":"schema_0","pointer":"/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/s2s/v2.0/task/face-swap/pre-process","servers":[{"url":"https://yce-api-01.makeupar.com"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuthenticationV2","type":"http","scheme":"bearer"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_0"}},"responseCodes":["200","400","401","429"],"pointer":"/s2s/v2.0/task/face-swap/pre-process","href":"v1.0/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process/post","summary":"執行 AI 照片換臉的臉部偵測任務。"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://yce-api-01.makeupar.com"}],"schemaId":"schema_0","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_0"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"任務執行成功"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/BasicRunTaskResponseV2"}},"schemaId":"components/schemas/BasicRunTaskResponseV2"},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"任務執行失敗"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_1"}},"schemaId":"schema_1"},{"code":"401","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"API 金鑰無效或缺失"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_2"}},"schemaId":"schema_2"},{"code":"429","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"請求過多"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_3"}},"schemaId":"schema_3"}],"pointer":"/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/BasicRunTaskResponseV2","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/BasicRunTaskResponseV2"}}},{"code":"400","schemaId":"schema_1","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_1"}}},{"code":"401","schemaId":"schema_2","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_2"}}},{"code":"429","schemaId":"schema_3","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_3"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/v1.0/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process/post"}],"panels":[]}]},"httpPath":"/s2s/v2.0/task/face-swap/pre-process"},{"label":"查詢 AI 照片換臉的臉部偵測任務狀態。","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/zh-tw/reference/ai_face_swap/v1.0/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process~1{task_id}/get","routeSlug":"/zh-tw/reference/ai_face_swap/v1.0/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process~1{task_id}/get","metadata":{"seo":{"title":"查詢 AI 照片換臉的臉部偵測任務狀態。","description":"查詢 AI 照片換臉的臉部偵測任務狀態。"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"name":"查詢 AI 照片換臉的臉部偵測任務狀態。","isWebhook":false,"pointer":"/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process~1{task_id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"查詢 AI 照片換臉的臉部偵測任務狀態。","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuthenticationV2","scopes":[],"type":"http","scheme":"bearer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用標準的 'Bearer authentication'。請在標頭中放入您的 'API Key'："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization:Bearer YOUR_API_KEY"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。請注意 'Bearer' 與 'YOUR_API_KEY' 之間有一個空格。"},"children":[],"type":"text"}],"type":"paragraph"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"task_id","in":"path","schemaId":"schema_4","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"要查詢的任務 ID"},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process~1{task_id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/s2s/v2.0/task/face-swap/pre-process/{task_id}","servers":[{"url":"https://yce-api-01.makeupar.com"}],"parameters":{"path":[{"name":"task_id","in":"path","required":true,"example":"grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe","schemaId":"schema_4"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuthenticationV2","type":"http","scheme":"bearer"}],"scopes":[]}],"responseCodes":["200","400","401","500"],"pointer":"/s2s/v2.0/task/face-swap/pre-process/{task_id}","href":"v1.0/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process~1{task_id}/get","summary":"查詢 AI 照片換臉的臉部偵測任務狀態。"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://yce-api-01.makeupar.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"成功查詢任務狀態"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_5"}},"schemaId":"schema_5"},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"任務 ID 無效"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_6"}},"schemaId":"schema_6"},{"code":"401","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"API 金鑰無效或缺失"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_2"}},"schemaId":"schema_2"},{"code":"500","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"任務執行逾時"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_7"}},"schemaId":"schema_7"}],"pointer":"/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process~1{task_id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_5","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_5"}}},{"code":"400","schemaId":"schema_6","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_6"}}},{"code":"401","schemaId":"schema_2","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_2"}}},{"code":"500","schemaId":"schema_7","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_7"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/v1.0/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process~1{task_id}/get"}],"panels":[]}]},"httpPath":"/s2s/v2.0/task/face-swap/pre-process/{task_id}"},{"label":"執行 AI 照片換臉任務。","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/zh-tw/reference/ai_face_swap/v1.0/paths/~1s2s~1v2.0~1task~1face-swap/post","routeSlug":"/zh-tw/reference/ai_face_swap/v1.0/paths/~1s2s~1v2.0~1task~1face-swap/post","metadata":{"seo":{"title":"執行 AI 照片換臉任務。","description":"AI 任務是非同步的。當功能支援 webhook 時，請優先使用以 webhook 為基礎的完成處理。設定您的 webhook 端點、驗證 webhook 簽章，並在收到 success 或 error 通知後，使用收到的 task_id 查詢任務結果。設定與驗證細節請見 webhook 整合指南。"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"name":"執行 AI 照片換臉任務。","isWebhook":false,"pointer":"/paths/~1s2s~1v2.0~1task~1face-swap/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"執行 AI 照片換臉任務。","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"AI 任務是非同步的。當功能支援 webhook 時，請優先使用以 webhook 為基礎的完成處理。設定您的 webhook 端點、驗證 webhook 簽章，並在收到 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"success"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 或 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"error"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 通知後，使用收到的 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"task_id"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 查詢任務結果。設定與驗證細節請見 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"href":"/develop/webhook"},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"webhook 整合指南"},"children":[],"type":"text"}],"type":"link"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"若您的整合不支援 webhook 或無法使用 webhook，請實作輪詢。送出 AI 任務後，以固定間隔（例如每 10 秒）輪詢狀態端點，直到任務狀態為 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"success"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 或 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"error"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"paragraph"}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuthenticationV2","scopes":[],"type":"http","scheme":"bearer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用標準的 'Bearer authentication'。請在標頭中放入您的 'API Key'："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization:Bearer YOUR_API_KEY"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。請注意 'Bearer' 與 'YOUR_API_KEY' 之間有一個空格。"},"children":[],"type":"text"}],"type":"paragraph"}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_8"}},"schemaId":"schema_8","pointer":"/paths/~1s2s~1v2.0~1task~1face-swap/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/s2s/v2.0/task/face-swap","servers":[{"url":"https://yce-api-01.makeupar.com"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuthenticationV2","type":"http","scheme":"bearer"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_8"}},"responseCodes":["200","400","401","429"],"pointer":"/s2s/v2.0/task/face-swap","href":"v1.0/paths/~1s2s~1v2.0~1task~1face-swap/post","summary":"執行 AI 照片換臉任務。"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://yce-api-01.makeupar.com"}],"schemaId":"schema_8","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_8"}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"任務執行成功"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/BasicRunTaskResponseV2"}},"schemaId":"components/schemas/BasicRunTaskResponseV2"},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"任務執行失敗"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_1"}},"schemaId":"schema_1"},{"code":"401","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"API 金鑰無效或缺失"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_2"}},"schemaId":"schema_2"},{"code":"429","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"請求過多"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_3"}},"schemaId":"schema_3"}],"pointer":"/paths/~1s2s~1v2.0~1task~1face-swap/post/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"components/schemas/BasicRunTaskResponseV2","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/BasicRunTaskResponseV2"}}},{"code":"400","schemaId":"schema_1","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_1"}}},{"code":"401","schemaId":"schema_2","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_2"}}},{"code":"429","schemaId":"schema_3","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_3"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/v1.0/paths/~1s2s~1v2.0~1task~1face-swap/post"}],"panels":[]}]},"httpPath":"/s2s/v2.0/task/face-swap"},{"label":"查詢 AI 照片換臉任務的狀態。","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/zh-tw/reference/ai_face_swap/v1.0/paths/~1s2s~1v2.0~1task~1face-swap~1{task_id}/get","routeSlug":"/zh-tw/reference/ai_face_swap/v1.0/paths/~1s2s~1v2.0~1task~1face-swap~1{task_id}/get","metadata":{"seo":{"title":"查詢 AI 照片換臉任務的狀態。","description":"查詢 AI 照片換臉任務的狀態。"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"name":"查詢 AI 照片換臉任務的狀態。","isWebhook":false,"pointer":"/paths/~1s2s~1v2.0~1task~1face-swap~1{task_id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"查詢 AI 照片換臉任務的狀態。","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"security","requirements":[{"schemes":[{"name":"BearerAuthenticationV2","scopes":[],"type":"http","scheme":"bearer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用標準的 'Bearer authentication'。請在標頭中放入您的 'API Key'："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization:Bearer YOUR_API_KEY"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。請注意 'Bearer' 與 'YOUR_API_KEY' 之間有一個空格。"},"children":[],"type":"text"}],"type":"paragraph"}]}]}]},{"nodeType":"item-content","variant":"path","label":"Path","labelTranslationKey":"path","parameters":[{"name":"task_id","in":"path","schemaId":"schema_4","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"要查詢的任務 ID"},"children":[],"type":"text"}],"type":"paragraph"}],"required":true}],"pointer":"/paths/~1s2s~1v2.0~1task~1face-swap~1{task_id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/s2s/v2.0/task/face-swap/{task_id}","servers":[{"url":"https://yce-api-01.makeupar.com"}],"parameters":{"path":[{"name":"task_id","in":"path","required":true,"example":"grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe","schemaId":"schema_4"}],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"BearerAuthenticationV2","type":"http","scheme":"bearer"}],"scopes":[]}],"responseCodes":["200","400","401","500"],"pointer":"/s2s/v2.0/task/face-swap/{task_id}","href":"v1.0/paths/~1s2s~1v2.0~1task~1face-swap~1{task_id}/get","summary":"查詢 AI 照片換臉任務的狀態。"},"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://yce-api-01.makeupar.com"}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"成功查詢任務狀態"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_9"}},"schemaId":"schema_9"},{"code":"400","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"任務 ID 無效"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_6"}},"schemaId":"schema_6"},{"code":"401","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"API 金鑰無效或缺失"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_2"}},"schemaId":"schema_2"},{"code":"500","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"任務執行逾時"},"children":[],"type":"text"}],"type":"paragraph"}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_7"}},"schemaId":"schema_7"}],"pointer":"/paths/~1s2s~1v2.0~1task~1face-swap~1{task_id}/get/responses"}],"panels":[{"children":[{"kind":"response","responseCodes":[{"code":"200","schemaId":"schema_9","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_9"}}},{"code":"400","schemaId":"schema_6","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_6"}}},{"code":"401","schemaId":"schema_2","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_2"}}},{"code":"500","schemaId":"schema_7","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"schema_7"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/v1.0/paths/~1s2s~1v2.0~1task~1face-swap~1{task_id}/get"}],"panels":[]}]},"httpPath":"/s2s/v2.0/task/face-swap/{task_id}"}],"content":{"contentType":"group","meta":{"name":"V1.0"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"V1.0","showPageActions":true},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"AI 照片換臉 API 可讓您使用預先定義的範本或手動對應，在目標照片與一或多張參考照片之間交換臉部。"},"children":[],"type":"text"}],"type":"paragraph"}]}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/s2s/v2.0/task/face-swap/pre-process","summary":"執行 AI 照片換臉的臉部偵測任務。","prefix":{"name":"post","color":"post"},"badges":[],"link":"/v1.0/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process/post","deprecated":false},{"title":"/s2s/v2.0/task/face-swap/pre-process/{task_id}","summary":"查詢 AI 照片換臉的臉部偵測任務狀態。","prefix":{"name":"get","color":"get"},"badges":[],"link":"/v1.0/paths/~1s2s~1v2.0~1task~1face-swap~1pre-process~1{task_id}/get","deprecated":false},{"title":"/s2s/v2.0/task/face-swap","summary":"執行 AI 照片換臉任務。","prefix":{"name":"post","color":"post"},"badges":[],"link":"/v1.0/paths/~1s2s~1v2.0~1task~1face-swap/post","deprecated":false},{"title":"/s2s/v2.0/task/face-swap/{task_id}","summary":"查詢 AI 照片換臉任務的狀態。","prefix":{"name":"get","color":"get"},"badges":[],"link":"/v1.0/paths/~1s2s~1v2.0~1task~1face-swap~1{task_id}/get","deprecated":false}]}]}]}]}}],"store":{"schemaStore":{"components/schemas/BasicRunTaskV2SrcFileUrl":{"id":"components/schemas/BasicRunTaskV2SrcFileUrl","kind":"json-schema","title":"BasicRunTaskV2SrcFileUrl","data":{"type":"object","required":["src_file_url"],"properties":{"src_file_url":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"要執行任務的檔案網址。該網址應可公開存取。"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"https://example.com/selfie.jpg"}}}},"components/schemas/BasicRunTaskV2SrcFileId":{"id":"components/schemas/BasicRunTaskV2SrcFileId","kind":"json-schema","title":"BasicRunTaskV2SrcFileId","data":{"type":"object","required":["src_file_id"],"properties":{"src_file_id":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"要執行任務的檔案 ID。檔案 ID 來自上傳檔案 API。"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="}}}},"components/schemas/BasicRunTaskV2":{"id":"components/schemas/BasicRunTaskV2","kind":"json-schema","title":"BasicRunTaskV2","data":{"title":"BasicRunTaskV2","anyOf":[{"title":"Run task with src file url","allOf":[{"$ref":"#/components/schemas/BasicRunTaskV2SrcFileUrl"}]},{"title":"Run task with src file ID","allOf":[{"$ref":"#/components/schemas/BasicRunTaskV2SrcFileId"}]}]}},"components/schemas/BasicRunTaskResponseV2":{"id":"components/schemas/BasicRunTaskResponseV2","kind":"json-schema","title":"BasicRunTaskResponseV2","data":{"type":"object","properties":{"status":{"type":"integer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應狀態"},"children":[],"type":"text"}],"type":"paragraph"}],"example":200},"data":{"type":"object","properties":{"task_id":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"這個任務的 ID。任務結果可以此 ID 查詢，有效期限 24 小時。"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"}}}}}},"components/schemas/RunError":{"id":"components/schemas/RunError","kind":"json-schema","title":"RunError","data":{"type":"object","properties":{"status":{"type":"integer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應狀態"},"children":[],"type":"text"}],"type":"paragraph"}],"example":400},"error":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"錯誤訊息"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"The operation could not be completed"},"error_code":{"type":"string","enum":["InvalidParameters","CreditInsufficiency","InvalidStyleGroup","InvalidStyle","BadRequest"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"錯誤代碼："},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"InvalidParameters - 請求參數無效"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"CreditInsufficiency - 點數不足，無法執行"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"BadRequest - 非預期的請求參數"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"InvalidStyleGroup - 風格群組 id 無效"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"InvalidStyle - 風格 id 無效"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]}}}},"components/schemas/EngineErrorCode":{"id":"components/schemas/EngineErrorCode","kind":"json-schema","title":"EngineErrorCode","data":{"type":"string","nullable":true,"enum":["error_exceed_max_image_size","exceed_max_filesize","invalid_parameter","error_download_image","error_download_mask","error_decode_image","error_decode_mask","error_nsfw_content_detected","error_no_face","error_pose","error_face_parsing","error_inference","exceed_nsfw_retry_limits","error_upload","unknown_internal_error"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"錯誤："},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_exceed_max_image_size`  - 輸入圖片尺寸超過上限"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`exceed_max_filesize` - 輸入檔案大小超過上限"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`invalid_parameter` - 參數值無效"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_download_image` - 下載來源圖片錯誤"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_download_mask` - 下載遮罩圖片錯誤"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_decode_image` - 解析來源圖片錯誤"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_decode_mask` - 解析遮罩圖片錯誤"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_nsfw_content_detected` - 在來源圖片中偵測到 NSFW 內容"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_no_face` - 來源圖片未偵測到臉部"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_pose` - 無法偵測來源圖片的姿势"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_face_parsing` - 無法對來源圖片進行臉部分割"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_inference` - 推論流程錯誤"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`exceed_nsfw_retry_limits` - 超過重試上限以避免產生 NSFW 圖片"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`error_upload` - 上傳結果圖片錯誤"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"`unknown_internal_error` - 其他"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}]}},"components/schemas/TaskStatusResponseBodySingleUrlResultsV2":{"id":"components/schemas/TaskStatusResponseBodySingleUrlResultsV2","kind":"json-schema","title":"TaskStatusResponseBodySingleUrlResultsV2","data":{"type":"object","properties":{"url":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"下載這個結果的網址。有效期限 2 小時"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"https://example.com/sample-result-url"}}}},"components/schemas/TaskStatusResponsePreProcessBase":{"id":"components/schemas/TaskStatusResponsePreProcessBase","kind":"json-schema","title":"TaskStatusResponsePreProcessBase","data":{"type":"object","properties":{"status":{"type":"integer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應狀態"},"children":[],"type":"text"}],"type":"paragraph"}],"example":200},"data":{"type":"object","properties":{"task_status":{"type":"string","enum":["running","success","error"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"這個任務的狀態"},"children":[],"type":"text"}],"type":"paragraph"}]},"error":{"$ref":"#/components/schemas/EngineErrorCode"},"error_message":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"錯誤的詳細說明"},"children":[],"type":"text"}],"type":"paragraph"}]},"results":{"allOf":[{"$ref":"#/components/schemas/TaskStatusResponseBodySingleUrlResultsV2"}]}}}}}},"components/schemas/BasicRunTaskV2RefFileUrls":{"id":"components/schemas/BasicRunTaskV2RefFileUrls","kind":"json-schema","title":"BasicRunTaskV2RefFileUrls","data":{"type":"object","properties":{"ref_file_urls":{"type":"array","minItems":1,"items":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"執行任務所用參考檔案的多個網址。該網址需可公開存取。"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"https://example.com/accessory.jpg"}}}}},"components/schemas/BasicRunTaskV2RefFileIds":{"id":"components/schemas/BasicRunTaskV2RefFileIds","kind":"json-schema","title":"BasicRunTaskV2RefFileIds","data":{"type":"object","properties":{"ref_file_ids":{"type":"array","minItems":1,"items":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"執行任務所用參考檔案的多個 ID。來自上傳檔案 API 的檔案 ID。"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="}}}}},"components/schemas/BasicRunTaskV2WithMultiRequiredRef":{"id":"components/schemas/BasicRunTaskV2WithMultiRequiredRef","kind":"json-schema","title":"BasicRunTaskV2WithRef","data":{"title":"BasicRunTaskV2WithRef","anyOf":[{"allOf":[{"title":"Run task with src file url & ref file urls","required":["ref_file_urls"]},{"$ref":"#/components/schemas/BasicRunTaskV2SrcFileUrl"},{"$ref":"#/components/schemas/BasicRunTaskV2RefFileUrls"}]},{"allOf":[{"title":"Run task with src file url & ref file IDs","required":["ref_file_ids"]},{"$ref":"#/components/schemas/BasicRunTaskV2SrcFileUrl"},{"$ref":"#/components/schemas/BasicRunTaskV2RefFileIds"}]},{"allOf":[{"title":"Run task with src file ID & ref file urls","required":["ref_file_urls"]},{"$ref":"#/components/schemas/BasicRunTaskV2SrcFileId"},{"$ref":"#/components/schemas/BasicRunTaskV2RefFileUrls"}]},{"allOf":[{"title":"Run task with src file ID & ref file IDs","required":["ref_file_ids"]},{"$ref":"#/components/schemas/BasicRunTaskV2SrcFileId"},{"$ref":"#/components/schemas/BasicRunTaskV2RefFileIds"}]}]}},"components/schemas/TaskStatusResponseV2":{"id":"components/schemas/TaskStatusResponseV2","kind":"json-schema","title":"TaskStatusResponseV2","data":{"type":"object","properties":{"url":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"下載這個結果的網址。有效期限 2 小時"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"https://example.com/sample-result-url"}}}},"schema_0":{"kind":"json-schema","data":{"allOf":[{"$ref":"#/components/schemas/BasicRunTaskV2"}]},"id":"schema_0"},"schema_1":{"kind":"json-schema","data":{"allOf":[{"$ref":"#/components/schemas/RunError"}]},"id":"schema_1"},"schema_2":{"kind":"json-schema","data":{"type":"object","properties":{"status":{"type":"integer","example":401,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應狀態"},"children":[],"type":"text"}],"type":"paragraph"}]},"error":{"type":"string","example":"Invalid API key"}}},"id":"schema_2"},"schema_3":{"kind":"json-schema","data":{"type":"object","properties":{"status":{"type":"integer","example":429,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應狀態"},"children":[],"type":"text"}],"type":"paragraph"}]},"error":{"type":"string","example":"Too many requests"}}},"id":"schema_3"},"schema_4":{"kind":"json-schema","data":{"type":"string","example":"grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"},"id":"schema_4"},"schema_5":{"kind":"json-schema","data":{"allOf":[{"$ref":"#/components/schemas/TaskStatusResponsePreProcessBase"},{"type":"object","properties":{"data":{"type":"object","properties":{"results":{"type":"object","properties":{"url":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"下載這個結果的網址。有效期限 2 小時"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"https://example.com/sample-result-url"},"faces":{"type":"array","items":{"type":"object","properties":{"bbox":{"type":"array","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"臉部的位置。共 4 個數字，格式為 [x1, y1, x2, y2]，其中 (x1, y1) 是左上點，(x2, y2) 是右下點。"},"children":[],"type":"text"}],"type":"paragraph"}],"items":{"type":"integer","example":[0,0,100,100]}}}}}}}}}}}]},"id":"schema_5"},"schema_6":{"kind":"json-schema","data":{"type":"object","properties":{"status":{"type":"integer","example":400,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應狀態"},"children":[],"type":"text"}],"type":"paragraph"}]},"error":{"type":"string","example":"Invalid task ID"}}},"id":"schema_6"},"schema_7":{"kind":"json-schema","data":{"type":"object","properties":{"status":{"type":"integer","example":500,"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應狀態"},"children":[],"type":"text"}],"type":"paragraph"}]},"error":{"type":"string","example":"Task execution timed out"}}},"id":"schema_7"},"schema_8":{"kind":"json-schema","data":{"allOf":[{"$ref":"#/components/schemas/BasicRunTaskV2WithMultiRequiredRef"},{"type":"object","required":["face_mapping"],"properties":{"face_mapping":{"type":"array","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"針對目標照片中每個被偵測到的臉部，要交換的參考圖片 id 與臉部位置資訊。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"邏輯規則"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"索引對應："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"index"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 直接對應您參考清單中提供圖片的順序。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"跳過交換：若要跳過交換來源中某個被偵測到的臉部，請將 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"index"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 與 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"position"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 都設為 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"-1"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"陣列順序：陣列中物件的順序，應依據 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"position"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":" 對應。"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用範例"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"情境："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"參考清單：提供 2 張圖片（圖片 A、圖片 B）。"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"來源照片：包含 3 個被偵測到的臉部（臉 0、臉 1、臉 2）。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"目標："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"將臉 0（來源）與圖片 1（參考）交換。"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"跳過交換臉 1（來源）。"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"將臉 2（來源）與圖片 0（參考）交換。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"設定："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"face_mapping\": ["},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"index\": 1,  // 使用第二張參考圖片"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"position\": 0 // 套用到來源中第一個被偵測到的臉"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"},"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"index\": -1, // 跳過交換"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"position\": -1 // 跳過交換"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"},"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"index\": 0,  // 使用第一張參考圖片"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"\"position\": 2 // 套用到來源中第三個被偵測到的臉"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"}"},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{},"children":[],"type":"softbreak"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"]"},"children":[],"type":"text"}],"type":"paragraph"}],"items":{"type":"object","properties":{"index":{"type":"integer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"參考圖片的索引"},"children":[],"type":"text"}],"type":"paragraph"}]},"position":{"type":"integer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"目標照片中臉部的索引。索引來自偵測結果的臉部。"},"children":[],"type":"text"}],"type":"paragraph"}]}}}}}}]},"id":"schema_8"},"schema_9":{"kind":"json-schema","data":{"type":"object","properties":{"status":{"type":"integer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"回應狀態"},"children":[],"type":"text"}],"type":"paragraph"}],"example":200},"data":{"type":"object","properties":{"task_status":{"type":"string","enum":["running","success","error"],"description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"這個任務的狀態"},"children":[],"type":"text"}],"type":"paragraph"}]},"error":{"$ref":"#/components/schemas/EngineErrorCode"},"error_message":{"type":"string","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"錯誤的詳細說明"},"children":[],"type":"text"}],"type":"paragraph"}]},"results":null}}},"$ref":"#/components/schemas/TaskStatusResponseBodySingleUrlResultsV2"},"id":"schema_9"}},"exampleStore":{},"securitySchemeStore":{"BearerAuthenticationV2":{"id":"BearerAuthenticationV2","type":"http","scheme":"bearer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"使用標準的 'Bearer authentication'。請在標頭中放入您的 'API Key'："},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"Authorization:Bearer YOUR_API_KEY"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。請注意 'Bearer' 與 'YOUR_API_KEY' 之間有一個空格。"},"children":[],"type":"text"}],"type":"paragraph"}]}},"specVersion":"3.0.0","servers":[{"url":"https://yce-api-01.makeupar.com"}],"specType":"openapi"},"options":{"layout":"stacked","mockServer":{"off":true,"position":"off"},"disableRouter":true,"downloadUrls":[{"url":"/_bundle/@l10n/zh-TW/reference/ai_face_swap.json?download"},{"url":"/_bundle/@l10n/zh-TW/reference/ai_face_swap.yaml?download"}],"excludeFromSearch":false,"replayFeatures":{"graphql":false,"asyncapi":false},"specType":"openapi","markdocOptions":{"tags":{},"nodes":{},"components":{}},"metadata":{"title":"AI 照片換臉","description":"# 概述\n使用 AI 照片換臉達到極其逼真的效果，並支援多張臉部。我們的人臉交換人工智慧支援交換一或多張臉部。無論是創造有趣的人臉照片，或需要專業工具，我們都能滿足您的需求。\n\n## 整合指南\n* 如何實作 AI 照片換臉\n\n   * 步驟 1：上傳來源與參考圖片\n\n      1. 向 API 請求上傳網址：\n\n        ```\n        POST https://yce-api-01.makeupar.com/s2s/v2.0/file\n        Authorization: Bearer YOUR_API_KEY\n        Content-Type: application/json\n        ```\n\n        內容：\n\n        ```json\n        {\n            \"files\": [\n            {\n                \"file_name\": \"target.jpg\",\n                \"file_size\": 123456,\n                \"content_type\": \"image/jpeg\"\n            }\n            ]\n        }\n        ```\n        1. 回應會提供預簽名的**上傳網址**與 `file_id`。\n        2. 使用 HTTP PUT 請求，將檔案上傳到指定的網址。\n        3. 儲存 `file_id` 以供後續使用。對**目標**與**參考**圖片都重複此步驟。\n\n      2. 將實際檔案上傳到**上傳網址**。\n\n---\n\n   * 步驟 2：前處理來源與參考圖片（臉部偵測）\n\n        1. 建立前處理任務：\n\n        ```\n        POST https://yce-api-01.makeupar.com/s2s/v2.0/task/face-swap/pre-process\n        Authorization: Bearer YOUR_API_KEY\n        Content-Type: application/json\n        ```\n\n        內容：\n\n        ```json\n        {\n            \"request_id\": 1,\n            \"payload\": {\n            \"file_sets\": {\n                \"src_ids\": [\"TARGET_FILE_ID\"]\n            },\n            \"actions\": [\n                { \"id\": 0 }\n            ]\n            }\n        }\n        ```\n        1. API 回傳 `task_id`。\n        2. 在此輪詢任務狀態：\n\n        ```\n        GET https://yce-api-01.makeupar.com/s2s/v2.0/task/face-swap/pre-process?task_id=TASK_ID\n        ```\n        1. 完成後，您會收到帶有邊界框的偵測臉部清單。\n\n---\n\n   * 步驟 3：執行換臉任務\n        1. 定義哪個參考圖片將取代每個來源圖片\n        `face_mapping` 陣列定義**來源圖片**中的臉部如何被**參考圖片**中的臉部取代。它就像一個連結清單，將來源中偵測到的臉部連接到特定的參考圖片。\n\n        * 結構\n\n            陣列中的每個元素都是包含兩個屬性的物件：\n\n            | 參數 | 類型 | 說明 |\n            | :--- | :--- | :--- |\n            | `position` | `integer` | 在**來源圖片**中偵測到的臉部索引（例如 0、1、2）。 |\n            | `index` | `integer` | 要交換的**參考圖片清單**中臉部圖片的索引。 |\n\n                * 邏輯規則\n            1.  **索引對應：** `index` 直接對應您參考清單中提供圖片的順序。\n                *   `0`：第一張參考圖片。\n                *   `1`：第二張參考圖片。\n            2.  **跳過交換：** 若要跳過交換來源中某個被偵測到的臉部，請將 `index` 與 `position` 都設為 `-1`。\n            3.  **陣列順序：** 陣列中物件的順序，應依據 `position` 對應。\n\n                * 使用範例\n\n            **情境：**\n            *   **參考清單：** 提供 2 張圖片（圖片 A、圖片 B）。\n            *   **來源圖片：** 包含 3 個被偵測到的臉部（臉 0、臉 1、臉 2）。\n\n            **目標：**\n            *   將**臉 0**（來源）與**圖片 1**（參考）交換。\n            *   跳過交換**臉 1**（來源）。\n            *   將**臉 2**（來源）與**圖片 0**（參考）交換。\n\n            **設定：**\n\n            ```json\n            \"face_mapping\": [\n                {\n                    \"index\": 1,  // 使用第二張參考圖片\n                    \"position\": 0 // 套用到來源中偵測到的第一張臉部\n                },\n                {\n                    \"index\": -1, // 跳過換臉\n                    \"position\": -1 // 跳過換臉\n                },\n                {\n                    \"index\": 0,  // 使用第一張參考圖片\n                    \"position\": 2 // 套用到來源中偵測到的第三張臉部\n                }\n            ]\n            ```\n\n        1. 發送主要任務請求：\n\n        ```\n        POST https://yce-api-01.makeupar.com/s2s/v2.0/task/face-swap\n        Authorization: Bearer YOUR_API_KEY\n        Content-Type: application/json\n        ```\n\n        內容：\n\n        ```json\n        {\n            \"request_id\": 2,\n            \"payload\": {\n            \"file_sets\": {\n                \"src_ids\": [\"TARGET_FILE_ID\"],\n                \"ref_ids\": [\"REFERENCE_FILE_ID\"]\n            },\n            \"actions\": [\n                {\n                \"id\": 0,\n                \"params\": {\n                    \"face_mapping\": [\n                    { \"index\": 0, \"position\": 0 },\n                    { \"index\": -1, \"position\": -1 }\n                    ]\n                }\n                }\n            ]\n            }\n        }\n        ```\n        1. 回應會回傳 `task_id`。\n\n---\n\n   * 步驟 4：輪詢任務狀態並取得結果\n        必須實作定時迴圈，在允許的輪詢窗口內以固定間隔查詢任務狀態。\n        1. 輪詢：\n\n        ```\n        GET https://yce-api-01.makeupar.com/s2s/v2.0/task/face-swap?task_id=TASK_ID\n        ```\n        2. 當 `status` 為 `success` 時，回應包含生成影像的網址。\n        3. 從該網址下載或顯示圖片。\n\n---\n\n   * 步驟 5：整合到您的平台\n\n        * 在**網頁前端**，您可以直接用 JavaScript 以 fetch 或 Axios 實作。\n        * 在**後端**（Node.js、Python、Java、PHP 等），您可以使用標準 HTTP 函式庫呼叫相同的端點。\n        * 由於任務以非同步執行，請實作重試與錯誤處理。\n\n---\n\n    * 除錯指南\n        1. **Invalid TaskId 錯誤**\n            </br>**原因：** 若您嘗試查詢已逾時任務的狀態，會收到 InvalidTaskId 錯誤。因此，AI 任務啟動後，您需要在 polling_interval 內輪詢其狀態，直到狀態變為 success 或 error。\n            </br>**解法：** 為避免任務失效，必須實作定時迴圈，在允許的輪詢窗口內以固定間隔查詢任務狀態。\n\n        2. **為什麼我的來源圖片中有些臉部未被偵測到**\n            </br>**原因：** 臉部必須清晰可見，未被覆蓋或遮擋，且在圖片中足夠大\n            </br>**解法：** 嘗試拍攝臉部看起來更大、且清晰可見無任何覆蓋或遮擋的照片\n\n---\n\n## 輸入與輸出\n\n* 實際範例：\n多人換臉範例：\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/dt_yce_face_swap_S2_img_04_d4b747a41d.jpg)\n\n單人換臉範例：\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/dt_yce_face_swap_S2_img_05_8e68faff2c.jpg)\n\n* 拍攝建議：\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/webp_AI%20Skin%20Analysis_camera_f93315b088.png)\n\n\n## 檔案規格與錯誤\n* 支援的格式與尺寸\n\n|AI 功能|支援的尺寸|支援的檔案大小|支援的格式|\n|  ----  | ----  | ----  | ----  |\n|AI 照片換臉|輸入與輸出：長邊必須小於或等於 4096 像素|< 10MB|jpg/jpeg/png|\n\n\n* 錯誤代碼\n\n| 錯誤代碼 | 說明 |\n| ------------------ | ----------- |\n| exceed_max_filesize | 輸入檔案大小超過上限 |\n| invalid_parameter | 參數值無效 |\n| error_download_image | 下載來源圖片時發生錯誤 |\n| error_download_mask | 下載遮罩圖片時發生錯誤 |\n| error_decode_image | 解碼來源圖片時發生錯誤 |\n| error_decode_mask | 解碼遮罩圖片時發生錯誤 |\n| error_download_video | 下載來源影片時發生錯誤 |\n| error_decode_video | 解碼來源影片時發生錯誤 |\n| error_nsfw_content_detected | 在來源圖片中偵測到 NSFW 內容 |\n| error_no_face | 來源圖片中未偵測到臉部 |\n| error_pose | 在來源圖片偵測姿勢失敗 |\n| error_face_parsing | 在來源圖片進行人臉解析失敗 |\n| error_inference | 推論流程發生錯誤 |\n| exceed_nsfw_retry_limits | 超過重試上限，以避免生成 NSFW 圖片 |\n| error_upload | 上傳結果圖片時發生錯誤 |\n| error_multiple_people | 人數超過上限 |\n| error_no_shoulder | 來源圖片中肩膀不可見 |\n| error_large_face_angle | 上傳圖片的臉部角度過大 |\n| error_unsupport_ratio | 輸入圖片的長寬比不受支援 |\n| unknown_internal_error | 其他內部錯誤 |\n\n---\n\n## 點數消耗\n\n| AI 功能 | 消耗的點數 |\n|---|---|\n| AI 照片換臉 V1.0 | 1 |\n\n---\n"}},"baseSlug":"/zh-tw/reference/ai_face_swap","routesMapping":{}}