Docs/AngeMedia

图片生成与编辑

先用文生图验证 Provider;参考图和蒙版任务应逐步增加输入,便于定位失败字段。

Text to imageImage to imageMask

调用入口

POST /v1/images/generations
Authorization: Bearer <GATEWAY_API_KEY>

文生图

curl -X POST http://localhost:9890/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_GATEWAY_KEY" \
  -d '{
    "model": "agnes-2.1",
    "prompt": "minimal product photo, soft natural light, clean background",
    "size": "1024x1024",
    "response_format": "url"
  }'

单图参考

{
  "model": "agnes-2.1",
  "prompt": "keep the subject and composition, change to a cinematic poster style",
  "image": "https://example.com/input.jpg",
  "strength": 0.55,
  "size": "1024x1024",
  "response_format": "url"
}

strength 越高,允许偏离原图的程度通常越大。先从中等值测试。

多图参考

{
  "model": "agnes-2.0",
  "prompt": "combine the clothing style from the first image with the scene from the second",
  "images": [
    "https://example.com/look.jpg",
    "https://example.com/scene.jpg"
  ],
  "size": "1024x1024"
}

局部编辑

{
  "model": "agnes-2.1",
  "prompt": "replace the selected area with white tulips and keep the original lighting",
  "image": "https://example.com/original.jpg",
  "mask": "https://example.com/mask.png",
  "size": "1024x1024"
}

输入建议