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.

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.
| Edits | Nano 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_urlis 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-Keyon retries so one job is created. - Treat
400 unsupported_parameteras 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
- Next.js 16.4 Cache Components: will a Sume webhook route break?
Next.js 16.4 turns on Cache Components in create-next-app. A POST route handler is never cached, so a Sume webhook route works if it reads the raw body.
- Next.js 16.4 GET route handler: poll a Sume job at request time
With Cache Components, Next.js 16.4 runs GET handlers at request time. A Sume job status route stays live if it sends no-store and follows the poll hint.
- Omni Flash API errors: which to retry and which to fix
A retry policy for Gemini Omni Flash 1.1 calls on Sume: 400, 401, 402, 409, 429 rate_limited, 429 queue_full and 503 each mapped to retry, wait or fix.
- Omni job status names: pending vs queued, cancelled vs canceled
Sume's /v1/videos poll uses pending, in_progress, completed, failed and cancelled; /v1/jobs uses queued, processing and canceled. Mapping table for Omni code.
Written by Sume