跳转到内容

执行 AI 替换物件 任务。

请求

查询任务状态请参见轮询指南。本接口需要源图片、蒙版文件,以及描述蒙版区域要替换成什么的提示词。

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

用于在蒙版区域生成对象的提示词。

示例:"a cute cat"
src_file_urlstring必需

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

示例:"https://example.com/selfie.jpg"
msk_file_urlstring必需

蒙版文件的 URL。须为与输入图片宽高完全一致的灰度蒙版图, 白色像素表示前景,黑色像素表示背景。该 URL 需可公开访问。

示例:"https://example.com/mask.jpg"
curl -i -X POST \
  https://yce-api-01.makeupar.com/s2s/v2.0/task/obj-replace \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "src_file_url": "https://example.com/selfie.jpg",
    "msk_file_url": "https://example.com/mask.jpg",
    "prompt": "a cute cat"
  }'

响应

任务执行成功

正文application/json
statusinteger

响应状态

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