RawFrame

Gemini Nano Banana 2.1

Google's Gemini Nano Banana 2.1 on Vertex AI. Text to image up to 4K, and editing with up to fourteen input images.

  • Model id: google/gemini-nano-banana-2.1
  • Type: Image, from Google Vertex AI
  • Modes: Text to image, Image edit
  • Prompt: up to 8,000 characters
  • Canceling: Only while queued. Generations finish within seconds once submitted.

Parameters

Set these in params. Anything left out takes the default, which is what the price estimate assumes.

ParameterAccepted valuesDefault
resolution1k, 2k, 4k1k
aspect_ratio1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 4:5, 5:4, 21:9, 4:1, 1:4, 8:1, 1:81:1
num_outputs1 only1
output_formatpng, jpeg, webpprovider's

References

Pass media in references, each with a role and an upload_id or HTTPS url (Uploads). When mode is left out it is inferred from the roles.

RoleUsed asAt most
source_imageImage to edit1
reference_imageSubject or style reference13

Pricing

Billed per image delivered, varying by resolution. The full price list for your account is on the dashboard's billing page and in pricing from GET /v1/models/google%2Fgemini-nano-banana-2.1. Each request reserves its maximum price and is charged for what was produced (Pricing and credits).

Examples

Text to image

import { RawFrame } from "@rawframe/sdk";

const rf = new RawFrame();

const generation = await rf.generations.createAndWait({
  model: "google/gemini-nano-banana-2.1",
  prompt: "A hand-lettered bakery sign reading OPEN in a sunlit window, morning light",
  params: { aspect_ratio: "1:1" },
});
console.log(generation.outputs?.[0]?.url);

Wide banner

import { RawFrame } from "@rawframe/sdk";

const rf = new RawFrame();

const generation = await rf.generations.createAndWait({
  model: "google/gemini-nano-banana-2.1",
  prompt: "A misty pine forest at sunrise seen from above, long shadows, lots of sky",
  params: { aspect_ratio: "16:9" },
});
console.log(generation.outputs?.[0]?.url);

On this page