Edit a photo with Nano Banana: aspect_ratio auto and the cost of 100

Send a product photo as input_references to Nano Banana 2.1 or Pro and set aspect_ratio auto to keep its shape. Python request and cost of 100 edits.

3 min readSume
All posts

To edit a photo with Nano Banana on Sume, pass the photo in input_references and set aspect_ratio: "auto" so the output matches the reference. A hundred 1K edits cost $10.00 on Nano Banana 2.1 and $18.75 on Pro.

The Image API warns that on edit and image-to-image calls, omitting aspect_ratio is not the same as auto. Send it explicitly.

Python

The response is 200 with Sume-hosted URLs, or 202 with a job envelope if generation outlasts the 30-second wait. This handler covers both.

import os, requests

H = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}
r = requests.post(
    "https://api.sume.com/v1/images",
    headers=H,
    json={
        "model": "google/nano-banana-2.1",
        "prompt": "Place this mug on a sunlit kitchen counter",
        "aspect_ratio": "auto",
        "input_references": [
            {"type": "image_url", "image_url": {"url": "https://example.com/mug.jpg"}}
        ],
    },
    timeout=60,
)
body = r.json()
if r.status_code == 200:
    print(body["data"][0]["url"])
elif r.status_code == 202:
    print("poll", body["data"]["status_url"])
else:
    print(r.status_code, body)

Cost of an edit batch

A reference does not add a line to the price; the per-image rate is the same as text-to-image at that resolution.

Sume price, read 2026-10-08
EditsNano Banana 2.1 (1K)Nano Banana Pro (1K)Nano Banana 2.1 (2K)
10$1.00$1.875$1.50
100$10.00$18.75$15.00
1000$100.00$187.50$150.00

Limits

  • Up to 10 references per call on both Nano Banana rows.
  • Reference URLs must be public HTTPS.
  • mask_url is documented for ChatGPT Image 2.5 edits only, so for a masked edit use gpt-image-2.5 rather than Nano Banana.

Handling failures

Sume bills a generation in full when it completes and does not bill one that fails or is cancelled, so a retry after a 5xx is safe to schedule.

  • Send an Idempotency-Key on retries so one job is created.
  • Treat 400 unsupported_parameter as a bug in the request: the model does not list that field.
  • Compare the output to the source in code before it ships.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume