One prompt. Any ratio. Any model. No restart.
δΈζ Β· Changelog Β· Report Bug
"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.
npm install -g nanobanana-extensionAlready logged in with
gemini auth login? That's all you need β OAuth is reused automatically.
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:

| 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 |
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| 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:9ultra-wide only supported on Gemini models. Seedocs/compatibility-21-9-matrix.md.
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:9nanobanana-plus generate \
--prompt "cyberpunk city at night, neon lights, rain reflections, cinematic" \
--model gemini-3.1-flash-image-preview --aspect-ratio 16:9export NANOBANANA_GEMINI_API_KEY="your_key" # recommended
export GEMINI_API_KEY="your_key" # fallback
export GOOGLE_API_KEY="your_key" # fallbackAlready logged in with Gemini CLI? OAuth session is reused β no key needed.
| 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 |
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 devApache License 2.0 β Fork of nanobanana by Google LLC.
If this saved you a restart, leave a β

