↓ Skip to main content

nano banana 2 1 · nano-banana Reference

Nano Banana 2.1 (gemini-nano-banana-2.1) Model Card #

Overview #

Nano Banana 2.1 (gemini-nano-banana-2.1) is Google’s primary high-efficiency image generation and editing workhorse. Released on October 6, 2026, it delivers strong spatial composition, legible text rendering, seamless panoramic synthesis across 14 aspect ratios, conversational multi-turn regional editing, three-tier controllable thinking (minimal, medium, high), real-time Google Web and Image Search grounding, and multi-reference consistency across up to 14 anchors.

  • Model Code: gemini-nano-banana-2.1 (default model for scripts/banana.py and gemini-api image)
  • CLI Aliases: nano-banana-2.1 (default), nano-banana-2-1, gemini-nano-banana-2.1
  • Release Date: October 6, 2026
  • Status: General Availability (GA)
  • Vertex AI Location: global only

Technical Specifications #

PropertyValue
Input ModalitiesText, Images (up to 14), Video (YouTube URLs, MP4s), PDF
Output ModalitiesImage and Text (Interleaved)
Input Token Limit131,072 tokens (1,120 tokens per input image)
Output Token Limit32,768 tokens
Supported Resolutions1K (1024px), 2K (2048px), 4K (4096px) (512px is not supported; use gemini-3.1-flash-image for 512px)
Aspect RatiosAll 14 discrete ratios (1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9) with panoramic seam and tiling elimination
Thinking ProcessSupported (minimal, medium [default], high)
Search GroundingGoogle Web Search (--search / web_search) + Google Image Search (--image-search / image_search)
Reference AnchorsUp to 14 reference images (up to 10 object anchors + up to 4 character resemblance anchors)
Conversational EditingMulti-turn regional edits, style transfers, and compositional refinements
Unsupported Parametersseed, temperature, topP, topK, logprobs (passing any of these returns an HTTP 400 API error)
Vertex AI Locationglobal only (us-central1 returns 404)
WatermarkingSynthID (Always On) + C2PA Metadata

Complete Resolution Grid and Token Consumption #

Aspect Ratio1K Resolution1K Tokens2K Resolution2K Tokens4K Resolution4K Tokens (AI Studio / Agent Platform)
1:11024 × 10241,1202048 × 20481,6804096 × 40962,520 / 3,780
1:4512 × 20481,1201024 × 40961,6802048 × 81922,520 / 3,780
1:8384 × 30721,120768 × 61441,6801536 × 122882,520 / 3,780
2:3848 × 12641,1201696 × 25281,6803392 × 50562,520 / 3,780
3:21264 × 8481,1202528 × 16961,6805056 × 33922,520 / 3,780
3:4896 × 12001,1201792 × 24001,6803584 × 48002,520 / 3,780
4:12048 × 5121,1204096 × 10241,6808192 × 20482,520 / 3,780
4:31200 × 8961,1202400 × 17921,6804800 × 35842,520 / 3,780
4:5928 × 11521,1201856 × 23041,6803712 × 46082,520 / 3,780
5:41152 × 9281,1202304 × 18561,6804608 × 37122,520 / 3,780
8:13072 × 3841,1206144 × 7681,68012288 × 15362,520 / 3,780
9:16768 × 13761,1201536 × 27521,6803072 × 55042,520 / 3,780
16:91376 × 7681,1202752 × 15361,6805504 × 30722,520 / 3,780
21:91584 × 6721,1203168 × 13441,6806336 × 26882,520 / 3,780

Capabilities and Key Features #

1. Three-Tier Controllable Thinking (minimal, medium, high) #

Nano Banana 2.1 adds the medium thinking level (its default) between minimal and high:

  • "minimal": Fast synthesis with minimal pre-generation reasoning latency.
  • "medium" (default): Balanced spatial layout planning, typography verification, and perspective coherence with low reasoning overhead (exclusive to gemini-nano-banana-2.1).
  • "high": Deep compositional planning for 4x4 sprite grids, multi-character scenes, intricate architectural perspectives, complex lighting, and dense infographic text.

2. Panoramic Seam and Tiling Elimination (1:4, 4:1, 1:8, 8:1) #

Nano Banana 2.1 eliminates repetition seams and horizon breaks across extreme panoramic (4:1, 8:1) and vertical scroll (1:4, 1:8) ratios. This makes it suited for 2D game parallax backgrounds, seamless level strips, and website banners.

3. Conversational Regional Editing and Multi-Reference Consistency #

Pass up to 14 reference images (up to 10 object references + 4 character anchors) and direct localized edits conversationally across turns (or via previous_interaction_id), naming what should change and what surrounding pixels or character details stay intact.

4. Google Web Search and Image Search Grounding #

Query Google Web Search and Google Image Search in real time to ground generated visuals in verified facts, real-world landmarks, and accurate visual taxonomy.

5. Video Context Understanding #

Pass YouTube URLs or MP4 files to synthesize keyframe illustrations, sprite sheets, or promotional posters grounded in video context.


CLI and SDK Examples #

1. uv run scripts/banana.py: 4K Panoramic Generation with medium Thinking and Search Grounding #

bash
uv run scripts/banana.py \
  -p "A seamless 2D side-scrolling pixel-art parallax background of a bioluminescent crystal cavern" \
  -f "cavern_parallax_4k.png" \
  -m "nano-banana-2.1" \
  -r "4K" \
  -a "4:1" \
  --thinking-level "medium" \
  --image-search

2. uv run scripts/banana.py: Reference-Locked 4x4 Game Sprite Grid #

bash
uv run scripts/banana.py \
  -p "Keep the exact character identity, proportions, and 4-step color swatches from the reference sheet. Generate a uniform 4x4 sprite sheet grid (4 rows, 4 columns) on a flat unlit #00FF00 background with at least 15% empty #00FF00 margin inside every cell, no grid lines, and no text labels. Row 1: idle. Row 2: walk. Row 3: run. Row 4: 4-phase jump arc including mid-air apex pose." \
  -i "character_sheet.png" \
  -f "raw_grid_part1.png" \
  -m "nano-banana-2.1" \
  -r "2K" \
  -a "1:1" \
  --thinking-level "high"

3. gemini-api CLI: 4K Panoramic Generation with medium Thinking and Search Grounding #

bash
gemini-api image "A seamless 2D side-scrolling pixel-art parallax background of a bioluminescent crystal cavern" \
  -m gemini-nano-banana-2.1 \
  --aspect-ratio 4:1 \
  --image-size 4K \
  --body '{"generation_config":{"thinking_level":"medium"},"tools":[{"type":"google_search","search_types":["web_search","image_search"]}]}' \
  --out cavern_parallax_4k.png
python
import base64
from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-nano-banana-2.1",
    input="A seamless 2D side-scrolling pixel-art parallax background of a bioluminescent crystal cavern",
    tools=[{"type": "google_search", "search_types": ["web_search", "image_search"]}],
    generation_config={"thinking_level": "medium"},
    response_format={
        "type": "image",
        "aspect_ratio": "4:1",
        "image_size": "4K",
    },
)

if interaction.output_image:
    with open("cavern_parallax_4k.png", "wb") as f:
        f.write(base64.b64decode(interaction.output_image.data))

5. Python SDK (google-genai): Multi-Reference Character Consistency #

python
import base64
from google import genai

client = genai.Client()

def encode_png(path: str) -> str:
    with open(path, "rb") as f:
        return base64.b64encode(f.read()).decode("utf-8")

interaction = client.interactions.create(
    model="gemini-nano-banana-2.1",
    input=[
        {"type": "image", "data": encode_png("character_sheet.png"), "mime_type": "image/png"},
        {
            "type": "text",
            "text": (
                "Keep the exact character identity, proportions, and color swatches from the reference sheet. "
                "Generate a uniform 4x4 sprite sheet grid on a flat unlit #00FF00 background with 15% empty cell margins."
            ),
        },
    ],
    generation_config={"thinking_level": "high"},
    response_format={"type": "image", "aspect_ratio": "1:1", "image_size": "2K"},
)

if interaction.output_image:
    with open("raw_grid_part1.png", "wb") as f:
        f.write(base64.b64decode(interaction.output_image.data))

6. JavaScript / TypeScript SDK (@google/genai) #

typescript
import { GoogleGenAI } from "@google/genai";
import * as fs from "node:fs";

const ai = new GoogleGenAI({});

async function generateBanner() {
  const interaction = await ai.interactions.create({
    model: "gemini-nano-banana-2.1",
    input: "A vibrant isometric cyber-arcade cabinet with glowing neon marquee",
    generation_config: {
      thinking_level: "medium",
    },
    response_format: {
      type: "image",
      aspect_ratio: "16:9",
      image_size: "2K",
    },
  });

  if (interaction.output_image) {
    fs.writeFileSync(
      "arcade_cabinet.png",
      Buffer.from(interaction.output_image.data, "base64")
    );
  }
}

generateBanner();

7. Go SDK (google.golang.org/genai) #

go
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"google.golang.org/genai"
)

func main() {
	ctx := context.Background()
	client, err := genai.NewClient(ctx, nil)
	if err != nil {
		log.Fatalf("failed to create genai client: %v", err)
	}

	resp, err := client.Models.GenerateContent(
		ctx,
		"gemini-nano-banana-2.1",
		genai.Text("A clean 16-bit SNES style treasure chest sprite on a solid #00FF00 background"),
		&genai.GenerateContentConfig{
			ResponseModalities: []string{"IMAGE"},
		},
	)
	if err != nil {
		log.Fatalf("generation failed: %v", err)
	}

	for _, part := range resp.Candidates[0].Content.Parts {
		if part.InlineData != nil {
			if err := os.WriteFile("chest_sprite.png", part.InlineData.Data, 0644); err != nil {
				log.Fatalf("write file failed: %v", err)
			}
			fmt.Println("Saved chest_sprite.png")
			break
		}
	}
}