Views
No views yet
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.
| 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 |
pip install requests1import os
2import time
3import requests
4
5API = "https://api.apiframe.ai/v2"
6headers = {
7 "X-API-Key": os.environ["APIFRAME_API_KEY"],
8 "Content-Type": "application/json",
9}
10
11job = requests.post(
12 f"{API}/images/generate",
13 headers=headers,
14 json={
15 "model": "nano-banana",
16 "prompt": "a serene mountain lake at dawn",
17 "nanoBananaParams": {
18 "aspect_ratio": "16:9",
19 "output_format": "png",
20 },
21 },
22).json()
23
24while True:
25 result = requests.get(f"{API}/jobs/{job['jobId']}", headers=headers).json()
26 if result["status"] in ("COMPLETED", "FAILED"):
27 break
28 time.sleep(2)
29
30print(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.1import os
2import requests
3
4headers = {
5 "X-API-Key": os.environ["APIFRAME_API_KEY"],
6 "Content-Type": "application/json",
7}
8
9requests.post(
10 "https://api.apiframe.ai/v2/images/generate",
11 headers=headers,
12 json={
13 "model": "nano-banana",
14 "prompt": "change the wall color to sage green, keep everything else the same",
15 "nanoBananaParams": {
16 "image_input": ["https://example.com/photo.jpg"],
17 "output_format": "png",
18 },
19 },
20)model for nano-banana-2 or nano-banana-pro to use a later variant. Those ids also accept resolution (1K, 2K, 4K).X-API-Key).