Skip to main content
skill CX Codex

image-gen · krishagel — Claude Code skill for image generation and setup

image-gen is a skill for Claude Code that creates images, infographics, and diagrams with Nano Banana 2 or edits an existing picture from a text prompt.

MIT 4 installs ★ 9 updated 2026-03-14

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

What image-gen does

The skill includes scripts for text-to-image generation, editing a supplied image, and combining reference images into a composition. Separate workflows guide infographic and diagram requests from choosing the main visual idea through prompt construction and result checks. You can also refine an image through follow-up requests.

It runs Python scripts with uv run and requires the GEMINI_API_KEY environment variable. The setup instructions show how to load that variable from Geoffrey’s secrets file. The safety filter blocks photorealistic humans, and copyrighted characters are off limits. Generated files are for the user to view: the instructions say not to open them with the Read tool.

What it helps with

  • generate an image from a text prompt
  • turn data into an infographic
  • draw a system or process diagram
  • change the background of an existing image
  • combine visual references into one composition

Example prompts for the agent

  • Create an autumn coffee shop image and save it as coffee.png.
  • Make a 16:9 infographic about neural networks at 2K resolution.
  • Change the background in photo.png to a beach sunset and save the result as edited.png.

How to install image-gen

1Skills CLI (Vercel)

npx skills add krishagel/geoffrey --skill image-gen -a claude-code

2Manually: put the files in place

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

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

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about image-gen

How do I install image-gen in Claude Code?

Run npx skills add krishagel/geoffrey --skill image-gen -a claude-code. The skill file is placed at ~/.claude/skills/image-gen/SKILL.md.

What does image-gen do?

It generates images from prompts, edits existing pictures, and composes visuals from reference images. Its infographic and diagram workflows help shape the prompt and review the result.

What does image-gen need to run?

Set the GEMINI_API_KEY environment variable. The skill runs Python scripts through uv run; its safety filter blocks photorealistic human images.

Source text

SKILL.md · MIT
---
name: image-gen
description: Generate images using Google's Nano Banana 2 (Gemini 3.1 Flash Image) with workflow-based prompting
triggers:
  - "create image"
  - "generate image"
  - "make infographic"
  - "create infographic"
  - "generate diagram"
  - "make diagram"
  - "design visual"
  - "create visual"
allowed-tools: Read, Write, Bash
version: 0.1.0
---

# Image Generation Skill

Generate professional images, infographics, and diagrams using Google's Nano Banana 2 model (gemini-3.1-flash-image-preview).

## Model Capabilities

**Nano Banana 2** (released February 26, 2026):
- **Text rendering** - Accurate, legible text in images
- **Google Search grounding** - Real-time data (weather, stocks, etc.)
- **Subject consistency** - Up to 5 characters maintained across generations
- **Multi-turn conversation** - Iterative refinement
- **Up to 14 reference images** - For composition and style transfer
- **Resolutions**: 1K, 2K, 4K
- **Aspect ratios**: 1:1, 2:3, 3:2, 4:3, 16:9, 21:9

## Scripts

All scripts use Python via `uv run` with inline dependencies.

### generate.py - Text to Image
```bash
uv run scripts/generate.py "prompt" output.png [aspect_ratio] [size]
```

**Examples:**
```bash
# Basic image
uv run scripts/generate.py "A cozy coffee shop in autumn" coffee.png

# Infographic with specific aspect ratio
uv run scripts/generate.py "Infographic explaining how neural networks work" nn.png 16:9 2K

# 4K professional image
uv run scripts/generate.py "Professional headshot, studio lighting" headshot.png 3:2 4K
```

### edit.py - Image Editing
```bash
uv run scripts/edit.py input.png "edit instructions" output.png
```

**Examples:**
```bash
# Edit existing image
uv run scripts/edit.py photo.png "Change the background to a beach sunset" edited.png
```

### compose.py - Multi-Image Composition
```bash
uv run scripts/compose.py "prompt" output.png --refs image1.png image2.png
```

**Examples:**
```bash
# Combine styles from multiple images
uv run scripts/compose.py "Combine these styles into a logo" logo.png --refs style1.png style2.png
```

## Workflows

Workflows provide structured approaches for specific visual types. Each workflow follows the PAI 6-step editorial process:

1. **Extract narrative** - Understand the complete story/concept
2. **Derive visual concept** - Single metaphor with 2-3 physical objects
3. **Apply aesthetic** - Define style, colors, mood
4. **Construct prompt** - Build detailed generation instructions
5. **Generate** - Execute via script
6. **Validate** - Check against criteria, regenerate if needed

### Available Workflows

- **infographic.md** - Data visualization, statistics, explainers
- **diagram.md** - Technical diagrams, flowcharts, architecture

## Workflow Usage

When generating images, follow the appropriate workflow:

### For Infographics
```markdown
1. What data/concept needs visualization?
2. What's the key insight or takeaway?
3. Aspect ratio: 16:9 (landscape) recommended
4. Include: clear hierarchy, minimal text, supporting icons
5. Generate at 2K minimum for text clarity
```

### For Diagrams
```markdown
1. What system/process is being illustrated?
2. What are the key components and relationships?
3. Style: flat colors, clean lines, minimal detail
4. Generate at 2K for label clarity
```

## Environment Setup

Requires `GEMINI_API_KEY` environment variable. This should be set from Geoffrey's secrets:

```bash
source ~/Library/Mobile\ Documents/com~apple~CloudDocs/Geoffrey/secrets/.env
```

## Best Practices

### Infographics
- Use simple, direct prompts: "Infographic explaining how X works"
- Model auto-includes relevant icons/logos
- 16:9 aspect ratio works best
- Generate at 2K+ for readable text

### General
- Multi-turn refinement: generate, then ask for specific changes
- Reference images improve consistency
- Be specific about style, mood, lighting
- SynthID watermark is automatic (Google provenance)

## Output Location

By default, save images to `/tmp/` or user-specified paths. For persistent storage, use:
```
~/Library/Mobile Documents/com~apple~CloudDocs/Geoffrey/images/
```

## ⚠️ CRITICAL: Never Read Generated Images

**DO NOT use the Read tool on generated images.**

Why:
- 4K images (3840x2160) are within the 8000px limit
- 2K images (2560x1440) are also safe
- BUT: Do not Read them - they're for user consumption, not analysis
- For edits, use edit.py script, not Read tool

Workflow:
1. Generate image with script
2. Return file path to user
3. User views the high-quality output

## Limitations

- No photorealistic humans (safety filter)
- No copyrighted characters
- Maximum 14 reference images for composition
- 4K only available with Nano Banana 2 and Nano Banana Pro

## Pricing

| Size | Cost per Image |
|------|---------------|
| 1K | Free tier / $0.04 |
| 2K | $0.134 |
| 4K | $0.24 |

© krishagel · MIT · krishagel/geoffrey

Similar skills

All skills for Design →

image-gen by other authors comes first.

image-gen marswaveai The image-gen skill turns a text description into an image through the ListenHub CLI, with a choice of model, resolution, aspect ratio and references. CX Codex +1 1,200installs image-gen dotslashsimran The image-gen Claude Code skill generates and edits images from requests. It activates for illustrations, icons, thumbnails, textures, and image series that need a consistent subject. CX Codex +1 ★ 541repo stars image-gen Nick Nisi image-gen is a Claude Code skill that generates or edits images with Gemini or OpenAI. It handles illustrations, diagrams, and graphics with readable labels. CX Codex +1 ★ 114repo stars seo-image-gen AgriciDaniel seo-image-gen — a skill for Claude Code, Codex, and Cursor builds search-optimized visuals via Gemini. Automates OG cards, blog hero banners, infographics, and clean product shots with preset aspect ratios. CX Codex +1 7,100installs skill-image-gen official adamd9 skill-image-gen generates images from text prompts directly inside your editor. Useful when building game sprites, app icons, and mockups during coding. ★ 41,430repo stars Image Gen nuver-labs Image Gen lets coding agents produce and modify local image assets via Gemini and OpenAI. Helpful whenever a workflow requires UI mockups, logos, or banner drafts. CX Codex +1 ★ 1repo stars openai-image-gen steipete openai-image-gen — a skill for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode: calls the OpenAI Images API, renders a batch of images from structured prompts, and builds an HTML gallery. CX Codex +1 1installs 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 ai-image-creator centminmod ai-image-creator generates PNG graphics, edits images from references, and inspects media via OpenRouter or Cloudflare AI Gateway in Claude Code. CX Codex +1 ★ 2,744repo stars

From the same set2

Project sponsors

Companies that keep this analytics open