Seedream (Doubao) family
ByteDance’s Doubao image models, three in total, called through the OpenAI-compatible endpoint /v1/images/generations; both text to image and editing use this endpoint.
Choosing a model
- Supports 1K sizes
- No image sets and no 4k preset
- Supports image sets and 4K
- Minimum 2K
- Supports image sets and n for multiple images
- Minimum 2K
volcengine/doubao-seedream-5.0-proFlagship; supports 1KFor live prices, see the model page .
Text to image
Python
import base64
from openai import OpenAI
client = OpenAI(api_key="YOUR_OFOX_API_KEY", base_url="https://api.ofox.ai/v1", timeout=600)
resp = client.images.generate(
model="volcengine/doubao-seedream-5.0-pro",
prompt="A red apple on a white table",
size="2560x1440",
)
with open("output.jpg", "wb") as f:
f.write(base64.b64decode(resp.data[0].b64_json))The output format is always JPEG, so save files with a .jpg extension. Base64 is returned by default; pass "response_format": "url" to get an image link instead.
Size (size)
1k and 1024×1024 are rejected.size accepts two forms:
- Resolution presets
1k,2k,4k(case-insensitive): these set only the resolution, and the model chooses the aspect ratio based on the prompt. In our tests,2kon 4.5 produced both 2048×2048 and 1664×2496. - Exact dimensions
WIDTHxHEIGHT: a fixed aspect ratio, which must fall within the pixel range in the table below.
”—” means not measured in this round; refer to the Volcano Engine Ark official docs .
Commonly used valid sizes (meeting the minimum for 4.5 and 5.0 Lite):
Image editing & multiple reference images
image field, not input_images; /v1/images/edits is not supported.Python
import base64
from openai import OpenAI
client = OpenAI(api_key="YOUR_OFOX_API_KEY", base_url="https://api.ofox.ai/v1", timeout=600)
with open("apple.jpg", "rb") as f:
ref = "data:image/jpeg;base64," + base64.b64encode(f.read()).decode()
resp = client.images.generate(
model="volcengine/doubao-seedream-5.0-pro",
prompt="Make the apple purple, keep everything else the same",
size="2k",
extra_body={"image": [ref]},
)
with open("apple_purple.jpg", "wb") as f:
f.write(base64.b64decode(resp.data[0].b64_json))imageis an array; each item is an image URL or a string starting withdata:image/...;base64,. Put multiple reference images into the array in order, and describe the role of each image in the prompt.input_imagesis a Qwen-Image-only field; Seedream does not support it.- Seedream does not support
/v1/images/edits; to edit images, use theimagefield described in this section.
Image sets & multiple images
Image set example:
{
"model": "volcengine/doubao-seedream-5.0-lite",
"prompt": "Generate 3 separate images: the same fox in spring, summer and autumn",
"size": "2k",
"sequential_image_generation": "auto",
"sequential_image_generation_options": { "max_images": 3 }
}automeans the model decides how many images to generate;max_imagesis only an upper limit. In our tests, with the same request 4.5 combined a three-panel comic into a single image and returned just 1. If you need a fixed number, state “generate N separate images” explicitly in the prompt.- Each image is billed separately;
usage.output_tokensis the total across all images.
Watermarks
In our tests, calls through OfoxAI have no watermark by default; no extra parameter is needed.
Latency
We measured about 12 to 40 seconds at 2K, and about 76 seconds for a set of 3 images. Set the client timeout to 300 seconds or more.
Common errors
The Request id: 0217… at the end of an error message is the upstream request ID; when contacting support, include it together with the request_id from the response.
Exact error messages
The parameter `size` specified in the request is not valid: image size must be at least 3686400 pixels.
The parameter `size` specified in the request are not valid: image area must be at least 921600 pixels.
The parameter `size` specified in the request is not valid: image size must be at most 16777216 pixels.
The parameter `size` specified in the request is not valid: the specified size is not supported for model doubao-seedream-4-5.
The parameter `size` specified in the request are not valid: must be 'WIDTHxHEIGHT' or a supported size preset.
The parameter `size` specified in the request is not valid: size must be one of 'WIDTHxHEIGHT', '1k', '2k', or '4k'.
The parameter `sequential_image_generation` specified in the request are not valid: the parameter `sequential_image_generation` is not supported by the current model.
The parameter `output_format` specified in the request is not valid: the parameter `output_format` is not supported by the current model.Official docs
The official docs describe behavior when calling Volcano Engine Ark directly; when calling through OfoxAI, the measured results on this page take precedence.
FAQ
How do I fix the Seedream error image size must be at least 3686400 pixels?
The minimum size for Seedream 4.5 and 5.0 Lite is 2K, i.e. 3,686,400 pixels; neither 1024x1024 nor 1k meets it. Use 2k, or dimensions such as 2048x2048, 2560x1440 or 1440x2560. For smaller sizes, use 5.0 Pro, whose minimum is 921,600 pixels (1280x720) and which also supports 1k.
How do I edit images with Seedream? Why does input_images have no effect?
The Seedream reference image field is image (an array; each item is an image URL or base64 starting with data:image), not input_images, which is a Qwen-Image field. Also, Seedream does not support /v1/images/edits; editing uses /v1/images/generations as well.
How do I generate several images at once with Seedream image sets?
Pass sequential_image_generation: "auto" and sequential_image_generation_options.max_images. auto means the model decides how many images to generate and max_images is the upper limit; stating "generate N separate images" in the prompt is more reliable. Supported by 5.0 Lite and 4.5, not by 5.0 Pro.
Why does passing n to Seedream 5.0 Pro return sequential_image_generation is not supported?
5.0 Pro cannot generate several images at once, and both n and the image set parameters return this error. Remove n; for multiple images, send several requests concurrently.
Do Seedream images have a watermark?
In our tests, calls through OfoxAI have no watermark by default; no extra parameter is needed.
Can Seedream output PNG?
No, the output is always JPEG. Sending output_format returns 400; just remove the parameter.
Why is the aspect ratio not fixed when I pass size 2k to Seedream?
1k, 2k and 4k set only the resolution; the model chooses the aspect ratio based on the prompt. For a fixed ratio, pass exact dimensions such as 2560x1440.