Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@
"public-endpoints/models/wan-2-6-t2i",
"public-endpoints/models/z-image-turbo",
"public-endpoints/models/nano-banana-edit",
"public-endpoints/models/nano-banana-pro-edit"
"public-endpoints/models/nano-banana-pro-edit",
"public-endpoints/models/nano-banana-2-edit"
]
},
{
Expand All @@ -545,7 +546,11 @@
"public-endpoints/models/wan-2-2-i2v",
"public-endpoints/models/wan-2-2-t2v",
"public-endpoints/models/wan-2-1-i2v",
"public-endpoints/models/wan-2-1-t2v"
"public-endpoints/models/wan-2-1-t2v",
"public-endpoints/models/wan-2-6-i2v",
"public-endpoints/models/p-video",
"public-endpoints/models/vidu-q3-i2v",
"public-endpoints/models/vidu-q3-t2v"
]
},
{
Expand Down
187 changes: 187 additions & 0 deletions public-endpoints/models/nano-banana-2-edit.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
---
title: "Nano Banana 2 Edit"
sidebarTitle: "Nano Banana 2"
description: "Google's latest multi-image editing model with resolution options up to 4K."
---

Nano Banana 2 Edit is Google's latest image editing model for combining and editing multiple reference images. It supports up to 14 input images and offers resolution options from 1K to 4K output. For best results, use 1-3 reference images.

<Card title="Try in playground" icon="play" href="https://console.runpod.io/hub/playground/image/google-nano-banana-2-edit" horizontal>
Test Nano Banana 2 Edit in the Runpod Hub playground.
</Card>

| | |
|---|---|
| **Endpoint** | `https://api.runpod.ai/v2/google-nano-banana-2-edit/runsync` |
| **Pricing** | \$0.0875 (1K), \$0.13 (2K), \$0.175 (4K) |
| **Type** | Image editing |

## Request

All parameters are passed within the `input` object in the request body.

<ParamField body="input.images" type="array" required>
Array of reference image URLs to edit or combine. Supports up to 14 images, but 1-3 images is recommended for best stability.
</ParamField>

<ParamField body="input.prompt" type="string" required>
Text description of the desired edit or how to combine the images.
</ParamField>

<ParamField body="input.resolution" type="string" default="1k">
Output resolution. Options: `1k`, `2k`, `4k`.
</ParamField>

<ParamField body="input.aspect_ratio" type="string">
Output aspect ratio (e.g., `1:1`, `3:2`, `16:9`, `9:16`, `4:5`).
</ParamField>

<ParamField body="input.output_format" type="string" default="png">
Output format. Options: `png`, `jpeg`.
</ParamField>

<ParamField body="input.enable_base64_output" type="boolean" default="false">
Return result as base64 string instead of URL.
</ParamField>

<RequestExample>
```bash cURL
curl -X POST "https://api.runpod.ai/v2/google-nano-banana-2-edit/runsync" \
-H "Authorization: Bearer $RUNPOD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"images": [
"https://example.com/subject.jpg",
"https://example.com/style-reference.jpg"
],
"prompt": "Apply the artistic style from the second image to the subject in the first image",
"resolution": "1k",
"aspect_ratio": "1:1",
"output_format": "png"
}
}'
```

```python Python
import requests

response = requests.post(
"https://api.runpod.ai/v2/google-nano-banana-2-edit/runsync",
headers={
"Authorization": f"Bearer {RUNPOD_API_KEY}",
"Content-Type": "application/json",
},
json={
"input": {
"images": [
"https://example.com/subject.jpg",
"https://example.com/style-reference.jpg",
],
"prompt": "Apply the artistic style from the second image to the subject in the first image",
"resolution": "1k",
"aspect_ratio": "1:1",
"output_format": "png",
}
},
)

result = response.json()
print(result["output"]["image_url"])
```

```javascript JavaScript
const response = await fetch(
"https://api.runpod.ai/v2/google-nano-banana-2-edit/runsync",
{
method: "POST",
headers: {
Authorization: `Bearer ${RUNPOD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
input: {
images: [
"https://example.com/subject.jpg",
"https://example.com/style-reference.jpg",
],
prompt: "Apply the artistic style from the second image to the subject in the first image",
resolution: "1k",
aspect_ratio: "1:1",
output_format: "png",
},
}),
}
);

const result = await response.json();
console.log(result.output.image_url);
```
</RequestExample>

## Response

<ResponseField name="id" type="string">
Unique identifier for the request.
</ResponseField>

<ResponseField name="status" type="string">
Request status. Returns `COMPLETED` on success, `FAILED` on error.
</ResponseField>

<ResponseField name="delayTime" type="integer">
Time in milliseconds the request spent in queue before processing began.
</ResponseField>

<ResponseField name="executionTime" type="integer">
Time in milliseconds the model took to edit the images.
</ResponseField>

<ResponseField name="output" type="object">
The generation result containing the image URL and cost.

<ResponseField name="output.image_url" type="string">
URL of the edited image. This URL expires after 7 days.
</ResponseField>

<ResponseField name="output.cost" type="float">
Cost of the generation in USD.
</ResponseField>
</ResponseField>

<ResponseExample>
```json 200
{
"id": "sync-a1b2c3d4-e5f6-7890-abcd-ef1234567890-u1",
"status": "COMPLETED",
"delayTime": 21,
"executionTime": 6234,
"output": {
"image_url": "https://image.runpod.ai/abc123/output.png",
"cost": 0.0875
}
}
```

```json 400
{
"id": "sync-a1b2c3d4-e5f6-7890-abcd-ef1234567890-u1",
"status": "FAILED",
"error": "Invalid image URL in images array"
}
```
</ResponseExample>

<Warning>
Image URLs expire after 7 days. Download and store edited images immediately if you need to keep them.
</Warning>

## Cost calculation

Nano Banana 2 Edit pricing varies by output resolution:

| Resolution | Price per image |
|------------|-----------------|
| 1K | \$0.0875 |
| 2K | \$0.13 |
| 4K | \$0.175 |
Loading
Loading