Skip to content
ByteDance logo

Seedream 4.0

Text-to-ImageByteDanceProxied

Seedream 4.0 is ByteDance's image creation model that combines text-to-image generation and image editing into a single architecture, offering fast, high-resolution output up to 4K.

Model Info
More informationlink
PricingView pricing in the Cloudflare dashboard

Usage

TypeScript
const response = await env.AI.run(
'bytedance/seedream-4.0',
{
prompt: 'A serene mountain lake surrounded by pine trees at dawn',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Simple Generation

Examples

High Resolution — 4K quality image generation
TypeScript
const response = await env.AI.run(
'bytedance/seedream-4.0',
{
prompt:
'A detailed steampunk mechanical owl with brass gears and copper feathers, intricate clockwork visible',
size: '4K',
aspect_ratio: '1:1',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
High Resolution
Widescreen Landscape — Cinematic aspect ratio image
TypeScript
const response = await env.AI.run(
'bytedance/seedream-4.0',
{
prompt:
'A vast alien desert landscape with two suns setting on the horizon, ancient ruins in the foreground',
size: '2K',
aspect_ratio: '21:9',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Widescreen Landscape
Portrait Format — Vertical image for portraits
TypeScript
const response = await env.AI.run(
'bytedance/seedream-4.0',
{
prompt:
'An elegant Art Deco poster featuring a jazz singer under a spotlight',
aspect_ratio: '9:16',
enhance_prompt: true,
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Portrait Format
Detailed 4K — High-resolution detailed botanical illustration
TypeScript
const response = await env.AI.run(
'bytedance/seedream-4.0',
{
prompt: 'A detailed botanical illustration of exotic tropical flowers',
size: '4K',
aspect_ratio: '3:4',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Detailed 4K

Parameters

prompt
stringrequired
size
stringenum: 1K, 2K, 4K, custom
aspect_ratio
stringenum: match_input_image, 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9
width
integerminimum: 1024maximum: 4096
height
integerminimum: 1024maximum: 4096
enhance_prompt
boolean

API Schemas (Raw)

Input
Output