Skip to content

webkubor/nanobanana-plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

53 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

🍌 nanobanana-plus

One prompt. Any ratio. Any model. No restart.

δΈ­ζ–‡ Β· Changelog Β· Report Bug

License Version Stars


"The official nanobanana always outputs a cropped 1:1 square. To change the model you have to restart the whole server. I just wanted a 16:9 wallpaper."

β€” Issue #44, 89 thumbs up

This fork fixes that. Fork of Google's official nanobanana β€” dynamic model switching + any aspect ratio, per call.


Install

npm install -g nanobanana-extension

Already logged in with gemini auth login? That's all you need β€” OAuth is reused automatically.


Real output

nanobanana-plus generate \
  --prompt "a tabby cat sitting on a rainy windowsill, cinematic lighting" \
  --aspect-ratio 16:9
# βœ… Saved β†’ /Users/you/tabby-cat-rainy-window.png
πŸ“Έ Demo output (click to expand)

nanobanana-plus β€” full 16:9 composition preserved: ζ©™θ‰²ηŒ«ε’ͺεεœ¨ι›¨ε€©ηͺ—ε°δΈŠ

original nanobanana β€” same prompt, always cropped to 1:1 square: CLI ζ“δ½œζˆͺε›Ύ


What's different from upstream

Feature nanobanana (official) nanobanana-plus
Aspect ratio 1:1 only 16:9 / 9:16 / 4:3 / 3:4 / 21:9
Switch model per call ❌ restart required βœ… --model flag
Imagen 4 Ultra / Fast ❌ βœ…
Output count (1-8) ❌ βœ… --output-count
Seed control ❌ βœ… --seed

Models

No server restart needed β€” specify per call.

--model Name Best for
(default) Nano Banana 2 (gemini-3.1-flash-image-preview) ⚑ Daily use, quota-friendly
gemini-3-pro-image-preview Nano Banana Pro 🎨 High quality, fine detail
gemini-2.5-flash-image Nano Banana v1 πŸ”„ Legacy compat
imagen-4.0-ultra-generate-001 Imagen 4 Ultra πŸ’Ž Photorealistic (Pro Key required)
imagen-4.0-fast-generate-001 Imagen 4 Fast πŸš€ Speed + quality (Pro Key required)
# Set a global default
export NANOBANANA_MODEL=gemini-3-pro-image-preview

All options

Flag Required Description
--prompt βœ… Describe the image
--model β€” Model ID (default: Nano Banana 2)
--aspect-ratio β€” 16:9 / 9:16 / 1:1 / 4:3 / 3:4 / 21:9*
--output-count β€” 1–8 images per call (default: 1)
--filename β€” Output file path
--file-format β€” png (default) or jpeg
--seed β€” Fix random seed for reproducibility
--preview / --no-preview β€” Toggle preview

*21:9 ultra-wide only supported on Gemini models. See docs/compatibility-21-9-matrix.md.


Gallery

πŸ’Ž Imagen 4 Ultra β€” photorealistic

nanobanana-plus generate \
  --prompt "majestic snowy mountain peak under a starry night sky, photorealistic, 8K" \
  --model imagen-4.0-ultra-generate-001 --aspect-ratio 16:9

Ultra 16:9

⚑ Nano Banana 2 β€” fast daily (default)

nanobanana-plus generate \
  --prompt "cyberpunk city at night, neon lights, rain reflections, cinematic" \
  --model gemini-3.1-flash-image-preview --aspect-ratio 16:9

Nano Banana 16:9


API Key setup

export NANOBANANA_GEMINI_API_KEY="your_key"   # recommended
export GEMINI_API_KEY="your_key"               # fallback
export GOOGLE_API_KEY="your_key"               # fallback

Already logged in with Gemini CLI? OAuth session is reused β€” no key needed.


Aspect ratio quick reference

Ratio Use case
16:9 πŸ–₯️ Desktop wallpaper / YouTube thumbnail / blog header
9:16 πŸ“± Phone wallpaper / Reels / Stories
1:1 ⬜ Avatar / Instagram / WeChat article
4:3 πŸ–ΌοΈ Classic landscape / presentation
3:4 πŸ“„ Classic portrait / poster
21:9 🎬 Cinematic ultrawide

Contributing

PRs welcome. Most wanted:

  • 🎨 Style presets β€” ink wash, ukiyo-e, cyberpunk as built-in prompt prefixes
  • πŸ” Model comparison β€” render same prompt with flash + pro side by side
  • πŸ“Š Quota tracker β€” alert when approaching API limits
git clone https://github.com/webkubor/nanobanana-plus
cd nanobanana-plus && pnpm install && pnpm run dev

License

Apache License 2.0 β€” Fork of nanobanana by Google LLC.


If this saved you a restart, leave a ⭐

About

A Gemini CLI extension for per-call Nano Banana 2 / Pro switching, aspect ratio control, and image generation without server restarts.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors