Nano Banana Image Generation
Generate professional images via the Gemini CLI's nanobanana extension.
When to Use This Skill
ALWAYS use this skill when the user:
- Asks for any image, graphic, illustration, or visual
- Wants a thumbnail, featured image, or banner
- Requests icons, diagrams, or patterns
- Asks to edit, modify, or restore a photo
- Uses words like: generate, create, make, draw, design, visualize
Do NOT attempt to generate images through any other method.
Before First Use
- Verify extension is installed:
gemini extensions list | grep nanobanana
- If missing, install it:
gemini extensions install https://github.com/gemini-cli-extensions/nanobanana
- Verify API key is set:
[ -n "$GEMINI_API_KEY" ] && echo "API key configured" || echo "Missing GEMINI_API_KEY"
Command Selection
| User Request |
Command |
| "make me a blog header" |
/generate |
| "create an app icon" |
/icon |
| "draw a flowchart of..." |
/diagram |
| "fix this old photo" |
/restore |
| "remove the background" |
/edit |
| "create a repeating texture" |
/pattern |
| "make a comic strip" |
/story |
Available Commands
Note: Always use the --yolo flag to automatically approve all tool actions.
| Command |
Use Case |
gemini --yolo "/generate 'prompt'" |
Text-to-image generation |
gemini --yolo "/edit file.png 'instruction'" |
Modify existing image |
gemini --yolo "/restore old_photo.jpg 'fix scratches'" |
Repair damaged photos |
gemini --yolo "/icon 'description'" |
App icons, favicons, UI elements |
gemini --yolo "/diagram 'description'" |
Flowcharts, architecture diagrams |
gemini --yolo "/pattern 'description'" |
Seamless textures and patterns |
gemini --yolo "/story 'description'" |
Sequential/narrative images |
gemini --yolo "/nanobanana prompt" |
Natural language interface |
Common Options
--yolo - Required. Auto-approve all tool actions (no confirmation prompts)
--count=N - Generate N variations (1-8)
--preview - Auto-open generated images
--styles="style1,style2" - Apply artistic styles
--format=grid|separate - Output arrangement
Common Sizes
| Use Case |
Dimensions |
Notes |
| YouTube thumbnail |
1280x720 |
--aspect=16:9 |
| Blog featured image |
1200x630 |
Social preview friendly |
| Square social |
1080x1080 |
Instagram, LinkedIn |
| Twitter/X header |
1500x500 |
Wide banner |
| Vertical story |
1080x1920 |
--aspect=9:16 |
Model Selection
Default: gemini-2.5-flash-image (~$0.04/image)
For higher quality (4K, better reasoning):
export NANOBANANA_MODEL=gemini-3-pro-image-preview
Blog Featured Image Examples
# Modern illustration style
gemini --yolo "/generate 'modern flat illustration of developer coding at laptop, purple and blue gradient background, minimalist style, no text' --preview"
# Professional photography style
gemini --yolo "/generate 'professional editorial photo of coffee cup next to laptop on wooden desk, morning sunlight, shallow depth of field, no text' --count=3"
# Tech/abstract
gemini --yolo "/generate 'abstract visualization of neural network connections, dark background with glowing blue nodes, futuristic style' --preview"
Icon Generation
gemini --yolo "/icon 'minimalist app logo for productivity tool' --sizes='64,128,256,512' --type='app-icon' --corners='rounded'"
Diagram Generation
gemini --yolo "/diagram 'user authentication flow with OAuth' --type='flowchart' --style='modern'"
Output Location
All generated images are saved to ./nanobanana-output/ in the current directory.
Presenting Results
After generation completes:
- List contents of
./nanobanana-output/ to find generated files
- Present the most recent image(s) to the user
- Offer to regenerate with variations if needed
Refinements and Iterations
When the user asks for changes:
- "Try again" / "Give me options": Regenerate with
--count=3
- "Make it more [adjective]": Adjust prompt and regenerate
- "Edit this one": Use
gemini --yolo "/edit nanobanana-output/filename.png 'adjustment'"
- "Different style": Add
--styles="requested_style" to the command
Prompt Tips
- Be specific: Include style, mood, colors, composition details
- Add "no text": If you don't want text rendered in the image
- Reference styles: "editorial photography", "flat illustration", "3D render", "watercolor"
- Specify aspect ratio context: "wide banner", "square thumbnail", "vertical story"
Troubleshooting
| Problem |
Solution |
GEMINI_API_KEY not set |
export GEMINI_API_KEY="your-key" |
| Extension not found |
Run install command from setup section |
| Quota exceeded |
Wait for reset or switch to flash model |
| Image generation failed |
Check prompt for policy violations, simplify request |
| Output directory missing |
Will be created automatically on first run |
1---2name: nano-banana3description: REQUIRED for all image generation requests. Generate and edit images using Nano Banana (Gemini CLI). Handles blog featured images, YouTube thumbnails, icons, diagrams, patterns, illustrations, photos, visual assets, graphics, artwork, pictures. Use this skill whenever the user asks to create, generate, make, draw, design, or edit any image or visual content.4---5
6# Nano Banana Image Generation
7
8Generate professional images via the Gemini CLI's nanobanana extension.
9
10## When to Use This Skill
11
12ALWAYS use this skill when the user:
13- Asks for any image, graphic, illustration, or visual
14- Wants a thumbnail, featured image, or banner
15- Requests icons, diagrams, or patterns
16- Asks to edit, modify, or restore a photo
17- Uses words like: generate, create, make, draw, design, visualize
18
19Do NOT attempt to generate images through any other method.
20
21## Before First Use
22
231. Verify extension is installed:
24 ```bash
25 gemini extensions list | grep nanobanana
26 ```
272. If missing, install it:
28 ```bash
29 gemini extensions install https://github.com/gemini-cli-extensions/nanobanana
30 ```
313. Verify API key is set:
32 ```bash
33 [ -n "$GEMINI_API_KEY" ] && echo "API key configured" || echo "Missing GEMINI_API_KEY"
34 ```
35
36## Command Selection
37
38| User Request | Command |
39|--------------|---------|
40| "make me a blog header" | `/generate` |
41| "create an app icon" | `/icon` |
42| "draw a flowchart of..." | `/diagram` |
43| "fix this old photo" | `/restore` |
44| "remove the background" | `/edit` |
45| "create a repeating texture" | `/pattern` |
46| "make a comic strip" | `/story` |
47
48## Available Commands
49
50**Note:** Always use the `--yolo` flag to automatically approve all tool actions.
51
52| Command | Use Case |
53|---------|----------|
54| `gemini --yolo "/generate 'prompt'"` | Text-to-image generation |
55| `gemini --yolo "/edit file.png 'instruction'"` | Modify existing image |
56| `gemini --yolo "/restore old_photo.jpg 'fix scratches'"` | Repair damaged photos |
57| `gemini --yolo "/icon 'description'"` | App icons, favicons, UI elements |
58| `gemini --yolo "/diagram 'description'"` | Flowcharts, architecture diagrams |
59| `gemini --yolo "/pattern 'description'"` | Seamless textures and patterns |
60| `gemini --yolo "/story 'description'"` | Sequential/narrative images |
61| `gemini --yolo "/nanobanana prompt"` | Natural language interface |
62
63## Common Options
64
65- `--yolo` - **Required.** Auto-approve all tool actions (no confirmation prompts)
66- `--count=N` - Generate N variations (1-8)
67- `--preview` - Auto-open generated images
68- `--styles="style1,style2"` - Apply artistic styles
69- `--format=grid|separate` - Output arrangement
70
71## Common Sizes
72
73| Use Case | Dimensions | Notes |
74|----------|------------|-------|
75| YouTube thumbnail | 1280x720 | `--aspect=16:9` |
76| Blog featured image | 1200x630 | Social preview friendly |
77| Square social | 1080x1080 | Instagram, LinkedIn |
78| Twitter/X header | 1500x500 | Wide banner |
79| Vertical story | 1080x1920 | `--aspect=9:16` |
80
81## Model Selection
82
83Default: `gemini-2.5-flash-image` (~$0.04/image)
84
85For higher quality (4K, better reasoning):
86```bash
87export NANOBANANA_MODEL=gemini-3-pro-image-preview
88```
89
90## Blog Featured Image Examples
91
92```bash
93# Modern illustration style
94gemini --yolo "/generate 'modern flat illustration of developer coding at laptop, purple and blue gradient background, minimalist style, no text' --preview"
95
96# Professional photography style
97gemini --yolo "/generate 'professional editorial photo of coffee cup next to laptop on wooden desk, morning sunlight, shallow depth of field, no text' --count=3"
98
99# Tech/abstract
100gemini --yolo "/generate 'abstract visualization of neural network connections, dark background with glowing blue nodes, futuristic style' --preview"
101```
102
103## Icon Generation
104
105```bash
106gemini --yolo "/icon 'minimalist app logo for productivity tool' --sizes='64,128,256,512' --type='app-icon' --corners='rounded'"
107```
108
109## Diagram Generation
110
111```bash
112gemini --yolo "/diagram 'user authentication flow with OAuth' --type='flowchart' --style='modern'"
113```
114
115## Output Location
116
117All generated images are saved to `./nanobanana-output/` in the current directory.
118
119## Presenting Results
120
121After generation completes:
1221. List contents of `./nanobanana-output/` to find generated files
1232. Present the most recent image(s) to the user
1243. Offer to regenerate with variations if needed
125
126## Refinements and Iterations
127
128When the user asks for changes:
129- **"Try again" / "Give me options"**: Regenerate with `--count=3`
130- **"Make it more [adjective]"**: Adjust prompt and regenerate
131- **"Edit this one"**: Use `gemini --yolo "/edit nanobanana-output/filename.png 'adjustment'"`
132- **"Different style"**: Add `--styles="requested_style"` to the command
133
134## Prompt Tips
135
1361. **Be specific**: Include style, mood, colors, composition details
1372. **Add "no text"**: If you don't want text rendered in the image
1383. **Reference styles**: "editorial photography", "flat illustration", "3D render", "watercolor"
1394. **Specify aspect ratio context**: "wide banner", "square thumbnail", "vertical story"
140
141## Troubleshooting
142
143| Problem | Solution |
144|---------|----------|
145| `GEMINI_API_KEY` not set | `export GEMINI_API_KEY="your-key"` |
146| Extension not found | Run install command from setup section |
147| Quota exceeded | Wait for reset or switch to flash model |
148| Image generation failed | Check prompt for policy violations, simplify request |
149| Output directory missing | Will be created automatically on first run |