nano-banana
Skill438 starsChanged 3 months agoMITView on GitHub
Generate or edit images using Google Nano Banana (Gemini image generation API). Trigger this skill whenever the user asks to generate an image, draw something, create artwork, edit a photo, or mentions "nano banana", "nanobanana", or any AI image generation/editing need — even if they don't explicitly mention Nano Banana. Proactively use this skill for any image creation or transformation request.
- Reads credentials
- Installs packages
25 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- EvoScientist/EvoSkillstheir own version, first seen Sep 30, 2026
- lsongdev/skillsedited, first seen Sep 10, 2026
- buildatscale-tv/agent-skillstheir own version, first seen Sep 9, 2026
- JoeCotellese/claude-code-configtheir own version, first seen Aug 5, 2026
- jh941213/my-cc-harnesstheir own version, first seen Jul 27, 2026
- Leo-Atienza/atlas-claudetheir own version, first seen Jul 24, 2026
Used with
Projects with it also use brand-guidelines, frontend-design and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
JetBrainsSkillbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Also in 3 projects that use this
VercelSkillfrontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
Also in 3 projects that use this
MicrosoftSkillskill-creator
Guide for creating effective GitHub Copilot skills (.github/skills/) in this repository. Use when creating a new skill, updating an existing skill, or when asked about skill structure, format, or best practices for the vscode-documentdb project.
Also in 3 projects that use this
Other versions25 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- lsongdev/skills★ 196% same
Wrote their own version · 24
- nexu-io/nexu★ 3.3ksame name
- EvoScientist/EvoSkills★ 470same name
- glebis/claude-skills★ 387same name
- kkoppenhaver/cc-nano-banana★ 377same name
- LichAmnesia/lich-skills★ 233same name
- refly-ai/refly-skills★ 203same name
- jh941213/my-cc-harness★ 126same name
- okou-ai/okou-skills★ 77same name
- mycelium-hq/ai-brain-starter★ 38same name
- nilecui/SkillsBase★ 27same name
14 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository51 other files it gives its agents.
- android-devSkill
- android-ui-automationSkill
- apple-remindersSkill
- appstoreprice-hubSkill
- asc-cliSkill
- bilibili-hubSkill
- Clash 控制器Skill
- cloudflare-dnsSkill
- codex-imageSkill
- codex-on-ishSkill
- contact-vcard-extractorSkill
- deepseek-usageSkill
- doubao-ttsSkill
- douyin-downloaderSkill
- exa-searchSkill
- free-ttsSkill
- fucai3d-latestSkill
- generative-ui-minisSkill
- github-sync-helperSkill
- health-sleep-analysisSkill
- hyperframes-cliSkill
- hyperframesSkill
- korea-stockSkill
- maimai-hubSkill
- memos-apiSkill
- notion-hubSkill
- openstreetmap-markerSkill
- pdf-converterSkill
- production-agent-publicSkill
- qbt-hubSkill
- quark-hubSkill
- reverse-dcfSkill
- self-improving-agentSkill
- shortcut-share-fileSkill
- spotify-hubSkill
- stock-fund-flowSkill
- stock-priceSkill
- tavily-searchSkill
- tg-hubSkill
- todoocardSkill
- twitter-downloaderSkill
- twitter-x-hubSkill
- us-stockSkill
- web-content-extractorSkill
- web-searchSkill
- weibo-hubSkill
- whenpeakSkill
- xianyu-hubSkill
- xiaohongshu-hubSkill
- youtube-downloaderSkill
- ytmusic-hubSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 24 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Check environment (API key + dependencies)
- Very specific: line 16
Run the script and save output to /var/minis/attachments/
- Distinctive: line 30
If not set, direct the user to Google AI Studio to obtain a key, then:
- Distinctive: line 93
Run any script with:
- Distinctive: line 126
When the user makes an image generation request:
“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Nano Banana — Image Generation Skill
Generate or edit images locally using the Google Gemini image generation API (a.k.a. Nano Banana).
Quick Workflow
- Check environment (API key + dependencies)
- Identify the mode: text-to-image / image editing / batch generation
- Choose the right model
- Use the bundled scripts directly — no need to rewrite them
- Run the script and save output to
/var/minis/attachments/ - Display the result inline in the conversation
Environment Setup
Check API Key
source /etc/profile && echo $GEMINI_API_KEY | head -c 10⚠️ Always run
source /etc/profilefirst — environment variables are stored there and won't be available otherwise.
If not set, direct the user to Google AI Studio to obtain a key, then:
echo 'export GEMINI_API_KEY="your_key_here"' >> /etc/profileCheck Dependencies
pip show google-genai pillow 2>&1 | grep -E "^Name|not found"If missing:
pip install google-genai pillowModel Selection
| Model | Model ID | Best For |
| Nano Banana 2 (recommended) | gemini-3.1-flash-image-preview | Fast, high quality, 2K support — default choice |
| Nano Banana Pro | gemini-3-pro-image-preview | Complex prompts, professional assets, precise text rendering |
| Nano Banana (original) | gemini-2.5-flash-image | Ultra-low latency, simple tasks |
Default to gemini-3.1-flash-image-preview unless the user explicitly requests another version.
⚠️ Known API Pitfalls
1. Aspect ratio / resolution config
❌ Wrong (old API, throws AttributeError):
# types.ImageGenerationConfig does not exist!
image_generation_config=types.ImageGenerationConfig(aspect_ratio="16:9")✅ Correct:
config=types.GenerateContentConfig(
response_modalities=["IMAGE"],
image_config=types.ImageConfig(
aspect_ratio="16:9", # options: 1:1, 4:3, 3:4, 16:9, 9:16
image_size="2K", # options: 1K, 2K (default: 1K)
),
)2. Environment variable loading
❌ Running python3 script.py directly may not have the API key
✅ Always prefix with source /etc/profile && python3 script.py
3. Saving images
part.as_image() returns a PIL Image object — call .save(path) directly. No need to handle base64 manually.
Bundled Scripts
Run any script with:
source /etc/profile && python3 <skill-path>/nano-banana/scripts/<script>.py [args]📄 gen.py — Text to Image
Usage: gen.py "prompt" [output_path] [aspect_ratio] [resolution]
Example: gen.py "a panda drinking tea in a bamboo forest" /var/minis/attachments/out.png 1:1 2K📄 edit.py — Image Editing (image + prompt → image)
Usage: edit.py <input_image> "edit instruction" [output_path]
Example: edit.py /var/minis/attachments/photo.jpg "add a wizard hat to the cat" /var/minis/attachments/edited.png📄 batch.py — Batch Generation (multiple prompts → multiple images)
Edit the TASKS list at the top of the script, then run it.
Step-by-Step
When the user makes an image generation request:
- Understand the request — text-to-image, image editing, or batch?
- Check API key —
source /etc/profile && echo $GEMINI_API_KEY | head -c 10 - Verify scripts exist —
ls <skill-path>/nano-banana/scripts/ - If scripts are missing, use
file_writeto recreate them from the source in this skill - Run the appropriate script:
- Text-to-image:
source /etc/profile && python3 <skill-path>/nano-banana/scripts/gen.py "prompt" /var/minis/attachments/out.png 16:9 2K - Image editing:
source /etc/profile && python3 <skill-path>/nano-banana/scripts/edit.py <image_path> "instruction" /var/minis/attachments/out.png - Batch: edit
TASKSinscripts/batch.py, then run it
- Text-to-image:
- Display the result —

Prompt Tips
- Describe a scene, don't just stack keywords — "An elderly Japanese potter focused at the wheel, soft afternoon light through a studio window, photorealistic" beats "Japan pottery old man realistic"
- Specify style explicitly — for photography add camera details ("50mm lens, shallow depth of field"); for illustration name the style ("Ghibli-style watercolor")
- Text in images — spell out exactly what text should appear; the model renders it more accurately when it's explicit
- Iterate with edit.py — make small adjustments on an existing image rather than regenerating from scratch
- Aspect ratio guide —
16:9for banners/social media,1:1for avatars/covers,9:16for phone wallpapers,3:4for portrait cards
Troubleshooting
| Issue | Cause & Fix |
AttributeError: ImageGenerationConfig | Deprecated API — use image_config=types.ImageConfig(...) instead |
KeyError: GEMINI_API_KEY | Run source /etc/profile before executing the script |
| Only text returned, no image | Ensure response_modalities includes "IMAGE" |
| Poor image quality | Switch to gemini-3-pro-image-preview or refine the prompt |
| Rate limit error | Free tier has limits — wait a moment and retry |
| Save fails | Confirm /var/minis/attachments/ directory exists |
References
- Official docs: https://ai.google.dev/gemini-api/docs/image-generation
- Get an API key: https://aistudio.google.com/apikey
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

