{"items":[{"type":"link","label":"AI Retake","link":"/zh-cn/reference/ai_retake","routeSlug":"/zh-cn/reference/ai_retake","content":{"contentType":"overview","meta":{"name":"AI Retake"},"children":[{"nodeType":"container","panels":[{"title":"Download OpenAPI description","titleTranslationKey":"download.description.title","children":[{"kind":"download","label":"ai_retake.json","url":"/_bundle/@l10n/zh-CN/reference/ai_retake.json?download"},{"kind":"download","label":"ai_retake.yaml","url":"/_bundle/@l10n/zh-CN/reference/ai_retake.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 Retake","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 换脸（Retake）可以逐张逐脸地重建任意合照。不管是想做搞怪换脸图，还是需要一套专业工具，我们都能满足。"},"children":[],"type":"text"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"alt":"","src":"https://plugins-media.makeupar.com/smb/blog/post/2025-01-14/3d504686-8057-418e-a0cb-eba3d47ea42c.jpg"},"children":[],"type":"image"}],"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 换脸（Retake）"},"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":"向接口请求上传 URL："},"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":"Body："},"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":"上传 URL"},"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 请求把文件上传到该 URL。"},"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":"上传 URL"},"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/retake/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/retake/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":"Body："},"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":"接口返回一个 "},"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/retake/pre-process?task_id=TASK_ID\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"GET https://yce-api-01.makeupar.com/s2s/v2.0/task/retake/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 步：执行 AI 换脸（Retake）任务"},"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":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"单次请求只支持替换一张脸。所有非目标的人脸都必须设为 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"{\"index\": -1, \"position\": -1}"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。尝试替换超过一张脸会返回 "},"children":[],"type":"text"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"error_change_too_many_faces"},"children":[],"type":"code"},{"$$mdtype":"Node","inline":true,"attributes":{"content":"。返回该错误的请求不会计费。参考图只支持使用检测到的第一张脸，因此 index 必须始终为 0。"},"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":"参数"},"children":[],"type":"text"}],"type":"paragraph"},{"$$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"},{"$$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":"position"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"整数"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"源图中检测到的人脸下标（例如 0、1、2）。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"index"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"整数"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"参考图人脸下标。目前只支持第一张检测到的人脸，因此该值必须为 0。"},"children":[],"type":"text"}],"type":"td"}],"type":"tr"}],"type":"tbody"}],"type":"table"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$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":"单脸替换：单次请求只能把一张源图人脸映射到一张参考图人脸。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"跳过某张脸：把 index 与 position 都设为 -1。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"参考图人脸下标：参考图只支持检测到的第一张脸，因此 index 始终为 0。"},"children":[],"type":"text"}],"type":"item"}],"type":"list"}],"type":"item"},{"$$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":{"ordered":false,"marker":"*"},"children":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"参考图：1 张含单张受支持人脸的图片。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"源图：检测到 4 张脸（Face 0、Face 1、Face 2、Face 3）。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"目标：只替换 Face 2，Face 0、Face 1、Face 3 保持不动。"},"children":[],"type":"text"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{"content":"    \"face_mapping\": [\n        {\n            \"index\": -1, // Skip replacing\n            \"position\": -1 // Skip replacing\n        },\n        {\n            \"index\": -1, // Skip replacing\n            \"position\": -1 // Skip replacing\n        },\n        {\n            \"index\": 0, // Always use the first reference image\n            \"position\": 2 // Apply to the third detected face in source\n        },\n        {\n            \"index\": -1, // Skip replacing\n            \"position\": -1 // Skip replacing\n        },\n    ]\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"    \"face_mapping\": [\n        {\n            \"index\": -1, // Skip replacing\n            \"position\": -1 // Skip replacing\n        },\n        {\n            \"index\": -1, // Skip replacing\n            \"position\": -1 // Skip replacing\n        },\n        {\n            \"index\": 0, // Always use the first reference image\n            \"position\": 2 // Apply to the third detected face in source\n        },\n        {\n            \"index\": -1, // Skip replacing\n            \"position\": -1 // Skip replacing\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/retake\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/retake\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":"Body："},"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\": -1, \"position\": -1},\n            {\"index\": -1, \"position\": -1},\n            {\"index\":  0, \"position\":  2},\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\": -1, \"position\": -1},\n            {\"index\": -1, \"position\": -1},\n            {\"index\":  0, \"position\":  2},\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/retake?task_id=TASK_ID\n"},"children":[{"$$mdtype":"Node","attributes":{"content":"GET https://yce-api-01.makeupar.com/s2s/v2.0/task/retake?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":" 时，响应中包含生成图片的 URL。"},"children":[],"type":"text"}],"type":"item"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"从该 URL 下载或展示图片。"},"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","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":{"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":"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"}],"type":"item"}],"type":"list"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"alt":"","src":"https://plugins-media.makeupar.com/smb/blog/post/2025-01-14/9aeab2bb-28aa-48f5-ab86-2edd897ad908.jpg"},"children":[],"type":"image"}],"type":"paragraph"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"alt":"","src":"https://plugins-media.makeupar.com/smb/blog/post/2025-07-02/webp_0196a9d4-1430-4121-9680-5e81b58b66ac.webp"},"children":[],"type":"image"}],"type":"paragraph"}]}],"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 换脸（Retake）"},"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":"为避免生成不适宜内容，重试次数已超限"},"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":"error_change_too_many_faces"},"children":[],"type":"text"}],"type":"td"},{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"单次请求只支持替换一张脸。所有非目标的人脸都必须设为 {\"index\": -1, \"position\": -1}。尝试替换超过一张脸就会返回该错误。"},"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 换脸（Retake）V2.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-cn/reference/ai_retake/section/概览","routeSlug":"/zh-cn/reference/ai_retake/section/概览","items":[{"type":"link","label":"接入指南","link":"/zh-cn/reference/ai_retake/section/概览/接入指南","routeSlug":"/zh-cn/reference/ai_retake/section/概览/接入指南","content":null},{"type":"link","label":"输入与输出","link":"/zh-cn/reference/ai_retake/section/概览/输入与输出","routeSlug":"/zh-cn/reference/ai_retake/section/概览/输入与输出","content":null},{"type":"link","label":"文件规格与错误码","link":"/zh-cn/reference/ai_retake/section/概览/文件规格与错误码","routeSlug":"/zh-cn/reference/ai_retake/section/概览/文件规格与错误码","content":null},{"type":"link","label":"点数消耗","link":"/zh-cn/reference/ai_retake/section/概览/点数消耗","routeSlug":"/zh-cn/reference/ai_retake/section/概览/点数消耗","content":null}],"content":null},{"type":"group","label":"V2.0","link":"/zh-cn/reference/ai_retake/v2.0","routeSlug":"/zh-cn/reference/ai_retake/v2.0","items":[{"label":"执行 AI Retake人脸检测任务。","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/zh-cn/reference/ai_retake/v2.0/paths/~1s2s~1v2.0~1task~1retake~1pre-process/post","routeSlug":"/zh-cn/reference/ai_retake/v2.0/paths/~1s2s~1v2.0~1task~1retake~1pre-process/post","metadata":{"seo":{"title":"执行 AI Retake人脸检测任务。","description":"AI 任务是异步处理的。功能支持 Webhook 时，优先用 Webhook 来接收完成通知。配置好您的 Webhook 端点、校验 Webhook 签名，收到 success 或 error 通知后，用收到的 task_id 查询任务结果。配置与校验的细节请见 Webhook 接入指南。"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"name":"执行 AI Retake人脸检测任务。","isWebhook":false,"pointer":"/paths/~1s2s~1v2.0~1task~1retake~1pre-process/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"执行 AI Retake人脸检测任务。","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 鉴权。把您的 API 密钥放进请求头： "},"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~1retake~1pre-process/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/s2s/v2.0/task/retake/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/retake/pre-process","href":"v2.0/paths/~1s2s~1v2.0~1task~1retake~1pre-process/post","summary":"执行 AI Retake人脸检测任务。"},"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~1retake~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":"/v2.0/paths/~1s2s~1v2.0~1task~1retake~1pre-process/post"}],"panels":[]}]},"httpPath":"/s2s/v2.0/task/retake/pre-process"},{"label":"查询 AI Retake人脸检测任务的状态。","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/zh-cn/reference/ai_retake/v2.0/paths/~1s2s~1v2.0~1task~1retake~1pre-process~1{task_id}/get","routeSlug":"/zh-cn/reference/ai_retake/v2.0/paths/~1s2s~1v2.0~1task~1retake~1pre-process~1{task_id}/get","metadata":{"seo":{"title":"查询 AI Retake人脸检测任务的状态。","description":"查询 AI Retake人脸检测任务的状态。"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"name":"查询 AI Retake人脸检测任务的状态。","isWebhook":false,"pointer":"/paths/~1s2s~1v2.0~1task~1retake~1pre-process~1{task_id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"查询 AI Retake人脸检测任务的状态。","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 鉴权。把您的 API 密钥放进请求头： "},"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~1retake~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/retake/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/retake/pre-process/{task_id}","href":"v2.0/paths/~1s2s~1v2.0~1task~1retake~1pre-process~1{task_id}/get","summary":"查询 AI Retake人脸检测任务的状态。"},"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~1retake~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":"/v2.0/paths/~1s2s~1v2.0~1task~1retake~1pre-process~1{task_id}/get"}],"panels":[]}]},"httpPath":"/s2s/v2.0/task/retake/pre-process/{task_id}"},{"label":"执行 AI Retake 任务。","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/zh-cn/reference/ai_retake/v2.0/paths/~1s2s~1v2.0~1task~1retake/post","routeSlug":"/zh-cn/reference/ai_retake/v2.0/paths/~1s2s~1v2.0~1task~1retake/post","metadata":{"seo":{"title":"执行 AI Retake 任务。","description":"AI 任务是异步处理的。功能支持 Webhook 时，优先用 Webhook 来接收完成通知。配置好您的 Webhook 端点、校验 Webhook 签名，收到 success 或 error 通知后，用收到的 task_id 查询任务结果。配置与校验的细节请见 Webhook 接入指南。"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"name":"执行 AI Retake 任务。","isWebhook":false,"pointer":"/paths/~1s2s~1v2.0~1task~1retake/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"执行 AI Retake 任务。","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 鉴权。把您的 API 密钥放进请求头： "},"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~1retake/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/s2s/v2.0/task/retake","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/retake","href":"v2.0/paths/~1s2s~1v2.0~1task~1retake/post","summary":"执行 AI Retake 任务。"},"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~1retake/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":"/v2.0/paths/~1s2s~1v2.0~1task~1retake/post"}],"panels":[]}]},"httpPath":"/s2s/v2.0/task/retake"},{"label":"查询 AI Retake 任务的状态。","deprecated":false,"httpVerb":"get","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/zh-cn/reference/ai_retake/v2.0/paths/~1s2s~1v2.0~1task~1retake~1{task_id}/get","routeSlug":"/zh-cn/reference/ai_retake/v2.0/paths/~1s2s~1v2.0~1task~1retake~1{task_id}/get","metadata":{"seo":{"title":"查询 AI Retake 任务的状态。","description":"查询 AI Retake 任务的状态。"}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"name":"查询 AI Retake 任务的状态。","isWebhook":false,"pointer":"/paths/~1s2s~1v2.0~1task~1retake~1{task_id}/get","hasSamples":false},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"查询 AI Retake 任务的状态。","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 鉴权。把您的 API 密钥放进请求头： "},"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~1retake~1{task_id}/get/parameters"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"GET","path":"/s2s/v2.0/task/retake/{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/retake/{task_id}","href":"v2.0/paths/~1s2s~1v2.0~1task~1retake~1{task_id}/get","summary":"查询 AI Retake 任务的状态。"},"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~1retake~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":"/v2.0/paths/~1s2s~1v2.0~1task~1retake~1{task_id}/get"}],"panels":[]}]},"httpPath":"/s2s/v2.0/task/retake/{task_id}"}],"content":{"contentType":"group","meta":{"name":"V2.0"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"V2.0","showPageActions":true},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"留住那一刻，重造每张脸。AI Retake可以让您逐张重建合影中的每一张脸。"},"children":[],"type":"text"}],"type":"paragraph"}]}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/s2s/v2.0/task/retake/pre-process","summary":"执行 AI Retake人脸检测任务。","prefix":{"name":"post","color":"post"},"badges":[],"link":"/v2.0/paths/~1s2s~1v2.0~1task~1retake~1pre-process/post","deprecated":false},{"title":"/s2s/v2.0/task/retake/pre-process/{task_id}","summary":"查询 AI Retake人脸检测任务的状态。","prefix":{"name":"get","color":"get"},"badges":[],"link":"/v2.0/paths/~1s2s~1v2.0~1task~1retake~1pre-process~1{task_id}/get","deprecated":false},{"title":"/s2s/v2.0/task/retake","summary":"执行 AI Retake 任务。","prefix":{"name":"post","color":"post"},"badges":[],"link":"/v2.0/paths/~1s2s~1v2.0~1task~1retake/post","deprecated":false},{"title":"/s2s/v2.0/task/retake/{task_id}","summary":"查询 AI Retake 任务的状态。","prefix":{"name":"get","color":"get"},"badges":[],"link":"/v2.0/paths/~1s2s~1v2.0~1task~1retake~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":"用于运行任务的文件 URL，该 URL 需可公开访问。"},"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，取自上传文件接口返回的 file_id。"},"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":"用源文件 URL 运行任务","allOf":[{"$ref":"#/components/schemas/BasicRunTaskV2SrcFileUrl"}]},{"title":"用源文件 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` - 为避免生成不适宜内容， 重试次数已用尽"},"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":"下载该结果的 URL，有效期 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":"用于运行任务的参考文件 URL，该 URL 需可公开访问。"},"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 列表，取自上传文件接口返回的 file_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":"以源文件 URL 与多张参考文件 URL 运行任务","required":["ref_file_urls"]},{"$ref":"#/components/schemas/BasicRunTaskV2SrcFileUrl"},{"$ref":"#/components/schemas/BasicRunTaskV2RefFileUrls"}]},{"allOf":[{"title":"以源文件 URL 与多张参考文件 ID 运行任务","required":["ref_file_ids"]},{"$ref":"#/components/schemas/BasicRunTaskV2SrcFileUrl"},{"$ref":"#/components/schemas/BasicRunTaskV2RefFileIds"}]},{"allOf":[{"title":"以源文件 ID 与多张参考文件 URL 运行任务","required":["ref_file_urls"]},{"$ref":"#/components/schemas/BasicRunTaskV2SrcFileId"},{"$ref":"#/components/schemas/BasicRunTaskV2RefFileUrls"}]},{"allOf":[{"title":"以源文件 ID 与多张参考文件 ID 运行任务","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":"下载该结果的 URL，有效期 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":"下载该结果的 URL，有效期 2 小时"},"children":[],"type":"text"}],"type":"paragraph"}],"example":"https://example.com/sample-result-url"},"faces":{"type":"array","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"照片上检测到的人脸，按从左到右排列。 数组中的位置即人脸编号，从 0 开始。"},"children":[],"type":"text"}],"type":"paragraph"}],"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":"指定用哪一张参考人脸来替换用户照片上检测到的人脸。 第 n 项对应用户照片上从左到右数的第 n 张脸。 即使照片只有一张脸也必须提供；每张照片各一张脸时， 写 [{\"index\": 0, \"position\": 0}]。"},"children":[],"type":"text"}],"type":"paragraph"}],"example":[{"index":0,"position":0}],"items":{"type":"object","required":["index","position"],"properties":{"index":{"type":"integer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"参考图在参考列表中的下标，从 0 开始。设为 -1 表示这张脸保持不变。"},"children":[],"type":"text"}],"type":"paragraph"}],"example":0},"position":{"type":"integer","description":[{"$$mdtype":"Node","attributes":{},"children":[{"$$mdtype":"Node","inline":true,"attributes":{"content":"该参考图上人脸的编号，从 0 开始，按人脸检测任务返回的从左到右顺序排列。设为 -1 表示这张脸保持不变。"},"children":[],"type":"text"}],"type":"paragraph"}],"example":0}}}}}}]},"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 鉴权。把您的 API 密钥放进请求头： "},"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-CN/reference/ai_retake.json?download"},{"url":"/_bundle/@l10n/zh-CN/reference/ai_retake.yaml?download"}],"excludeFromSearch":false,"replayFeatures":{"graphql":false,"asyncapi":false},"specType":"openapi","markdocOptions":{"tags":{},"nodes":{},"components":{}},"metadata":{"title":"AI Retake","description":"# 概览\n留住这一刻，把脸换一换。AI 换脸（Retake）可以逐张逐脸地重建任意合照。不管是想做搞怪换脸图，还是需要一套专业工具，我们都能满足。\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2025-01-14/3d504686-8057-418e-a0cb-eba3d47ea42c.jpg)\n\n## 接入指南\n* 如何实现 AI 换脸（Retake）\n\n   * 第 1 步：上传源图与参考图\n\n      1. 向接口请求上传 URL：\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        Body：\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. 响应会给出一个预签名的**上传 URL** 和一个 `file_id`。\n        2. 用 HTTP PUT 请求把文件上传到该 URL。\n        3. 保存 `file_id` 备用。**目标图**与**参考图**都要重复这一套流程。\n\n      2. 把实际文件上传到**上传 URL**。\n\n---\n\n   * 第 2 步：预处理源图与参考图（人脸检测）\n\n        1. 创建预处理任务：\n\n        ```\n        POST https://yce-api-01.makeupar.com/s2s/v2.0/task/retake/pre-process\n        Authorization: Bearer YOUR_API_KEY\n        Content-Type: application/json\n        ```\n\n        Body：\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. 接口返回一个 `task_id`。\n        2. 在此接口轮询任务状态：\n\n        ```\n        GET https://yce-api-01.makeupar.com/s2s/v2.0/task/retake/pre-process?task_id=TASK_ID\n        ```\n        1. 处理完成后，您会收到一份带边界框的检测到的人脸列表。\n\n---\n\n   * 第 3 步：执行 AI 换脸（Retake）任务\n        1. 指定哪张参考图的脸去替换源图中的哪张脸\n        `face_mapping` 数组定义了**源图**中的人脸如何被**参考图**的人脸替换，作用相当于把源图中检测到的人脸与指定参考图串起来的关联表。 \n        \n        单次请求只支持替换一张脸。所有非目标的人脸都必须设为 `{\"index\": -1, \"position\": -1}`。尝试替换超过一张脸会返回 `error_change_too_many_faces`。返回该错误的请求不会计费。参考图只支持使用检测到的第一张脸，因此 index 必须始终为 0。\n\n        * 参数\n            \n            | 参数\t| 类型\t| 说明 |\n            | -- | -- | -- |\n            | position\t| 整数\t| 源图中检测到的人脸下标（例如 0、1、2）。\n            | index\t| 整数\t| 参考图人脸下标。目前只支持第一张检测到的人脸，因此该值必须为 0。\n            \n        * 规则\n          * 单脸替换：单次请求只能把一张源图人脸映射到一张参考图人脸。\n          * 跳过某张脸：把 index 与 position 都设为 -1。\n          * 参考图人脸下标：参考图只支持检测到的第一张脸，因此 index 始终为 0。\n            \n        * 示例\n\n            场景\n            * 参考图：1 张含单张受支持人脸的图片。\n            * 源图：检测到 4 张脸（Face 0、Face 1、Face 2、Face 3）。\n            * 目标：只替换 Face 2，Face 0、Face 1、Face 3 保持不动。\n            ```\n                \"face_mapping\": [\n                    {\n                        \"index\": -1, // Skip replacing\n                        \"position\": -1 // Skip replacing\n                    },\n                    {\n                        \"index\": -1, // Skip replacing\n                        \"position\": -1 // Skip replacing\n                    },\n                    {\n                        \"index\": 0, // Always use the first reference image\n                        \"position\": 2 // Apply to the third detected face in source\n                    },\n                    {\n                        \"index\": -1, // Skip replacing\n                        \"position\": -1 // Skip replacing\n                    },\n                ]\n            ```\n        1. 发送主任务请求：\n\n        ```\n        POST https://yce-api-01.makeupar.com/s2s/v2.0/task/retake\n        Authorization: Bearer YOUR_API_KEY\n        Content-Type: application/json\n        ```\n\n        Body：\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\": -1, \"position\": -1},\n                    {\"index\": -1, \"position\": -1},\n                    {\"index\":  0, \"position\":  2},\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/retake?task_id=TASK_ID\n        ```\n        2. 当 `status` 为 `success` 时，响应中包含生成图片的 URL。\n        3. 从该 URL 下载或展示图片。\n\n---\n\n   * 第 5 步：接入您的平台\n\n        * 在**网页前端**，可以直接用 JavaScript 的 fetch 或 Axios 实现。\n        * 在**后端**（Node.js、Python、Java、PHP 等），用标准 HTTP 库调用同样的接口即可。\n        * 任务是异步执行的，请实现重试与错误处理。\n\n---\n\n    * 排障指引\n\n        1. **为什么源图里有些脸没被检测到**\n            </br>**原因：** 理由：人脸必须清楚可见、没有被覆盖或遮挡，且在图片中足够大\n            </br>**解决办法：** 重新拍一张照片，让脸部更大、清楚可见，没有任何遮盖或遮挡\n\n---\n\n## 输入与输出\n\n* 实际案例：\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2025-01-14/9aeab2bb-28aa-48f5-ab86-2edd897ad908.jpg)\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2025-07-02/webp_0196a9d4-1430-4121-9680-5e81b58b66ac.webp)\n\n\n## 文件规格与错误码\n* 支持的格式与尺寸\n\n| AI 功能 | 支持尺寸 | 支持文件大小 | 支持格式 |\n| ---- | ---- | ---- | ---- |\n| AI 换脸（Retake） | 输入与输出：长边不得超过 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 | 为避免生成不适宜内容，重试次数已超限 |\n| error_upload | 上传结果图片出错 |\n| error_multiple_people | 人数超出上限 |\n| error_no_shoulder | 源图中看不到肩部 |\n| error_large_face_angle | 上传图片中的脸部角度过大 |\n| error_unsupport_ratio | 输入图片的宽高比不受支持 |\n| error_change_too_many_faces | 单次请求只支持替换一张脸。所有非目标的人脸都必须设为 {\"index\": -1, \"position\": -1}。尝试替换超过一张脸就会返回该错误。 |\n| unknown_internal_error | 其他内部错误 |\n\n---\n\n## 点数消耗\n\n| AI 功能 | 消耗点数 |\n|---|---|\n| AI 换脸（Retake）V2.0 | 1 |\n\n---\n"}},"baseSlug":"/zh-cn/reference/ai_retake","routesMapping":{}}