nano-banana
Skill10 starsChanged 7 months agoMITView on GitHub
AI image generation, editing, and web-asset rendering using Google Gemini models. Supports text-to-image, image editing, background removal for transparent PNGs, region-targeted inpainting, and a multi-pass pipeline for producing web-ready assets.
- Reads credentials
- Installs packages
We split this skill into the rules it gives an agent
11 rules. 0 are common, 5 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 34 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Check API key: Verify GEMINI_API_KEY is available.
- Very specific: line 26
For inpainting only: Verify Vertex AI auth: gcloud auth application-default print-access-token (inpainting uses Vertex AI, not the Gemini …
- Distinctive: line 28
If the API key is in a secret manager, export it before running scripts:
- Distinctive: line 74
Remove backgrounds to produce transparent PNGs for websites.
- Distinctive: line 79
Pass 1 — Generate: Create the image with a solid-color background (white, light gray, or magenta for earth-toned subjects)
- Very specific: line 80
Pass 2 — Remove background: Use edit_image.py to visually remove the background
- Very specific: line 81
Pass 3 — Make transparent: Use make_transparent.py to convert to real RGBA (Gemini outputs a checkerboard pattern, NOT actual alpha …
- Distinctive: line 161
Default is Flash: Use Pro when you need higher fidelity for final assets or when the prompt requires advanced reasoning (text in images, …
- Very specific: line 172
Use object-contain to preserve aspect ratios
- Very specific: line 174
Use Next.js <Image> with quality={85} and appropriate sizes
- Distinctive: line 197
All generated images include invisible SynthID watermarks (added by Gemini)
“Common” is measured: kept by at least 6 in 10 of the 34 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
AI image generation and editing skill powered by Google Gemini. Generates images from text prompts, edits existing images, removes backgrounds for web-ready transparent PNGs, and performs region-targeted inpainting.
Setup Verification
The agent should verify the following before using this skill:
- Check Python:
python3 --version(requires 3.9+) - Check dependencies:
python3 -c "from google import genai; print('ok')"— if it fails, install:pip install -r scripts/requirements.txt - Check API key: Verify
GEMINI_API_KEYis available. Retrieve from your secret manager:- GCP:
gcloud secrets versions access latest --secret=GEMINI_API_KEY - Or check for a
.env/.env.localfile in the working directory
- GCP:
- For inpainting only: Verify Vertex AI auth:
gcloud auth application-default print-access-token(inpainting uses Vertex AI, not the Gemini API key)
If the API key is in a secret manager, export it before running scripts:
export GEMINI_API_KEY=$(gcloud secrets versions access latest --secret=GEMINI_API_KEY)Capabilities
1. Text-to-Image Generation
Generate images from text descriptions.
python3 scripts/generate_image.py "a serene Japanese garden with cherry blossoms" \
--aspect-ratio 16:9Parameters:
prompt(required): Text description of the image to generate--output/-o: Output directory or file path (default: current directory)--filename/-f: Custom filename (default: auto-generated with timestamp)--aspect-ratio/-a: Image aspect ratio (default: 1:1)--model/-m: Model to use (default: gemini-2.5-flash-image)
2. Image Editing
Edit existing images with text prompts.
python3 scripts/edit_image.py "change the sky to sunset colors" \
--images landscape.jpg
# Multiple images for consistency/reference (up to 14):
python3 scripts/edit_image.py "create a collage combining these images" \
--images img1.png img2.png img3.png --aspect-ratio 16:9Parameters:
prompt(required): Text description of the edit--images/-i(required): One or more input image paths--output/-o: Output directory or file path (default: current directory)--filename/-f: Custom filename (default: auto-generated)--aspect-ratio/-a: Output aspect ratio (optional)--model/-m: Model to use
3. Background Removal (Web-Asset Pipeline)
Remove backgrounds to produce transparent PNGs for websites. This is a three-pass workflow.
CRITICAL: Read references/web-asset-workflow.md before attempting background removal. Agents frequently get this wrong. The key rules:
- Always use FOUR separate passes — do not try to generate a transparent image in one shot
- Pass 1 — Generate: Create the image with a solid-color background (white, light gray, or magenta for earth-toned subjects)
- Pass 2 — Remove background: Use
edit_image.pyto visually remove the background - Pass 3 — Make transparent: Use
make_transparent.pyto convert to real RGBA (Gemini outputs a checkerboard pattern, NOT actual alpha transparency) - Pass 4 — Compress:
pngquant --quality=65-85to get under 500KB for web delivery - Output MUST be PNG — JPEG does not support transparency
# Pass 1: Generate the subject (use magenta bg for earth-toned subjects)
python3 scripts/generate_image.py \
"a modern two-story ADU building, isometric tilt-shift miniature style, on a simple white background" \
--output ./assets/ --filename subject.png
# Pass 2: Remove the background (Gemini renders checkerboard, not real alpha)
python3 scripts/edit_image.py \
"Remove the background completely. Make the background fully transparent. Keep only the main subject with clean edges. Output as PNG with alpha transparency." \
--images ./assets/subject.png \
--output ./assets/ --filename subject-keyed.png
# Pass 3: Convert checkerboard to real RGBA transparency
python3 scripts/make_transparent.py ./assets/subject-keyed.png \
--output ./assets/ --filename subject-transparent.png
# Pass 4: Compress for web (target: under 500KB)
pngquant --quality=65-85 --force --output ./assets/subject-transparent.png \
./assets/subject-transparent.pngWhy Pass 3 is required: Gemini's background removal renders a visible checkerboard pattern to represent transparency, but the actual PNG output is RGB with no alpha channel. The make_transparent.py script detects this checkerboard pattern and converts it to real RGBA transparency with a proper alpha channel.
If artifacts remain (white fringe near shadows), adjust the threshold:
python3 scripts/make_transparent.py ./assets/subject-keyed.png \
--threshold 210 --feather 2Naming convention: Web-ready transparent assets should use the -transparent.png suffix.
4. Region-Targeted Inpainting (Vertex AI)
Edit ONLY a specific region of an image while preserving everything else. Uses Imagen 3 via Vertex AI (requires gcloud auth application-default login, not GEMINI_API_KEY).
# Edit a bounding box region (auto-generates mask):
python3 scripts/inpaint_image.py "redraw these arrows with clean routing" \
--image figure.png --bbox 100,200,500,600
# With a pre-made mask PNG (white=edit, black=preserve):
python3 scripts/inpaint_image.py "fix the overlapping labels" \
--image figure.png --mask region_mask.png
# Remove content from a region:
python3 scripts/inpaint_image.py "" --image photo.png --bbox 50,50,300,200 --mode removeParameters:
prompt(required): What to draw in the masked region (empty string for removal)--image/-i(required): Source image path--mask/-m: Path to mask PNG (white=area to edit, black=preserve)--bbox/-b: Bounding boxx1,y1,x2,y2— auto-generates a rectangular mask--output/-o: Output directory or file path--filename/-f: Custom filename--mode:insert(default) orremove--mask-dilation: Mask edge expansion 0.0-1.0 (default: 0.01)--num-images/-n: Generate 1-4 candidates (default: 1)--negative-prompt: What to avoid
When to use inpaint vs edit:
- Inpaint — fix a specific area without disturbing the rest (e.g., fix arrows in one corner)
- Edit — the entire image needs modification (e.g., style changes, background removal)
Supported Parameters
Aspect Ratios
1:1 | 2:3 | 3:2 | 3:4 | 4:3 | 4:5 | 5:4 | 9:16 | 16:9 | 21:9
Models
| Model ID | Name | Best For |
gemini-2.5-flash-image | Nano Banana Flash (default) | Fast iterations, lower cost, good quality |
gemini-3-pro-image-preview | Nano Banana Pro | Higher quality, text rendering, complex prompts |
Default is Flash. Use Pro when you need higher fidelity for final assets or when the prompt requires advanced reasoning (text in images, complex compositions).
Web-Asset Rendering Pipeline
For generating assets intended for websites, follow the full pipeline documented in references/web-asset-workflow.md. Summary:
Generate (solid bg) → Remove BG (Gemini) → Make Transparent (real RGBA) → Compress (pngquant) → IntegrateKey integration patterns for web:
- Use
object-containto preserve aspect ratios - Apply
drop-shadowfor floating depth on gradient backgrounds - Use Next.js
<Image>withquality={85}and appropriatesizes - For random/deterministic assignment from a pool, hash the entity ID
See examples/web-asset-pipeline.md for a complete walkthrough.
Resources
scripts/
generate_image.py— Text-to-image generation (Gemini API)edit_image.py— Image editing and visual background removal (Gemini API)make_transparent.py— Converts checkerboard backgrounds to real RGBA transparency (Pillow + scipy)inpaint_image.py— Region-targeted inpainting (Imagen 3, Vertex AI)requirements.txt— Python dependencies
references/
api_reference.md— Model comparison, error codes, rate limits, prompting tipsweb-asset-workflow.md— Multi-pass rendering pipeline for web-ready transparent PNGs
examples/
web-asset-pipeline.md— Step-by-step example of the full generate → key → integrate workflow
Notes
- All generated images include invisible SynthID watermarks (added by Gemini)
- Pro model supports up to 14 reference images for style/subject consistency
- The background removal pass may need 1-2 attempts — always verify the output
- For batch generation, use Flash model for iterations and Pro for final versions
Other versions38 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- mikeOnBreeze/cc-crossbeam★ 29728% same
Wrote their own version · 37
- OpenMinis/MinisSkills★ 584same name
- EvoScientist/EvoSkills★ 481same name
- glebis/claude-skills★ 404same name
- kkoppenhaver/cc-nano-banana★ 368same name
- ruizrica/agent-pi★ 274same name
- LichAmnesia/lich-skills★ 233same name
- refly-ai/refly-skills★ 203same name
- okou-ai/okou-skills★ 81same name
- vm0-ai/vm0-skills★ 81same name
- mycelium-hq/ai-brain-starter★ 50same name
27 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.
Used alongsideProjects with it also use agency-docs-updater, brand-agency and 10 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.
KISHOR403Skillagency-docs-updater
End-to-end pipeline for publishing Claude Code lab meetings. Automatically finds/creates Fathom transcript, downloads video, uploads to YouTube, generates fact-checked Russian summary, creates MDX documentation, and pushes to agency-docs for Vercel deployment. Single invocation replaces 5+ manual steps.
Also in 3 projects that use this
KISHOR403Skillbrand-agency
Applies Agency brand colors and typography to artifacts including presentations, SVG graphics, documents, and web interfaces. This skill should be used when brand colors, visual formatting, neobrutalism style, or Agency design standards apply. Keywords - branding, corporate identity, visual identity, styling, brand colors, typography, visual formatting, visual design, neobrutalism.
Also in 3 projects that use this
emanueleieloSkillelevenlabs-tts
Text-to-speech with ElevenLabs: generate realistic voice audio from text. Requires ELEVENLABS_API_KEY.
Also in 5 projects that use this
- +9 more from KISHOR403
In this repository23 other files it gives its agents.
- data-lake-starterSkill
- google-workspaceSkill
- mcp-guideSkill
- secrets-managerSkill
- semantic-layer-auditSkill
- gmailSkill
- google-calendarSkill
- google-chatSkill
- slack-directorySkill
- slackSkill
- google-docsSkill
- google-driveSkill
- google-sheetsSkill
- google-tasksSkill
- brand-identitySkill
- creative-matrixSkill
- google-adsSkill
- autoresearchSkill
- long-running-agentSkill
- morning-briefingSkill
- playbook-discoverySkill
- revenue-forecasterSkill
- patent-figureSkill
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.

