| name | gemini-image-generator |
| description | Generate images using Google Gemini NanoBanana via browser automation. Use this skill for general-purpose AI image generation from text prompts. Includes persistent authentication, automatic environment setup, and reference image support for style matching. |
Gemini Image Generator
Gemini NanoBananaใไฝฟใฃใๆฑ็จAI็ปๅ็ๆในใญใซใ
When to Use This Skill
Trigger when user:
- Asks to generate/create images with AI
- Mentions "Gemini image", "generate picture", "create artwork"
- Requests visual content from text descriptions
- Wants to produce illustrations or graphics
- Wants to create images matching a reference image's style (NEW!)
For specific use cases, use specialized skills:
- LP/ใปใผใซในใฌใฟใผ็ปๅ โ
gemini-lp-generator
- ใฆใงใใใผในใฉใคใ โ
gemini-slide-generator
Quick Start
cd /path/to/gemini-image-generator
python scripts/run.py auth_manager.py status
python scripts/run.py auth_manager.py setup
python scripts/run.py image_generator.py \
--prompt "sunset over mountains, watercolor style" \
--output output/my_image.png
python scripts/run.py image_generator.py \
--prompt "็ฌใๆใใฆ" \
--reference-image "/path/to/reference.png" \
--output output/styled_dog.png
How It Works
Basic Mode (ใใญในใใฎใฟ)
- Navigate to
gemini.google.com
- Click "ใใผใซ" (Tools) button
- Select "็ปๅใไฝๆ" (Create Image) - Activates NanoBanana
- Enter prompt and generate
- Download generated image
Reference Image Mode (ๅ่็ปๅใใ) - NEW!
- Upload reference image to Gemini
- AI analyzes visual elements (style, colors, lighting, etc.)
- Extract analysis as YAML format
- Generate optimized meta-prompt
- Create new image with matching style
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โ ๐ท Reference โ โ โ ๐ YAML โ โ โ ๐ Optimized โ
โ Image โ โ Analysis โ โ Prompt โ
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโ
โ ๐ผ๏ธ Generated โ
โ Image โ
โโโโโโโโโโโโโโโโโโ
Parameters
| Parameter | Required | Default | Description |
|---|
--prompt | Yes | - | Image generation prompt |
--output | No | output/generated_image.png | Output file path |
--reference-image | No | - | Reference image for style extraction |
--yaml-output | No | - | Save YAML analysis to file |
--show-browser | No | False | Show browser for debugging |
--timeout | No | 180 | Max wait time in seconds |
Prompt Examples
Basic Examples (ใใญในใใฎใฟ)
python scripts/run.py image_generator.py \
--prompt "serene sunset over snow-capped mountains, warm orange sky, photorealistic"
python scripts/run.py image_generator.py \
--prompt "watercolor painting of a cat sitting by window, soft colors"
python scripts/run.py image_generator.py \
--prompt "professional product photography, white background, soft lighting"
Reference Image Examples (ๅ่็ปๅใใ) - NEW!
python scripts/run.py image_generator.py \
--prompt "็ฌใๆใใฆ" \
--reference-image "examples/watercolor_cat.png" \
--output output/watercolor_dog.png
python scripts/run.py image_generator.py \
--prompt "ๆฃฎใฎ้ขจๆฏ" \
--reference-image "examples/sunset.jpg" \
--yaml-output output/analysis.yaml \
--output output/forest.png
python scripts/run.py image_generator.py \
--prompt "ใซใใงใฎๅ
่ฃ
" \
--reference-image "examples/cozy_room.png" \
--show-browser \
--output output/cafe.png
Standalone Tools
python scripts/run.py prompt_extractor.py \
--image "examples/reference.png" \
--output analysis.yaml
python scripts/run.py meta_prompt.py \
--yaml analysis.yaml \
--request "็ซใๆใใฆ"
Authentication
This skill manages browser authentication for all Gemini-based skills:
gemini-slide-generator (shares browser profile)
gemini-lp-generator (shares browser profile)
python scripts/run.py auth_manager.py status
python scripts/run.py auth_manager.py setup
python scripts/run.py auth_manager.py clear
Troubleshooting
| Problem | Solution |
|---|
| Not authenticated | Run auth_manager.py setup |
| Timeout | Increase with --timeout 300 |
| UI not found | Use --show-browser to debug |
| Generation refused | Modify prompt (avoid restricted content) |
Data Storage
data/browser_profile/ - Browser session (shared with other Gemini skills)
data/state.json - Authentication state
output/ - Generated images
Architecture
scripts/
โโโ config.py # Centralized settings
โโโ browser_utils.py # BrowserFactory and StealthUtils
โโโ auth_manager.py # Authentication management
โโโ image_generator.py # Image generation (with reference image support)
โโโ prompt_extractor.py # Extract visual elements as YAML (NEW!)
โโโ meta_prompt.py # Generate optimized prompts from YAML (NEW!)
โโโ run.py # Wrapper script for venv
docs/
โโโ UPGRADE_SPEC.md # Feature specification with diagrams
Notes
- First generation takes longer (browser startup)
- Subsequent generations faster (session reuse)
- Authentication persists ~7 days
- UI selectors may break when Gemini updates