Generate images using Google Gemini/Imagen API. Use when the user asks to create, generate, or make an image, picture, photo, illustration, artwork, or visual content.
Generate images using Google's Gemini and Imagen models.
The user must have:
GEMINI_API_KEY environment variablepip install google-genai pillow| Model | Best For | Notes |
|---|---|---|
gemini-2.5-flash-image |
Fast, high-volume generation | Speed optimized |
gemini-3-pro-image-preview |
Professional assets, complex prompts | Best quality, supports 4K |
imagen-4.0-generate-001 |
Standard image generation | Good balance |
imagen-4.0-fast-generate-001 |
Quick iterations | Fastest |
imagen-4.0-ultra-generate-001 |
Highest quality | Supports 2K |
Use the script at ~/.claude/skills/gemini-image/scripts/generate.py:
python ~/.claude/skills/gemini-image/scripts/generate.py \
--prompt "A serene mountain landscape at sunset" \
--output ~/Pictures/mountain.png \
--model gemini-2.5-flash-image
| Argument | Required | Default | Description |
|---|---|---|---|
--prompt |
Yes | - | Text description of the image |
--output |
No | ./generated_image.png |
Output file path |
--model |
No | gemini-2.5-flash-image |
Model to use |
--aspect-ratio |
No | 1:1 |
Aspect ratio (e.g., 16:9, 9:16, 4:3) |
--size |
No | 1K |
Image size (1K, 2K, or 4K for pro model) |
--count |
No | 1 |
Number of images (1-4, Imagen models only) |
1:1 - Square (default)16:9 - Widescreen landscape9:16 - Portrait/mobile4:3 - Standard landscape3:4 - Standard portrait3:2, 2:3 - Photo aspect ratiosProduct shot:
Professional product photography of a sleek smartphone on a marble surface,
soft studio lighting, clean white background, 8K detail
Artwork:
Digital painting of a cyberpunk city at night, neon lights reflecting on
wet streets, flying cars, towering skyscrapers, cinematic composition
Portrait:
Professional headshot of a business executive, neutral background,
soft lighting, confident expression, high resolution
GEMINI_API_KEY is set in your environmentpip install google-genai pillow