# Doubao Seedream image API: size, image sets, editing parameters and errors Source: https://ofox.ai/docs/develop/models/seedream 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 **Key point**:5.0 Pro generates one image per request and supports 1K to 2K; image sets and 4K are available on 5.0 Lite and 4.5. - **Seedream 5.0 Pro**(Flagship): Supports 1K sizes; No image sets and no 4k preset — doubao-seedream-5.0-pro - **Seedream 5.0 Lite**: Supports image sets and 4K; Minimum 2K — doubao-seedream-5.0-lite - **Seedream 4.5**(Previous gen): Supports image sets and n for multiple images; Minimum 2K — doubao-seedream-4.5 **Model IDs (copy them exactly)** - 5.0 Pro: `volcengine/doubao-seedream-5.0-pro` — Flagship; supports 1K For live prices, see the [model page](https://ofox.ai/models/volcengine/doubao-seedream-5.0-pro). ## Text to image **Python** ```python filename="seedream.py" 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)) ``` **cURL** ```bash filename="Terminal" curl https://api.ofox.ai/v1/images/generations \ --max-time 600 \ -H "Authorization: Bearer $OFOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "volcengine/doubao-seedream-5.0-pro", "prompt": "A red apple on a white table", "size": "2560x1440" }' | jq -r '.data[0].b64_json' | base64 --decode > output.jpg ``` 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`) **Key point**:4.5 and 5.0 Lite have a 2K minimum (3,686,400 pixels); both `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, `2k` on 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. | | 5.0 Pro | 5.0 Lite | 4.5 | |---|---|---|---| | Minimum pixels | 921,600 (e.g. 1280×720) | 3,686,400 (e.g. 2560×1440) | 3,686,400 | | Maximum pixels | — | — | 16,777,216 (4096×4096) | | `1k` | Supported; measured 1152×864 | Not supported | Not supported | | `2k` | Supported | Supported | Supported | | `4k` | Not supported | Supported; measured 4096×4096 | Supported | | `size` omitted | Measured 2368×1776 | — | — | "—" means not measured in this round; refer to the [Volcano Engine Ark official docs](https://www.volcengine.com/docs/82379). **Commonly used valid sizes** (meeting the minimum for 4.5 and 5.0 Lite): | Aspect ratio | Size | |---|---| | 1:1 | `2048x2048` | | 16:9 | `2560x1440` | | 9:16 | `1440x2560` | | 4:3 | `2304x1728` | | 3:4 | `1728x2304` | ## Image editing & multiple reference images **Key point**:Reference images go in the `image` field, not `input_images`; `/v1/images/edits` is not supported. **Python** ```python filename="seedream_edit.py" 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)) ``` **cURL** ```bash filename="Terminal" # The base64 is long; putting it straight on the command line fails with # "Argument list too long", so write it to a file first printf 'data:image/jpeg;base64,%s' "$(base64 < apple.jpg | tr -d '\n')" > apple.b64 jq -n --rawfile img apple.b64 '{ model: "volcengine/doubao-seedream-5.0-pro", prompt: "Make the apple purple, keep everything else the same", size: "2k", image: [$img] }' > body.json curl https://api.ofox.ai/v1/images/generations \ --max-time 600 \ -H "Authorization: Bearer $OFOX_API_KEY" \ -H "Content-Type: application/json" \ -d @body.json | jq -r '.data[0].b64_json' | base64 --decode > apple_purple.jpg ``` - `image` is an array; each item is an image URL or a string starting with `data:image/...;base64,`. Put multiple reference images into the array in order, and describe the role of each image in the prompt. - `input_images` is a Qwen-Image-only field; Seedream does not support it. - Seedream does not support `/v1/images/edits`; to edit images, use the `image` field described in this section. ## Image sets & multiple images **Key point**:5.0 Lite and 4.5 can return several images per request; 5.0 Pro generates only one image per request. | Request | 5.0 Pro | 5.0 Lite | 4.5 | |---|---|---|---| | `n: 2` | Returns 400 | — | Measured: returns 2 images | | `sequential_image_generation: "auto"` | Returns 400 | Measured: returns 3 images | Measured: returns only 1 image | Image set example: ```json { "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 } } ``` - `auto` means **the model decides** how many images to generate; `max_images` is 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_tokens` is 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 **Key point**:Size errors are the most common; check the pixel count in the error message first. | Error message (excerpt) | Cause | Fix | |---|---|---| | `image size must be at least 3686400 pixels` | Size below 2K on 4.5 or 5.0 Lite | Use `2k`, `2560x1440` or similar; see [Size](#size) | | `image area must be at least 921600 pixels` | Size below 1280×720 on 5.0 Pro | Increase the size | | `image size must be at most 16777216 pixels` | Larger than 4096×4096 | Reduce the size | | `the specified size is not supported for model doubao-seedream-4-5` | `1k` sent to 4.5 | Use `2k` or `4k` | | `must be 'WIDTHxHEIGHT' or a supported size preset` | `4k` sent to 5.0 Pro | Use `2k` or exact dimensions | | `size must be one of 'WIDTHxHEIGHT', '1k', '2k', or '4k'` | An invalid value such as `8K` or `2048` | Use one of those four forms | | `the parameter sequential_image_generation is not supported by the current model` | `n` or image set parameters sent to 5.0 Pro | Remove `n`; for multiple images, send several requests concurrently | | `the parameter output_format is not supported by the current model` | `output_format` was sent | Remove it; the output format is always JPEG | | `does not support the /v1/images/edits endpoint` | The edit endpoint was called | Use the [image field](#edit) on `/v1/images/generations` | | Reference image has no effect | `input_images` was used | Use `image` | 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 ```text 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. - [Volcano Engine Ark documentation](https://www.volcengine.com/docs/82379) ## 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.