# Seedream 5.0 API Complete API reference for Seedream 5.0 models by ByteDance. ## Model Variants This API supports two model variants: | Model | ID | Description | |-------|-----|-------------| | **Seedream 5.0** | `seedream-v5.0` | High-quality text-to-image generation | | **Seedream 5.0 Edit** | `seedream-v5.0-edit` | Image editing and multi-image composition | ## Quick Comparison | Feature | Seedream 5.0 | Seedream 5.0 Edit | |---------|--------------|-------------------| | Input | Text prompt | Image(s) + Text prompt | | Resolution Options | 2K, 4K | 2K, 4K | | Aspect Ratios | 7 options | 7 options | | Image Input | No | Yes (1-10 images) | ### Supported Aspect Ratios `16:9`, `4:3`, `3:2`, `1:1`, `2:3`, `3:4`, `9:16` ## Seedream 5.0 (Text-to-Image) ### Endpoint ``` POST /api/v1/image/task ``` ### Request Parameters #### Required | Parameter | Type | Description | |-----------|------|-------------| | `model_name` | string | Must be `"seedream-v5.0"` | | `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: `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-v5.0', prompt: 'A futuristic cityscape at night with neon lights', 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 5.0 Edit (Image Editing) ### Endpoint ``` POST /api/v1/image/task ``` ### Request Parameters #### Required | Parameter | Type | Description | |-----------|------|-------------| | `model_name` | string | Must be "seedream-v5.0-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"` or `"4k"` | ### Single Image Edit Example ```javascript { model_name: 'seedream-v5.0-edit', image_url_list: ['https://example.com/photo.jpg'], prompt: 'Add dramatic lighting and enhance the colors', width: 16, height: 9, resolution: '2k' } ``` ### Multi-Image Composition Example ```javascript { model_name: 'seedream-v5.0-edit', image_url_list: [ 'https://example.com/image1.jpg', 'https://example.com/image2.jpg' ], prompt: 'Blend these images into a cohesive composition', width: 16, height: 9, resolution: '2k' } ``` ## Response Format ### Initial Response ```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 `GET /api/v1/image/{task_id}` 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`: Image generation in progress - `succeed`: Image generation completed - `failed`: Image generation failed ## Processing Time Typical processing time: 15-60 seconds depending on resolution and complexity. ## Best Practices 1. **Detailed Prompts**: More descriptive prompts yield better results 2. **Resolution Selection**: Use `2k` for faster processing, `4k` for print-quality output 3. **Aspect Ratio**: Match the ratio to your target use case before generating 4. **Image Edit Quality**: For editing, use high-resolution, well-lit source images