Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add laurigates/claude-plugins --skill generate-image -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/generate-image/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/generate-image/

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.

generate-image K-Dense-AI The generate-image skill for Claude Code generates and edits images via OpenRouter Image API with Gemini, Recraft, and Seedream, for artwork, logos, and concept art. CX Codex +1 2,200installs generate-image official github Generate images from text prompts with OpenAI or Google Gemini. Use it to create project textures, icons, sprites, artwork, or mockups. CX Codex +1 93installs generate-image OpenClaudia generate-image generates images from text prompts using OpenAI or Stability AI. Useful when your coding agent needs to create logos, banners, or illustrations directly in the project. CX Codex +1 360installs generate-image Sateezg generate-image turns a text request into a PNG file — icons, logos, banners, illustrations, mockups — by calling Claude-image-2 inside the Claude CLI already signed in on your machine. CX Codex +1 ★ 195repo stars generate-image Samarth Gupta generate-image — a Claude Code skill that creates and edits images through generate.py — logos, stickers, product mockups, t2i, i2i and multi-reference composites. It kicks in when you need a finished visual, not markup. CX Codex +1 ★ 276repo stars byted-seedream-image-generate bytedance byted-seedream-image-generate generates images from text prompts via Volcano Engine Seedream. Choose from three model versions, batch generation, style transfer, and web search integration (5.0-lite). CX Codex +1 304installs image-generation claude-office-skills image-generation is a Claude Code skill that writes prompts for DALL-E, Midjourney, and Stable Diffusion. It helps shape image requests around a chosen style or format. CX Codex +1 5,800installs nano-banana-pro-prompts-recommend-skill YouMind-OpenLab nano-banana-pro-prompts-recommend-skill is a Claude Code skill that finds image generation prompts in a library of 10,000+ texts. Prompts for Nano Banana Pro also work with DALL-E, Midjourney, Stable Diffusion, and Flux. CX Codex +1 1installs oma-image First Fluke oma-image dispatches AI image generation across Codex and Pollinations from your coding agent with auth checks and reproducible manifests. CX Codex +1 ★ 1,472repo stars baoyu-cover-image JimLiu baoyu-cover-image generates article covers from five parameters: composition type, palette (11 options), rendering style (7 options), text level, and mood. Triggers on "generate cover image" or "create article cover". CX Codex +1 32,900installs jimeng-api-image-gen wvlvik jimeng-api-image-gen — a skill for Claude Code, Codex, Cursor and other platforms that generates images via Volcengine Jimeng API 4.0. Activates on prompts like 'create image', 'draw', or mentions of Jimeng. CX Codex +1 503installs

From the same set27

The whole set →
uv-tool-management uv-tool-management is a Claude Code skill for managing global Python CLI tools with uv and running them temporarily with uvx, including as an alternative to pipx. CX Codex +1 328installs imagemagick-conversion imagemagick-conversion — a skill for converting, resizing and optimizing images via ImageMagick command-line. Useful for bulk format conversion, thumbnail generation, and large-scale image processing workflows. CX Codex +1 260installs jq-json-processing jq-json-processing — a skill for parsing, filtering and transforming JSON with jq. Extracts fields, filters arrays, reshapes objects and validates syntax. CX Codex +1 245installs python-development python-development gives your agent Python 3.10+ idioms: type hints, pattern matching, asyncio. Handy for library code and refactors. CX Codex +1 192installs justfile-expert justfile-expert is a Claude Code skill for designing Just recipes, parameters, dependencies, and modules. It supports adding project commands and task automation. CX Codex +1 162installs git-commit-workflow The git-commit-workflow Claude Code skill defines commit-message and staging rules. It helps split related edits into focused commits and review staged changes. CX Codex +1 161installs binary-analysis binary-analysis guides your coding agent in inspecting unknown binaries, running hex dumps, and extracting embedded artifacts. CX Codex +1 146installs shell-expert shell-expert is a Claude Code skill for writing Bash, zsh, and POSIX scripts and composing command-line automation. It activates for shell pipelines and portable scripting tasks. CX Codex +1 141installs

Project sponsors

Companies that keep this analytics open