About Nano Banana 2
The editing endpoint needs prompt and image_urls. Use it for a versioned design revision where source artwork already exists. The Dress color swap output supplies a concrete reference-edit example for a comparison panel. Store the source and result independently so users can return to the earlier version after trying another instruction.
Call it with the model name google/nano-banana-2/edit on POST /jobs/createTask, from $0.0361032.
Introduction
Nano Banana 2 Edit runs Google's Gemini 3.1 Flash Image on images you already have. It accepts one to fourteen sources, keeps the source shape or reframes to one of fourteen shapes, and renders at 0.5k, 1k, 2k or 4k.
Choose a mode by starting material
| What you have | Mode |
|---|---|
| a written brief | Nano Banana 2 Text to image |
| an image to change | Nano Banana 2 Edit |
Key features
Up to fourteen references
Combine people, outfits, settings and products from up to fourteen images, each described by its role in the prompt.
Reframe while editing
Aspect ratio auto keeps the source shape; any of fourteen shapes reframes the result, as in our example where a 4:1 banner became a 16:9 night scene.
Request parameters
| Parameter | Required | Description |
|---|---|---|
aspect_ratio | No | The shape of the frame: wide, square or tall. auto · 1:1 · 3:2 · 2:3 · 3:4 · 4:3 · 4:5 · 5:4 · 9:16 · 16:9 · 21:9 · 1:4 · 4:1 · 1:8 · 8:1 · Default: auto |
enable_image_search | No | Looks up real pictures of a place or product first. Default: false |
enable_web_search | No | Checks the web first, for dates, places and current facts. Default: false |
image_urls | Yes | Photos to edit or combine. Say in the prompt what each one adds. |
prompt | Yes | Describe what you want to make. |
resolution | No | Choose an available output size. 0.5k · 1k · 2k · 4k · Default: 1k |
Pricing
Prices are in USD and charged to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.
| Option | USD per image |
|---|---|
| resolution 0.5K | $0.036 |
| resolution 1K | $0.0536 |
| resolution 2K | $0.0808 |
| resolution 4K | $0.1208 |
Send the same request body to POST /jobs/quote to see the estimated and maximum USD charge before running. A quote does not run the task or charge your balance.
Use cases
Relocation and time-of-day changes
Move a person to a new place or turn day into night for a campaign, keeping the face, the outfit and the pose.
Reformatting finished images
Turn a wide banner into a 16:9 or 9:16 version with new content at the edges instead of a simple crop.
Styled product groups
Arrange several product shots into one styled scene, naming each product and where it should sit.
Prompt guide & pro tips
List what must stay
Name the face, hair, outfit and pose you want kept after describing the change; the model respects a written list.
Describe the new frame when reframing
When the shape changes, say what the added space should hold: more sky, another table, the rest of the street.
Keep search for real references
Switch on image search only when the edit depends on a real place or product the model needs to see.
Draft edits at 0.5k
Test the instruction at 0.5k first; if the change reads correctly, run the same request at 2k or 4k.
Match the tier to the source
An edit cannot add detail the source never had; 2k is usually enough unless the source itself is large.
API quick start
Call the Nano Banana 2 API in three steps
- Create an API key. Sign in to PopNow and create a key in the API console. Keys start with sk-popnow-. API calls are billed in USD from your PopNow balance.
- Send the request. POST /jobs/createTask with model google/nano-banana-2/edit and an input object that follows the parameter table. The response returns a task ID straight away.
- Get the result. Poll GET /jobs/recordInfo with the task ID, or pass a callBackUrl and we post the result to it. Download the output links when the task succeeds.
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-d '{
"model": "google/nano-banana-2/edit",
"input": {
"prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette",
"image_urls": [
"https://media.popnow.ai/influencer/examples/marco.webp"
],
"aspect_ratio": "auto",
"resolution": "1k"
}
}'
# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
-H "Authorization: Bearer $POPNOW_API_KEY"Replace the prompt and any links with your own. The API tab has the response, polling and callback reference.
About the Nano Banana 2 Edit Image endpoint
image_urls accepts up to fourteen source pictures in the order the prompt describes them. Explain each picture's contribution in the brief and save the serialized ordering. A generic upload gallery that sorts items by filename can accidentally change the instruction. Keep your own reference role metadata outside the payload and compile it into the supported prompt field.
auto is the default aspect ratio on this route and retains the source shape. Supported explicit ratios include very tall and wide formats, but only the enum values are accepted. Resolution is an independent size tier. Unlike some image editors, this schema exposes no seed; do not send a hidden seed from a previously selected renderer.
The web search and image search flags are optional and disabled initially. They are distinct from supplied source pictures. An application may offer both, but it should record their exact values with the accepted edit so users understand how the request was configured. Describe the desired change and preserved elements in the prompt itself.
official_fallback is enabled by default and permits billing at the official rate if the initial route cannot complete. Quote the actual edit including this choice. Confirm the maximum charge, not merely the usual expected amount. Your billing UI can show the reservation while pending, then replace it with settled costUsd when the task finishes.
Complete the revision through recordInfo polling or a verified task webhook. Persist taskId before navigating away, and use webhook request_id to prevent duplicate delivery from creating duplicate project versions. On invalid_asset, fix the source reference; on invalid_request, inspect tier strings and array bounds. Neither correction should discard the author's written edit.
Nano Banana 2 API questions
How much does the Nano Banana 2 API cost?
Nano Banana 2 starts at $0.0361032 per image with Edit Image, its lowest-priced task. Prices by option: 0.5K $0.036 per image, 1K $0.0536 per image, 2K $0.0808 per image, 4K $0.1208 per image. API usage is charged in USD to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.
What are the limits of the Nano Banana 2 · Edit Image API?
Resolutions: 0.5K · 1K · 2K · 4K; Aspect ratios: auto · 1:1 · 3:2 · 2:3 · 3:4 · 4:3 +9; Reference images: 14; Prompt length (characters): 5,000; Largest upload: 10 MB. Requests outside these limits are rejected before anything is charged.
More about Nano Banana 2
- Endpoints
- Nano Banana 2 · Create Image
- Compare
- GPT Image 2 vs Nano Banana 2