异步图片接口
提交
章节:提交POST /v1/image/generationsAuthorization: Bearer sk-your-api-keyContent-Type: application/json路径为单数 image。无论有没有参考图,都调用同一个异步端点。
本页通用参数表针对 Seedream、GPT Image 2 和 Nano Banana。Midjourney / Niji 复用同一接口,但使用独立参数契约,见 Midjourney 章节。
| 字段 | 类型 | 说明 |
|---|---|---|
model | string,必填 | 公开模型 ID |
prompt | string,必填 | 非空提示词或图片编辑指令 |
images | string[] | 可选参考图;非空时自动进入编辑 |
image_urls | string[] | images 的兼容别名;两者不要同时使用 |
aspect_ratio | string | 比例,枚举或格式依模型而定 |
resolution | string | 分辨率档位,依模型而定 |
size | string | 仅支持自定义尺寸的模型使用,如 1536x1024 |
output_format | string | 输出格式,依模型而定 |
Seedream、GPT Image 2 和 Nano Banana 每个任务生成一张。GPT Image 2 和 Nano Banana 的 n 必须为 1;Seedream 不提供批量 n 参数。MJ 的 n=1 表示一组任务,可能返回多张,必须遍历 outputs。
参数不要跨模型照搬
章节:参数不要跨模型照搬| 模型 | 参考图上限 | 分辨率 | 自定义尺寸 | 专属选项 |
|---|---|---|---|---|
| Seedream 5 Pro EP | 10 | 1K / 2K | 不支持 | 无 quality / moderation |
| GPT Image 2(default) | 16 | auto / 1K / 2K / 4K | 支持 | quality、moderation |
| Nano Banana 2 / Pro(default) | 14 | 1K / 2K | 支持 | 不使用 GPT 的质量枚举 |
带参考图不需要为模型 ID 添加 -edit 后缀。没有参考图是文生图,有参考图是编辑。
{ "model": "dola-seedream-5-0-pro-ep", "prompt": "A quiet futuristic city after rain, cinematic lighting, no text.", "aspect_ratio": "16:9", "resolution": "2k", "output_format": "png"}查询
章节:查询GET /v1/image/generations/{task_id}Authorization: Bearer sk-your-api-key响应为 image.generation.task,状态与视频相同。成功结果位于 outputs[].url,不返回同步图片接口的 data[].b64_json。
operation: "generate" 或 "edit" 反映实际操作。不要在任务尚未 completed 时仅根据输出字段存在就停止查询。
模型章节
章节:模型章节- Seedream 5 Pro
- GPT Image 2
- Nano Banana 2 / Pro
- Midjourney / Niji:多结果、风格参考、变体、放大和图转提示词。
