Text to image
Text to image generates an image from a text prompt. A complete, specific prompt produces an image closer to what you want.
Models
| Model | Max resolution | Notes |
|---|---|---|
| doubao-seedream-5-0-260128 | 4096x4096 | Sequential images, multi-image fusion, and web search |
| doubao-seedream-5-0-pro-260628 | 2048x2048 | Higher fidelity, interactive editing, and layer splitting |
Request parameters
| Parameter | Description | Required | Type |
|---|---|---|---|
| model | Model ID | Yes | String |
| prompt | Text description. Describe the subject, details, and scene. | Yes | String |
| size | Resolution tier, or pixel size as widthxheight | No | String |
| response_format | url or b64_json | No | String |
| watermark | Whether to add a watermark | No | Boolean |
Writing a prompt
A useful prompt usually includes:
- Subject: the main object in the frame
- Details: color, material, texture
- Setting: time, place, mood
- Style: art style, photographic style
- Composition: angle, focal length, depth of field
Example:
A cute kitten playing in a garden, bright sunlight, vivid colors, watercolor stylesize values
Use one method. Do not mix them.
Option 1: resolution tier (recommended). Describe aspect ratio, shape, or use in the prompt and let the model pick the exact size.
| Model | Tiers | Default |
|---|---|---|
| doubao-seedream-5-0-260128 | 2K, 3K, 4K | 2K |
| doubao-seedream-5-0-pro-260628 | 1K, 1.5K, 2K | 2K |
Option 2: pixel size (widthxheight). The total pixel count and the aspect ratio must both fall in [1/16, 16].
| Model | Total pixel range | Default |
|---|---|---|
| doubao-seedream-5-0-260128 | [2560x1440, 4096x4096] | 2048x2048 |
| doubao-seedream-5-0-pro-260628 | [1280x720, 2048x2048×1.1025] | 2K |
Reference sizes for doubao-seedream-5-0-260128:
| Tier | 1:1 | 16:9 | 9:16 | 4:3 | 3:4 |
|---|---|---|---|---|---|
| 2K | 2048x2048 | 2848x1600 | 1600x2848 | 2304x1728 | 1728x2304 |
| 4K | 4096x4096 | 5504x3040 | 3040x5504 | 4704x3520 | 3520x4704 |
Pixel sizes for each tier of doubao-seedream-5-0-pro-260628 differ slightly. Follow the official Doubao documentation.
Examples
doubao-seedream-5-0-260128
bash
curl -X POST https://api-ai.xiaoku.ai/doubao/api/v3/images/generations \
-H "Authorization: Bearer XIAOKU_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5-0-260128",
"prompt": "A bamboo grove in the rain, a winding path, mist, fresh and natural",
"size": "2K",
"watermark": false
}'doubao-seedream-5-0-pro-260628 (high fidelity)
bash
curl -X POST https://api-ai.xiaoku.ai/doubao/api/v3/images/generations \
-H "Authorization: Bearer XIAOKU_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5-0-pro-260628",
"prompt": "A fine landscape oil painting, a mountain stream, snow peaks in the distance, mist, sunlight breaking through clouds onto the water",
"size": "2K",
"watermark": false
}'Response
json
{
"model": "doubao-seedream-5-0-260128",
"created": 1757321139,
"data": [
{
"url": "https://api-ai.xiaoku.ai/images/xxx.jpg",
"size": "2048x2048"
}
],
"usage": {
"generated_images": 1
}
}Notes
- Keep prompts under 300 Chinese characters or 600 English words
- Image URLs expire after 24 hours. Save them promptly.
