Loading...
Loading...
Generate images using Google's Gemini API. Use when creating images from text prompts, editing existing images, or combining reference images for AI-generated visual content.
npx skill4agent add ckorhonen/claude-skills gemini-image-generatorgoogle-genaiGEMINI_API_KEYpip install google-genaiexport GEMINI_API_KEY="your-api-key"~/.zshrc~/.bashrcecho 'export GEMINI_API_KEY="your-api-key"' >> ~/.zshrcpython scripts/generate_image.py -p "A fluffy orange cat sitting on a windowsill, warm sunlight, cozy atmosphere"python scripts/generate_image.py -p "Modern tech startup banner" -a 16:9 -o banner.pngpython scripts/generate_image.py -p "Make the sky more dramatic with sunset colors" -i photo.jpg -o edited.pngpython scripts/generate_image.py [options]
Required:
-p, --prompt TEXT Text prompt describing the image
Optional:
-o, --output PATH Output file path (default: auto-generated)
-m, --model MODEL Model to use (default: gemini-3-pro-image-preview)
-a, --aspect-ratio RATIO Aspect ratio (default: 1:1)
-s, --size SIZE Image size: 1K, 2K, 4K (default: 1K, Pro only)
-i, --input-image PATH Input image for editing mode
-r, --reference-images Reference image(s), can be repeated (max 14)
-v, --verbose Show detailed progress| Model | Resolution | Best For |
|---|---|---|
| Up to 4K | Final assets, high quality, professional work |
| 1024px | Quick iterations, prototyping, batch generation |
python scripts/generate_image.py -p "Quick concept sketch" -m gemini-2.5-flash-image| Ratio | Use Case |
|---|---|
| App icons, profile pictures, thumbnails |
| Portrait photos, book covers |
| Landscape photos, postcards |
| Portrait photos, social media posts |
| Traditional photos, presentations |
| Instagram posts, portrait social media |
| Large format prints |
| Stories, vertical videos, mobile wallpapers |
| Widescreen banners, video thumbnails, headers |
| Ultrawide banners, cinematic headers |
| Size | Resolution | Use Case |
|---|---|---|
| 1024px | Web graphics, thumbnails |
| 2048px | Print materials, detailed graphics |
| 4096px | High-resolution prints, large displays |
python scripts/generate_image.py -p "Detailed landscape" -s 4K -o landscape_4k.png[Subject] + [Style] + [Details] + [Quality modifiers]Bad: "a cat"
Good: "a fluffy orange tabby cat sitting on a windowsill"Minimalist app icon for a weather app, blue gradient background,
white cloud with golden sun rays, flat design, rounded corners,
iOS style, clean and modernProfessional tech startup banner, abstract geometric shapes
flowing from left to right, purple and blue gradient,
modern and clean aesthetic, corporate stylePixel art character sprite, fantasy warrior with glowing sword,
32x32 style, transparent background, retro 16-bit game aesthetic,
vibrant colorsProfessional product photo of wireless earbuds on white background,
soft shadows, studio lighting, minimalist composition,
commercial photography styleFuturistic city skyline at sunset, flying vehicles between
towering skyscrapers, neon lights reflecting on wet streets,
cyberpunk atmosphere, cinematic composition, detailedAbstract gradient background for mobile app, soft purple to pink
transition, subtle geometric patterns, modern and minimal,
suitable for dark text overlaypython scripts/generate_image.py -p "Your description here" -o output.pngpython scripts/generate_image.py \
-p "Change the background to a tropical beach at sunset" \
-i original.jpg \
-o edited.pngpython scripts/generate_image.py \
-p "Create a new character in this art style" \
-r style_ref1.png \
-r style_ref2.png \
-o new_character.png# iOS-style weather icon
python scripts/generate_image.py \
-p "Minimalist weather app icon, blue sky gradient, white fluffy cloud, sun peeking out, flat design, rounded square, iOS 17 style" \
-a 1:1 \
-o weather_icon.png
# Fitness app icon
python scripts/generate_image.py \
-p "Fitness app icon, running figure silhouette, orange to red gradient background, energetic and dynamic, modern flat design" \
-a 1:1 \
-o fitness_icon.png# Website hero banner
python scripts/generate_image.py \
-p "Abstract tech hero banner, flowing data visualization, dark blue background with glowing cyan accents, futuristic and professional" \
-a 21:9 \
-s 2K \
-o hero_banner.png
# Social media post
python scripts/generate_image.py \
-p "Motivational quote background, soft sunrise gradient, minimalist mountain silhouette, peaceful and inspiring" \
-a 4:5 \
-o social_post_bg.png# Character sprite
python scripts/generate_image.py \
-p "Pixel art hero character, knight with blue cape and silver armor, idle pose, transparent background, 16-bit retro style" \
-a 1:1 \
-o knight_sprite.png
# Environment tile
python scripts/generate_image.py \
-p "Grass tile for top-down RPG, seamless pattern, vibrant green with small flowers, pixel art style, 32x32 aesthetic" \
-a 1:1 \
-o grass_tile.png# Change background
python scripts/generate_image.py \
-p "Replace background with a cozy coffee shop interior" \
-i portrait.jpg \
-o portrait_coffee_shop.png
# Style enhancement
python scripts/generate_image.py \
-p "Enhance with dramatic cinematic color grading, increase contrast, add film grain" \
-i landscape.jpg \
-o landscape_cinematic.pngexport GEMINI_API_KEY="your-api-key"gemini-3-pro-image-preview