Seedream-5.0 画像生成
Generate high-quality images using Seedream 5.0 lite model with 2K/3K resolution and web search
中国本土のユーザー向け: 中国本土のユーザーは https://toapis.cn を API エンドポイント(Base URL)としてご利用ください。本ドキュメント内の例では https://toapis.com を https://toapis.cn に置き換えてください。
- Seedream 5.0 lite — the latest image generation model from ByteDance Seed team
- Use the model parameter to select
doubao-seedream-5-0 - Supports text-to-image, image-to-image, and multi-reference generation
- New web search capability for real-time knowledge-enhanced generation
- Supports 2K and 3K resolution output
- Async task management, query results by task ID
Important Change: For better performance and cost control, we no longer support passing base64 image data directly in image_urls. Please use the Upload 画像API first to upload images and get URLs, then call this endpoint.
Authorizations
Authorizationstringヘッダー必須All endpoints require Bearer Token authentication
Get your API Key from the API Key Management Page
Add to request header:
Authorization: Bearer YOUR_API_KEYBody
modelstringボディ必須デフォルト: doubao-seedream-5-0Image generation model name
Example: "doubao-seedream-5-0"
promptstringボディ必須Text description for image generation
sizestringボディデフォルト: 1:1Image aspect ratio
Supported aspect ratios:
1:1- Square (default)4:3- Landscape 4:33:4- Portrait 3:416:9- Landscape widescreen9:16- Portrait vertical3:2- Landscape 3:22:3- Portrait 2:321:9- Ultra-wide9:21- Ultra-tall
nintegerボディデフォルト: 1Number of images to generate
Range: 1-15 (minimum 1, maximum 15)
Default: 1
Note:
- The total of reference images + generated images must be ≤ 15
- Must enter a plain number (e.g.,
1), do not use quotes or it will cause an error
Charges will be pre-deducted based on the number
image_urlsstring[]ボディReference image URL list for image-to-image or image editing
⚠️ URL format only (base64 no longer supported)
- Publicly accessible image URL (http:// or https://)
- You can use the Upload 画像API to upload local images and get URLs
Limitations:
- Maximum 10 images
- Image formats: jpeg, png
- Aspect ratio (width/height) range: [1/3, 3]
- Width and height (px) > 14
- Size: not exceeding 10MB
- Total pixels: not exceeding 6000×6000 px
metadataobjectボディChannel-specific parameters for advanced Seedream 5.0 model configuration
metadata properties
metadata.resolutionstringボディデフォルト: 2KImage resolution
Supported resolutions:
2K- Standard resolution (default)3K- High definition
Note: Seedream 5.0 does not support 1K or 4K resolution
Resolution reference sizes:
| Resolution | 1:1 Size | 16:9 Size |
|---|---|---|
| 2K | 2048×2048 | 2848×1600 |
| 3K | 3072×3072 | 4096×2304 |
Total pixel range: 2560×1440 ~ 3072×3072×1.1025 (~10.4 MP)
metadata.sequential_image_generationstringボディデフォルト: disabledSequential image generation mode (Doubao-specific feature)
Controls whether to generate multiple images:
disabled: Disable sequential mode, generates only 1 image even with multiple reference images (default)auto: Enable sequential mode, can generate multiple images
Usage Notes:
- ✅ Set
n: 3or usesequential_image_generation: "auto"+max_images: 3 - ✅ Supports text-to-image sets: up to 15 images from text prompt only
- ✅ Supports image-to-image sets: provide
image_urlsto generate multiple variations - ⚠️ When
n > 1, it will automatically be set toauto
Note:
- Total reference images + generated images must be ≤ 15
metadata.sequential_image_generation_optionsobjectボディSequential image generation options
Available when sequential_image_generation is set to auto
Properties:
max_images(integer): Specify the number of images to generate, Range: 1-15
Example:
"sequential_image_generation_options": { "max_images": 3 }metadata.watermarkbooleanボディデフォルト: falseWhether to add a watermark to the generated image
true: Add watermarkfalse: No watermark (default)
レスポンス
idstringUnique task identifier for status queries
objectstringObject type, always generation.task
modelstringモデル name used
statusstringTask status
queued- Queued for processingin_progress- Processingcompleted- Successfully completedfailed- Failed
progressintegerTask progress percentage (0-100)
created_atintegerTask creation timestamp (Unix timestamp)
metadataobjectTask metadata
リクエスト例
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-0",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"metadata": {
"resolution": "2K"
}
}'curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-0",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"image_urls": [
"https://example.com/panda.jpg"
],
"metadata": {
"resolution": "3K"
}
}'curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-0",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 4,
"metadata": {
"resolution": "2K",
"sequential_image_generation": "auto",
"sequential_image_generation_options": { "max_images": 4 },
"watermark": false
}
}'import requests
response = requests.post(
"https://toapis.com/v1/images/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "doubao-seedream-5-0",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"metadata": {
"resolution": "2K"
}
}
)
task = response.json()
print(f"Task ID: {task['id']}")
print(f"Status: {task['status']}")import requests
response = requests.post(
"https://toapis.com/v1/images/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "doubao-seedream-5-0",
"prompt": "A cute panda playing in a bamboo forest",
"size": "1:1",
"n": 1,
"image_urls": ["https://example.com/panda.jpg"],
"metadata": {
"resolution": "3K"
}
}
)
task = response.json()
print(f"Task ID: {task['id']}")
print(f"Status: {task['status']}")const response = await fetch('https://toapis.com/v1/images/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'doubao-seedream-5-0',
prompt: 'A cute panda playing in a bamboo forest',
size: '1:1',
n: 1,
metadata: {
resolution: '2K'
}
})
});
const task = await response.json();
console.log(`Task ID: ${task.id}`);
console.log(`Status: ${task.status}`);const response = await fetch('https://toapis.com/v1/images/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'doubao-seedream-5-0',
prompt: 'A cute panda playing in a bamboo forest',
size: '1:1',
n: 1,
image_urls: ['https://example.com/panda.jpg'],
metadata: {
resolution: '3K'
}
})
});
const task = await response.json();
console.log(`Task ID: ${task.id}`);
console.log(`Status: ${task.status}`);レスポンス例
{
"id": "task_img_abc123def456",
"object": "generation.task",
"model": "doubao-seedream-5-0",
"status": "queued",
"progress": 0,
"created_at": 1703884800,
"metadata": {}
}