A Claude Code plugin for generating images using Google's Gemini API.
This plugin enables Claude Code to generate images using Google's Gemini API. When you ask Claude to create, generate, or edit images, it will use this plugin automatically.
Features:
- Generate images from text prompts
- Edit existing images with AI
- Use reference images for style consistency
- Support for multiple aspect ratios
- Batch generation of multiple variations
- uv package manager
- Google AI API key from Google AI Studio
In Claude Code, run:
/plugin marketplace add ypfaff/google-image-gen-plugin
/plugin install google-image-gen@google-image-gen
Option A: Config file (recommended)
mkdir -p ~/.config/google-image-gen
echo "GOOGLE_AI_API_KEY=your_actual_api_key_here" > ~/.config/google-image-gen/.envOption B: Environment variable
export GOOGLE_AI_API_KEY=your_actual_api_key_here
# Add to your shell profile (~/.zshrc, ~/.bashrc) for persistenceClaude Code will automatically detect and use the plugin when you ask it to generate images.
Just ask Claude Code naturally:
Generate an image of a red sports car on a mountain road and save it as car.png
Create a minimalist logo for a coffee shop, save as logo.png with 1:1 aspect ratio
Generate a YouTube thumbnail showing a coding tutorial, use 16:9 aspect ratio
Create a phone wallpaper with abstract geometric shapes, aspect ratio 9:16
Edit the image input.png and change the background to a sunset sky
Generate an image in the same style as reference.png but with a cat instead
Generate 3 variations of app icons: a rocket, a star, and a lightning bolt
You can create custom style templates as markdown files with a ## Prompt Template section:
## Prompt Template
\```
Minimalist flat design illustration of {subject}.
Clean lines, bold colors, white background.
Modern corporate style, suitable for presentations.
\```Then ask Claude:
Generate an image of a laptop using the style template my-style.md
| Ratio | Use Case |
|---|---|
1:1 |
Social media posts, profile pictures |
3:4 |
Portrait photos |
4:3 |
Standard landscape |
4:5 |
Instagram portrait |
5:4 |
Large format prints |
9:16 |
Phone wallpapers, Stories, TikTok |
16:9 |
YouTube thumbnails, presentations (default) |
21:9 |
Ultrawide displays, cinematic |
| Error | Cause | Solution |
|---|---|---|
GOOGLE_AI_API_KEY not found |
Missing API key | Create ~/.config/google-image-gen/.env with your API key |
Rate limit exceeded |
Too many API requests | Wait a few minutes or upgrade to paid tier |
uv: command not found |
uv not installed | Install via curl -LsSf https://astral.sh/uv/install.sh | sh |
claude --plugin-dir .Bump version in plugin.json (semver) and push to main. Claude Code pulls the latest commit from the default
branch — git tags are currently ignored. Optionally tag for your own release tracking:
git tag 1.1.0 && git push origin 1.1.0Users receive updates via /plugin update or automatic update checks.
| Component | Role |
|---|---|
skills/…/SKILL.md |
Loaded into Claude's context as skill prompt |
main.py, scripts/ |
Executed via Bash by Claude |
${CLAUDE_PLUGIN_ROOT} |
Plugin cache path (where plugin files live) |
--cwd / working dir |
User's project path (where output files are saved) |
This plugin is based on the work from AI Engineer Skool's Google Image Gen API Starter.
For more infos, check out the corresponding video guide.