An existing campaign portrait may have the right person and outfit but the wrong setting. Moving that subject outdoors is more specific than generating another vaguely similar character: the reference must supply identity and object details while the prompt supplies the changed scene.
Use Nano Banana 2 editing when you want an existing subject in a new setting: start with one subject image, describe the new background, and add a second reference image only if a specific location matters. The task accepts up to 14 reference images but has no mask or identity-strength slider. At 1k an edit costs $0.0384 on the default route, with one to ten sources at the same price; if it falls back to the official route it costs $0.0536 plus a small charge per source. Keep both search switches off for a supplied-reference edit unless you actually need external information.
Nano Banana 2 is filtered: choose it for SFW promotional portraits and clothed character scenes. For adult imagery, see the Nano Banana 2 content results before choosing this task.
Start with the smallest useful set of reference images
On the Nano Banana 2 editing page, open the Playground tab. Add the subject image under Images, paste the prompt below into Prompt, leave Aspect ratio on Auto, set Resolution to 1k, keep Web search and Enable Image Search off, then press Run model and check the price shown before you confirm. For a fictional rainwear campaign, source one shows an adult woman aged 32 with a short dark bob, saffron raincoat, charcoal trousers and cream trainers beside a dark-green bicycle. A clear full-body source lets you judge whether the coat, feet and wheels survive the edit.
Try this first without a location image:
Keep the fictional adult woman and bicycle from image one: the same facial structure, short dark bob, saffron matte raincoat, charcoal trousers, cream trainers and dark-green bicycle. Replace only the studio setting with a flat riverside path in light morning mist. Preserve the pose and camera view. Match the soft cool daylight and ground contact to the new setting. No other people, bicycles or text.
Inspect the crop before approving the result.
A riverside can be described in words; an extra landscape image is useful only when its specific layout matters.
A reference edit does not train a reusable character model. If you build front, side and full-body reference views, check each against the approved identity before reusing it; a generated side view can introduce features the original photo never showed. Supply the useful views again for each new scene.
Add a location, then a material reference image only if needed
If the first scene is too generic, add a riverside photograph as source two. Choose one with a level path and a camera angle compatible with the standing subject. Add:
Image two defines the path, river and mist only. Keep the person, outfit, bicycle and their relative placement from image one. Do not import people, signs or vehicles from image two.
If the coat's surface is the unresolved issue, source three can be a close photograph of matte saffron fabric. Add:
Image three supplies only the coat's matte surface texture. Keep the coat's original color, hood, fastening and silhouette from image one.
Keep the roles of the reference images distinct:
- Image 1: person, clothing, bicycle and their relative placement.
- Image 2: location and its perspective; exclude competing people or vehicles.
- Image 3: material surface, without replacing the coat design.
The order must match the actual upload order. A palette swatch should not occupy slot two while the text calls slot two the river. There are no per-image weights on this task, so give the model a clear assignment in ordinary sentences.
A material photograph showing a second complete coat may accidentally suggest a different collar or fastening. Crop to the needed surface if construction is already defined by source one. Conversely, if you want a new coat design, say so explicitly; that is wardrobe replacement rather than preservation.
Relocation is also a lighting and perspective problem
A studio portrait and a riverside photograph can disagree even when the face stays recognizable. The studio may be lit from the left while the outdoor reference has sunlight from the right. Keeping every old shadow would paste the subject into the new place. Preserve the facial structure and coat design, while allowing a compatible ground shadow and soft environmental light.
Choose a location image whose horizon and viewpoint suit the source. An eye-level standing portrait fits an eye-level path more naturally than an overhead landscape. If the brief asks for a new low camera angle, the model must invent unseen parts of the face, garment and bicycle. That is a broader reconstruction than background replacement, so approve the simple relocation before asking for a new viewpoint.
For the bicycle scene, the wheels should meet the same ground plane as the adult's shoes. A location source with a steep sloping bank can place a wheel in the river or distort its round shape. Select a flat visible path and retain the source's relative person/bicycle placement. If the face is correct but the wheels are wrong, repair the environment or wheel geometry rather than adding more face references.
There is no need for a separate weather, river, sky, coat, bicycle and portrait image just because fourteen slots are available. Two references with clear roles can describe this job. A third is useful only when it supplies something the existing images and prompt do not already settle.
Settings that matter to this edit
| Setting | Practical choice |
|---|---|
| Reference images | 1 required, up to 14; start with subject, then add necessary roles |
| Shape | auto for the source shape; 4:5 for a planned portrait card. With sources of different shapes, pick the ratio yourself instead of auto |
| Resolution | 1k first; 2k or 4k when the accepted composition needs a larger delivery |
| Web search | Off for this invented scene |
| Image search | Off when you already supply the desired reference images |
| Mask / seed / identity weight | Not exposed by this task |
| Output format | No selector; the current model-page contract describes JPEG edits |
A 4:5 card and a 16:9 banner are different compositions. If you need the whole person and both wheels in 4:5, say that in the prompt and use a source with enough margin. Merely choosing a portrait ratio does not preserve every object at the edge. For text on the card, see the Nano Banana Pro text layout guide.
Google's introduction identifies Nano Banana 2 as Gemini 3.1 Flash Image and describes reference-driven image work.
What the edit costs
Prices in USD per edited image, with both search switches off:
| Size tier | Default route | If it falls back to the official route |
|---|---|---|
| 0.5k | — | $0.036 |
| 1k | $0.0384 | $0.0536 |
| 2k | $0.0602 | $0.0808 |
| 4k | $0.0902 | $0.1208 |
Aspect ratio does not change these rows. The default route takes one to ten source images at the same price. The official route adds $0.0001032 per supplied image, and it is the only route for 0.5k, for more than ten sources and for search. With Official fallback on (the default), a request is held at the official price and the difference is refunded when the default route delivers.
One to three sources therefore cost $0.0384 at 1k, or at most about $0.054 if the request falls back. Start at the 0.5k tier ($0.036) for a rough composition, then increase size for fine garment or facial details. Search adds charges when enabled.
A refusal returned as a short text reply is billed as a completed generation; other refusals are not charged. Confirm that the returned artifact is an image.
Use the approved setup through the API
Set SPICY_API_KEY in your environment. Set SUBJECT_IMAGE_URL, LOCATION_IMAGE_URL, FABRIC_IMAGE_URL to your approved images’ direct HTTPS URLs. Run with Python 3; confirm the displayed quote only when you want a new paid attempt.
import json
import os
import uuid
from pathlib import Path
from urllib.request import Request, urlopen
payload = {"model": 'google/nano-banana-2/edit', "input": {
'prompt': 'Image one defines the adult woman, outfit and bicycle. Image two defines only the riverside setting. Image three supplies only the coat texture. Preserve the person, pose, outfit construction and bicycle from image one; match the new daylight and ground shadow.',
'image_urls': [os.environ['SUBJECT_IMAGE_URL'], os.environ['LOCATION_IMAGE_URL'], os.environ['FABRIC_IMAGE_URL']],
'resolution': '1k',
'aspect_ratio': '4:5',
'enable_web_search': False,
'enable_image_search': False,
}}
def api(action, body, key=None):
headers = {"Authorization": "Bearer " + os.environ["SPICY_API_KEY"],
"Content-Type": "application/json"}
if key:
headers["Idempotency-Key"] = key
request = Request("https://api.spicyapi.ai/api/v1/jobs/" + action,
data=json.dumps(body).encode(), headers=headers)
with urlopen(request, timeout=60) as response:
result = json.load(response)
if result.get("code") != 200:
raise RuntimeError(result)
return result["data"]
quote = api("quote", payload)
print("Maximum charge (USD):", quote["maxCharge"])
if input("Create this new attempt? Type yes: ").strip() != "yes":
raise SystemExit("No task created")
key = str(uuid.uuid4())
body = {**payload, "quoteId": quote["quoteId"],
"expectedCost": quote["estimatedCost"]}
Path(key + ".json").write_text(json.dumps({"key": key, "request": body}))
task = api("createTask", body, key)
Path(key + ".task.json").write_text(json.dumps(task))
print("Task ID:", task["taskId"])Keep the saved key for retries of that same request. For a local file, upload it first and pass the returned spicy:// address (see media). Result retrieval and file handling are in the task API guide.
For repeated edits, an Agent can handle the approved brief:
- CLI:
npx @spicyapi/cli tasks create --model google/nano-banana-2/edit --input-file input.json --waitreads theinputobject frominput.json, with the same fields. - MCP: ask it to use
spicyapi_task_create, thenspicyapi_task_wait. - Skill: install with
npx skills add spicyapi-ai/spicy-skill, then ask thespicyapiSkill to run this setup after showing its quote.
Diagnose drift without rewriting the whole brief
The background changed, but the face did too.
- Return to the original subject image and remove other faces from the location source.
- Retain the existing camera view; a dramatic new angle asks the editor to invent unseen features.
- For exact identity pixels, composite the approved foreground into the new setting. The task has no pixel-locking mask.
The coat became glossy or changed construction.
- Surface error: request matte fabric under soft light, or supply a material crop.
- Design error: use the original source showing the approved fastening and silhouette. Changing texture does not repair a different coat.
The bicycle gained an extra tube or lost a wheel. Use a source where the frame and wheels are unobscured. Reduce mist around the bicycle, retain the existing viewpoint and remove any competing bicycle in source two. Adding a fabric reference does not address a geometry problem.
The person looks pasted onto the path. Allow the ground shadow and environmental light to change while protecting the face and garment design. Demanding the original studio shadow in a misty outdoor scene can create the mismatch yourself.
The second edit is worse than the first. Start again from the accepted source rather than feeding the failure into another request. Use the successful candidate only for the feature it contributes, if it is needed at all. A later image is not automatically a better identity reference.
When Nano Banana 2 is the wrong operation
Choose another operation when you need an exact masked repair, a transparent cutout, an editable layered file or adult content. Neither extra reference images nor search switches add those missing controls. For the rainwear scene, Nano Banana 2 is a practical editing option; for a garment catalogue that must preserve every seam exactly, conventional foreground compositing may be the more direct solution.
Frequently asked questions
Do I need all fourteen reference image slots for character consistency?
No. Start with the subject view that shows the needed face, outfit and objects. Add a location or material only when it supplies missing information. Fourteen is an input limit, not a consistency score or a reason to upload conflicting views.
Does auto preserve the original dimensions?
The model contract describes auto as keeping the source shape. Resolution is selected separately; auto does not promise the original pixel dimensions or exact edge content. For a planned 4:5 card, choose that ratio and give the full person and bicycle enough margin in the source.
Can a seed or identity slider stop face drift?
This hosted editing task exposes neither. Use the same approved identity reference for each scene and avoid importing other faces through location images. Exact unchanged face pixels require a conventional composite rather than a stronger preservation adjective.
Do refusals cost money?
A completed short-text refusal is charged. Other refusals are not. A successful task status alone therefore does not confirm that you received an image.
The useful first attempt is one subject, one relocation and one modest output. Add reference images to answer a visible missing requirement, not to fill the available slots.






