generate-image · laurigates — Claude Code skill: AI image generation via Gemini
The generate-image skill generates images from text prompts using Google's Gemini 3 Pro Image model on Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode.
MIT 177 installs ★ 60 updated 2026-11-16
npx skills add laurigates/claude-plugins --skill generate-image -a claude-codeWhat generate-image does
The skill calls a Python script that sends your prompt to Gemini 3 Pro Image and saves the result as PNG. You can specify aspect ratios (1:1 through 21:9), resolution levels (1K, 2K, 4K), and up to five reference images to guide the artistic style or maintain consistent subjects. Default output is 16:9 at 2K resolution, saved to ./generated/image_YYYYMMDD_HHMMSS.png.
Requires GOOGLE_API_KEY or GEMINI_API_KEY set in your environment. Arguments are parsed from the command line: a required prompt, then optional --aspect, --resolution, --reference, and --output flags. If the API key is missing, the skill points you to where to get one.
What it helps with
- generate a portrait at specific resolution and aspect ratio
- create a product photo on white background in 4K
- produce multiple landscape variations with different proportions
- render a scene matching the style of an existing image
- make an ultrawide banner for UI mockups
Example prompts for the agent
- Generate a stunning mountain landscape at sunset in 4K resolution
- Create a product photo on white background in square 1:1 ratio at maximum quality
- Draw a portrait matching the style of the image in
reference.png
How to install generate-image
1Skills CLI (Vercel)
npx skills add laurigates/claude-plugins --skill generate-image -a claude-code2Manually: put the files in place
~/.claude/skills/generate-image/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/generate-image/
1Skills CLI (Vercel)
npx skills add laurigates/claude-plugins --skill generate-image -a codex2Manually: put the files in place
.agents/skills/generate-image/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add laurigates/claude-plugins --skill generate-image -a cursor2Manually: put the files in place
.cursor/skills/generate-image/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install laurigates/claude-plugins tools-plugin/skills/generate-image2Manually: put the files in place
.github/skills/generate-image/SKILL.md1Skills CLI (Vercel)
npx skills add laurigates/claude-plugins --skill generate-image -a gemini-cli2Platform CLI
gemini skills install https://github.com/laurigates/claude-plugins --path tools-plugin/skills/generate-imageManually: put the files in place
.devin/skills/generate-image/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add laurigates/claude-plugins --skill generate-image -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about generate-image
How do I install generate-image for Claude Code?
Run npx skills add laurigates/claude-plugins --skill generate-image -a claude-code, then check ~/.claude/skills/generate-image/SKILL.md to verify installation.
What does generate-image do?
Generates images from text descriptions using Google's Gemini 3 Pro Image model. You can control aspect ratio, resolution, and provide reference images to guide the style.
What API key do I need?
Set the environment variable GOOGLE_API_KEY or GEMINI_API_KEY. Get one at https://aistudio.google.com/apikey.
Source text
SKILL.md · MIT
---
created: 2025-12-16
modified: 2026-11-14
reviewed: 2026-04-25
description: "Image generation via Gemini 3 Pro Image: aspect ratio, resolution, reference images. Use when creating artwork, product photos, or mockups with AI."
allowed-tools: Read, WebFetch
model: haiku
args: <prompt> [--aspect <ratio>] [--resolution <size>] [--reference <path>] [--output <path>]
disable-model-invocation: true
name: generate-image
effort: low
---
Generate images using Google's Nano Banana Pro (Gemini 3 Pro Image) model.
## When to Use This Skill
| Use this skill when... | Use imagemagick-conversion instead when... |
|---|---|
| Producing a brand-new image from a text prompt | Converting, resizing, or compressing an existing image |
| Generating cinematic, product, or portrait artwork | Building thumbnails or batch-processing many files |
| Mixing up to five reference images into a new render | Applying deterministic transforms (rotate, crop, format) |
| Use this skill when... | Use mermaid-diagrams or d2-diagrams instead when... |
|---|---|
| The output is a photographic or illustrative image | The output is a flowchart, sequence, or architecture diagram |
| Quality settings (1K/2K/4K) and aspect ratio matter | Diagram-as-code rendering would be more maintainable |
## Parameters
Parse these from `$ARGUMENTS`. The prompt is the quoted string (or, if
unquoted, every token before the first `--` flag):
- **prompt** (required): Image description. If `$ARGUMENTS` is empty, ask the user for one and stop.
- **--aspect**: Aspect ratio (`1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9`) - default: `16:9`
- **--resolution**: Image resolution (`1K`, `2K`, `4K`) - default: `2K`
- **--reference**: Path to reference image (repeatable, max 5)
- **--output**: Custom output path
## Environment Requirements
Verify API key is set:
```bash
echo "API Key: ${GOOGLE_API_KEY:+SET}${GEMINI_API_KEY:+SET}"
```
If not set, get one from: https://aistudio.google.com/apikey
## Usage Examples
```
/generate-image "A beautiful mountain landscape at sunset"
/generate-image "Product photo on white background" --aspect 1:1 --resolution 4K
/generate-image "Portrait photo" --aspect 3:4
/generate-image "Cinematic scene" --aspect 21:9
/generate-image "Similar style" --reference existing_image.png
```
## Task Workflow
1. **Parse arguments** from `$ARGUMENTS` (see [Parameters](#parameters)):
- Extract the prompt
- Read `--aspect` (default `16:9`), `--resolution` (default `2K`),
each `--reference <path>` (at most 5), and `--output <path>` if given
2. **Build and execute the command**, substituting the parsed values for the
`<...>` slots. Add one `--reference <path>` per reference image and
`--output <path>` only when given:
```bash
uv run python .claude/scripts/nano_banana_pro.py "<prompt>" \
--aspect <ratio> \
--resolution <size> \
--reference <path>
```
3. **Report results**:
- Show path to generated image
- Note any reference images used
- Offer next steps (regenerate, different aspect, etc.)
## Output
Default output: `./generated/image_YYYYMMDD_HHMMSS.png`
Custom output with `--output`:
```
/generate-image "Scene" --output custom_name.png
```
## Reference Images
Reference images help maintain consistency:
- Use existing images as style references
- Keep subjects consistent across generations
- Match artistic styles
When using references, describe the relationship:
- "Similar style to the reference"
- "This person in a different setting"
- "Same product, different angle"
Maximum 5 reference images per generation.
## Aspect Ratio Quick Reference
| Use Case | Ratio |
|----------|-------|
| Square/Instagram | 1:1 |
| Portrait | 3:4, 9:16 |
| Landscape | 16:9 |
| Ultrawide | 21:9 |
| Photo | 3:2, 4:3 |
## Resolution Quick Reference
| Use Case | Resolution |
|----------|------------|
| Preview | 1K |
| Standard | 2K |
| High quality | 4K |
## Error Handling
- **No API key**: Set `GOOGLE_API_KEY` or `GEMINI_API_KEY`
- **Generation failed**: Simplify prompt or reduce references
- **Rate limited**: Wait and retry
© laurigates · MIT · laurigates/claude-plugins
Similar skills
All skills for Design →generate-image by other authors comes first.