New Capability: Gemini Image Model Migration to Nano Banana 2

New Capability: Gemini Image Model Migration to Nano Banana 2

Date: March 8, 2026 (Sunday) Origin: Chris asked whether we're using the correct Gemini image model. Research revealed the current model (gemini-3-pro-image-preview / Nano Banana Pro) is deprecated and scheduled for shutdown March 9, 2026 — one day away. Impact: All image generation across the platform now uses Nano Banana 2 (gemini-3.1-flash-image-preview), preventing a complete image pipeline failure and cutting per-image cost by 50%.


What Was Built

This was an emergency migration of every image generation reference across the monorepo — from the deprecated gemini-3-pro-image-preview (Nano Banana Pro, shutting down March 9) to gemini-3.1-flash-image-preview (Nano Banana 2).

The migration touched 7 files across 4 areas: the shared Gemini client library, three image generation scripts, the image generator agent, a client project (Adams Outdoor billboard generator), and the architecture documentation. Fallback models were also updated — the agent's fallback moved from the defunct gemini-2.0-flash-preview-image-generation to gemini-2.5-flash-image.

Without this migration, every image generation operation — article banners, OG images, featured images, carousel slides, show thumbnails, client billboard generation — would have failed starting March 9.

Infrastructure Changes

Change Before After
Primary image model gemini-3-pro-image-preview (Nano Banana Pro) gemini-3.1-flash-image-preview (Nano Banana 2)
Agent fallback model gemini-2.0-flash-preview-image-generation (defunct) gemini-2.5-flash-image (Nano Banana)
Cost per 1K image ~$0.134 ~$0.067 (50% reduction)
Cost per 4K image ~$0.24 ~$0.151 (37% reduction)
Model status Deprecated (shutdown Mar 9) Active, Google-recommended successor

Implementation

File Purpose
apps/website/src/lib/gemini.ts Shared Gemini client — used by carousel generation, all visual generators
apps/website/scripts/publish-article.ts Article publishing pipeline — featured image generation
apps/website/scripts/generate-og-images.ts OG image generation for social sharing
apps/website/scripts/generate-featured-images.ts Batch featured image generation
agents/image-generator/run.ts Image generator agent — Tron:Ares visuals, presentations, thumbnails
clients/adams-outdoor/projects/billboard-generator/src/providers/gemini.ts Client billboard image generation
apps/website/docs/architecture/INTEGRATION_MAP.md Architecture documentation

Usage

No usage changes. All existing commands work identically — only the underlying model changed.

# Article publishing (generates featured image automatically)
npx tsx apps/website/scripts/publish-article.ts /path/to/article.json --author v

# OG image batch generation
npx tsx apps/website/scripts/generate-og-images.ts

# Featured image batch generation
npx tsx apps/website/scripts/generate-featured-images.ts

# Image generator agent
npx tsx agents/image-generator/run.ts --type=concept --name="test" "abstract data visualization"

Leader Applications

V (Operations)

Every content operation that generates visuals — article publishing, OG images, show thumbnails, carousel generation — now runs on Nano Banana 2. The publish-article.ts pipeline (used today for the weekly build log) and the distribute-article.ts LinkedIn distribution both depend on this. V's content velocity is preserved.

Sage (Customer)

No direct application. Sage's relationship intelligence doesn't generate images.

Pax (Finance)

Cost reduction: 50% per image at 1K resolution, 37% at 4K. At current volume (4-5 images/week), savings are modest ($0.35/week → ~$0.18/week), but the per-unit economics improve if content production scales. No budget impact worth tracking at current volume.


Dependencies

Dependency Status Notes
GEMINI_API_KEY Confirmed In monorepo root .env, loaded by all scripts
@google/generative-ai SDK Confirmed v0.24.1+ in website, uses responseModalities: ['IMAGE']
Google AI Studio billing Confirmed Free tier does NOT support image generation — paid tier required

Verification

# Quick verification — generate a test image
cd /mnt/d/Projects/value-first-operations && npx tsx agents/image-generator/run.ts --type=concept --name="test-nano-banana-2" "abstract data node"

Expected output should show Model: Nano Banana 2 (gemini-3.1-flash-image-preview) in the console.


Gemini Image Model Reference (March 2026)

For future model decisions:

Model API ID Codename Cost (1K) Status
Gemini 3.1 Flash Image gemini-3.1-flash-image-preview Nano Banana 2 $0.067 Active (current)
Gemini 3 Pro Image gemini-3-pro-image-preview Nano Banana Pro $0.134 Deprecated Mar 9
Gemini 2.5 Flash Image gemini-2.5-flash-image Nano Banana $0.039 Active (fallback)
Imagen 4 Fast imagen-4.0-fast-generate-001 $0.02 Active (different API)
Imagen 4 Standard imagen-4.0-generate-001 $0.04 Active
Imagen 4 Ultra imagen-4.0-ultra-generate-001 $0.06 Active