Nano Image Generator
Generate images using Nano Banana Pro (Gemini 3 Pro Preview) for any visual asset needs.
Requirements
Set the GEMINI_API_KEY environment variable. Get a key at: https://aistudio.google.com/apikey
Quick Start
python scripts/generate_image.py "A friendly robot mascot waving" --output ./assets/mascot.png
Script Usage
python scripts/generate_image.py <prompt> --output <path> [options]
Required:
prompt - Image description
--output, -o - Output file path
Options:
--aspect, -a - Aspect ratio (default: 1:1)
- Square:
1:1
- Portrait:
2:3, 3:4, 4:5, 9:16
- Landscape:
3:2, 4:3, 5:4, 16:9, 21:9
--size, -s - Resolution: 1K, 2K (default), 4K
Workflow
Determine output location - Place images where contextually appropriate:
- App icons →
./assets/icons/ or ./public/icons/
- Marketing →
./marketing/ or ./assets/images/
- UI elements →
./src/assets/ or ./public/images/
- General →
./generated/
Craft effective prompts - Be specific and descriptive:
- Include style: "flat design", "3D rendered", "watercolor", "minimalist"
- Include context: "for a mobile app", "website hero image", "social media post"
- Include details: colors, mood, composition
Choose appropriate settings:
- Icons/logos →
--aspect 1:1
- Banners/headers →
--aspect 16:9
- Mobile screens →
--aspect 9:16
- Photos →
--aspect 3:2 or 4:3
Examples
App icon:
python scripts/generate_image.py "Minimalist flat design app icon of a lightning bolt, purple gradient background, modern iOS style" \
--output ./assets/app-icon.png --aspect 1:1
Marketing banner:
python scripts/generate_image.py "Professional website hero banner for a productivity app, abstract geometric shapes, blue and white color scheme, modern and clean" \
--output ./public/images/hero-banner.png --aspect 16:9
High-quality illustration:
python scripts/generate_image.py "Detailed isometric illustration of a cozy home office setup with plants, warm lighting, digital art style" \
--output ./assets/illustrations/office.png --size 4K
Prompt Tips
- Be specific - "A red apple on a wooden table" vs "an apple"
- Include style - "in the style of pixel art" or "photorealistic"
- Mention purpose - "for a children's book" affects the output style
- Describe composition - "centered", "rule of thirds", "close-up"
- Specify colors - Explicit color palettes yield better results
- Avoid - Don't ask for text in images (use overlays instead)
1---2name: nano-image-generator3description: Generate images using Nano Banana Pro (Gemini 3 Pro Preview). Use when creating app icons, logos, UI graphics, marketing banners, social media images, illustrations, diagrams, or any visual assets. Triggers include phrases like 'generate an image', 'create a graphic', 'make an icon', 'design a logo', 'create a banner', or any request needing visual content.4---5
6# Nano Image Generator
7
8Generate images using Nano Banana Pro (Gemini 3 Pro Preview) for any visual asset needs.
9
10## Requirements
11
12Set the `GEMINI_API_KEY` environment variable. Get a key at: https://aistudio.google.com/apikey
13
14## Quick Start
15
16```bash
17python scripts/generate_image.py "A friendly robot mascot waving" --output ./assets/mascot.png
18```
19
20## Script Usage
21
22```bash
23python scripts/generate_image.py <prompt> --output <path> [options]
24```
25
26**Required:**
27- `prompt` - Image description
28- `--output, -o` - Output file path
29
30**Options:**
31- `--aspect, -a` - Aspect ratio (default: `1:1`)
32 - Square: `1:1`
33 - Portrait: `2:3`, `3:4`, `4:5`, `9:16`
34 - Landscape: `3:2`, `4:3`, `5:4`, `16:9`, `21:9`
35- `--size, -s` - Resolution: `1K`, `2K` (default), `4K`
36
37## Workflow
38
391. **Determine output location** - Place images where contextually appropriate:
40 - App icons → `./assets/icons/` or `./public/icons/`
41 - Marketing → `./marketing/` or `./assets/images/`
42 - UI elements → `./src/assets/` or `./public/images/`
43 - General → `./generated/`
44
452. **Craft effective prompts** - Be specific and descriptive:
46 - Include style: "flat design", "3D rendered", "watercolor", "minimalist"
47 - Include context: "for a mobile app", "website hero image", "social media post"
48 - Include details: colors, mood, composition
49
503. **Choose appropriate settings:**
51 - Icons/logos → `--aspect 1:1`
52 - Banners/headers → `--aspect 16:9`
53 - Mobile screens → `--aspect 9:16`
54 - Photos → `--aspect 3:2` or `4:3`
55
56## Examples
57
58**App icon:**
59```bash
60python scripts/generate_image.py "Minimalist flat design app icon of a lightning bolt, purple gradient background, modern iOS style" \
61 --output ./assets/app-icon.png --aspect 1:1
62```
63
64**Marketing banner:**
65```bash
66python scripts/generate_image.py "Professional website hero banner for a productivity app, abstract geometric shapes, blue and white color scheme, modern and clean" \
67 --output ./public/images/hero-banner.png --aspect 16:9
68```
69
70**High-quality illustration:**
71```bash
72python scripts/generate_image.py "Detailed isometric illustration of a cozy home office setup with plants, warm lighting, digital art style" \
73 --output ./assets/illustrations/office.png --size 4K
74```
75
76## Prompt Tips
77
78- **Be specific** - "A red apple on a wooden table" vs "an apple"
79- **Include style** - "in the style of pixel art" or "photorealistic"
80- **Mention purpose** - "for a children's book" affects the output style
81- **Describe composition** - "centered", "rule of thirds", "close-up"
82- **Specify colors** - Explicit color palettes yield better results
83- **Avoid** - Don't ask for text in images (use overlays instead)