Back to Models

Nano Banana 2

Second-generation Nano Banana models for image generation and prompt-based editing, with stronger prompt adherence than the original.

Defaultfrom$0.04Image Editingfrom$0.04
Pricingstarting $0.04/request
Latency~30 seconds average
Resolution1K/2K/4K
Best fortext to image, Improved, Balanced

Parameters

Estimated Cost

You save 50% on this model
Base cost per request$0.08
Discount-50%
Your Total$0.04
You save $0.04 per request

Sign in to run models

Output Preview

Ready

No output yet

Run the model to see generated results.

Sample Output

API Example— Current Parameters

generate.py
import requests

result = requests.post(
    'https://api.e2x.ai/v1/jobs/submit',
    headers={
        'Authorization': f'Bearer {API_KEY}',
        'Content-Type': 'application/json'
    },
    json={
  'model': 'google/nano-banana-2/edit-image',
  'input': {}
}
)

Get Job— Poll for result

get_job.py
import time

job_id = result.json()['jobId']

while True:
    response = requests.get(
        f'https://api.e2x.ai/v1/jobs/{'{job_id}'}',
        headers={'Authorization': f'Bearer {'{API_KEY}'}'}
    )
    data = response.json()['data']

    if data['status'] == 'completed':
        print('Done!', data['outputs'][0]['url'])
        break
    elif data['status'] == 'failed':
        raise Exception(f"Job failed: {'{'}data['error']['message']{'}'}")

    time.sleep(2)
Explore Alternatives

Related Models

Discover more AI models for Image Editing

View all models

Nano Banana 2 Image Editing API on E2X

Nano Banana 2 is Google's gemini-3.1-flash-image, and its editing capability is the workhorse of our image catalog. We expose it as google/nano-banana-2/edit-image, we charge $0.04 per edited image at the 1K default, and one request can carry up to fourteen source images. fal.ai lists the same model at $0.08.

No source image to work from? Then you want Nano Banana 2 text-to-image instead — same model, same price, prompt only.

Worth stating plainly, because provider catalogs have muddled it: this is not Nano Banana Pro. Pro is gemini-3-pro-image, roughly double the price at source. If another site's table shows "Nano Banana 2" with Pro's specs, check the Gemini model ID underneath.

Our pricing as of August 26, 2026:

API providerPrice per edit (1K)vs. E2X
E2X$0.04—
fal.ai$0.08we're 50% lower
WaveSpeed$0.07we're 43% lower
Google Gemini API$0.067we're 40% lower

Prices and product terms can change. Check each provider's current pricing before making a purchasing decision. Google Batch or Flex pricing is not directly equivalent to a standard on-demand API request because scheduling, availability, and processing conditions differ; it is therefore excluded from this comparison. This is a scoped comparison, not a claim that E2X is the world's cheapest option in every configuration.

Resolution is what moves that number, in fixed steps:

ResolutionMultiplierPer editfal.ai
1K (default)×1$0.04$0.08
2K×1.5$0.06$0.12
4K×2$0.08$0.16

Notice where that lands: a 4K edit from us costs what fal.ai charges for a 1K one. The machine-readable spec mirrors these values.

What half of Pro's price actually buys

Google prices gemini-3.1-flash-image at exactly half of gemini-3-pro-image, and the capability difference is much smaller than the price difference. Editing makes that asymmetry even more favourable — you're transforming an image that already looks right, so the model has less to invent.

The parts that matter in a pipeline:

  • Fourteen source images in one call. Composite a subject, a product and a background reference without chaining three requests and babysitting the intermediate outputs. There's no enforced role split — you decide what each attachment is for and say so in the prompt.
  • Output up to 4K. This is the decisive gap against the cheaper Lite tier, which exposes no resolution parameter whatsoever — 1K is all it returns. If an edited asset has to go to print or a retina hero slot, Lite is out of the running.
  • Thinking mode before it paints. The model reasons about what you asked to change. That's why a well-scoped edit holds the untouched regions instead of quietly regenerating them.
  • Search grounding, Image Search included. Useful when an edit has to match something real — a specific building behind your subject, a genuine product variant.

Median latency runs around 8.4 seconds. Function calling isn't supported, so an agent loop has to orchestrate this model from outside.

API request: editing with references

Two fields are required: prompt and image_urls. Keep your key server-side and post the job.

curl -X POST https://api.e2x.ai/v1/jobs/submit \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/nano-banana-2/edit-image",
    "input": {
      "prompt": "Image 1 is the sneaker, image 2 is the surface reference. Put the sneaker on the wet concrete from image 2, matching its reflections. Do not alter the shoe or its logo.",
      "image_urls": [
        "https://example.com/sneaker.png",
        "https://example.com/concrete.jpg"
      ],
      "aspect_ratio": "1:1",
      "resolution": "2k"
    }
  }'

Submitting returns a job ID. Poll until it settles:

const headers = {
  Authorization: `Bearer ${process.env.E2X_API_KEY}`,
  "Content-Type": "application/json",
};

const submitted = await fetch("https://api.e2x.ai/v1/jobs/submit", {
  method: "POST",
  headers,
  body: JSON.stringify({
    model: "google/nano-banana-2/edit-image",
    input: {
      prompt: "Change the season outside the window to deep winter. Keep the room, the furniture and the person exactly as they are.",
      image_urls: ["https://example.com/interior.jpg"],
      aspect_ratio: "3:2",
      resolution: "1k",
    },
  }),
}).then((r) => r.json());

const jobId = submitted.data.jobId;

for (;;) {
  const job = await fetch(`https://api.e2x.ai/v1/jobs/${jobId}`, { headers })
    .then((r) => r.json());
  if (job.data.status === "completed") {
    console.log(job.data.outputs[0].url);
    break;
  }
  if (job.data.status === "failed") {
    throw new Error(job.data.error?.message ?? "Edit failed");
  }
  await new Promise((r) => setTimeout(r, 1500));
}

Statuses go pending → processing → completed, or land on failed / cancelled. Pass a webhookUrl in the submit body and we'll call you instead.

Schema details worth pinning: image_urls is an array even for one source, our aspect_ratio default is 9:16 rather than the source image's own ratio, and resolution values are lowercase. That default is the one that surprises people — feed in a landscape photo without setting it and a portrait crop comes back.

Choosing between our image editing models

Nano Banana 2 is our default recommendation for editing, but it isn't the right answer for every job. Here's what else we run:

ModelPrice / editPick it when
Nano Banana 2$0.042K/4K output, multi-reference composites, grounded edits
Nano Banana 2 Lite$0.0238Bulk 1K edits, one instruction at a time
Nano Banana Pro$0.075Rewriting text inside an image, strict identity across a set
Nano Banana (legacy)$0.0312A pipeline you haven't migrated yet
GPT Image 2from $0.0525Mask-based editing, or you want OpenAI's look

If your edits are background swaps and colour corrections at 1K, move to Nano Banana 2 Lite — around 40% cheaper, tied on text and reference consistency, and at volume that gap is the whole margin. Two reasons not to: Lite tops out at 1K forever, and it gets less reliable once a prompt asks it to place several objects correctly. That second failure is subtle, so test your own worst prompt rather than trusting a benchmark.

Go up to Nano Banana Pro when readable words inside the frame are the deliverable. Ignore the legacy row unless you're stuck on it: Google now classes gemini-2.5-flash-image as legacy and recommends Nano Banana 2 Lite instead — newer and cheaper at once. The rest sits in the image editing category and the wider model catalog.

Writing edit prompts that hold

The instinct carried over from generation is to describe the finished picture. In an edit that competes with the source, and you get a drifting re-render instead of the change you asked for.

Say what changes, then say what must not. Naming the protected regions is not optional — the model holds a face, a logo or a label far better when you tell it those are off limits.

Index your attachments in the prompt. "Image 1 is the subject, image 2 is a lighting reference only" is the model's only signal about intent; without it, attachment three becomes another subject to include.

Chained edits are where quality quietly leaks. Each pass re-encodes, and small identity drift compounds over four or five rounds. Collapse a sequence into one request with every reference attached — same $0.04 either way, and the single-pass result is usually cleaner.

Before you ship

Every edited output carries a SynthID watermark. Google applies it unconditionally, and no provider — us included — exposes a flag to disable it. If a contract prohibits AI-generated assets, settle that before writing the integration.

Watch your input quality. A soft, over-compressed source constrains the output whatever resolution you request; asking for 4K from a 600px JPEG buys an expensive upscale of the original's flaws.

Re-check aspect_ratio on every migration. Ours defaults to portrait, providers differ, and a silently reframed batch is the kind of bug you notice after publishing.

Frequently asked questions

What is Nano Banana 2 image editing?

It's the editing capability of Google's gemini-3.1-flash-image model, exposed on our API as google/nano-banana-2/edit-image. You send one or more source images plus an instruction, and it returns a modified image at up to 4K.

How much does one edit cost on E2X?

Our 1K default is $0.04 per edited image; 2K is $0.06 and 4K is $0.08. Those were the prices at the August 26, 2026 check. Prices change, so confirm on the live model page before committing a budget.

How many source images can one request take?

Up to fourteen in a single call. There's no enforced role split between them — you tell the model in the prompt which attachment is the subject, which is a background, and which is style reference only.

Can Nano Banana 2 produce 4K edits?

Yes — our resolution enum accepts 1k, 2k and 4k, and a 4K edit costs $0.08. This is the main reason to choose it over Nano Banana 2 Lite, which has no resolution parameter and only ever returns 1K.

Is E2X cheaper than fal.ai for this model?

For the comparable on-demand prices we checked on that date, yes — $0.04 with us against $0.08 on fal.ai, a 50% saving on a like-for-like 1K request. Batch products, promotional rates and different plans aren't part of that comparison.

Do edited images carry a watermark?

Yes. Every output includes a SynthID watermark, Google's imperceptible marker for AI-generated content. No provider offers a parameter to remove it.

Why did my landscape photo come back in portrait?

Because our aspect_ratio default is 9:16, not the source image's ratio. Set aspect_ratio explicitly in every request — it's the single most common surprise when people port an editing pipeline over to us.

Is the editing API synchronous?

No. You submit a job and either poll /v1/jobs/{id} or supply a webhookUrl for a callback. Completed jobs expose the result at data.outputs[0].url; median model latency is around 8.4 seconds.