Skip to content

Commit a22ba09

Browse files
techpro-aimlapigitbook-bot
authored andcommitted
GITBOOK-369: docs: add google/gemini-2.5-flash-image and google/gemini-2.5-flash-image-edit
1 parent 13b0dcb commit a22ba09

8 files changed

Lines changed: 225 additions & 2 deletions

File tree

144 KB
Loading
87.6 KB
Loading
2.17 MB
Loading

docs/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@
137137
* [Imagen 3](api-references/image-models/google/imagen-3.0.md)
138138
* [Imagen 4 Preview](api-references/image-models/google/imagen-4-preview.md)
139139
* [Imagen 4 Ultra](api-references/image-models/google/imagen-4-ultra.md)
140+
* [Gemini 2.5 Flash Image](api-references/image-models/google/gemini-2.5-flash-image.md)
141+
* [Gemini 2.5 Flash Image Edit](api-references/image-models/google/gemini-2.5-flash-image-edit.md)
140142
* [OpenAI](api-references/image-models/OpenAI/README.md)
141143
* [DALL·E 2](api-references/image-models/OpenAI/dall-e-2.md)
142144
* [DALL·E 3](api-references/image-models/OpenAI/dall-e-3.md)

docs/api-references/image-models/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ We obtained the following image by running that code example:
6464

6565
## All Available Image Models
6666

67-
<table><thead><tr><th width="274.20001220703125">Model ID + API Reference link</th><th width="123.39996337890625">Developer</th><th width="103.79998779296875">Context</th><th>Model Card</th></tr></thead><tbody><tr><td><a href="alibaba-cloud/qwen-image.md">alibaba/qwen-image</a></td><td>Alibaba Cloud</td><td></td><td><a href="https://aimlapi.com/models/qwen-image">Qwen Image</a></td></tr><tr><td><a href="bytedance/seedream-3.0.md">bytedance/seedream-3.0</a></td><td>ByteDance</td><td></td><td><a href="https://aimlapi.com/models/seedream-3-0">Seedream 3.0</a></td></tr><tr><td><a href="bytedance/seededit-3.0-image-to-image.md">bytedance/seededit-3.0-i2i</a></td><td>ByteDance</td><td></td><td><a href="https://aimlapi.com/models/seedream-3-0">Seedream 3.0</a></td></tr><tr><td><a href="flux/flux-pro.md">flux-pro</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-pro-api">FLUX.1 [pro]</a></td></tr><tr><td><a href="flux/flux-pro.md">flux-pro/v1.1</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-1-pro-api">FLUX 1.1 [pro]</a></td></tr><tr><td><a href="flux/flux-pro-v1.1-ultra.md">flux-pro/v1.1-ultra</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-1-pro-ultra-api">FLUX 1.1 [pro ultra]</a></td></tr><tr><td><a href="flux/flux-realism.md">flux-realism</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-realism-lora-api">FLUX Realism LoRA</a></td></tr><tr><td><a href="flux/flux-dev.md">flux/dev</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-dev-api">FLUX.1 [dev]</a></td></tr><tr><td><a href="flux/flux-dev-image-to-image.md">flux/dev/image-to-image</a></td><td>Flux</td><td></td><td>-</td></tr><tr><td><a href="flux/flux-schnell.md">flux/schnell</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-schnell-api">FLUX.1 [schnell]</a></td></tr><tr><td><a href="flux/flux-kontext-max-text-to-image.md">flux/kontext-max/text-to-image</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-kontext-max">FLUX.1 Kontext [max]</a></td></tr><tr><td><a href="flux/flux-kontext-max-image-to-image.md">flux/kontext-max/image-to-image</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-kontext-max">FLUX.1 Kontext [max]</a></td></tr><tr><td><a href="flux/flux-kontext-pro-text-to-image.md">flux/kontext-pro/text-to-image</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-kontext-pro">Flux.1 Kontext [pro]</a></td></tr><tr><td><a href="flux/flux-kontext-pro-image-to-image.md">flux/kontext-pro/image-to-image</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-kontext-pro">Flux.1 Kontext [pro]</a></td></tr><tr><td><a href="google/imagen-3.0.md">imagen-3.0-generate-002</a></td><td>Google</td><td></td><td><a href="https://aimlapi.com/models/imagen-3-api">Imagen 3</a></td></tr><tr><td><a href="google/imagen-4-preview.md">google/imagen4/preview</a></td><td>Google</td><td></td><td><a href="https://aimlapi.com/models/imagen-4-preview">Imagen 4 Preview</a></td></tr><tr><td><a href="google/imagen-4-ultra.md">imagen-4.0-ultra-generate-preview-06-06</a></td><td>Google</td><td></td><td><a href="https://aimlapi.com/models/imagen-4-ultra">Imagen 4 Ultra</a></td></tr><tr><td><a href="OpenAI/dall-e-2.md">dall-e-2</a></td><td>OpenAI</td><td></td><td><a href="https://aimlapi.com/models/openai-dall-e-2-api">OpenAI DALL·E 2</a></td></tr><tr><td><a href="OpenAI/dall-e-3.md">dall-e-3</a></td><td>OpenAI</td><td></td><td><a href="https://aimlapi.com/models/openai-dall-e-3">OpenAI DALL·E 3</a></td></tr><tr><td><a href="openai/gpt-image-1.md">openai/gpt-image-1</a></td><td>OpenAI</td><td></td><td><a href="https://aimlapi.com/models/gpt-image-1">gpt-image-1</a></td></tr><tr><td><a href="RecraftAI/recraft-v3.md">recraft-v3</a></td><td>Recraft AI</td><td></td><td><a href="https://aimlapi.com/models/recraft-v3">Recraft v3</a></td></tr><tr><td><a href="Stability-AI/stable-diffusion-v3-medium.md">stable-diffusion-v3-medium</a></td><td>Stability AI</td><td></td><td><a href="https://aimlapi.com/models/stable-diffusion-3-api">Stable Diffusion 3</a></td></tr><tr><td><a href="Stability-AI/stable-diffusion-v35-large.md">stable-diffusion-v35-large</a></td><td>Stability AI</td><td></td><td><a href="https://aimlapi.com/models/stable-diffusion-3-5-large-api">Stable Diffusion 3.5 Large</a></td></tr></tbody></table>
67+
<table><thead><tr><th width="274.20001220703125">Model ID + API Reference link</th><th width="123.39996337890625">Developer</th><th width="103.79998779296875">Context</th><th>Model Card</th></tr></thead><tbody><tr><td><a href="alibaba-cloud/qwen-image.md">alibaba/qwen-image</a></td><td>Alibaba Cloud</td><td></td><td><a href="https://aimlapi.com/models/qwen-image">Qwen Image</a></td></tr><tr><td><a href="bytedance/seedream-3.0.md">bytedance/seedream-3.0</a></td><td>ByteDance</td><td></td><td><a href="https://aimlapi.com/models/seedream-3-0">Seedream 3.0</a></td></tr><tr><td><a href="bytedance/seededit-3.0-image-to-image.md">bytedance/seededit-3.0-i2i</a></td><td>ByteDance</td><td></td><td><a href="https://aimlapi.com/models/seedream-3-0">Seedream 3.0</a></td></tr><tr><td><a href="flux/flux-pro.md">flux-pro</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-pro-api">FLUX.1 [pro]</a></td></tr><tr><td><a href="flux/flux-pro.md">flux-pro/v1.1</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-1-pro-api">FLUX 1.1 [pro]</a></td></tr><tr><td><a href="flux/flux-pro-v1.1-ultra.md">flux-pro/v1.1-ultra</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-1-pro-ultra-api">FLUX 1.1 [pro ultra]</a></td></tr><tr><td><a href="flux/flux-realism.md">flux-realism</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-realism-lora-api">FLUX Realism LoRA</a></td></tr><tr><td><a href="flux/flux-dev.md">flux/dev</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-dev-api">FLUX.1 [dev]</a></td></tr><tr><td><a href="flux/flux-dev-image-to-image.md">flux/dev/image-to-image</a></td><td>Flux</td><td></td><td>-</td></tr><tr><td><a href="flux/flux-schnell.md">flux/schnell</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-schnell-api">FLUX.1 [schnell]</a></td></tr><tr><td><a href="flux/flux-kontext-max-text-to-image.md">flux/kontext-max/text-to-image</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-kontext-max">FLUX.1 Kontext [max]</a></td></tr><tr><td><a href="flux/flux-kontext-max-image-to-image.md">flux/kontext-max/image-to-image</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-kontext-max">FLUX.1 Kontext [max]</a></td></tr><tr><td><a href="flux/flux-kontext-pro-text-to-image.md">flux/kontext-pro/text-to-image</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-kontext-pro">Flux.1 Kontext [pro]</a></td></tr><tr><td><a href="flux/flux-kontext-pro-image-to-image.md">flux/kontext-pro/image-to-image</a></td><td>Flux</td><td></td><td><a href="https://aimlapi.com/models/flux-1-kontext-pro">Flux.1 Kontext [pro]</a></td></tr><tr><td><a href="google/imagen-3.0.md">imagen-3.0-generate-002</a></td><td>Google</td><td></td><td><a href="https://aimlapi.com/models/imagen-3-api">Imagen 3</a></td></tr><tr><td><a href="google/imagen-4-preview.md">google/imagen4/preview</a></td><td>Google</td><td></td><td><a href="https://aimlapi.com/models/imagen-4-preview">Imagen 4 Preview</a></td></tr><tr><td><a href="google/imagen-4-ultra.md">imagen-4.0-ultra-generate-preview-06-06</a></td><td>Google</td><td></td><td><a href="https://aimlapi.com/models/imagen-4-ultra">Imagen 4 Ultra</a></td></tr><tr><td><a href="google/gemini-2.5-flash-image.md">google/gemini-2.5-flash-image-</a></td><td>Google</td><td></td><td><em>Coming Soon</em></td></tr><tr><td><a href="google/gemini-2.5-flash-image.md">google/gemini-2.5-flash-image-edit</a></td><td>Google</td><td></td><td><em>Coming Soon</em></td></tr><tr><td><a href="OpenAI/dall-e-2.md">dall-e-2</a></td><td>OpenAI</td><td></td><td><a href="https://aimlapi.com/models/openai-dall-e-2-api">OpenAI DALL·E 2</a></td></tr><tr><td><a href="OpenAI/dall-e-3.md">dall-e-3</a></td><td>OpenAI</td><td></td><td><a href="https://aimlapi.com/models/openai-dall-e-3">OpenAI DALL·E 3</a></td></tr><tr><td><a href="openai/gpt-image-1.md">openai/gpt-image-1</a></td><td>OpenAI</td><td></td><td><a href="https://aimlapi.com/models/gpt-image-1">gpt-image-1</a></td></tr><tr><td><a href="RecraftAI/recraft-v3.md">recraft-v3</a></td><td>Recraft AI</td><td></td><td><a href="https://aimlapi.com/models/recraft-v3">Recraft v3</a></td></tr><tr><td><a href="Stability-AI/stable-diffusion-v3-medium.md">stable-diffusion-v3-medium</a></td><td>Stability AI</td><td></td><td><a href="https://aimlapi.com/models/stable-diffusion-3-api">Stable Diffusion 3</a></td></tr><tr><td><a href="Stability-AI/stable-diffusion-v35-large.md">stable-diffusion-v35-large</a></td><td>Stability AI</td><td></td><td><a href="https://aimlapi.com/models/stable-diffusion-3-5-large-api">Stable Diffusion 3.5 Large</a></td></tr></tbody></table>
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Gemini 2.5 Flash Image Edit
2+
3+
{% hint style="info" %}
4+
This documentation is valid for the following list of our models:
5+
6+
* `google/gemini-2.5-flash-image-edit`
7+
{% endhint %}
8+
9+
## Model Overview
10+
11+
The model takes multiple images as input, with the prompt defining how they are used or combined.
12+
13+
## Setup your API Key
14+
15+
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).
16+
17+
## API Schema
18+
19+
{% openapi-operation spec="gemini-2-5-flash-image-edit" path="/v1/images/generations" method="post" %}
20+
[OpenAPI gemini-2-5-flash-image-edit](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/image-models/Google/gemini-2.5-flash-image-edit.json)
21+
{% endopenapi-operation %}
22+
23+
## Quick Example
24+
25+
Let's generate an image of the specified size using a simple prompt.
26+
27+
{% tabs %}
28+
{% tab title="Python" %}
29+
{% code overflow="wrap" %}
30+
```python
31+
import requests
32+
import json
33+
34+
35+
def main():
36+
response = requests.post(
37+
"https://api.aimlapi.com/v1/images/generations",
38+
headers={
39+
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
40+
"Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
41+
"Content-Type": "application/json",
42+
},
43+
json={
44+
"model": "google/gemini-2.5-flash-image-edit",
45+
"image_urls": [
46+
"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png",
47+
"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blue-mug.jpg"
48+
],
49+
"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.",
50+
}
51+
)
52+
53+
data = response.json()
54+
print(json.dumps(data, indent=2, ensure_ascii=False))
55+
56+
57+
if __name__ == "__main__":
58+
main()
59+
```
60+
{% endcode %}
61+
{% endtab %}
62+
63+
{% tab title="JS" %}
64+
{% code overflow="wrap" %}
65+
```javascript
66+
async function main() {
67+
try {
68+
const response = await fetch('https://api.aimlapi.com/v1/images/generations', {
69+
method: 'POST',
70+
headers: {
71+
// Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
72+
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
73+
'Content-Type': 'application/json',
74+
},
75+
body: JSON.stringify({
76+
model: 'google/gemini-2.5-flash-image-edit',
77+
image: 'https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png',
78+
prompt: 'Add a bird to the foreground of the photo.',
79+
}),
80+
});
81+
}
82+
83+
main();
84+
```
85+
{% endcode %}
86+
{% endtab %}
87+
{% endtabs %}
88+
89+
<details>
90+
91+
<summary>Response</summary>
92+
93+
{% code overflow="wrap" %}
94+
```json5
95+
{
96+
"images": [
97+
{
98+
"url": "https://cdn.aimlapi.com/eagle/files/panda/9g3PokYLjWoygTVrRgfvG_output.png",
99+
"content_type": "image/png",
100+
"file_name": "output.png",
101+
"file_size": 2273159,
102+
"width": null,
103+
"height": null
104+
}
105+
],
106+
"description": "Here is your T-Rex in a business suit, enjoying a drink in a cozy cafe! "
107+
}
108+
```
109+
{% endcode %}
110+
111+
</details>
112+
113+
<table data-full-width="false"><thead><tr><th width="339.6666259765625" valign="top">Reference Images</th><th valign="top">Generated Image</th></tr></thead><tbody><tr><td valign="top"><div><figure><img src="../../../.gitbook/assets/flux-dev-t-rex.png" alt=""><figcaption><p>Image #1</p></figcaption></figure></div></td><td valign="top"><div><figure><img src="../../../.gitbook/assets/gemini_2.5_flash_image_edit_output.png" 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 (1).jpg" alt=""><figcaption><p>Image #2</p></figcaption></figure></div></td><td valign="top"></td></tr></tbody></table>
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Gemini 2.5 Flash Image
2+
3+
{% hint style="info" %}
4+
This documentation is valid for the following list of our models:
5+
6+
* `google/gemini-2.5-flash-image`
7+
{% endhint %}
8+
9+
## Model Overview <a href="#model-overview" id="model-overview"></a>
10+
11+
Google’s smartest image generation model as of August 2025.
12+
13+
{% hint style="info" %}
14+
Images produced or modified with Gemini 2.5 Flash Image carry an invisible SynthID digital watermark, allowing them to be recognized as AI-generated or edited.
15+
{% endhint %}
16+
17+
## Setup your API Key <a href="#setup-your-api-key" id="setup-your-api-key"></a>
18+
19+
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).
20+
21+
## API Schema
22+
23+
{% openapi-operation spec="gemini-2-5-flash-image" path="/v1/images/generations" method="post" %}
24+
[OpenAPI gemini-2-5-flash-image](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/image-models/Google/gemini-2.5-flash-image.json)
25+
{% endopenapi-operation %}
26+
27+
## Quick Example
28+
29+
Let's generate an image of the specified aspect ratio using a simple prompt.
30+
31+
{% tabs %}
32+
{% tab title="Python" %}
33+
{% code overflow="wrap" %}
34+
```python
35+
import requests
36+
37+
38+
def main():
39+
response = requests.post(
40+
"https://api.aimlapi.com/v1/images/generations",
41+
headers={
42+
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
43+
"Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
44+
"Content-Type": "application/json",
45+
},
46+
json={
47+
"model": "google/gemini-2.5-flash-image",
48+
"prompt": "Racoon eating ice-cream"
49+
}
50+
)
51+
52+
response.raise_for_status()
53+
data = response.json()
54+
55+
print("Generation:", data)
56+
57+
58+
if __name__ == "__main__":
59+
main()
60+
```
61+
{% endcode %}
62+
{% endtab %}
63+
64+
{% tab title="JS" %}
65+
{% code overflow="wrap" %}
66+
```javascript
67+
async function main() {
68+
try {
69+
const response = await fetch('https://api.aimlapi.com/v1/images/generations', {
70+
method: 'POST',
71+
headers: {
72+
// Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
73+
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
74+
'Content-Type': 'application/json',
75+
},
76+
body: JSON.stringify({
77+
model: 'google/gemini-2.5-flash-image',
78+
prompt: 'Racoon eating ice-cream',
79+
aspect_ratio: '16:9'
80+
}),
81+
});
82+
83+
} catch (error) {
84+
console.error('Error:', error);
85+
}
86+
}
87+
88+
main();
89+
```
90+
{% endcode %}
91+
{% endtab %}
92+
{% endtabs %}
93+
94+
<details>
95+
96+
<summary>Response</summary>
97+
98+
{% code overflow="wrap" %}
99+
```json5
100+
Generation: {'images': [{'url': 'https://cdn.aimlapi.com/eagle/files/elephant/Ltdy-0QLZAnyBGLRyh-pP.jpeg', 'content_type': None, 'file_name': None, 'file_size': None}], 'description': "Sounds adorable! Here's a racoon enjoying some ice cream: "}
101+
```
102+
{% endcode %}
103+
104+
</details>
105+
106+
So we obtained the following 1024x1024 image by running this code example:
107+
108+
<figure><img src="../../../.gitbook/assets/Ltdy-0QLZAnyBGLRyh-pP.jpeg" alt=""><figcaption><p>In reality, raccoons shouldn’t be given ice cream or chocolate—it’s harmful to their metabolism. <br>But in the AI world, raccoons party like there’s no tomorrow.</p></figcaption></figure>

0 commit comments

Comments
 (0)