跳转到内容

V2.0

借助 AI 图片生成器 V2.0 接口,用文字提示词或现有图片即可即时生成高质量图像,视觉表现、细节与一致性都有明显提升。

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

请求

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

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

安全
BearerAuthenticationV2
正文application/json必需
modelstring必需

模型名称。

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

正向提示词,描述您想要的画面内容、风格与构图。
支持中英文,最长 800 字符。每个汉字、字母、数字、符号各计 1 字符。

示例:"A sitting orange cat with a joyful expression, lively and adorable, highly realistic."
negative_promptstring, [ 1 .. 500 ] characters

反向提示词,描述您不希望出现在画面中的内容。
支持中英文,最长 500 字符。

示例:"Low resolution, low quality, distorted limbs, malformed fingers, oversaturated colors, wax-like appearance, no facial details, overly smooth surfaces
sizestring

输出图片分辨率,格式为 width*height。
支持的分辨率及其宽高比:
- 1664*928(默认):16:9
- 1472*1104:4:3
- 1328*1328:1:1
- 1104*1472:3:4
- 928*1664:9:16

默认值:"1664*928"
Enum:"1664*928""1472*1104""1328*1328""1104*1472""928*1664"
示例:"1664*928"
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
curl -i -X POST \
  https://yce-api-01.makeupar.com/s2s/v2.0/task/text-to-image/youcam \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "youcam-image-v2",
    "prompt": "A sitting orange cat with a joyful expression, lively and adorable, highly realistic.",
    "negative_prompt": "Low resolution, low quality, distorted limbs, malformed fingers, oversaturated colors, wax-like appearance, no facial details, overly smooth surfaces, AI-generated look. Chaotic composition. Blurry or distorted text.",
    "size": "1664*928",
    "prompt_extend": true
  }'

响应

任务执行成功

正文application/json
statusinteger

响应状态

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