NanoBanana Image Generation
Generate and edit AI images through AceDataCloud's NanoBanana (Gemini-based) API.
Setup: See authentication for token setup.
Quick Start
curl -X POST https://api.acedata.cloud/nano-banana/images \
-H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action": "generate", "prompt": "a watercolor painting of a French countryside village", "model": "nano-banana"}'
Async: See async task polling. Poll via POST /nano-banana/tasks with {"id": "..."}.
Models
| Model |
Best For |
nano-banana |
Standard image generation (default) |
nano-banana-2-lite |
Fast, lightweight second-generation model |
nano-banana-2 |
Improved quality, second generation |
nano-banana-pro |
Highest quality, most detailed output |
nano-banana:official |
Official channel variant of nano-banana |
nano-banana-2-lite:official |
Official channel variant of nano-banana-2-lite |
nano-banana-2:official |
Official channel variant of nano-banana-2 |
nano-banana-pro:official |
Official channel variant of nano-banana-pro |
Workflows
1. Text-to-Image
POST /nano-banana/images
{
"action": "generate",
"prompt": "a photorealistic macro shot of morning dew on a spider web",
"model": "nano-banana-pro",
"aspect_ratio": "16:9",
"resolution": "2K"
}
2. Image Editing
Edit existing images using natural language instructions — no mask needed. Pass source images via image_urls.
POST /nano-banana/images
{
"action": "edit",
"prompt": "change the background to a starry night sky",
"image_urls": ["https://example.com/photo.jpg"],
"model": "nano-banana"
}
Parameters
| Parameter |
Values |
Description |
action |
"generate", "edit" |
Operation mode |
model |
"nano-banana", "nano-banana-2-lite", "nano-banana-2", "nano-banana-pro", "nano-banana:official", "nano-banana-2-lite:official", "nano-banana-2:official", "nano-banana-pro:official" |
Model to use |
prompt |
string |
Image description or editing instruction |
image_urls |
array of strings |
Source image URLs (required for edit action) |
aspect_ratio |
"1:1", "3:2", "2:3", "16:9", "9:16", "4:3", "3:4" |
Output aspect ratio |
resolution |
"1K", "2K", "4K" |
Output resolution (1K=1024px, 2K=2048px, 4K=4096px) |
callback_url |
string |
Async callback URL; returns a task ID immediately |
Gotchas
- Editing does NOT require a mask — just describe the change in natural language
- Editing uses the same
/nano-banana/images endpoint with action: "edit" and image_urls array (not a separate /edit path)
nano-banana-2 is the second-generation model; nano-banana-pro offers the highest quality
:official variants (e.g., nano-banana:official) route through the official channel
- Task polling uses
id (not task_id) in the /nano-banana/tasks request body
- Aspect ratio uses colon notation (e.g.,
"16:9") not pixel dimensions
- The Gemini-based model excels at understanding complex, conversational editing instructions
MCP: pip install mcp-nano-banana | Hosted: https://nanobanana.mcp.acedata.cloud/mcp | See all MCP servers
1---
2name: nano-banana-image
3description: Generate and edit AI images with NanoBanana (Gemini-based) via AceDataCloud API. Use when creating images from text prompts or editing existing images with text instructions. Supports nano-banana, nano-banana-2-lite, nano-banana-2, nano-banana-pro and their :official variants.
4license: Apache-2.0
5metadata:
6 author: acedatacloud
7 version: "1.0"
8compatibility: Requires ACEDATACLOUD_API_TOKEN in .env file (see _shared/authentication.md). Optionally pair with mcp-nano-banana for tool-use.
9---
10
11# NanoBanana Image Generation
12
13Generate and edit AI images through AceDataCloud's NanoBanana (Gemini-based) API.
14
15> **Setup:** See [authentication](../_shared/authentication.md) for token setup.
16
17## Quick Start
18
19```bash
20curl -X POST https://api.acedata.cloud/nano-banana/images \
21 -H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
22 -H "Content-Type: application/json" \
23 -d '{"action": "generate", "prompt": "a watercolor painting of a French countryside village", "model": "nano-banana"}'
24```
25
26> **Async:** See [async task polling](../_shared/async-tasks.md). Poll via `POST /nano-banana/tasks` with `{"id": "..."}`.
27## Models
28
29| Model | Best For |
30|-------|----------|
31| `nano-banana` | Standard image generation (default) |
32| `nano-banana-2-lite` | Fast, lightweight second-generation model |
33| `nano-banana-2` | Improved quality, second generation |
34| `nano-banana-pro` | Highest quality, most detailed output |
35| `nano-banana:official` | Official channel variant of `nano-banana` |
36| `nano-banana-2-lite:official` | Official channel variant of `nano-banana-2-lite` |
37| `nano-banana-2:official` | Official channel variant of `nano-banana-2` |
38| `nano-banana-pro:official` | Official channel variant of `nano-banana-pro` |
39
40## Workflows
41
42### 1. Text-to-Image
43
44```json
45POST /nano-banana/images
46{
47 "action": "generate",
48 "prompt": "a photorealistic macro shot of morning dew on a spider web",
49 "model": "nano-banana-pro",
50 "aspect_ratio": "16:9",
51 "resolution": "2K"
52}
53```
54
55### 2. Image Editing
56
57Edit existing images using natural language instructions — no mask needed. Pass source images via `image_urls`.
58
59```json
60POST /nano-banana/images
61{
62 "action": "edit",
63 "prompt": "change the background to a starry night sky",
64 "image_urls": ["https://example.com/photo.jpg"],
65 "model": "nano-banana"
66}
67```
68
69## Parameters
70
71| Parameter | Values | Description |
72|-----------|--------|-------------|
73| `action` | `"generate"`, `"edit"` | Operation mode |
74| `model` | `"nano-banana"`, `"nano-banana-2-lite"`, `"nano-banana-2"`, `"nano-banana-pro"`, `"nano-banana:official"`, `"nano-banana-2-lite:official"`, `"nano-banana-2:official"`, `"nano-banana-pro:official"` | Model to use |
75| `prompt` | string | Image description or editing instruction |
76| `image_urls` | array of strings | Source image URLs (required for edit action) |
77| `aspect_ratio` | `"1:1"`, `"3:2"`, `"2:3"`, `"16:9"`, `"9:16"`, `"4:3"`, `"3:4"` | Output aspect ratio |
78| `resolution` | `"1K"`, `"2K"`, `"4K"` | Output resolution (1K=1024px, 2K=2048px, 4K=4096px) |
79| `callback_url` | string | Async callback URL; returns a task ID immediately |
80
81## Gotchas
82
83- Editing does **NOT** require a mask — just describe the change in natural language
84- Editing uses the same `/nano-banana/images` endpoint with `action: "edit"` and `image_urls` array (not a separate `/edit` path)
85- `nano-banana-2` is the second-generation model; `nano-banana-pro` offers the highest quality
86- `:official` variants (e.g., `nano-banana:official`) route through the official channel
87- Task polling uses `id` (not `task_id`) in the `/nano-banana/tasks` request body
88- Aspect ratio uses colon notation (e.g., `"16:9"`) not pixel dimensions
89- The Gemini-based model excels at understanding complex, conversational editing instructions
90
91> **MCP:** `pip install mcp-nano-banana` | Hosted: `https://nanobanana.mcp.acedata.cloud/mcp` | See [all MCP servers](../_shared/mcp-servers.md)