New to Claude Skills? Learn how to install them โ†’

resciencelab on GitHub

Nano Banana

Free

Effortlessly generate and edit images with AI.

Get this skill

Free ยท Opens the source repo

What Nano Banana does

Nano Banana is a skill designed for developers and designers who want to leverage the power of Google's Gemini 3 Pro Image model for image generation and editing. This skill allows users to create images from textual descriptions, edit existing images, and customize outputs in various aspect ratios and high resolutions. With support for both 2K and 4K outputs, Nano Banana is ideal for producing high-quality visuals for a range of applications, from product photography to artistic illustrations.

The skill operates through simple command-line scripts, making it accessible for users familiar with Python and bash. Users can generate images by providing descriptive prompts, and they can also modify images by specifying changes in natural language. This flexibility allows for creative exploration and rapid iteration, which is essential for designers and content creators. Additionally, the skill includes options for batch image generation, enabling users to create multiple variations of an image with ease.

For those needing accurate representations, Nano Banana offers a Google Search grounding feature that enhances the factual accuracy of generated images. This is particularly useful when creating images that involve real-world subjects or specific brands. The skill also includes best practices for prompt writing, ensuring users can maximize the quality of the generated images by crafting detailed and thoughtful prompts.

Overall, Nano Banana is a practical tool for anyone looking to integrate AI-driven image generation and editing into their workflow, whether for personal projects, professional design, or content creation.

When to use it

Use Nano Banana when you need to quickly create or modify images based on text descriptions, especially for projects requiring high-resolution outputs.

When not to use it

This skill may not be suitable for users seeking advanced image manipulation features found in dedicated graphic design software or those who require extensive customization beyond what text prompts can provide.

What you can build with it

Creating Marketing Assets

Generate high-quality product images for marketing campaigns by using descriptive prompts tailored to your brand's aesthetic.

Artistic Exploration

Use Nano Banana to experiment with different artistic styles and concepts by generating multiple variations of an image based on creative prompts.

Rapid Prototyping for Design Projects

Quickly create and modify images for design mockups, allowing for fast iterations and adjustments based on client feedback.

How to install Nano Banana

View source

1. Install with the skills CLI

npx skills add resciencelab/opc-skills/nanobanana --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by resciencelab

Nano Banana - AI Image Generation

Generate and edit images using Google's Gemini 3 Pro Image model (gemini-3-pro-image-preview, nicknamed "Nano Banana Pro" ๐ŸŒ).

Prerequisites

Required:

  • GEMINI_API_KEY - Get from Google AI Studio
  • Python 3.10+ with google-genai package

Install dependencies:

pip install google-genai pillow

Quick Start

Generate an image:

python3 <skill_dir>/scripts/generate.py "a cute robot mascot, pixel art style" -o robot.png

Edit an existing image:

python3 <skill_dir>/scripts/generate.py "make the background blue" -i input.jpg -o output.png

Generate with specific aspect ratio:

python3 <skill_dir>/scripts/generate.py "cinematic landscape" --ratio 21:9 -o landscape.png

Generate high-resolution 4K image:

python3 <skill_dir>/scripts/generate.py "professional product photo" --size 4K -o product.png

Script Reference

scripts/generate.py

Main image generation script.

Usage: generate.py [OPTIONS] PROMPT

Arguments:
  PROMPT              Text prompt for image generation

Options:
  -o, --output PATH   Output file path (default: auto-generated)
  -i, --input PATH    Input image for editing (optional)
  -r, --ratio RATIO   Aspect ratio (1:1, 16:9, 9:16, 21:9, etc.)
  -s, --size SIZE     Image size: 2K or 4K (default: standard)
  --search            Enable Google Search grounding for accuracy
  -v, --verbose       Show detailed output

Supported aspect ratios:

  • 1:1 - Square (default)
  • 2:3, 3:2 - Portrait/Landscape
  • 3:4, 4:3 - Standard
  • 4:5, 5:4 - Photo
  • 9:16, 16:9 - Widescreen
  • 21:9 - Ultra-wide/Cinematic

scripts/batch_generate.py

Generate multiple images with sequential naming.

Usage: batch_generate.py [OPTIONS] PROMPT

Arguments:
  PROMPT              Text prompt for image generation

Options:
  -n, --count N       Number of images to generate (default: 10)
  -d, --dir PATH      Output directory
  -p, --prefix STR    Filename prefix (default: "image")
  -r, --ratio RATIO   Aspect ratio
  -s, --size SIZE     Image size (2K/4K)
  --delay SECONDS     Delay between generations (default: 3)

Example:

python3 <skill_dir>/scripts/batch_generate.py "pixel art logo" -n 20 -d ./logos -p logo

Python API

You can also use the module directly:

from generate import generate_image, edit_image

# Generate image
result = generate_image(
    prompt="a futuristic city at night",
    output_path="city.png",
    aspect_ratio="16:9",
    image_size="4K"
)

# Edit existing image
result = edit_image(
    prompt="add flying cars to the sky",
    input_path="city.png",
    output_path="city_edited.png"
)

Environment Variables

VariableDescriptionDefault
GEMINI_API_KEYGoogle Gemini API keyRequired
IMAGE_OUTPUT_DIRDefault output directory./nanobanana-images

Features

Text-to-Image Generation

Create images from text descriptions. The model excels at:

  • Photorealistic images
  • Artistic styles (pixel art, illustration, etc.)
  • Product photography
  • Landscapes and scenes

Image Editing

Transform existing images with natural language:

  • Style transfer
  • Object addition/removal
  • Background changes
  • Color adjustments

High-Resolution Output

  • Standard: Fast generation, good quality
  • 2K: Enhanced detail (2048px)
  • 4K: Maximum quality (3840px), best for text rendering

Google Search Grounding

Enable --search for factually accurate images involving:

  • Real people, places, landmarks
  • Current events
  • Specific products or brands

Best Practices

Prompt Writing

Good prompts include:

  • Subject description
  • Style/aesthetic
  • Lighting and mood
  • Composition details
  • Color palette

Example:

"A cozy coffee shop interior, warm lighting, vintage aesthetic, 
wooden furniture, plants on shelves, morning sunlight through windows, 
soft focus background, 35mm film photography style"

Batch Generation Tips

  1. Generate 10-20 variations to explore options
  2. Use consistent prompts for style coherence
  3. Add 3-5 second delays to avoid rate limits
  4. Review results and iterate on best candidates

Rate Limits

  • Gemini API has usage quotas
  • Add delays between batch generations
  • Check your quota at Google AI Studio

Troubleshooting

"API key not found"

  • Set GEMINI_API_KEY environment variable
  • Or pass via --api-key option

"No image in response"

  • Prompt may have triggered safety filters
  • Try rephrasing to avoid sensitive content

"Rate limit exceeded"

  • Wait a few seconds and retry
  • Reduce batch size or add longer delays

References

Frequently asked questions about Nano Banana

Similar skills