Image GenerationSeedream
Seedream 4
High-resolution image generation and editing with multi-reference support by ByteDance.
POST /v2/images/generate — model: "seedream-4"
Next-generation image creation model that combines text-to-image generation and image editing into a single architecture. Supports up to 4K resolution, multi-reference inputs, and natural-language prompt editing.
See Image Generation overview for common request fields, response format, and error codes.
Model-specific parameters
| Parameter | Type | Description |
|---|---|---|
seedreamParams.aspect_ratio | string | Aspect ratio. Use "match_input_image" to match input image, or "W:H" format (e.g. "16:9") |
seedreamParams.size | string | "1K", "2K" (default), "4K", or "custom" |
seedreamParams.width | integer | Custom width (1024–4096). Only used when size is "custom" |
seedreamParams.height | integer | Custom height (1024–4096). Only used when size is "custom" |
seedreamParams.image_input | string[] | Up to 10 input image URLs for image-to-image generation or editing |
seedreamParams.enhance_prompt | boolean | Enable prompt enhancement for higher quality results (default true) |
Credit cost
| Credits per generation |
|---|
| 3 |
Code examples
curl -X POST https://api.apiframe.ai/v2/images/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "a detailed architectural blueprint of a modern glass house",
"model": "seedream-4",
"seedreamParams": {
"size": "4K",
"aspect_ratio": "16:9"
}
}'import requests
response = requests.post(
"https://api.apiframe.ai/v2/images/generate",
headers={
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
json={
"prompt": "a detailed architectural blueprint of a modern glass house",
"model": "seedream-4",
"seedreamParams": {
"size": "4K",
"aspect_ratio": "16:9",
},
},
)
print(response.json())const response = await fetch("https://api.apiframe.ai/v2/images/generate", {
method: "POST",
headers: {
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "a detailed architectural blueprint of a modern glass house",
model: "seedream-4",
seedreamParams: { size: "4K", aspect_ratio: "16:9" },
}),
});
console.log(await response.json());With image editing
curl -X POST https://api.apiframe.ai/v2/images/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Replace the dog with a golden retriever puppy",
"model": "seedream-4",
"seedreamParams": {
"image_input": ["https://example.com/photo-with-dog.jpg"],
"aspect_ratio": "match_input_image"
}
}'import requests
response = requests.post(
"https://api.apiframe.ai/v2/images/generate",
headers={
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
json={
"prompt": "Replace the dog with a golden retriever puppy",
"model": "seedream-4",
"seedreamParams": {
"image_input": ["https://example.com/photo-with-dog.jpg"],
"aspect_ratio": "match_input_image",
},
},
)
print(response.json())Try it
POST
/v2/images/generateTry it