
"Seedream 4.0 API Tutorial: ByteDance's Image Generation Model for Developers"
ByteDance's Seedream 4.0 has quietly become one of the most capable image generation models available. While DALL-E 3 and Midjourney dominate the conversation, Seedream 4.0 offers competitive quality at significantly lower prices — and it excels in areas where others struggle, particularly text rendering in images and Chinese text generation.
This tutorial walks you through everything you need to start generating images with Seedream 4.0.
What Is Seedream 4.0?#
Seedream 4.0 is the fourth generation of ByteDance's image generation model, part of their "Seed" AI family. It powers image generation features across ByteDance's products (Douyin, TikTok, Jimeng) and is available via API.
Key capabilities:
- Photorealistic image generation from text prompts
- Superior text rendering — accurately renders text within images (English and Chinese)
- Multiple aspect ratios — square, portrait, landscape, and custom
- Style control — photorealistic, illustration, anime, 3D, watercolor, and more
- High resolution — up to 2048x2048 pixels
- Fast generation — typically under 10 seconds per image
- Inpainting and outpainting support
What Makes Seedream 4.0 Special?#
The standout feature is text rendering accuracy. If you've tried generating images with text using DALL-E 3 or Stable Diffusion, you know the pain of misspelled words and garbled characters. Seedream 4.0 handles this remarkably well:
- English text: ~95% accuracy for short phrases
- Chinese text: ~90% accuracy (best in class)
- Logos and signage: Consistent and readable
- Multi-line text: Properly formatted
This makes it ideal for generating marketing materials, social media graphics, and mockups that include text.
Getting Started#
Prerequisites#
You'll need an API key from a provider that offers Seedream 4.0. The easiest option for international developers is Crazyrouter:
- Sign up at crazyrouter.com
- Add credits to your account
- Get your API key from the dashboard
Python Setup#
pip install requests
# Or use the OpenAI SDK for compatible endpoints
pip install openai
Code Examples#
Basic Image Generation (Python)#
import requests
import json
API_KEY = "your-crazyrouter-key"
BASE_URL = "https://api.crazyrouter.com"
response = requests.post(
f"{BASE_URL}/v1/images/generations",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
},
json={
"model": "seedream-4.0",
"prompt": "A cozy coffee shop interior with warm lighting. A chalkboard menu on the wall reads 'Today's Special: Caramel Latte $4.50'. Wooden tables, plants, morning sunlight through windows.",
"size": "1024x1024",
"n": 1
}
)
result = response.json()
image_url = result["data"][0]["url"]
print(f"Image URL: {image_url}")
Using OpenAI SDK (Python)#
from openai import OpenAI
client = OpenAI(
api_key="your-crazyrouter-key",
base_url="https://api.crazyrouter.com/v1"
)
response = client.images.generate(
model="seedream-4.0",
prompt="Professional product photo of a minimalist watch on a marble surface. The watch face shows '10:10'. Soft studio lighting, shallow depth of field.",
size="1024x1024",
n=1
)
print(response.data[0].url)
Node.js Example#
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'your-crazyrouter-key',
baseURL: 'https://api.crazyrouter.com/v1'
});
const response = await client.images.generate({
model: 'seedream-4.0',
prompt: 'A tech startup office with a neon sign on the wall that reads "Build Fast, Ship Faster". Modern furniture, developers working at standing desks, large monitors.',
size: '1024x1024',
n: 1
});
console.log(response.data[0].url);
cURL#
curl -X POST https://api.crazyrouter.com/v1/images/generations \
-H "Authorization: Bearer your-crazyrouter-key" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-4.0",
"prompt": "Flat design illustration of a developer workflow. Icons for code, deploy, test, monitor arranged in a circle. Clean, modern style with blue and purple gradient.",
"size": "1024x1024",
"n": 1
}'
Batch Generation#
prompts = [
"App store screenshot: a fitness tracking app showing a weekly progress chart. Clean UI, dark mode.",
"App store screenshot: the same fitness app showing a workout timer. Minimalist design.",
"App store screenshot: the fitness app's social feed with friend activities.",
]
for i, prompt in enumerate(prompts):
response = client.images.generate(
model="seedream-4.0",
prompt=prompt,
size="1024x1792", # Portrait for app screenshots
n=1
)
print(f"Screenshot {i+1}: {response.data[0].url}")
Prompt Engineering for Seedream 4.0#
Text Rendering Tips#
For best text rendering results:
✅ Good: 'A poster with the text "SALE 50% OFF" in bold red letters'
✅ Good: 'A book cover with the title "The Art of Code" in serif font'
❌ Bad: 'A poster with some sale text on it'
❌ Bad: 'A book with a title' (too vague)
Rules for text in prompts:
- Put the exact text in quotes within the prompt
- Specify font style if important (bold, serif, handwritten)
- Specify color and placement
- Keep text short (1-5 words works best)
Style Control#
# Photorealistic
"A photorealistic portrait of a woman in a garden. Natural lighting, 85mm lens, shallow depth of field."
# Illustration
"A flat vector illustration of a city skyline at sunset. Geometric shapes, limited color palette, no gradients."
# Anime
"Anime-style illustration of a samurai standing on a cliff overlooking the ocean. Studio Ghibli inspired, soft colors."
# 3D Render
"3D rendered isometric view of a tiny room — a developer's desk with monitors, keyboard, coffee cup, and a cat sleeping on the chair."
Pricing Comparison#
| Model | Price per Image | Resolution | Text Rendering | Speed |
|---|---|---|---|---|
| Seedream 4.0 | ~$0.02-0.04 | Up to 2048x2048 | ⭐⭐⭐⭐⭐ | ~5-10s |
| DALL-E 3 | $0.04-0.08 | Up to 1024x1792 | ⭐⭐⭐⭐ | ~10-15s |
| Midjourney v6 | $0.01-0.03* | Up to 2048x2048 | ⭐⭐⭐ | ~30-60s |
| Stable Diffusion 3 | $0.03-0.06 | Up to 1024x1024 | ⭐⭐⭐ | ~5-10s |
| Ideogram 2.0 | $0.04-0.08 | Up to 1024x1024 | ⭐⭐⭐⭐⭐ | ~10-15s |
Midjourney pricing based on subscription plan usage.
Seedream 4.0 offers the best value when you factor in text rendering quality and price.
Seedream 4.0 via Crazyrouter vs Direct#
| Feature | Direct (Volcano Engine) | Crazyrouter |
|---|---|---|
| Signup | Chinese phone required | Email signup |
| Payment | CNY (Alipay/WeChat) | USD (Card/Crypto) |
| API Format | Custom | OpenAI-compatible |
| Other Models | ByteDance only | 300+ models |
| Price | ¥0.1-0.2/image | $0.02-0.04/image |
Seedream 4.0 vs DALL-E 3 vs Midjourney#
| Feature | Seedream 4.0 | DALL-E 3 | Midjourney v6 |
|---|---|---|---|
| Text in Images | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ |
| Chinese Text | ⭐⭐⭐⭐⭐ | ⭐⭐ | ⭐ |
| Photorealism | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
| Artistic Style | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
| API Access | ✅ | ✅ | ❌ (Discord only) |
| Speed | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐ |
| Price | 💰 | 💰💰 | 💰 (subscription) |
| Open Source | ❌ | ❌ | ❌ |
Frequently Asked Questions#
Is Seedream 4.0 the same as Jimeng AI?#
Seedream 4.0 is the underlying model that powers Jimeng AI (即梦AI), ByteDance's consumer-facing image generation product. The API gives you direct access to the model without the Jimeng interface.
Can Seedream 4.0 generate Chinese text in images?#
Yes, this is one of Seedream 4.0's strongest features. It renders Chinese characters with high accuracy, making it the best choice for generating images with Chinese text content.
What's the maximum resolution?#
Seedream 4.0 supports up to 2048x2048 pixels. Common sizes include 1024x1024 (square), 1024x1792 (portrait), and 1792x1024 (landscape).
Does Seedream 4.0 support image editing?#
Yes, Seedream 4.0 supports inpainting (editing specific regions of an image) and outpainting (extending an image beyond its borders). These features are available through the API.
How does Seedream 4.0 handle content safety?#
Seedream 4.0 includes built-in content safety filters that block generation of explicit, violent, or otherwise prohibited content. The filters are generally stricter than Western alternatives.
Summary#
Seedream 4.0 is a strong contender in the image generation space, with best-in-class text rendering and competitive pricing. For developers who need reliable text in generated images — especially Chinese text — it's the clear choice.
Access Seedream 4.0 alongside DALL-E 3, Midjourney, and other image models through Crazyrouter's unified API. One key, all models.


