home / skills / laurigates / claude-plugins / generate-image

generate-image skill

/tools-plugin/skills/generate-image

This skill generates images using Gemini 3 Pro Image by interpreting prompts and optional references for customized aspect and resolution.

npx playbooks add skill laurigates/claude-plugins --skill generate-image

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.9 KB
---
model: haiku
created: 2025-12-16
modified: 2026-02-06
reviewed: 2025-12-16
description: Generate images using Nano Banana Pro (Gemini 3 Pro Image)
allowed-tools: Bash, Read, WebFetch
args: <prompt> [--aspect <ratio>] [--resolution <size>] [--reference <path>]
name: generate-image
---

Generate images using Google's Nano Banana Pro (Gemini 3 Pro Image) model.

## Arguments

- **{{arg:1}}** (required): Image description
- **--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**:
   - Extract prompt from {{arg:1}}
   - Identify aspect ratio, resolution, and reference images

2. **Build command**:
   ```bash
   uv run python .claude/scripts/nano_banana_pro.py \
     "{{arg:1}}" \
     --aspect {{aspect|default:"16:9"}} \
     --resolution {{resolution|default:"2K"}} \
     {{reference_flags}}
   ```

3. **Execute generation**:
   ```bash
   uv run python .claude/scripts/nano_banana_pro.py "PROMPT" --aspect RATIO --resolution SIZE
   ```

4. **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

Overview

This skill generates images using the Nano Banana Pro (Gemini 3 Pro Image) model. It accepts a text prompt plus optional aspect ratio, resolution, reference images, and custom output path to produce reproducible image files. The tool is designed for quick iterations and consistent style matching using reference images.

How this skill works

The skill parses the required prompt and optional flags (aspect, resolution, reference images, output). It builds and runs a command that invokes the Nano Banana Pro generator and writes a timestamped PNG by default. After generation it reports the output path and any reference images used, and suggests next actions like regenerating or changing composition. Errors are surfaced with actionable guidance (API key, rate limits, prompt simplification).

When to use it

  • Create product photos, marketing visuals, or concept art from text prompts
  • Generate portraits or environmental scenes with specific aspect ratios
  • Produce consistent variations using reference images for style or subject continuity
  • Quickly iterate compositions at different resolutions for preview or final export
  • Automate image generation in scripts or pipelines that need reproducible output

Best practices

  • Provide a clear, concise prompt and include key visual details (lighting, mood, subject, style)
  • Use reference images (up to 5) to maintain style or subject consistency across generations
  • Choose aspect ratio and resolution appropriate to the target platform (e.g., 1:1 for square, 16:9 landscape, 3:4 portrait)
  • Start with 2K for balanced speed and quality; switch to 4K for high-quality final renders
  • If generation fails, simplify the prompt or remove some reference images; check API key and rate limit status

Example use cases

  • /generate-image "A beautiful mountain landscape at sunset" — wide landscape for website header
  • /generate-image "Product photo on white background" --aspect 1:1 --resolution 4K for e-commerce listings
  • /generate-image "Portrait photo" --aspect 3:4 for editorial layouts
  • /generate-image "Cinematic scene" --aspect 21:9 for concept art or desktop wallpapers
  • /generate-image "Similar style" --reference existing_image.png to create variations matching an existing style

FAQ

What environment variables are required?

Set GOOGLE_API_KEY or GEMINI_API_KEY before running; the tool checks these and will error if none are present.

How many reference images can I use?

You can attach up to five reference images to guide style or subject consistency.

Where is the output saved by default?

By default the image is saved as ./generated/image_YYYYMMDD_HHMMSS.png; use --output to set a custom path.

What should I do if generation fails or is rate limited?

Try simplifying the prompt, removing or reducing references, confirm your API key, and retry after a short wait if rate limited.