Automated summary
Generates and edits images using Google's Gemini Image API (Nano Banana) from the command line.
Strengths
- Fast generation with standard Nano Banana model
- Edit existing images (background replacement, content modification)
- Pro model support for professional-quality visuals
- Simple usage via uv with no manual installation
Limitations
- Requires a Gemini API key and internet connection
- Cost per image (approx $0.039 for Nano Banana)
- Quality depends on model choice and prompt
Best for quickly creating visuals, infographics, or editing images without complex graphic tools.
Avoid for precise photo compositing or professional retouching that requires desktop software.
Security analysis
SafeThe skill instructs running a Python script that uses a local API key to call Google's Gemini API for image generation. No destructive commands, exfiltration, or obfuscation present. The script is not provided, but assuming it follows the instructions, it is safe.
No concerns found
How this analysis is madeExamples
Generate an image of a futuristic city at sunset with flying cars and neon lights.Edit this image: change the background to a beach sunset. The image is at /path/to/photo.jpg.Create an infographic about renewable energy sources using the Pro model.name: nano-banana-imagegen description: Generate and edit images using Google's Nano Banana (Gemini Image API). Use when the user wants to create AI-generated images, edit existing images, create infographics, generate product mockups, design social media graphics, or perform any image generation/manipulation task. Requires GEMINI_API_KEY environment variable.
Nano Banana Image Generation
Generate and edit images using Google's Gemini Image models (Nano Banana and Nano Banana Pro).
Prerequisites
-
API Key: Set the
GEMINI_API_KEYenvironment variable- Get key from: https://aistudio.google.com/apikey
-
uv: The script uses inline dependencies with uv (no manual install needed)
Quick Start
Using the Script
# Generate an image
uv run scripts/generate_image.py "A futuristic city at sunset" -o city.png
# Edit an existing image
uv run scripts/generate_image.py "Remove the background" -i photo.jpg -o edited.png
# Use Nano Banana Pro for higher quality
uv run scripts/generate_image.py "Create a detailed infographic" -m pro -o infographic.png
Direct Python Usage (with uv)
uv run --with google-genai python -c '
from google import genai
import os
client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])
response = client.models.generate_content(
model="gemini-2.5-flash-image",
contents=["Create an image of a cat wearing a space helmet"]
)
for part in response.candidates[0].content.parts:
if part.inline_data:
with open("output.png", "wb") as f:
f.write(part.inline_data.data)
print("Saved to output.png")
'
Model Selection
| Model | Use Case |
|-------|----------|
| gemini-2.5-flash-image (Nano Banana) | Fast generation, iterations, high volume |
| gemini-3-pro-image-preview (Nano Banana Pro) | Professional quality, text rendering, complex prompts |
Common Tasks
Image Generation
uv run scripts/generate_image.py "A serene Japanese garden with cherry blossoms" -o garden.png
Image Editing
uv run scripts/generate_image.py "Change the background to a beach sunset" -i input.jpg -o edited.png
Infographics (use Pro model)
uv run scripts/generate_image.py "Create an infographic about renewable energy" -m pro -o infographic.png
Resources
- Script:
scripts/generate_image.py- CLI tool with inline uv dependencies - API Reference: See
references/api_reference.mdfor detailed SDK usage - Prompting Guide: See
references/prompting_guide.mdfor effective prompts
Pricing
~$0.039 per image for Nano Banana (1290 tokens per image at $30/1M tokens)
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/nano-banana-image-generation-mrx3y0pc/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/nano-banana-image-generation-mrx3y0pc' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/nano-banana-image-generation-mrx3y0pc/download' --output '.skill-downloads/nano-banana-image-generation-mrx3y0pc/SKILL.md.part' && mv '.skill-downloads/nano-banana-image-generation-mrx3y0pc/SKILL.md.part' '.skill-downloads/nano-banana-image-generation-mrx3y0pc/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
Original excerpt: Prerequisites
-
API Key: Set the
GEMINI_API_KEYenvironment variable- Get key from: https://aistudio.google.com/apikey
-
uv: The script uses inline dependencies with uv (no manual install needed)
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/nano-banana-image-generation-mrx3y0pc/SKILL.md' && test -s '.skill-downloads/nano-banana-image-generation-mrx3y0pc/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/nano-banana-imagegen' && cp -R '.skill-downloads/nano-banana-image-generation-mrx3y0pc' '.claude/skills/nano-banana-imagegen'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/nano-banana-image-generation-mrx3y0pc'openskills read 'nano-banana-image-generation-mrx3y0pc'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/nano-banana-image-generation-mrx3y0pc/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
Writing Fragments
Content
Mine raw writing fragments through a relentless interview, without imposing structure. Capture ideas, quotes, and leading words for later use.
UI Copywriting & Auditing
Content
Write or audit user-facing UI copy including buttons, errors, empty states, and tooltips across the monorepo, following the design system source of truth.
Music MIDI Extraction
Content
Extracts the MIDI or score from an existing music production via the CogMusic MCP tool and confirms availability.