|
| 1 | +# Seedream 4.5 |
| 2 | + |
| 3 | +{% columns %} |
| 4 | +{% column width="66.66666666666666%" %} |
| 5 | +{% hint style="info" %} |
| 6 | +This documentation is valid for the following list of our models: |
| 7 | + |
| 8 | +* `bytedance/seedream-4-5` |
| 9 | +{% endhint %} |
| 10 | +{% endcolumn %} |
| 11 | + |
| 12 | +{% column width="33.33333333333334%" %} |
| 13 | +<a href="https://aimlapi.com/app/bytedance/seedream-4-5" class="button primary">Try in Playground</a> |
| 14 | +{% endcolumn %} |
| 15 | +{% endcolumns %} |
| 16 | + |
| 17 | +## Model Overview |
| 18 | + |
| 19 | +The model combines both text-to-image and image-to-image capabilities. Compared to [Seedream 4.0](seedream-v4-edit-image-to-image.md), this model significantly improves editing consistency (preserving subject details, lighting, and color tone), the quality of portraits and small text. |
| 20 | + |
| 21 | +## Setup your API Key |
| 22 | + |
| 23 | +If you don’t have an API key for the AI/ML API yet, feel free to use our [Quickstart guide](https://docs.aimlapi.com/quickstart/setting-up). |
| 24 | + |
| 25 | +## API Schema |
| 26 | + |
| 27 | +{% openapi-operation spec="seedream-4-5" path="/v1/images/generations" method="post" %} |
| 28 | +[OpenAPI seedream-4-5](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/image-models/ByteDance/seedream-4-5.json) |
| 29 | +{% endopenapi-operation %} |
| 30 | + |
| 31 | +## Quick Example |
| 32 | + |
| 33 | +Let's generate a new image using the one from [the flux/dev Quick Example](../flux/flux-dev.md#quick-example) as a reference — and make a simple change to it with a prompt. |
| 34 | + |
| 35 | +{% tabs %} |
| 36 | +{% tab title="Python" %} |
| 37 | +{% code overflow="wrap" %} |
| 38 | +```python |
| 39 | +import requests |
| 40 | +import json # for getting a structured output with indentation |
| 41 | + |
| 42 | +def main(): |
| 43 | + response = requests.post( |
| 44 | + "https://api.aimlapi.com/v1/images/generations", |
| 45 | + headers={ |
| 46 | + # Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>: |
| 47 | + "Authorization": "Bearer <YOUR_AIMLAPI_KEY>", |
| 48 | + "Content-Type": "application/json", |
| 49 | + }, |
| 50 | + json={ |
| 51 | + "model": "bytedance/seedream-4-5", |
| 52 | + "prompt": "Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect.", |
| 53 | + "image_urls": [ |
| 54 | + "https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png", |
| 55 | + "https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blue-mug.jpg" |
| 56 | + ] |
| 57 | + } |
| 58 | + ) |
| 59 | + |
| 60 | + data = response.json() |
| 61 | + print(json.dumps(data, indent=2, ensure_ascii=False)) |
| 62 | + |
| 63 | +if __name__ == "__main__": |
| 64 | + main() |
| 65 | +``` |
| 66 | +{% endcode %} |
| 67 | +{% endtab %} |
| 68 | + |
| 69 | +{% tab title="JS" %} |
| 70 | +{% code overflow="wrap" %} |
| 71 | +```javascript |
| 72 | +async function main() { |
| 73 | + const response = await fetch('https://api.aimlapi.com/v1/images/generations', { |
| 74 | + method: 'POST', |
| 75 | + headers: { |
| 76 | + // Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>: |
| 77 | + 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>', |
| 78 | + 'Content-Type': 'application/json', |
| 79 | + }, |
| 80 | + body: JSON.stringify({ |
| 81 | + model: 'bytedance/seedream-4-5', |
| 82 | + prompt: 'Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect.', |
| 83 | + image_urls: [ |
| 84 | + "https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png", |
| 85 | + "https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blue-mug.jpg" |
| 86 | + ] |
| 87 | + }), |
| 88 | + }); |
| 89 | + |
| 90 | + const data = await response.json(); |
| 91 | + console.log(data); |
| 92 | +} |
| 93 | + |
| 94 | +main(); |
| 95 | +``` |
| 96 | +{% endcode %} |
| 97 | +{% endtab %} |
| 98 | +{% endtabs %} |
| 99 | + |
| 100 | +<details> |
| 101 | + |
| 102 | +<summary>Response</summary> |
| 103 | + |
| 104 | +{% code overflow="wrap" %} |
| 105 | +```json5 |
| 106 | +{ |
| 107 | + "data": [ |
| 108 | + { |
| 109 | + "url": "https://cdn.aimlapi.com/bison/seedream-4-5/02176522545211712014becacfaf8a37949eaec3c8139753caaae_0.jpeg?X-Tos-Algorithm=TOS4-HMAC-SHA256&X-Tos-Credential=AKLTYWJkZTExNjA1ZDUyNDc3YzhjNTM5OGIyNjBhNDcyOTQ%2F20251208%2Fap-southeast-1%2Ftos%2Frequest&X-Tos-Date=20251208T202437Z&X-Tos-Expires=86400&X-Tos-Signature=9be05c928d39a74abc5c06bff5759a28449256d72f1d062933479f279bc672cb&X-Tos-SignedHeaders=host", |
| 110 | + "size": "2048x2048" |
| 111 | + } |
| 112 | + ], |
| 113 | + "meta": { |
| 114 | + "usage": { |
| 115 | + "credits_used": 84000 |
| 116 | + } |
| 117 | + } |
| 118 | +} |
| 119 | +``` |
| 120 | +{% endcode %} |
| 121 | + |
| 122 | +</details> |
| 123 | + |
| 124 | +<table data-full-width="true"><thead><tr><th width="442.0667724609375" valign="top">Reference Images</th><th valign="top">Generated Image</th></tr></thead><tbody><tr><td valign="top"><div><figure><img src="../../../.gitbook/assets/t rex (1).png" alt=""><figcaption><p>Image #1</p></figcaption></figure></div></td><td valign="top"><div><figure><img src="../../../.gitbook/assets/bytedance-seedream-4-5_output.jpeg" alt=""><figcaption><p><kbd><code>"Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect."</code></kbd></p></figcaption></figure></div></td></tr><tr><td valign="top"><div><figure><img src="../../../.gitbook/assets/blue mug.jpg" alt=""><figcaption><p>Image #2</p></figcaption></figure></div></td><td valign="top"></td></tr></tbody></table> |
0 commit comments