# Seedream 4.5 API Complete API reference for Seedream 4.5 models by ByteDance. ## Model Variants This API supports two model variants: | Model | ID | Description | |-------|-----|-------------| | **Seedream 4.5** | `seedream-v4.5` | Fast stylized text-to-image generation | | **Seedream 4.5 Edit** | `seedream-v4.5-edit` | Image editing and multi-image composition | ## Quick Comparison | Feature | Seedream 4.5 | Seedream 4.5 Edit | |---------|--------------|-------------------| | Input | Text prompt | Image(s) + Text prompt | | Generation Speed | Ultra-fast | Fast | | Resolution Options | 2K, 4K | 2K, 4K | | Aspect Ratios | 9 options | 9 options | | Image Input | ❌ No | ✅ Yes (1-10 images) | | Best For | Anime, illustrations, artistic styles | Style transfer, image composition | ### Supported Aspect Ratios Both models support 9 aspect ratios: - `21:9`, `16:9`, `4:3`, `3:2`, `1:1`, `2:3`, `3:4`, `9:16`, `9:21` ## Seedream 4.5 (Text-to-Image) ### Endpoint ``` POST /api/v1/image/task ``` ### Request Parameters #### Required | Parameter | Type | Description | |-----------|------|-------------| | `model_name` | string | Must be `"seedream-v4.5"` | | `prompt` | string | Image generation prompt | | `width` | number | Width ratio value (e.g., 16 for 16:9) | | `height` | number | Height ratio value (e.g., 9 for 16:9) | | `resolution` | string | Output resolution: `"2k"` or `"4k"` | **Note:** The width:height ratio must be one of: "21:9", "9:21", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "1:1" ### Example Request ```javascript const response = await fetch('https://api.flaq.ai/api/v1/image/task', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ model_name: 'seedream-v4.5', prompt: 'A magical girl in a fantasy forest, anime style', width: 16, height: 9, resolution: '2k' }) }); const { data } = await response.json(); const taskId = data.task_id; // Poll for results const pollResponse = await fetch( `https://api.flaq.ai/api/v1/image/${taskId}`, { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } } ); const result = await pollResponse.json(); console.log(result.data.task_result.images[0].url); ``` ## Seedream 4.5 Edit (Image Editing) ### Endpoint ``` POST /api/v1/image/task ``` ### Request Parameters #### Required | Parameter | Type | Description | |-----------|------|-------------| | `model_name` | string | Must be "seedream-v4.5-edit" | | `prompt` | string | Description of desired edits | | `image_url_list` | string[] | Array of image URLs to edit (1-10 images) | #### Optional | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `width` | number | - | Width ratio value (e.g., 16 for 16:9) | | `height` | number | - | Height ratio value (e.g., 9 for 16:9) | | `resolution` | string | `"2k"` | Output resolution: `"2k"`, `"4k"` | ### Single Image Edit Example ```javascript { model_name: 'seedream-v4.5-edit', image_url_list: ['https://example.com/photo.jpg'], prompt: 'Convert to anime art style with vibrant colors', width: 16, height: 9, resolution: '2k' } ``` ### Multi-Image Composition Example ```javascript { model_name: 'seedream-v4.5-edit', image_url_list: [ 'https://example.com/image1.jpg', 'https://example.com/image2.jpg' ], prompt: 'Blend these images into a cohesive anime-style illustration', width: 16, height: 9, resolution: '2k' } ``` ## Response Format ### Initial Response Both models return a `task_id` for polling: ```json { "code": 0, "data": { "task_id": "{task_id}", "task_status": "submitted", "response_url": "https://api.flaq.ai/api/v1/image/{task_id}" }, "message": "success" } ``` ### Polling Response Poll `/api/v1/image/{taskId}` to check status: ```json { "code": 0, "data": { "task_id": "{task_id}", "task_status": "succeed", "task_status_msg": null, "response_url": "https://api.flaq.ai/api/v1/image/{task_id}", "task_result": { "credit": 0.0997, "images": [ { "url": "https://example.com/generated-image.jpeg" } ] } }, "message": "success" } ``` ### Status Values - `submitted`: Task accepted - `processing`: Generation in progress - `succeed`: Generation completed successfully - `failed`: Generation failed ## Processing Time Seedream 4.5 is optimized for speed: - **Text-to-Image**: ~10-30 seconds - **Image Edit**: ~15-40 seconds ## Best Practices 1. **Anime & Illustration Focus**: Seedream excels at anime, manga, and stylized art 2. **Fast Iterations**: Lower generation time allows for rapid experimentation 3. **Multi-Image Editing**: Can combine up to 10 images for complex compositions 4. **Resolution Selection**: 2K is sufficient for most use cases, 4K for highest quality 5. **Prompt Style**: Include art style keywords (anime, manga, illustration) for best results ## Example Use Cases ### Anime Character Generation ```javascript { model_name: 'seedream-v4.5', prompt: 'Anime girl with blue hair, magical powers, detailed eyes, studio lighting', width: 9, height: 16, resolution: '2k' } ``` ### Style Transfer ```javascript { model_name: 'seedream-v4.5-edit', image_url_list: ['photo.jpg'], prompt: 'Transform into vibrant anime art style with bold colors', resolution: '2k' } ``` ### Multi-Image Collage ```javascript { model_name: 'seedream-v4.5-edit', image_url_list: ['img1.jpg', 'img2.jpg', 'img3.jpg'], prompt: 'Create a manga-style panel layout with these images', width: 16, height: 9, resolution: '2k' } ```