Skip to content
Docs
ByteDance logo

Seedream 4.0

Text-to-ImageByteDance

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' },
)
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',
aspect_ratio: '1:1',
size: '4K',
},
)
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',
aspect_ratio: '21:9',
size: '2K',
},
)
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,
},
)
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',
aspect_ratio: '3:4',
size: '4K',
},
)
console.log(response)
Detailed 4K

Parameters

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

API Schemas (Raw)

Input
Output