google/nano-banana-2/edit
Nano Banana 2 is Google's new state-of-the-art image generation and editing model
PNG, JPEG, WebP, or GIF · 20 MiB maximum each
Example output — click Run to generate your own
Send your first request
OpenAI-compatible endpoint with unified authentication and usage tracking.
https://api.sandbase.ai/v1/rungoogle/nano-banana-2/editInput Schema
7 parameters · 2 required · 5 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
images | string[] | Required | The URLs of the images to use for image-to-image generation or image editing. |
prompt | string | Required | The text prompt to generate an image from. · Min length: 3 · Max length: 50000 · Default: "Make a 3 panel comic in a gritty, noir art style with high-contrast black and white inks. Put the character in a humurous scene." |
resolution | string | Optional | The resolution of the image to generate. · Options: 0.5K, 1K, 2K, 4K · Default: "1K" 0.5K1K2K4K |
aspect_ratio | string | Optional | The aspect ratio of the generated image. · Options: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16, 4:1, 1:4, 8:1, 1:8 21:916:93:24:35:41:14:53:42:39:164:11:48:11:8 |
output_format | string | Optional | The format of the generated image. · Options: jpeg, png · Default: "png" jpegpng |
enable_web_search | boolean | Optional | Enable Google web search grounding to provide background context for image generation. · Default: false |
enable_image_search | boolean | Optional | Enable Google image search to retrieve web images as visual background reference for generation. · Default: false |
Output Schema
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the generation task |
status | string | Task status: pending, running, completed, failed, timeout |
model | string | Model used for the generation |
outputs | array | Array of output items |
outputs[].url | string | URL of the generated artifact |
outputs[].content_type | string | MIME type (e.g. image/png, video/mp4) |
error | object | null | Error details if failed, null on success |
error.type | string | Machine-readable error type code |
error.message | string | Human-readable error description |
Async Workflow
This model uses asynchronous execution. Submit a request and poll for the result.
- Submit — POST to /v1/run, receive an
id - Poll — GET /v1/run/{id} until status is
completed,failed, ortimeout - Retrieve — Read
outputsfrom the completed response
Code Examples
Ready-to-run snippets
# Step 1: Submit
curl -X POST https://api.sandbase.ai/v1/run \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "google/nano-banana-2/edit",
"images": [
"https://ai.google.dev/static/gemini-api/docs/images/man_in_white_glasses.jpg"
],
"prompt": "Make a 3 panel comic in a gritty, noir art style with high-contrast black and white inks. Put the character in a humurous scene.",
"resolution": "1K",
"output_format": "png",
"enable_web_search": false,
"enable_image_search": false
}'
# Step 2: Poll result (replace <id>)
curl https://api.sandbase.ai/v1/run/<id> \
-H "Authorization: Bearer YOUR_API_KEY"API README
Google Nano Banana 2 Image Editing
Fast image editing powered by Google's Nano Banana 2 model. Modify existing images with natural language — swap elements, combine subjects, change backgrounds, or restyle — with support for up to 14 reference images and web search grounding.
- Need to generate from scratch? Try Nano Banana 2.
Highlights
Multi-image synthesis — Accepts up to 14 reference images per request. Combine elements from multiple sources, apply styles cross-image, or use product photos as composition guides.
Web & Image Search grounding — Use Google Image Search to pull web images as visual context, enabling reference-aware edits without manual asset upload.
Extended aspect ratios — Output in extreme ratios (1:8, 8:1) for banners and scrolling content, plus all standard ratios.
Fast turnaround — Optimized for speed, making it suitable for high-volume editing workflows.
Pricing
| Resolution | Price |
|---|---|
| 0.5K | $0.04 |
| 1K | $0.06 |
| 2K | $0.10 |
| 4K | $0.14 |
| Web Search | Free |
| Image Search | Free |
When to Use
| ✅ Good fit | ❌ Consider alternatives |
|---|---|
| Virtual try-on (clothing on models) | Generating from scratch (use Generation model) |
| Product background swaps | Pixel-perfect mask control |
| Combining multiple items into one scene | Real-time interactive editing |
| Style transfer across images | Video manipulation |
| Batch product photo editing | Simple crops or color adjustments |
Technical Specs
| Spec | Value |
|---|---|
| Input | Text prompt + 1–14 image URLs |
| Output | PNG or JPEG |
| Resolution | 0.5K / 1K / 2K / 4K |
| Aspect ratio | 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16, 4:1, 1:4, 8:1, 1:8 |
| Web Search | Google web + image search grounding |
| Execution | Async (submit → poll for result) |
| Typical latency | 20–40 seconds |
Related
- Nano Banana 2 — Text-to-image generation from scratch
- Nano Banana Pro Edit — Higher quality editing at higher cost

