跳转到内容

执行 AI 图片生成器 V2(图生图)任务。

请求

AI 任务是异步处理的。功能支持 Webhook 时,优先用 Webhook 来接收完成通知。配置好您的 Webhook 端点、校验 Webhook 签名,收到 success 或 error 通知后,用收到的 task_id 查询任务结果。配置与校验的细节请见 Webhook 接入指南。

若功能不支持 Webhook,或您的接入方式用不了 Webhook,就请实现轮询。提交 AI 任务后,按固定间隔(例如每 10 秒)轮询状态接口,直到任务状态变为 success 或 error。

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

模型名称。

Value:"youcam-image-v2"
promptstring, [ 1 .. 800 ] characters必需

图片编辑指令(正向提示词),描述您希望在生成图片中出现的元素与视觉特征。
支持中英文,最长 800 字符,每个汉字或英文字母计 1 字符。

示例:"Make the girl from Image 1 wear the black dress from Image 2 and sit in the pose from Image 3. Keep her clothing, hairstyle, and expression unchanged
negative_promptstring, [ 1 .. 500 ] characters

反向提示词,描述您不希望出现在生成图片中的内容。
支持中英文,最长 500 字符,每个汉字或英文字母计 1 字符。

示例:"low resolution, error, worst quality, low quality, disfigured, extra fingers, bad proportions."
sizestring

以 width*height 格式指定输出图片分辨率,例如 "1024*1536"。
- 宽与高都须落在 [512, 2048] 像素之间。
- 默认总像素约为 1024*1024,宽高比接近输入图片(多图请求时以最后一张为准)。
指定 size 参数后,系统会以 size 给出的宽高为目标,把实际输出图片的宽高调整为最接近的 16 的倍数。例如指定 1033*1032,输出尺寸为 1040*1024。
常用宽高比的推荐分辨率:
- 1:1:1024*1024、1536*1536
- 2:3:768*1152、1024*1536
- 3:2:1152*768、1536*1024
- 3:4:960*1280、1080*1440
- 4:3:1280*960、1440*1080
- 9:16:720*1280、1080*1920
- 16:9:1280*720、1920*1080
- 21:9:1344*576、2048*872

示例:"1024*1024"
prompt_extendboolean

开启智能改写提示词。模型会优化正向提示词,不影响反向提示词。

默认值:true
Enum ValueDescription
true

Enables rewriting. Use this for more diverse image content; the model adds details.

false

Disables rewriting. Use this for tighter control over image details.

示例:true
src_file_urlsArray of strings, [ 1 .. 3 ] items必需

取自上传文件接口的文件 URL。请提供 src_file_urls 或 src_file_ids 二者之一。

示例:
[ "https://example.com/selfie.jpg", "https://example.com/selfie.jpg", "https://example.com/selfie.jpg" ]
curl -i -X POST \
  https://yce-api-01.makeupar.com/s2s/v2.0/task/image-to-image/youcam \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "src_file_urls": [
      "https://example.com/selfie.jpg",
      "https://example.com/selfie.jpg",
      "https://example.com/selfie.jpg"
    ],
    "model": "youcam-image-v2",
    "prompt": "Make the girl from Image 1 wear the black dress from Image 2 and sit in the pose from Image 3. Keep her clothing, hairstyle, and expression unchanged, and ensure the action is natural and smooth.",
    "negative_prompt": "low resolution, error, worst quality, low quality, disfigured, extra fingers, bad proportions.",
    "size": "1024*1024",
    "prompt_extend": true
  }'

响应

任务执行成功

正文application/json
statusinteger

响应状态

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