
nano-banana
Generate and edit images using Google's Gemini image generation models (Nano Banana family). Supports style presets, platform-specific sizing (YouTube/slides/blog), variants, image editing via inlineData, reference images for style transfer, and organized output with metadata. Default model is Nano Banana 2 (gemini-3.1-flash-image-preview). Key is auto-decrypted via SOPS.
- Installs
- 209
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/glebis/claude-skills --skill nano-banana- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads nano-banana automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Nano Banana - Gemini Image Generation
Generate and edit images from text prompts via Google's Gemini image generation API.
When to Use
- User requests image generation, creation, or production from a text description
- Editing existing images with text instructions
- Style-transfer: generate new images that match the aesthetic of a reference
- Creating illustrations for presentations, articles, thumbnails, social posts
- Batch variations of the same concept
First-Time Setup
scripts/nano_banana.py init
Wizard checks dependencies (sops, age, magick), verifies the API key, and saves defaults to ~/.config/nano-banana/config.yaml.
Quick Start
# Simple generation
scripts/nano_banana.py "a minimalist illustration of a rocket" ./rocket.png
# With style preset
scripts/nano_banana.py --preset editorial "interconnected nodes" ./nodes.png
# YouTube thumbnail (auto-cropped to 1280x720)
scripts/nano_banana.py --preset grain --platform youtube "coffee on desk" ./thumb.png
# Generate 4 variants + contact sheet
scripts/nano_banana.py --preset wireframe "a crystal" ./crystal.png --n 4
# Edit existing image
scripts/nano_banana.py --edit ./old.png "make the background deep teal" ./new.png
# Style reference (match aesthetic of existing image)
scripts/nano_banana.py --reference ./style.png "a new mountain landscape" ./mountain.png
# Re-roll last prompt
scripts/nano_banana.py again
# View history
scripts/nano_banana.py history -n 10
Requirements
GEMINI_API_KEY— auto-decrypted fromsecrets.enc.yamlvia SOPS + age. Fallback:export GEMINI_API_KEY=...sops,age— for key decryptionmagick(ImageMagick) — for platform fit + contact sheetspython3withpyyaml
Models
| Model | Alias | Nano Banana Name | Use When |
|---|---|---|---|
gemini-3.1-flash-image-preview (default) | flash | Nano Banana 2 | Best instruction following, fast |
gemini-3-pro-image-preview | pro | Nano Banana Pro | Highest quality, text in images |
gemini-2.5-flash-image | flash-2.5 | Nano Banana (original) | Legacy |
Use via --model flash|pro|flash-2.5 or full ID.
Style Presets
scripts/nano_banana.py list-presets
scripts/nano_banana.py --preset editorial "your subject" out.png
| Preset | Style |
|---|---|
editorial | Thin lines on black, muted palette, technical diagram feel |
blueprint | White/cyan lines on dark navy, engineering drawing |
ink | Japanese sumi-e ink wash, organic brushstrokes, monochrome |
risograph | Flat colors, grain, terracotta + sage, zine aesthetic |
wireframe | 3D wireframe mesh, glowing edges on black |
constellation | Star map dots connected by faint lines, celestial |
brutalist | Bold shapes, thick borders, hard shadows, flat colors |
grain | Film grain photo, high ISO, warm cinematic tones |
Defined in presets.yaml — edit to add your own.
Platform Presets
scripts/nano_banana.py list-platforms
scripts/nano_banana.py --platform youtube "your subject" out.png
Generated image is automatically resized + center-cropped to target dimensions.
| Platform | Size |
|---|---|
youtube | 1280×720 |
youtube-short | 1080×1920 |
slides | 1920×1080 |
blog | 1200×630 |
x | 1600×900 |
square | 1080×1080 |
story | 1080×1920 |
pinterest | 1000×1500 |
Features
Variants + Contact Sheet
--n N generates N variants in parallel and assembles them into a contact sheet:
scripts/nano_banana.py --preset ink "mountain" ./mt.png --n 6
# Creates mt-01.png ... mt-06.png + mt-contact.png
Batch generation (campaigns / multi-copy ad sets)
When each output needs different text or a different prompt (e.g. a set of ads sharing one style), loop over a list. --n won't help here — it re-rolls the same prompt. Use a shared $STYLE string + a per-item array.
cd /abs/output/dir
REF="_reference.png" # optional style anchor
STYLE="<shared visual-style description, written once>"
# Each entry: pipe-delimited fields + output filename. NAME the array — see gotchas.
ADS=(
"CALL NOW|FOR TOTAL|CONFIDENTIALITY|ad-callnow.png"
"REDACT|BEFORE|YOU SEND|ad-redact.png"
)
for entry in "${ADS[@]}"; do
IFS='|' read -r L1 L2 L3 OUT <<< "$entry"
python3 scripts/nano_banana.py \
"$STYLE The exact text reads, on three centered lines: '$L1' / '$L2' / '$L3'. Spell every word correctly." \
"$OUT" --reference "$REF" --platform youtube --model pro --no-metadata --project NAME
done
Shell gotchas (this is zsh on macOS — these bite every time):
- Never name a loop array
LINES,COLUMNS,PATH,path,status,argv, etc. — zsh reserves them.LINES=(...)fails withcan't assign array value to non-array special. UseADS,ITEMS,JOBS. - zsh does NOT word-split unquoted variables (unlike bash).
CMD="magick montage"; $CMD ...looks for a single command literally named "magick montage". Don't stuff multi-word commands in a var — call the command directly, or use an array (cmd=(magick montage); "${cmd[@]}"). - Always quote expansions —
"$OUT","${ADS[@]}"— paths and prompts contain spaces. - Use
'single quotes'for the exact text you want rendered, inside the double-quoted prompt, so the model reproduces it verbatim. - To parallelize a batch, append
&per iteration andwaitat the end — but cap concurrency (the API rate-limits); sequential is safest for >6 items.
After a batch, assemble a review sheet by calling the tool directly (no var indirection): magick montage ad-*.png -tile 2x3 -geometry 480x270+6+6 -background black _contact.png.
Edit Mode
Pass an existing image and the prompt becomes the edit instruction:
scripts/nano_banana.py --edit ./thumb.png "remove the watermark, warmer colors" ./clean.png
Reference Images (Style Anchor)
Use one or more reference images to guide the aesthetic without editing them:
scripts/nano_banana.py --reference ./episode1.png --reference ./episode2.png \
"episode 3: data drift" ./ep3.png
Projects + Metadata
Organize outputs by project:
scripts/nano_banana.py --project lab-04/meeting-02 --preset editorial "MCP loops" ./overlay.png
# Saves to ~/nano-banana/outputs/lab-04/meeting-02/20260414-<subject>.png + .json sidecar
Re-roll + History
scripts/nano_banana.py again # rerun last prompt
scripts/nano_banana.py history -n 20 # show last 20 generations
scripts/nano_banana.py history --project lab-04
Dry Run
Preview the composed prompt without calling the API:
scripts/nano_banana.py --preset editorial --platform youtube "subject" --dry-run
Transient Errors & Retry
The API occasionally returns 500/INTERNAL or empty candidates. The script retries up to 4 times with exponential backoff (2s, 4s, 8s, 16s). Permanent errors (4xx, safety violations) fail fast without retry.
Prompt Tips
- Specify visual style: "photograph", "flat illustration", "watercolor", "3D render"
- Include composition: "centered", "white background", "wide shot"
- Name colors: "blue and white color scheme", "warm earth tones"
- For text rendering, use
--model proand quote exact text:'with the text "Hello"'
See references/api_reference.md for full API documentation.
Files
scripts/nano_banana.py— main CLI (Python)scripts/generate_image.sh— thin bash wrapper (back-compat)presets.yaml— style presetsplatforms.yaml— platform sizing presetssecrets.enc.yaml— encrypted API key (SOPS + age)~/.config/nano-banana/config.yaml— user defaults (frominit)~/.config/nano-banana/history.jsonl— generation log~/.config/nano-banana/last.json— last run (foragain)
FAQ
What does the nano-banana skill do?
Generate and edit images using Google's Gemini image generation models (Nano Banana family). Supports style presets, platform-specific sizing (YouTube/slides/blog), variants, image editing via inlineData, reference images for style transfer, and organized output with metadata. Default model is Nano Banana 2 (gemini-3.1-flash-image-preview). Key is auto-decrypted via SOPS.
How do I install nano-banana?
Run npx skills add https://github.com/glebis/claude-skills --skill nano-banana in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/nano-banana/ (personal) or .claude/skills/nano-banana/ (project).
Which AI agents can use nano-banana?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is nano-banana safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains nano-banana?
It is published by glebis in glebis/claude-skills. It has 209 recorded installs.
More from glebis/claude-skills
google-image-search
glebis/claude-skills
Search and download images via Google Custom Search API with LLM-powered selection. This skill should be used when finding images for articles, presentations, research documents, or enriching Obsidian notes with relevant visuals. Supports simple queries, batch processing from JSON config, automatic config generation from terms, and full note enrichment with automatic image insertion below headings.
pdf-generation
glebis/claude-skills
Professional PDF generation from markdown using Pandoc with Eisvogel template and EB Garamond fonts. Use when converting markdown to PDF, creating white papers, research documents, marketing materials, or technical documentation. Supports both English and Russian documents with professional typography and color-coded themes. Mobile-optimized layout (6x9) by default for Telegram bot context, desktop/print layout (A4) for other contexts.
health-data
glebis/claude-skills
Query Apple Health SQLite database for vitals, activity, sleep, and workouts. Supports Markdown, JSON, and FHIR R4 output formats. This skill should be used when analyzing health metrics, generating health reports, answering questions about fitness or sleep patterns, or exporting health data in standard formats.
firecrawl-research
glebis/claude-skills
This skill should be used when the user requests to research topics using FireCrawl, enrich notes with web sources, search and scrape information, or write scientific/academic papers. It extracts research topics from markdown files, creates research documents with scraped sources, generates BibTeX bibliographies from research results, and provides Pandoc/MyST templates for academic writing with citation management.
deep-research
glebis/claude-skills
This skill should be used when conducting comprehensive research on any topic using the OpenAI Deep Research API. It automates prompt enhancement through interactive clarifying questions, saves research parameters, and executes deep research with web search capabilities. Use when the user asks for in-depth analysis, investigation, research summaries, or topic exploration.
presentation-generator
glebis/claude-skills
Generate interactive HTML presentations with neobrutalism styling, ASCII art decorations, and Agency brand colors. Outputs HTML (interactive with navigation), PNG (individual slides via Playwright), and PDF. References brand-agency skill for colors and typography. Use when creating presentations, slide decks, pitch materials, or visual summaries.
Popular media & creative skills
hyperframes
heygen-com/hyperframes
Read first to make, edit, animate or render any video with HyperFrames (HTML rendered to video), including launch films, explainers, music videos, charts, maps, vertical clips, title cards, captions and overlays. Holds the render contract, the work loop and what each kind of video needs.
media-use
heygen-com/hyperframes
Get or make any media for a HyperFrames video - music, sound effects, images, icons, logos, voiceover, avatar and generated video, transcripts, cutouts, colour grades and looks - with HeyGen or free local tools, and mix placed audio. Also for footage that looks dark, flat or dull, or should be stylized or hidden.
hyperframes-registry
heygen-com/hyperframes
About 450 ready-made HyperFrames blocks and components installed as editable source - transitions, overlays, titles, kinetic type, captions, charts, map overlays, 3D, camera moves. Use it before hand-building any named visual (CRT scanlines, glitch, film grain, a chart); also for hyperframes add and catalog.
hyperframes-creative
heygen-com/hyperframes
Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use hyperframes-animation.
ai-video-generation
101-skills/superpowers
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse
ai-image-generation
101-skills/superpowers
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image