Happy Horse 1.0 is now on ModelsLab

Try Now
Skip to main content
Available now on ModelsLab · Image Generation

Nano Banana 2 API — Gemini Image EditingGoogle Gemini's image editing model via REST API. No GCP setup, free API key.

Nano Banana 2 API — Gemini Image Editing

Why teams ship with Nano Banana 2

Nano Banana 2

Google Gemini's image editing model

Nano Banana 2 is Google's newer image editing release in the Gemini family — sharper outputs, better text rendering inside images, and stronger multi-subject composition vs. the original Nano Banana.

Instruction-based edit

Edit with natural language

Pass an existing image plus a plain-English instruction and the model performs the edit. No prompt-engineering hacks required: 'replace the background with a sunlit kitchen' just works.

Character consistency

Keep subjects identical across edits

Generate variations of the same character, product, or scene without identity drift. Essential for storyboards, ad variants, and avatar workflows.

Multi-image composition

Combine multiple reference images

Pass two or more init images and the model blends them into a single coherent output. Ideal for try-on, scene composition, and creative assembly use cases.

Single REST endpoint

No GCP, no service accounts

One API key, one POST request. ModelsLab handles the GCP plumbing so your team ships features instead of provisioning infrastructure.

Resolution

1024px and 2048px outputs

Generate at 1024×1024 for fast iteration, scale up to 2048×2048 for hero assets. Pair with the Real-ESRGAN API for 4x super-resolution to print-ready dimensions.

Async support

Webhook delivery for batch

Submit batches of edits and receive webhook callbacks as each completes. Perfect for catalog edits, bulk photo retouching, and marketing content pipelines.

Unified billing

Same API key across modalities

Use Nano Banana 2 alongside the image, video, audio, and LLM APIs on a single dashboard, single bill, single API key.

Examples

Nano Banana 2 image edit examples

Copy any prompt below and try it yourself in the playground.

Lighting Transformation

Change this daytime landscape to golden hour sunset lighting. Keep the mountains sharp and increase the warmth of the sky to deep orange and pink tones.

Background Replacement

Replace the background with a modern minimalist office space. Keep the person in the foreground sharp and well-lit, matching the new indoor lighting.

Style Transfer

Apply the cinematic color grading and film grain from this reference photo to the product image. Maintain all product details and proportions.

Object Removal

Remove the power lines from this architectural photograph. Fill the sky naturally while preserving the building's sharp details and original lighting.

For Developers

A few lines of code.
Image editing in one POST

ModelsLab handles the infrastructure: fast inference, auto-scaling, and a developer-friendly API. No GPU management needed.

  • Serverless: scales to zero, scales to millions
  • Pay per image, no minimums
  • Python and JavaScript SDKs, plus REST API
import requests
response = requests.post(
"https://modelslab.com/api/v7/images/image-to-image",
json={
"key": "YOUR_API_KEY",
"prompt": "The girl in image 1 and the dog in image 2 together in same frame, in living room, sofa in the background",
"init_image": "",
"aspect_ratio": "1:1"
}
)
print(response.json())

FAQ

Common questions about Nano Banana 2 API — Gemini Image Editing

Read the docs

The Nano Banana 2 API is a REST endpoint that runs Google Gemini's image editing model on cloud GPU infrastructure. POST an image plus a natural-language instruction; receive an edited image as a hosted URL. No Google Cloud setup required.

Nano Banana 2 is the newer Gemini image release with sharper outputs, better text rendering inside images, and stronger multi-subject composition. The original Nano Banana (Gemini 2.5 Flash Image) is still available; Nano Banana 2 is the recommended upgrade for new integrations.

Pass an existing image URL and a plain-English instruction in your request. The model interprets the instruction and produces the edited image. Examples: 'replace the background with a kitchen', 'make the shirt blue', 'remove the person on the left', 'add cinematic lighting'.

Yes. Pass the same source character image across multiple requests and the model preserves identity, clothing, and key features. This is one of the strongest capabilities in the Nano Banana family.

Yes. Pass two or more init_image URLs and a prompt describing how to combine them. The model produces a single coherent output. Common patterns: try-on (model + garment), scene composition (subject + background), creative assembly (style + content).

JPEG, PNG, and WebP. Maximum input dimension is 4096×4096 pixels. Multi-image requests accept up to 4 reference images per call.

Single image edits typically complete in 4–8 seconds. Multi-image composition takes 8–12 seconds. There are no cold starts on the dedicated GPU pool.

Pricing is per generation, starting at $0.01 per edit at 1024px and $0.02 per edit at 2048px. Multi-image composition is billed at $0.03 per output. No subscription required.

Yes. Source images, prompts, and generated outputs are processed in compliant regions and removed from infrastructure after delivery. A signed DPA is available for enterprise customers.

Direct Google Cloud access requires a GCP project, service accounts, billing setup, and IAM configuration — typically days of engineering work. ModelsLab gives you a single API key and an unchanging endpoint URL. Same model, no GCP plumbing.

Ready to create?

Start generating with Nano Banana 2 API — Gemini Image Editing on ModelsLab.