Skip to content

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 ​

ModelMax resolutionNotes
doubao-seedream-5-0-2601284096x4096Sequential images, multi-image fusion, and web search
doubao-seedream-5-0-pro-2606282048x2048Higher fidelity, interactive editing, and layer splitting

Request parameters ​

ParameterDescriptionRequiredType
modelModel IDYesString
promptText description. Describe the subject, details, and scene.YesString
sizeResolution tier, or pixel size as widthxheightNoString
response_formaturl or b64_jsonNoString
watermarkWhether to add a watermarkNoBoolean

Writing a prompt ​

A useful prompt usually includes:

  1. Subject: the main object in the frame
  2. Details: color, material, texture
  3. Setting: time, place, mood
  4. Style: art style, photographic style
  5. Composition: angle, focal length, depth of field

Example:

A cute kitten playing in a garden, bright sunlight, vivid colors, watercolor style

size 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.

ModelTiersDefault
doubao-seedream-5-0-2601282K, 3K, 4K2K
doubao-seedream-5-0-pro-2606281K, 1.5K, 2K2K

Option 2: pixel size (widthxheight). The total pixel count and the aspect ratio must both fall in [1/16, 16].

ModelTotal pixel rangeDefault
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:

Tier1:116:99:164:33:4
2K2048x20482848x16001600x28482304x17281728x2304
4K4096x40965504x30403040x55044704x35203520x4704

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 ​

  1. Keep prompts under 300 Chinese characters or 600 English words
  2. Image URLs expire after 24 hours. Save them promptly.