Generate and edit images using Google Gemini (NanoBanana). Use when asked to generate images, create artwork, illustrations, concept art, edit images, perform style transfer, produce storyboards, design infographics, or handle any visual-creation task.
Generate professional-quality images using Google's Gemini image models. Default model is Nano Banana 2 (gemini-3.1-flash-image-preview) — Pro quality at Flash speed and half the price.
Key Insight: NanoBanana models are "Thinking" models. They don't just match keywords; they understand intent, physics, and composition. Stop using "tag soups" and start acting like a Creative Director.
python ~/.claude/skills/nanobanana/scripts/generate.py "your prompt here"
If an image is 80% correct, don't regenerate from scratch. Ask for the specific change:
"That's great, but change the lighting to sunset and make the text neon blue."
Talk to the model as if you were briefing a human artist.
| Bad | Good | |-----|------| | "Cool car, neon, city, night, 8k" | "A cinematic wide shot of a futuristic sports car speeding through a rainy Tokyo street at night. The neon signs reflect off the wet pavement and the car's metallic chassis." |
Vague prompts yield generic results. Define:
Context helps the model make logical artistic decisions:
"Create an image of a sandwich for a Brazilian high-end gourmet cookbook."
The model will infer professional plating, shallow depth of field, and perfect lighting.
| Model | ID | Best For |
|-------|-----|----------|
| NB2 (default) | gemini-3.1-flash-image-preview | Pro quality at Flash speed, supports 4K, best value (~$0.04/img) |
| Pro | gemini-3-pro-image-preview | Highest quality, complex prompts, 4K, thinking mode (~$0.08/img) |
python ~/.claude/skills/nanobanana/scripts/generate.py "prompt" [options]
| Option | Description | Default |
|--------|-------------|---------|
| -o, --output | Output file path | Auto: generated_images/nano_TIMESTAMP.{ext} |
| -a, --aspect | Aspect ratio | 16:9 |
| -r, --resolution | Resolution (NB2 and Pro) | 2K |
| -m, --model | Model: nb2 or pro | nb2 |
| -i, --input | Input image for editing/style transfer | None |
| --search | Enable Google Search grounding | False |
| Ratio | Use Case |
|-------|----------|
| 1:1 | Square (social media, icons) |
| 1:4, 4:1 | Tall/wide banner strips |
| 1:8, 8:1 | Ultra-narrow/ultra-wide strips |
| 3:4 | Portrait (book covers) |
| 4:3 | Standard screen |
| 16:9 | Widescreen/cinematic (DEFAULT) |
| 9:16 | Vertical video/phone |
| 21:9 | Ultra-wide/cinematic |
| Resolution | 16:9 Dimensions | Notes |
|------------|-----------------|-------|
| 512px | ~512px shortest side | Quick previews, thumbnails |
| 1K | 1376x768 | Faster |
| 2K | 2752x1536 | Default, recommended |
| 4K | 5504x3072 | Highest quality, best for textures |
Important: Resolution must be uppercase (1K, 2K, 4K) except 512px!
NanoBanana has SOTA text rendering capabilities.
Best Practices:
Example:
"Generate a clean, modern infographic summarizing the key financial highlights
from this earnings report. Include charts for 'Revenue Growth' and 'Net Income',
and highlight the CEO's key quote in a stylized pull-quote box."
Supports up to 4 character reference images and up to 10 object reference images.
Best Practices:
Example:
python generate.py "Design a viral video thumbnail using the person from Image 1.
Face Consistency: Keep facial features exactly the same.
Action: Pose them on the left, pointing right with excited expression.
Subject: On the right, a high-quality image of avocado toast.
Graphics: Bold yellow arrow connecting finger to toast.
Text: Overlay '3 Minutes!' in massive pop-style text.
Background: Blurred bright kitchen. High saturation." -i person.jpg
Use --search for real-time data, current events, or factual verification.
Example:
python generate.py "Generate an infographic of the best times to visit U.S. National Parks in 2025 based on current travel trends." --search
The model excels at complex edits via conversational prompting.
Capabilities:
Best Practices:
Examples:
# Remove tourists from photo
python generate.py "Remove the tourists from the background and fill the space with logical textures (cobblestones and storefronts) that match the environment." -i photo.jpg
# Colorize manga
python generate.py "Colorize this manga panel. Use a vibrant anime style palette. Ensure the energy beams are glowing neon blue." -i manga.jpg
# Seasonal change
python generate.py "Turn this scene into winter time. Keep the house exactly the same, but add snow to the roof and yard, and change the lighting to a cold, overcast afternoon." -i house_summer.jpg
Translate between 2D schematics and 3D visualizations.
Example:
# Floor plan to 3D interior
python generate.py "Based on this 2D floor plan, generate a professional interior design board. Layout: Large main image (wide-angle of living area), three smaller images below (Master Bedroom, Home Office, 3D top-down floor plan). Style: Modern Minimalist with warm oak wood flooring. Quality: Photorealistic, soft natural lighting." -i floorplan.png
Use 4K for detailed textures and large-format prints.
Best Practices:
Example:
python generate.py "Harness native high-fidelity output to craft a breathtaking, atmospheric environment of a mossy forest floor. Command complex lighting effects and delicate textures, ensuring every strand of moss and beam of light is rendered in pixel-perfect resolution suitable for a 4K wallpaper." -r 4K
Pro model generates interim "thought images" (not charged) to refine composition.
Capabilities:
Generate sequential art or storyboards in a single session.
Example:
python generate.py "Create an addictively intriguing 9-part story with 9 images featuring a woman and man in a luxury luggage commercial. The story should have emotional highs and lows, ending on an elegant shot with the logo. The identity of the woman and man and their attire must stay consistent throughout but they can be seen from different angles and distances. Generate images one at a time in 16:9 landscape format."
Use input images to control composition and layout.
Best Practices:
Example:
# Sketch to polished ad
python generate.py "Create an ad for a gaming product following this sketch layout." -i rough_sketch.jpg
# Wireframe to UI
python generate.py "Create a mock-up for a plush toy rental app following these guidelines." -i wireframe.png
A photorealistic [shot type] of [subject], [action or expression], set in [environment].
The scene is illuminated by [lighting description], creating a [mood] atmosphere.
Captured with [camera/lens details], emphasizing [key textures and details].
Create a [style: clean/retro/technical] infographic about [topic].
Include distinct sections for [section 1], [section 2], and [section 3].
Ensure all text is legible and stylized to match [aesthetic period/style].
[Action description] using the person from Image 1.
Face Consistency: Keep the person's facial features exactly the same as Image 1.
Expression: [describe emotion/expression change]
Action: [describe pose/action]
Background: [describe background]
A high-resolution, studio-lit product photograph of [product description]
on [background surface]. The lighting is [setup] to [purpose].
Camera angle: [angle] to showcase [feature]. Sharp focus on [detail].
GOOGLE_API_KEY) - auto-detectedgoogle-genai, Pillowpip install google-genai Pillow
| Issue | Solution |
|-------|----------|
| "No image generated" | Prompt may violate content policy, try rephrasing |
| Invalid resolution | Use uppercase: 1K, 2K, 4K |
| Generic/poor results | Use full sentences, not keyword tags |
| Character inconsistency | Add "Keep facial features exactly the same as Image 1" |
| Wrong composition | Upload a rough sketch as input to guide layout |
Generate or edit images via Gemini 3 Pro Image (Nano Banana Pro).
Batch-generate images via OpenAI Images API. Random prompt sampler + `index.html` gallery.
Generate spectrograms and feature-panel visualizations from audio with the songsee CLI.
Extract frames or short clips from videos using ffmpeg.
Search GIF providers with CLI/TUI, download results, and extract stills/sheets.
Category:media-generate