# Seedream 4.5 > Seedream 4.5 delivers photorealistic image generation with unmatched accuracy and creative control for professional applications. ## Overview - **Endpoint**: `https://api.segmind.com/v1/seedream-4.5` - **Model ID**: `seedream-4.5` - **Category**: Image-to-Image Transformation - **Type**: Synchronous (Direct response) - **Average Cost**: $0.04006325581395349 ## Pricing - **Cost**: $0.040 per generation ## API Information This model uses a **synchronous response pattern**: 1. Make a POST request with your parameters 2. Receive the output directly in the response (binary for images/videos/audio, JSON for text) 3. No polling required - response is immediate ### Input Schema The API accepts the following input parameters: - **`size`** (`string | null`, _optional_): Size Image resolution quality level. '2K' for standard (8-9M pixels), '4K' for high-res (up to 16.7M pixels). When used alone, API optimizes dimensions. When combined with aspect_ratio, dimensions are calculated but may not reach full 4K quality for extreme ratios (e.g., 9:16). Use 'custom' for exact control. - Default: `"2K"` - Options: "1K" (1K), "2K" (2K), "4K" (4K), "custom" (custom) - **`width`** (`integer | null`, _optional_): Width Custom width in pixels (only when size='custom'). Range: 1024-4096. Total pixels (width × height) must be 3.7M-16.7M. Dimensions rounded to 64-pixel increments. For maximum 4K quality with aspect ratios, calculate dimensions manually. - Default: `2048` - Range: 1024 to 4096 - **`height`** (`integer | null`, _optional_): Height Custom height in pixels (only when size='custom'). Range: 1024-4096. Total pixels (width × height) must be 3.7M-16.7M. Dimensions rounded to 64-pixel increments. Images below 3.7M pixels will be auto-scaled up. - Default: `2048` - Range: 1024 to 4096 - **`prompt`** (`string`, _required_): Prompt Describe the image. Include subjects like 'serene evening at the beach'. - **`max_images`** (`integer | null`, _optional_): Max images Limit generated images: 1 for single output, 5 for more variety. - Default: `1` - Range: 1 to 15 - **`image_input`** (`array`, _optional_): Image input list Input images to guide creation, use 1-3 URLs for reference. - Item type: string - **`aspect_ratio`** (`string | null`, _optional_): Aspect ratio Image proportions. 'match_input_image' (recommended with image_input) lets API match input aspect ratio and optimize quality. Other ratios (1:1, 16:9, 9:16, etc.) calculate dimensions from size preset. Note: Non-square ratios with 4K may produce lower pixel counts than maximum (e.g., 9:16 gives ~9M pixels vs 16.7M max). Ignored when size is set to custom and both height and width are provided - Default: `"match_input_image"` - Options: "match_input_image" (match_input_image), "1:1" (1:1), "4:3" (4:3), "3:4" (3:4), "16:9" (16:9), "9:16" (9:16), "3:2" (3:2), "2:3" (2:3), "21:9" (21:9) - **`sequential_image_generation`** (`string | null`, _optional_): Sequential image generation Choose sequence: 'auto' for batch, 'disabled' for individual images. - Default: `"disabled"` - Options: "disabled" (disabled), "auto" (auto) **Required Parameters Example**: ```json { "prompt": "Create a professional H&M clothing brand photoshoot of the man wearing all the reference clothes, striking confident model poses against an urban city street background with skyscrapers and vibrant daylight." } ``` **Full Example**: ```json { "size": "2K", "width": 2048, "height": 2048, "prompt": "Create a professional H&M clothing brand photoshoot of the man wearing all the reference clothes, striking confident model poses against an urban city street background with skyscrapers and vibrant daylight.", "max_images": 1, "image_input": [ "https://segmind-inference-inputs.s3.amazonaws.com/273f368e-3274-4a6e-8a2c-2cdd5881948e-d61283c9-839e-4107-9185-4ea883ecaded.webp", "https://segmind-inference-inputs.s3.amazonaws.com/d47c85b4-f584-45e7-97ea-2ae0eeae4880-548c2fcfa1e14e301329ef45b8e093af.jpg", "https://segmind-inference-inputs.s3.amazonaws.com/d4545759-47ba-4c92-afa3-49fb260e8c51-IMG_7135.webp", "https://segmind-inference-inputs.s3.amazonaws.com/2d803ba1-7c89-4d54-996f-11c9572d8db9-IMG_7137.webp", "https://segmind-inference-inputs.s3.amazonaws.com/a461a78b-6db9-443a-8882-69ed7ccc2390-IMG_7138.webp" ], "aspect_ratio": "match_input_image", "sequential_image_generation": "disabled" } ``` ### Output Schema The API returns a synchronous response based on the model type: **For Image/Video/Audio Models**: - Response contains binary data (image/png, video/mp4, audio/mp3) - Content-Type header indicates the media type - Save the response body directly to a file **For Text Models**: - Response is JSON with the generated text - Structure varies by model **HTTP Response Codes**: - **200 - OK**: Request successful, output in response body - **400 - Bad Request**: Invalid parameters - **401 - Unauthorized**: Invalid or missing API key - **404 - Not Found**: Model not found - **406 - Not Acceptable**: Insufficient credits - **429 - Too Many Requests**: Rate limit exceeded - **500 - Server Error**: Internal server error ## Usage Examples ### cURL ```bash curl -X POST "https://api.segmind.com/v1/seedream-4.5" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "size": "2K", "width": 2048, "height": 2048, "prompt": "Create a professional H&M clothing brand photoshoot of the man wearing all the reference clothes, striking confident model poses against an urban city street background with skyscrapers and vibrant daylight.", "max_images": 1, "image_input": [ "https://segmind-inference-inputs.s3.amazonaws.com/273f368e-3274-4a6e-8a2c-2cdd5881948e-d61283c9-839e-4107-9185-4ea883ecaded.webp", "https://segmind-inference-inputs.s3.amazonaws.com/d47c85b4-f584-45e7-97ea-2ae0eeae4880-548c2fcfa1e14e301329ef45b8e093af.jpg", "https://segmind-inference-inputs.s3.amazonaws.com/d4545759-47ba-4c92-afa3-49fb260e8c51-IMG_7135.webp", "https://segmind-inference-inputs.s3.amazonaws.com/2d803ba1-7c89-4d54-996f-11c9572d8db9-IMG_7137.webp", "https://segmind-inference-inputs.s3.amazonaws.com/a461a78b-6db9-443a-8882-69ed7ccc2390-IMG_7138.webp" ], "aspect_ratio": "match_input_image", "sequential_image_generation": "disabled" }' ``` ### Python ```python import requests import json api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/seedream-4.5" data = { "size": "2K", "width": 2048, "height": 2048, "prompt": "Create a professional H&M clothing brand photoshoot of the man wearing all the reference clothes, striking confident model poses against an urban city street background with skyscrapers and vibrant daylight.", "max_images": 1, "image_input": [ "https://segmind-inference-inputs.s3.amazonaws.com/273f368e-3274-4a6e-8a2c-2cdd5881948e-d61283c9-839e-4107-9185-4ea883ecaded.webp", "https://segmind-inference-inputs.s3.amazonaws.com/d47c85b4-f584-45e7-97ea-2ae0eeae4880-548c2fcfa1e14e301329ef45b8e093af.jpg", "https://segmind-inference-inputs.s3.amazonaws.com/d4545759-47ba-4c92-afa3-49fb260e8c51-IMG_7135.webp", "https://segmind-inference-inputs.s3.amazonaws.com/2d803ba1-7c89-4d54-996f-11c9572d8db9-IMG_7137.webp", "https://segmind-inference-inputs.s3.amazonaws.com/a461a78b-6db9-443a-8882-69ed7ccc2390-IMG_7138.webp" ], "aspect_ratio": "match_input_image", "sequential_image_generation": "disabled" } response = requests.post( url, json=data, headers={ 'x-api-key': api_key, 'Content-Type': 'application/json' } ) if response.status_code == 200: # For image/video/audio models, response.content contains the binary data with open('output.png', 'wb') as f: f.write(response.content) print('Generation complete, saved to output.png') else: print(f"Error: {response.status_code}") print(response.text) ``` ### JavaScript ```javascript const apiKey = 'YOUR_API_KEY'; const url = 'https://api.segmind.com/v1/seedream-4.5'; const data = { "size": "2K", "width": 2048, "height": 2048, "prompt": "Create a professional H&M clothing brand photoshoot of the man wearing all the reference clothes, striking confident model poses against an urban city street background with skyscrapers and vibrant daylight.", "max_images": 1, "image_input": [ "https://segmind-inference-inputs.s3.amazonaws.com/273f368e-3274-4a6e-8a2c-2cdd5881948e-d61283c9-839e-4107-9185-4ea883ecaded.webp", "https://segmind-inference-inputs.s3.amazonaws.com/d47c85b4-f584-45e7-97ea-2ae0eeae4880-548c2fcfa1e14e301329ef45b8e093af.jpg", "https://segmind-inference-inputs.s3.amazonaws.com/d4545759-47ba-4c92-afa3-49fb260e8c51-IMG_7135.webp", "https://segmind-inference-inputs.s3.amazonaws.com/2d803ba1-7c89-4d54-996f-11c9572d8db9-IMG_7137.webp", "https://segmind-inference-inputs.s3.amazonaws.com/a461a78b-6db9-443a-8882-69ed7ccc2390-IMG_7138.webp" ], "aspect_ratio": "match_input_image", "sequential_image_generation": "disabled" }; const response = await fetch(url, { method: 'POST', headers: { 'x-api-key': apiKey, 'Content-Type': 'application/json', }, body: JSON.stringify(data), }); if (response.ok) { // For image/video/audio models, response contains binary data const blob = await response.blob(); const downloadUrl = URL.createObjectURL(blob); // Create download link const a = document.createElement('a'); a.href = downloadUrl; a.download = 'output.png'; a.click(); console.log('Generation complete'); } ``` ## Additional Resources ### Documentation - [Model Playground](https://www.segmind.com/models/seedream-4.5) - [API Documentation](https://www.segmind.com/models/seedream-4.5/api) - [Pricing Details](https://www.segmind.com/models/seedream-4.5/pricing) - [Platform Documentation](https://docs.segmind.com/) ### Tags No tags available