Prompt guides

Nano Banana prompt guide: generation, editing and in-image text

Nine prompts for Nano Banana Pro and 2.1: scenes, edits on a reference image, multi-reference composition and exact in-image text, with runnable API calls.

A banana-shaped paintbrush painting a glowing landscape onto a canvas on an easel
On this page

Nano Banana Pro and Nano Banana 2.1 take a plain-language prompt, optionally with reference images, and return an image. This guide has nine prompts grouped by job: scenes, edits to an existing picture, multi-reference composition and exact in-image text. Each has a note on why it is written that way, and a short Python helper runs them through the DreamTo API.

Nano Banana Pro (gemini-3-pro-image) and Nano Banana 2.1 (gemini-nano-banana-2.1) share one request shape, so eight of the nine prompts run on either model unchanged. Prompt 6 uses a style reference, which is documented for Pro only.

Set up the request once#

Both models use the generateContent endpoint at https://api.dreamto.ai. The key goes in the Authorization: Bearer header, or in x-goog-api-key. The request is synchronous and usually takes 5 to 60 seconds. This is the smallest working call:

bash
curl -X POST "https://api.dreamto.ai/v1beta/models/gemini-nano-banana-2.1:generateContent" \  -H "Authorization: Bearer $DREAMTO_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "contents": [      {        "role": "user",        "parts": [          { "text": "A ceramic mug of black coffee on a windowsill, rain outside, soft morning light" }        ]      }    ],    "generationConfig": {      "responseModalities": ["TEXT", "IMAGE"],      "imageConfig": { "aspectRatio": "16:9", "imageSize": "2K" }    }  }'

These are the fields you will touch while prompting:

FieldValues
contents[].parts[].textThe prompt: what to generate or change
contents[].parts[].inlineData.dataA reference image as Base64, with mimeType of image/png, image/jpeg, image/webp, image/heic or image/heif
contents[].parts[].fileData.fileUriA reference image as a public https link
generationConfig.imageConfig.aspectRatioPro: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9. 2.1 adds 1:4, 4:1, 1:8, 8:1. When omitted: 1:1 for text-to-image, the input image's ratio for edits
generationConfig.imageConfig.imageSize1K (default), 2K or 4K, with an uppercase K
generationConfig.responseModalities["TEXT", "IMAGE"] (default) or ["IMAGE"] for images only

The helper below wraps the call, attaches any number of local reference images and writes the result to disk. It asks for images only and sends aspectRatio only when you pass one, so an edit keeps the ratio of the input image. The later examples assume it is saved as gen.py.

python
import base64import mimetypesimport osimport requestsMODEL = os.environ.get("MODEL", "gemini-nano-banana-2.1")URL = f"https://api.dreamto.ai/v1beta/models/{MODEL}:generateContent"HEADERS = {"Authorization": f"Bearer {os.environ['DREAMTO_API_KEY']}"}def generate(prompt, refs=(), aspect_ratio=None, size="1K", out="output.png"):    parts = [{"text": prompt}]    for path in refs:        mime = mimetypes.guess_type(path)[0] or "image/png"        with open(path, "rb") as f:            data = base64.b64encode(f.read()).decode()        parts.append({"inlineData": {"mimeType": mime, "data": data}})    image_config = {"imageSize": size}    if aspect_ratio:        image_config["aspectRatio"] = aspect_ratio    payload = {        "contents": [{"role": "user", "parts": parts}],        "generationConfig": {            "responseModalities": ["IMAGE"],            "imageConfig": image_config,        },    }    resp = requests.post(URL, headers=HEADERS, json=payload, timeout=300)    resp.raise_for_status()    candidate = resp.json()["candidates"][0]    for part in candidate["content"]["parts"]:        if "inlineData" in part and not part.get("thought"):            with open(out, "wb") as f:                f.write(base64.b64decode(part["inlineData"]["data"]))            return out    raise RuntimeError(f"no image in response: {candidate.get('finishReason')}")

Set MODEL=gemini-3-pro-image to run it against Pro. Invalid requests and failed generations are not charged; the error reference lists the error codes.

Scene prompts: describe a photograph, not a tag list#

Write a scene prompt as a short description of a photograph: the subject, where it is, the light, the lens or medium, and what to leave out. The Pro model page adds a tip: start from the design specification, meaning target aspect ratio, visual priority, required whitespace and exact copy.

Prompt 1: a location with a point of view#

text
Architectural photograph of a small timber ferry terminal at dusk on a calm grey bay.Shot from the water at eye level, 35mm lens, the terminal's windows lit warm amberagainst a blue-grey sky. A single figure with a red umbrella stands at the end of thepier. Empty foreground, no boats, no text.

Camera position, lens and one colour accent give the model a composition to follow. The closing "no boats, no text" names the clutter to leave out.

Prompt 2: a product on a controlled set#

text
Studio product photograph of an unbranded matte-green glass bottle standing on aslab of pale travertine. Single soft window light from the left, a long gentleshadow to the right, seamless warm-white backdrop. Bottle centred, slightly belowthe middle of the frame, with generous empty space above. No label, no logos.

The prompt places both the object and the empty space, so the result works as a banner background. Ask for no logos when you plan to composite your own.

Prompt 3: a wide format#

text
Panoramic illustration of a salt flat at first light, a lone cyclist crossing it,long thin clouds stretching to the horizon, flat gouache colours in peach andslate blue, paper grain. Wide empty sky in the upper half.

Run this with aspectRatio set to 21:9 on either model. Nano Banana 2.1 also has 4:1 and 8:1, which Pro lacks, and its docs list a fix for tiling artifacts on those ratios at 2K and 4K.

Edit prompts: say what changes and what stays#

For an edit, send the image as an inlineData part, or as a public link in fileData.fileUri, next to the text part. Brief the model as you would a retoucher: what to change, then what must stay.

The 2.1 model page advises setting the extent of a local edit: describe the region and the edge of the change, name the text and outlines to preserve, and compare the areas outside the edit with the original afterwards.

Prompt 4: a local change with a preserve list#

text
Using the attached photo, replace only the wall behind the sofa with deepbottle-green paint with a subtle matte texture. Keep the sofa, the cushions, thefloor lamp, the framed print and all shadows exactly as they are. Do not changethe camera angle or the lighting on the floor.

The prompt has one change, one named region and an explicit list of things not to touch. For two changes, run two requests and check each.

Prompt 5: a change of time or weather#

text
Edit the attached street photo so it is a rainy evening. Wet pavement withreflections of the shop signs, the same buildings, the same people in the samepositions, headlights on the cars. Keep the framing identical.

The prompt describes the finished picture, not the steps, and names what stays the same so the edit does not become a new image.

Chaining edits from an approved image#

Approve an image before going further. The 2.1 model page suggests keeping the approved original, its prompt and its copy together and recording only what changes in each follow-up, so unintended differences across a series are easy to spot. In code, pass the previous output back as a reference:

python
from gen import generategenerate(    "Create a product poster for the attached bottle on a pale travertine slab.",    refs=["bottle.jpg"],    aspect_ratio="4:5",    out="v1.png",)generate(    "Keep everything in the attached poster. Change only the background colour to "    "warm terracotta. Do not move the bottle.",    refs=["v1.png"],    aspect_ratio="4:5",    out="v2.png",)

The API also accepts multi-turn contents, with the model's earlier parts sent back unchanged. A new request with the approved image as its reference is simpler to script.

Multi-reference prompts: give each image a role#

Both models accept up to 14 reference images per request, in a different mix:

ModelObject imagesCharacter imagesStyle references
gemini-3-pro-imageup to 6up to 5up to 3
gemini-nano-banana-2.1up to 10up to 4not listed

Give each image a role in the prompt. The 2.1 model page suggests one photo for the subject, a sketch for composition and a separate note for colour and light, so a mismatch points to the instruction that caused it.

Prompt 6: subject, layout and style as separate inputs#

text
Three reference images are attached. Image 1 is the product: keep its shape,colours and proportions exactly. Image 2 is a rough layout sketch: follow itsplacement of the product and the empty area on the right. Image 3 is a stylereference: use only its colour palette and the softness of its light, not itssubject. Result: a clean advertising image in a 4:5 frame.

Number the references and say what to take from each and what to ignore. This version is for Pro, because style references are documented for Pro only. On 2.1, attach images 1 and 2 and describe the palette and light in words instead of sending image 3.

Prompt 7: a character across scenes#

text
Using the attached character reference, show the same woman, same hairstyle andthe same yellow raincoat, sitting at a night-market noodle stall. Only the settingchanges: warm paper lanterns, steam, shallow depth of field. Keep her face andclothing details unchanged.

This follows the 2.1 model page's advice on consistency: keep a clear character reference, name the pose or setting that changes, and list the details to preserve. Then compare hairstyle, clothing and palette from scene to scene.

Choose Pro for style references or a fifth character in one image. 2.1 takes more object images, 10 against 6, at a lower price per request.

In-image text prompts: quote the copy and say where it goes#

The catalog describes Pro as Google's best for in-image text, and the 2.1 docs say it renders text and infographic layouts more accurately than its predecessor. On either model, quote the exact words and say where each phrase goes and how many times it appears.

Prompt 8: a poster with fixed copy#

text
Flat editorial poster, cream background with one large terracotta circle. Exactheading "SLOW SUNDAYS" in heavy black sans-serif capitals at the top. Small subhead"A MARKET FOR THE LONG MORNING" beneath it. Footer text at the bottom left:"OPEN 9 TO 2". Render each of those three phrases once, with exact spelling andgenerous margins. No other text, no logos.

Quotation marks, a position for each phrase and the word "once" leave the model little to improvise. The closing "No other text" matters as much as the copy.

Prompt 9: a labelled diagram#

text
Clean infographic on a white background showing the water cycle with four labelledsteps in a clockwise loop: "Evaporation", "Condensation", "Precipitation","Collection". One simple arrow between each step, flat pastel icons, labels in asingle dark-grey sans-serif font, equal text size. No other words.

Keep labels short. The model pages advise checking spelling, line breaks and figure numbers at the delivery size. For legal or price text, set the type yourself and use the model for the artwork behind it.

For localised versions, the Pro model page suggests supplying an approved headline for each language and reviewing line count and minimum readable size after each one.

Choosing between Pro and 2.1#

Apart from Prompt 6, the prompts are not tied to one model, so choose on references, aspect ratios and price.

Nano Banana ProNano Banana 2.1
Model IDgemini-3-pro-imagegemini-nano-banana-2.1
Sizes1K / 2K / 4K1K / 2K / 4K
Aspect ratios1014, including 1:4, 4:1, 1:8, 8:1
Referencesup to 14 (6 object, 5 character, 3 style)up to 14 (10 object, 4 character)
ReasoningThinks before rendering; always on, cannot be disabledDefault medium thinking level
Price per request, as of December 2026$0.03 (1K), $0.03 (2K), $0.05 (4K)$0.01 (1K), $0.02 (2K), $0.03 (4K)

Billing is per request and only imageSize changes the price; current numbers are on /prices. At these prices a 1K draft on 2.1 costs half of a 2K render and a third of a 4K one, so settle composition and wording at 1K, then render the approved prompt at delivery size. On Pro, 1K and 2K cost the same.

Nano Banana 2 (gemini-3.1-flash-image), the model that 2.1 updates, is also available. You can try the prompts in the Nano Banana Pro playground or the Nano Banana 2.1 playground before writing code.

For more on sizes and references, see the Nano Banana Pro API guide and Nano Banana 2.1 vs Pro vs 2 vs 2 Lite. Product photo prompts for AI image models goes deeper on catalogue shots.

Known limits of the API#

  • systemInstruction, safetySettings and tools (including Google Search grounding) are not supported yet. They return 400, the model is not called and nothing is charged. Put standing instructions in the prompt.
  • Only generateContent is covered. The Batch API and files/... references from Files API uploads are not supported; send images as Base64 or as a public https link.
  • A generation that fails upstream, including a content moderation refusal, returns 502 and is not charged. You can retry it.
  • Errors use the DreamTo error envelope, not Google's status envelope. The authentication page covers keys and headers.

The full parameter lists are on the docs pages for Gemini 3 Pro Image and Gemini Nano Banana 2.1. Every model on DreamTo is listed at /models.

FAQ#

How do I get exact text in a Nano Banana image?#

Put each phrase in quotation marks, say where it goes and how many times it appears, and end the prompt with "No other text". Keep the copy short, then check spelling and line breaks at your delivery size.

How do I edit a photo with Nano Banana through the API?#

Send the photo as an inlineData part (Base64) or a fileData.fileUri (public https link) next to a text part that says what to change and what to keep. If you omit aspectRatio, the output follows the ratio of the input image.

How many reference images can I send?#

Up to 14 on both models. Pro allows up to 6 object images, 5 character images and 3 style references; 2.1 allows up to 10 object images and 4 character images. Inline images can be PNG, JPEG, WebP, HEIC or HEIF.

What does Nano Banana cost per image on DreamTo?#

As of December 2026, Nano Banana Pro is $0.03 per request at 1K and 2K and $0.05 at 4K, and Nano Banana 2.1 is $0.01 at 1K, $0.02 at 2K and $0.03 at 4K. Invalid requests and failed generations are not charged. Check /prices for current numbers.

Can I use a system prompt with Nano Banana?#

Not yet. systemInstruction returns 400 on both models and nothing is charged, so put standing instructions in the prompt text. The same applies to safetySettings and the google_search tool.

  • Nano Banana
  • Prompts
  • Image Editing