Seedream 4.0
Text-to-Image • ByteDance
bytedance/seedream-4.0
- Third-party
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 information | link ↗ |
| Pricing | <ul><li>Per image$0.03</li></ul> |
Usage
const response = await env.AI.run(
'bytedance/seedream-4.0',
{ prompt: 'A serene mountain lake surrounded by pine trees at dawn' },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "bytedance/seedream-4.0",
"input": {
"prompt": "A serene mountain lake surrounded by pine trees at dawn"
}
}'

{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://ark-content-generation-v2-ap-southeast-1.tos-ap-southeast-1.volces.com/seedream-4-0/021776387438887c5f50319cb4d4388d7836967b82aebe5227f8d_0.jpeg"
},
"state": "Completed"
}
Examples
<details>
<summary>High Resolution — 4K quality image generation</summary>
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)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "bytedance/seedream-4.0",
"input": {
"prompt": "A detailed steampunk mechanical owl with brass gears and copper feathers, intricate clockwork visible",
"aspect_ratio": "1:1",
"size": "4K"
}
}'

{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://ark-content-generation-v2-ap-southeast-1.tos-ap-southeast-1.volces.com/seedream-4-0/021776387448153c5f50319cb4d4388d7836967b82aebe5807cbc_0.jpeg"
},
"state": "Completed"
}
</details>
<details>
<summary>Widescreen Landscape — Cinematic aspect ratio image</summary>
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)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "bytedance/seedream-4.0",
"input": {
"prompt": "A vast alien desert landscape with two suns setting on the horizon, ancient ruins in the foreground",
"aspect_ratio": "21:9",
"size": "2K"
}
}'

{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://ark-content-generation-v2-ap-southeast-1.tos-ap-southeast-1.volces.com/seedream-4-0/021776387469085c5f50319cb4d4388d7836967b82aebe5dcf17e_0.jpeg"
},
"state": "Completed"
}
</details>
<details>
<summary>Portrait Format — Vertical image for portraits</summary>
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)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "bytedance/seedream-4.0",
"input": {
"prompt": "An elegant Art Deco poster featuring a jazz singer under a spotlight",
"aspect_ratio": "9:16",
"enhance_prompt": true
}
}'

{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://ark-content-generation-v2-ap-southeast-1.tos-ap-southeast-1.volces.com/seedream-4-0/021776387475078c5f50319cb4d4388d7836967b82aebe5e6ec81_0.jpeg"
},
"state": "Completed"
}
</details>
<details>
<summary>Detailed 4K — High-resolution detailed botanical illustration</summary>
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)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "bytedance/seedream-4.0",
"input": {
"prompt": "A detailed botanical illustration of exotic tropical flowers",
"aspect_ratio": "3:4",
"size": "4K"
}
}'

{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://ark-content-generation-v2-ap-southeast-1.tos-ap-southeast-1.volces.com/seedream-4-0/021776441662380e1f2c28e220bf76d8a56e2a46eaa08e982d37f_0.jpeg"
},
"state": "Completed"
}
</details>
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
image
stringformat: uri
API Schemas (Raw)
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/ai/models/bytedance/seedream-4.0/#page","headline":"Seedream 4.0","description":"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.","url":"https://developers.cloudflare.com/ai/models/bytedance/seedream-4.0/","inLanguage":"en","image":"https://developers.cloudflare.com/og-docs.png","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Seedream 4.5 builds on 4.0 with multi-reference image support, batch generation, and sequential image generation. title: Seedream 4.5 image: https://developers.cloudflare.com/og-docs.png
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/llms.txt
Use this file to discover all available pages before exploring further.

