File size: 3,035 Bytes
27754b7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | ---
language:
- en
license: other
pipeline_tag: text-to-image
tags:
- nano-banana
- text-to-image
- image-to-image
inference: false
---
# Nano Banana API
**Model Page:** [Nano Banana API](https://apiframe.ai/models/nano-banana)
Community model card for calling Nano Banana through a REST API.
This repo documents the `nano-banana` model as exposed by Apiframe: Google's Gemini 2.5 Flash Image, text-to-image and image-to-image, up to 14 reference images, mask-free edits from a text prompt. Related ids on the same endpoint: `nano-banana-pro`, `nano-banana-2`, `nano-banana-2-lite`.
This repository does not host weights. Nano Banana is a closed model. Inference runs remotely.
<img src="https://apiframe.ai/models-examples/nano-banana-character-consistency-four-panel-day.jpeg" alt="Sample output" width="280" />
## Model description
| | |
|---|---|
| Architecture | Gemini 2.5 Flash Image (Nano Banana) |
| Task | text-to-image; image-to-image (up to 14 references) |
| Output | 1 image |
| Aspect ratios | `1:1`, `3:4`, `4:3`, `9:16`, `16:9` |
| Typical latency | ~9s |
## How to use
```bash
pip install requests
```
```python
import os
import time
import requests
API = "https://api.apiframe.ai/v2"
headers = {
"X-API-Key": os.environ["APIFRAME_API_KEY"],
"Content-Type": "application/json",
}
job = requests.post(
f"{API}/images/generate",
headers=headers,
json={
"model": "nano-banana",
"prompt": "a serene mountain lake at dawn",
"nanoBananaParams": {
"aspect_ratio": "16:9",
"output_format": "png",
},
},
).json()
while True:
result = requests.get(f"{API}/jobs/{job['jobId']}", headers=headers).json()
if result["status"] in ("COMPLETED", "FAILED"):
break
time.sleep(2)
print(result.get("result"))
```
`result["images"]` is a list with one CDN URL. Pass `webhookUrl` on the generate call if you do not want to poll.
### Image-to-image
```python
import os
import requests
headers = {
"X-API-Key": os.environ["APIFRAME_API_KEY"],
"Content-Type": "application/json",
}
requests.post(
"https://api.apiframe.ai/v2/images/generate",
headers=headers,
json={
"model": "nano-banana",
"prompt": "change the wall color to sage green, keep everything else the same",
"nanoBananaParams": {
"image_input": ["https://example.com/photo.jpg"],
"output_format": "png",
},
},
)
```
Swap `model` for `nano-banana-2` or `nano-banana-pro` to use a later variant. Those ids also accept `resolution` (`1K`, `2K`, `4K`).
## Limitations
- Closed model. No weights, fine-tuning, or local inference.
- Requires an Apiframe API key (`X-API-Key`).
- Outputs carry Google's SynthID watermark.
- Commercial use follows Google's terms.
- Generated media is retained on the CDN for 90 days.
## License
Outputs are subject to Google's terms. This card is documentation only. Apiframe is not affiliated with, endorsed by, or sponsored by Google LLC.
|