Image Generation (Sync)
Seedream synchronous text-to-image and image-to-image API
Text to Image
This page covers the Doubao plugin's synchronous OpenAI Images API. For submit-and-poll usage see Image Generation (Async) and Query Result in this section; the separate async adaptor supports different models and parameters. The completed images are returned in data; no asynchronous task polling is required.
Supported models
doubao-seedream-5-0-pro-260628doubao-seedream-5-0-flash-260915doubao-seedream-5-0-lite-260128doubao-seedream-5-0-260128doubao-seedream-4-5-251128doubao-seedream-4-0-250828
| Model | Presets | Custom pixel area | Sequential | Layers | Output format | Tools | Fast prompt |
|---|---|---|---|---|---|---|---|
| Seedream 5.0 Pro | 1K, 1.5K, 2K | 921600–4624220 | No | Yes | png, jpeg | No | Yes |
| Seedream 5.0 Flash | 1K, 1.5K, 2K | 921600–4624220 | No | Yes | png, jpeg | No | No |
| Seedream 5.0 Lite / 5.0 | 2K, 3K, 4K | 3686400–16777216 | Yes | No | png, jpeg | Yes | No |
| Seedream 4.5 | 2K, 4K | 3686400–16777216 | Yes | No | No | No | No |
| Seedream 4.0 | 1K, 2K, 4K | 921600–16777216 | Yes | No | No | No | Yes |
Custom dimensions are widthxheight (also X, ×, *), with positive integer sides and aspect ratio from 1:16 to 16:1. Presets are case-insensitive. Omitted size is estimated as 2K but not inserted into the upstream request; the actual output depends on the provider. auto is only valid for layer decomposition on the edit endpoint.
JSON parameters
| Field | Values and restrictions |
|---|---|
model | Required. One of the six registered models above, subject to channel configuration. |
prompt | Required nonempty string. |
size | A preset from this model's row, or dimensions within its pixel and aspect-ratio limits. |
n | Only 1; not used for multiple outputs. |
sequential_image_generation | auto or disabled, only on models with sequential support. |
sequential_image_generation_options.max_images | Integer 1–15; maximum requested, not a guaranteed output count. |
seed / guidance_scale | Integer / finite number; upstream may apply further limits. |
watermark / optimize_prompt | Boolean flags. |
optimize_prompt_options.mode | standard or fast; fast only for 5.0 Pro and 4.0. The options object can also be null. |
output_format | png or jpeg, only for 5.0-series models. |
background | opaque or transparent. For 5.0 Pro / Flash, transparent requires exactly one reference image and cannot be combined with JPEG, so it is unavailable for text-only generation on these models. Other models forward it; upstream decides whether it works. |
tools | Only for 5.0 / 5.0 Lite: array of objects with nonempty string type; specific tool support depends on upstream. |
response_format | url or b64_json. For Base64 the gateway attempts to download and add it to URL results; downloads can fail, leaving only URLs. |
stream | Omit or set to false; streaming is unsupported. |
layer_decomposition: true requires exactly one reference image and cannot be used here. This OpenAI Images endpoint forwards only its known fields; do not assume unknown fields reach upstream.
Authorization
BearerAuth
使用 OmwAI API Key 认证
In: header
Request Body
application/json
Seedream 模型
"doubao-seedream-5-0-pro-260628" | "doubao-seedream-5-0-flash-260915" | "doubao-seedream-5-0-lite-260128" | "doubao-seedream-5-0-260128" | "doubao-seedream-4-5-251128" | "doubao-seedream-4-0-250828"图片生成提示词
1 <= length模型对应预设(见页面能力表),或正整数宽x高:宽高比 1:16–16:1,像素数按模型限制;auto 仅用于图层拆分。省略时普通生成按 2K、图层拆分按 auto 预估,但不补写上游参数。
兼容参数,Seedream 仅允许 1
11url 或 b64_json;后者由网关尝试下载 URL 后添加 Base64,下载失败可能仅有 URL
"url""url" | "b64_json"当前接口不支持流式响应
falsefalse整数,其他约束由上游决定
有限数字,其他约束由上游决定
是否添加水印
是否优化提示词
对象或 null;mode=standard,fast 仅 Seedream 5.0 Pro 和 4.0 支持
auto(组图)或 disabled;仅 Seedream 5.0、5.0 Lite、4.5、4.0 支持。参考图加预估输出图最多 15 张。
"auto" | "disabled"上游生成格式 png/jpeg;仅 5.0 Pro、5.0 Flash、5.0 Lite、5.0 支持
"png" | "jpeg"opaque/transparent;5.0 Pro/Flash 使用 transparent 时必须有且仅有一张参考图,且不可和 jpeg 同时使用;其他模型交由上游决定
"opaque" | "transparent"仅 5.0 和 5.0 Lite:对象数组,每项 type 必须为非空字符串;具体工具类型取决于上游
Response Body
application/json
curl -X POST "https://www.omwai.xyz/v1/images/generations" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedream-5-0-pro-260628", "prompt": "一只橘猫坐在雨后的霓虹街道旁,电影感摄影", "size": "2K", "response_format": "url", "watermark": false }'{
"created": 0,
"data": [
{
"url": "http://example.com",
"b64_json": "string"
}
]
}Image to Image
This page covers the Doubao plugin's synchronous image-to-image endpoint POST /v1/images/edits. For async reference-image generation, use Image Generation (Async) in this section; its adaptor has different model and parameter support. Reference images may be supplied through the JSON image field as public HTTP(S) URLs or Base64 data URIs with a lowercase MIME format. Multipart requests may upload image, image[], or image[n] file fields.
Parameters and available options
The six registered models, their presets, custom pixel limits, output formats, tools and prompt optimization support are listed in the Text to Image section above.
| Field | Values and restrictions |
|---|---|
model | Required registered Seedream model available on your channel. |
image | Required single string or array of HTTP(S) URLs or lowercase-MIME data:image/<format>;base64,... strings. Up to 10 references for 5.0 Pro / Flash, 14 for other listed models. Use file fields for multipart. |
prompt | Required nonempty string for ordinary edits. May be omitted only for layer decomposition; when supplied must be a string. |
size | Model-specific presets or dimensions as on the generation page. For layers: 1K, 1.5K, 2K, auto; no custom dimensions. Omission is estimated as auto. |
layer_decomposition | Boolean, only 5.0 Pro / Flash; true requires exactly one input image. |
sequential_image_generation | auto or disabled, only 5.0 / 5.0 Lite / 4.5 / 4.0; with auto, references plus generated images are estimated to total at most 15. |
sequential_image_generation_options.max_images | Integer 1–15; requested upper bound, not guaranteed output count. |
n / stream | Only 1 / false, respectively. |
response_format | url or b64_json; gateway attempts to download URL images and append Base64 for the latter. Downloads may fail, leaving only URLs. |
output_format | png / jpeg, only 5.0-series models; distinct from response_format. |
background | opaque / transparent. On 5.0 Pro / Flash, transparent requires exactly one input image and cannot be combined with JPEG; otherwise forwarded for upstream handling. |
optimize_prompt_options.mode | standard / fast, fast only on 5.0 Pro / 4.0; optimize_prompt is a boolean. |
watermark, seed, guidance_scale | Boolean, integer, finite number respectively; upstream may impose additional limits. |
tools | Only 5.0 / 5.0 Lite; array of objects each containing a nonempty string type. Particular tool types depend on upstream. |
mask | Unsupported on this plugin's OpenAI Images protocol; requests are rejected. |
Multipart file fields may be image, image[], or image[n], up to 30 MiB per file. Other form fields may appear only once; n, seed, and guidance_scale are parsed as numbers; stream, watermark, optimize_prompt, and layer_decomposition use true / false. Send optimize_prompt_options, sequential_image_generation_options, and tools as JSON strings. Repeat image file fields for multiple files, not ordinary fields. Results are synchronous; there is no task-query step.
Authorization
BearerAuth
使用 OmwAI API Key 认证
In: header
"doubao-seedream-5-0-pro-260628" | "doubao-seedream-5-0-flash-260915" | "doubao-seedream-5-0-lite-260128" | "doubao-seedream-5-0-260128" | "doubao-seedream-4-5-251128" | "doubao-seedream-4-0-250828"普通图生图必填非空字符串;图层拆分允许省略
必填:HTTP(S) URL 或小写 MIME 的 data:image/;base64,...;单图用字符串,多图用数组。5.0 Pro/Flash 最多 10 张,其他已列模型最多 14 张
模型对应预设(见页面能力表),或正整数宽x高:宽高比 1:16–16:1,像素数按模型限制;auto 仅用于图层拆分。省略时普通生成按 2K、图层拆分按 auto 预估,但不补写上游参数。
11url 或 b64_json;后者由网关尝试下载 URL 后添加 Base64,下载失败可能仅有 URL
"url""url" | "b64_json"falsefalse整数,其他约束由上游决定
有限数字,其他约束由上游决定
对象或 null;mode=standard,fast 仅 Seedream 5.0 Pro 和 4.0 支持
auto(组图)或 disabled;仅 Seedream 5.0、5.0 Lite、4.5、4.0 支持。参考图加预估输出图最多 15 张。
"auto" | "disabled"仅 Seedream 5.0 Pro/Flash 支持;true 时恰好 1 张参考图,size 仅 1K/1.5K/2K/auto,不能自定义宽高
上游生成格式 png/jpeg;仅 5.0 Pro、5.0 Flash、5.0 Lite、5.0 支持
"png" | "jpeg"opaque/transparent;5.0 Pro/Flash 使用 transparent 时必须有且仅有一张参考图,且不可和 jpeg 同时使用;其他模型交由上游决定
"opaque" | "transparent"仅 5.0 和 5.0 Lite:对象数组,每项 type 必须为非空字符串;具体工具类型取决于上游
Response Body
application/json
curl -X POST "https://www.omwai.xyz/v1/images/edits" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedream-5-0-pro-260628", "prompt": "保留主体,将背景替换为日落时的海边", "image": "https://example.com/reference.png", "size": "2K", "response_format": "url" }'{
"created": 0,
"data": [
{
"url": "http://example.com",
"b64_json": "string"
}
]
}How is this guide?
Last updated on