Skip to content

生图接口

GPT-Image-2

Base URL:

text
https://api.zmoapi.cn/v1

文生图:

bash
curl https://api.zmoapi.cn/v1/images/generations \
  -H "Authorization: Bearer 你的知梦 API Key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "一张高级电商宣传海报",
    "size": "1024x1024",
    "n": 1
  }'

图生图:

bash
curl https://api.zmoapi.cn/v1/images/edits \
  -H "Authorization: Bearer 你的知梦 API Key" \
  -F "model=gpt-image-2" \
  -F "prompt=保持主体不变,改成高级商业海报" \
  -F "image=@input.png" \
  -F "n=1"

Banana2 / Banana Pro

Base URL:

text
http://180.178.51.134:19073/v1

文生图:

bash
curl http://180.178.51.134:19073/v1/images/generations \
  -H "Authorization: Bearer 你的 Banana 专用对接 Key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "banana-pro-2k",
    "prompt": "一张高级商业广告海报",
    "aspectRatio": "16:9",
    "n": 1
  }'

图生图:

bash
curl http://180.178.51.134:19073/v1/images/edits \
  -H "Authorization: Bearer 你的 Banana 专用对接 Key" \
  -F "model=banana2-2k" \
  -F "prompt=保持主体不变,改成黑白高级摄影风格" \
  -F "aspectRatio=1:1" \
  -F "image=@input.png" \
  -F "n=1"

通用注意事项

  • 上传文件时让 curl -F 或 SDK 自动生成 multipart/form-data boundary。
  • 多图上传推荐重复使用 image[]
  • URL 参考图必须无需登录、未过期且可被服务端公网访问。
  • 生图客户端读取超时建议设置为 600 秒以上。
  • 只有最终返回 data[].urldata[].b64_json 才算成功。

知梦AI文档中心