Submit Async Image Generation Task
Submit an image generation task and receive a task ID. Poll the GET endpoint to check status and retrieve results.
Recommended for models with long generation times (typically 30+ seconds).
Supported models: gpt-image-2
Reference images (image-to-image): Pass a reference image via image (single URL/Base64) or images (array of URLs/Base64 strings) to enable image-to-image mode. input_reference is an alias for image — use either one.
Authorization
BearerAuth
使用 Bearer Token 认证。
格式: Authorization: Bearer sk-xxxxxx
In: header
Request Body
application/json
模型名称。
gpt-image-2
| 模型 ID | 说明 |
|---|---|
gpt-image-2 | OpenAI GPT Image 2 |
豆包 Seedream 系列
| 模型 ID | 说明 |
|---|---|
doubao-seedream-3-0-t2i-250415 | Seedream 3.0 |
doubao-seedream-4-5-t2i-250505 | Seedream 4.5 |
doubao-seedream-4-5-251128 | Seedream 4.5(增强版) |
doubao-seedream-5-0-t2i-250804 | Seedream 5.0 |
Gemini 系列
| 模型 ID | 系列名 | 说明 |
|---|---|---|
gemini-2.5-flash-image | Nano Banana | Gemini 2.5 Flash Image |
gemini-3-pro-image | Nano Banana Pro | Gemini 3 Pro Image |
gemini-3.1-flash-image | Nano Banana 2 | Gemini 3.1 Flash Image |
Kling 系列
| 模型 ID | 说明 |
|---|---|
kling-image-2.1 | Kling Image 2.1 |
kling-image-3.0 | Kling Image 3.0 |
kling-image-3.0-omni | Kling Image 3.0 Omni,支持 auto 宽高比 |
kling-image-o1 | Kling Image O1,支持 auto 宽高比 |
kling-image-scene | Kling Image Scene,扩图模式,需配合 extra_fields.scene_type="image_expand" |
Vidu 系列
| 模型 ID | 说明 |
|---|---|
vidu-image-q2 | Vidu Q2 |
Qwen 系列
| 模型 ID | 说明 |
|---|---|
qwen-image-0925 | Qwen-Image-0925,通过 size 传自定义像素尺寸 |
Hunyuan 系列
| 模型 ID | 说明 |
|---|---|
hunyuan-image-3.0 | Hunyuan 3.0,通过 size 传自定义像素尺寸;支持全景图模式 |
图像描述提示词
参考图(单张)的 URL 或 Base64 字符串。与 images 等价,二者同时传时以 images 为准。传入后默认触发图生图(image-to-image)模式。
参考图列表(支持多张)。每项为图片 URL 或 Base64 字符串。传入后默认触发图生图(image-to-image)模式。
各模型参考图数量上限(超出将被自动截断):
| 模型 | 最多参考图数 |
|---|---|
gemini-2.5-flash-image | 3 张 |
gemini-3-pro-image | 14 张 |
gemini-3.1-flash-image | 14 张 |
kling-image-2.1 | 4 张 |
kling-image-3.0 | 1 张 |
kling-image-3.0-omni | 10 张 |
kling-image-o1 | 10 张 |
kling-image-scene | 1 张(扩图原图) |
vidu-image-q2 | 7 张 |
qwen-image-0925 | 1 张 |
hunyuan-image-3.0 | 3 张 |
超出上限的图片将被自动截断。
图像尺寸。
Gemini(GG)系列:映射到宽高比(AspectRatio),不支持自定义像素尺寸。
- 直接传宽高比(推荐):
"1:1"、"16:9"、"9:16"等 - 传像素尺寸:系统自动转换为最近邻宽高比,如
"1024x1024"→"1:1"
各版本支持的宽高比:GG 2.5/3.0 支持 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9;GG 3.1 额外支持 1:4, 1:8, 4:1, 8:1。
gpt-image-2:指定 宽x高,总像素数范围 655,360 – 8,294,400。
Kling 系列(除 scene):映射到宽高比(AspectRatio)。
支持:1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9;3.0-omni / o1 额外支持 auto。
kling-image-scene 扩图模式 size 参数无效,输出尺寸由扩图参数决定。
Vidu(vidu-image-q2):映射到宽高比。支持:1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9。
Qwen(qwen-image-0925):指定 宽x高,总像素范围 261,632 – 4,194,304(512×512 至 2048×2048)。
Hunyuan(hunyuan-image-3.0):指定 宽x高,宽高均在 [512, 2048] 内,且宽×高 ≤ 1,048,576。
图像质量 / 分辨率档位。各模型语义不同:
Gemini(GG)系列:映射到分辨率档位(Resolution)。
- 直接传档位(推荐):
1K、2K、4K;gemini-3.1-flash-image额外支持720P - 兼容标准值:
low/standard→1K,medium/hd/high→2K - 默认:
1K
gpt-image-2:low / standard → image2_low,medium → image2_medium,hd / high → image2_high。默认 standard(image2_low)。
Kling 系列(除 scene):映射到分辨率档位(小写)。
- 直接传档位(推荐):
1k、2k;3.0-omni/o1额外支持4k - 兼容标准值:
low/standard/medium→1k,hd/high→2k - 默认:
1k;kling-image-scene忽略此参数
Vidu(vidu-image-q2):映射到分辨率档位。
- 直接传档位(推荐):
1080p、2K、4K - 兼容标准值:
low/standard→1080p,medium/hd/high→2K - 默认:
1080p
Qwen / Hunyuan:不使用此参数(通过 size 传像素尺寸)。
其他模型:low、medium、standard、hd / high,默认 standard。
生成图像数量。默认 1。
豆包 Seedream 系列:n 映射为组图生成的 max_images(最多允许生成的张数上限),模型以 auto 模式根据 prompt 自主推理实际生成张数,最终张数 ≤ n。如需精确控制张数,建议在 prompt 中明确描述(如「生成 4 张不同风格的图片」)。支持范围 1-15。
Kling 系列:支持 1-9 张,超出自动截断。
OG(gpt-image-2):支持 1-8 张,超出自动截断。
其他模型(Gemini / Vidu / Qwen / Hunyuan 等):底层 API 不支持数量参数,n 字段传入后会被忽略,固定返回 1 张。
图像风格,如 vivid、natural。部分模型支持。
输出图像文件格式。不传时跟随模型默认值。
gpt-image-2 / Kling 系列:支持 jpeg / png。
豆包 Seedream 系列:支持 jpeg / png / webp;仅 doubao-seedream-5-0 系列支持。
其他模型:不支持,传入后忽略。
输出图像压缩质量(0-100),仅在 output_format 为 jpeg 或 webp 时有效。部分模型支持。
模型扩展参数,不支持的字段将被忽略。
| 参数 | 类型 | 支持模型 | 说明 |
|---|---|---|---|
negative_prompt | string | gpt-image-2、Gemini 系列、Kling 系列 | 反向提示词 |
seed | integer | gpt-image-2、Gemini 系列、Kling 系列 | 随机种子,控制生成结果可复现性 |
enhance_prompt | string | Gemini 系列 | 自动优化 prompt,取值 Enabled / Disabled |
scene_type | string | Kling scene、Hunyuan 3.0 | 场景类型:image_expand(Kling 扩图)/ 3d_panorama(Hunyuan 全景图) |
expansion | object | kling-image-scene | 扩图比例,配合 scene_type="image_expand" 使用,含 up / down / left / right,取值范围 [0, 2] |
Response Body
application/json
curl -X POST "https://loading/v1/image-tasks/submit" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2", "prompt": "一只橙色的猫坐在窗台上,背景是城市夜景" }'{
"id": "string",
"task_id": "string",
"status": "string",
"model": "string",
"created_at": 0
}Last updated on