Skip to main content

Seedream 4.0

Generate high-quality images from text prompts using the Seedream 4.0 model.

Endpoint

POST https://api.azerion.ai/v1/images/generations

Description

Seedream 4.0 is an advanced image generation model that creates high-quality images from text prompts. It supports various generation modes including text-to-image, image-to-image, sequential image generation, and multi-image reference generation.

Authentication

This endpoint requires authentication using an API key.

Request Parameters

  • model (string, required): Model ID. Use bytedance-seedream-4 for Seedream 4.0.
  • prompt (string, required): A text description of the desired image. Maximum length is 4000 characters.
  • image (string or array, optional): Input image URL(s) for image-to-image generation or reference images.
    • Single string for editing one image
    • Array of strings for multi-image reference generation
  • sequential_image_generation (string, optional): Enable sequential image generation. Options: "disabled" (default), "auto".
  • sequential_image_generation_options (object, optional): Configuration for sequential generation.
    • max_images (integer): Maximum number of images to generate sequentially (e.g., 4, 5).
  • response_format (string, optional): Format of the response. Options: "url" (default), "b64_json".
  • size (string, optional): Output image size. Options: "2K", "1024x1024", "512x512". Default: "2K".
  • watermark (boolean, optional): Add watermark to generated images. Default: true.
Writing Effective Prompts

For best results, be specific and descriptive in your prompts. Include details about style, lighting, composition, colors, and atmosphere. For example, instead of "a train", try "Interstellar travel, a black hole, from which a nearly shattered vintage train bursts forth, visually striking, cinematic blockbuster, apocalyptic vibe, dynamic, contrasting colors".

Response

A successful request returns a 200 OK status code with a JSON response body.

Response Example

{
"created": 1764147396,
"data": [
{
"url": "https://ark-content-generation-v2-ap-southeast-1.tos-ap-southeast-1.volces.com/seedream-4-0/02176414738114475aeae14c82856eca08eecb5e75c057578b849_0.jpeg?X-Tos-Algorithm=TOS4-HMAC-SHA256&X-Tos-Credential=AKLTYWJkZTExNjA1ZDUyNDc3YzhjNTM5OGIyNjBhNDcyOTQ%2F20251126%2Fap-southeast-1%2Ftos%2Frequest&X-Tos-Date=20251126T085636Z&X-Tos-Expires=86400&X-Tos-Signature=102ae74754d05e2811df8e8e773a3ace71dbda1e7dc7cf2640676697c6515415&X-Tos-SignedHeaders=host"
}
],
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"image_tokens": 0,
"text_tokens": 0
},
"output_tokens": 15552,
"total_tokens": 15552
}
}

Example Requests

Generate an Image from Prompt

curl -X POST https://api.azerion.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"model": "bytedance-seedream-4",
"prompt": "Interstellar travel, a black hole, from which a nearly shattered vintage train bursts forth, visually striking, cinematic blockbuster, apocalyptic vibe, dynamic, contrasting colors, OC render, ray tracing, motion blur, depth of field, surrealism, deep blue. The image uses delicate and rich color layers to shape the subject and scene, with realistic textures. The dark style background'\''s light and shadow effects create an atmospheric mood, blending artistic fantasy with an exaggerated wide-angle perspective, lens flare, reflections, extreme light and shadow, intense gravitational pull, devouring.",
"sequential_image_generation": "disabled",
"response_format": "url",
"size": "2K",
"watermark": true
}'

Generate Multiple Images from Prompt

Generate a series of coherent images with sequential generation:

curl -X POST https://api.azerion.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"model": "bytedance-seedream-4",
"prompt": "Generate a series of 4 coherent illustrations focusing on the same corner of a courtyard across the four seasons, presented in a unified style that captures the unique colors, elements, and atmosphere of each season.",
"sequential_image_generation": "auto",
"sequential_image_generation_options": {
"max_images": 4
},
"response_format": "url",
"size": "2K",
"watermark": true
}'

Edit an Image

Transform an existing image using a text prompt:

curl -X POST https://api.azerion.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"model": "bytedance-seedream-4",
"prompt": "Generate a close-up image of a dog lying on lush grass.",
"image": "https://ark-doc.tos-ap-southeast-1.bytepluses.com/doc_image/seedream4_imageToimage.png",
"sequential_image_generation": "disabled",
"response_format": "url",
"size": "2K",
"watermark": true
}'

Expand an Image to Multiple Images

Generate multiple variations or expansions from a single reference image:

curl -X POST https://api.azerion.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"model": "bytedance-seedream-4",
"prompt": "Using this LOGO as a reference, create a visual design system for an outdoor sports brand named GREEN, including packaging bags, hats, paper boxes, wristbands, lanyards, etc. Main visual tone is green, with a fun, simple, and modern style.",
"image": "https://ark-doc.tos-ap-southeast-1.bytepluses.com/doc_image/seedream4_imageToimages.png",
"sequential_image_generation": "auto",
"sequential_image_generation_options": {
"max_images": 5
},
"response_format": "url",
"size": "2K",
"watermark": true
}'

Generate an Image with Reference Images

Use multiple reference images to guide the generation:

curl -X POST https://api.azerion.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"model": "bytedance-seedream-4",
"prompt": "Replace the clothing in image 1 with the outfit from image 2.",
"image": ["https://ark-doc.tos-ap-southeast-1.bytepluses.com/doc_image/seedream4_imagesToimage_1.png", "https://ark-doc.tos-ap-southeast-1.bytepluses.com/doc_image/seedream4_imagesToimage_2.png"],
"sequential_image_generation": "disabled",
"response_format": "url",
"size": "2K",
"watermark": true
}'