Seedream 4.0
Text-to-Image • ByteDance • ProxiedSeedream 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 ↗ |
Usage
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)
Examples
High Resolution — 4K quality image generation
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)
Widescreen Landscape — Cinematic aspect ratio image
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)
Portrait Format — Vertical image for portraits
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)
Custom Dimensions — Specific width and height
const response = await env.AI.run( 'bytedance/seedream-4.0', { prompt: 'A detailed botanical illustration of exotic tropical flowers', size: 'custom', width: 2048, height: 3072, }, { gateway: { id: 'default' }, })console.log(response)
Parameters
stringrequiredstringenum: 1K, 2K, 4K, customstringenum: match_input_image, 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9integerminimum: 1024maximum: 4096integerminimum: 1024maximum: 4096booleanstringformat: uriAPI Schemas
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string" }, "size": { "type": "string", "enum": [ "1K", "2K", "4K", "custom" ] }, "aspect_ratio": { "type": "string", "enum": [ "match_input_image", "1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3", "21:9" ] }, "width": { "type": "integer", "minimum": 1024, "maximum": 4096 }, "height": { "type": "integer", "minimum": 1024, "maximum": 4096 }, "enhance_prompt": { "type": "boolean" } }, "required": [ "prompt" ], "additionalProperties": false}{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "image": { "type": "string", "format": "uri" } }, "required": [ "image" ], "additionalProperties": false}