> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runpod.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Nano Banana 2 Edit

> 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 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "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 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "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         |
