image-generation

image-generation is a skill for Claude Code, Codex from hex/claude-image-generation. It costs 127 tokens per session (3,651 once invoked), scanned A, original, MIT.

An image tool for generating new pictures and editing existing ones through the Gemini, OpenAI, and xAI image services.

In plain words
What is it for?
Creating illustrations, concept images, and other generated graphics, or modifying an existing image with one of the supported services.
Why use it?
It avoids switching between separate image tools or writing the API calls yourself. It gives an agent a documented way to create or change images from a request.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the claude-image-generation plugin — 1 skill, 1 command, 1 agent shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/hex/claude-image-generation/image-generation
Any agent
npx skills add hex/claude-image-generation --skill image-generation
Clone the repo
git clone --depth 1 https://github.com/hex/claude-image-generation

Made for: Claude Code, Codex.

Or install claude-image-generation, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for image-generation

README.md
[![agentmods](https://agentmods.dev/badge/skills/hex/claude-image-generation/image-generation.svg)](https://agentmods.dev/skills/hex/claude-image-generation/image-generation)
Your own site
<a href="https://agentmods.dev/skills/hex/claude-image-generation/image-generation"><img src="https://agentmods.dev/badge/skills/hex/claude-image-generation/image-generation.svg" alt="Measured on agentmods" height="20"></a>
Per session 127 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,651 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00127 $0.03651
Opus 5 $0.00063 $0.01826
Sonnet 5 $0.00025 $0.00730
Haiku 4.5 $0.00013 $0.00365

Measured today against content hash 9431508c8909, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

image-generation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/image-generation/SKILL.md · 239 lines

How it starts

The opening of the file, as written. The whole thing — 239 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Image Generation with Gemini, OpenAI, xAI, and OpenRouter

Generate and edit images using Google Gemini, OpenAI GPT Image 2, xAI Grok Image, and OpenRouter APIs via shell scripts.

Available Providers

Google Gemini

  • Model: gemini-3-pro-image (default, "Nano Banana Pro"). Alt: gemini-3.1-flash-image (Flash, 14 ratios), gemini-3.1-flash-lite-image (cheapest). The -preview IDs are past their shutdown date.
  • Strengths: Premium quality, up to 4K output, thinking mode, Google Search grounding, multi-turn editing with up to 14 reference images
  • Aspect ratios: 10 on Pro (1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 4:5, 5:4, 21:9); Flash adds 4 extreme ratios (1:4, 4:1, 1:8, 8:1)
  • Resolution: --image-size takes 1K, 2K, 4K on both Pro and Flash; Flash additionally supports 512 (UPPERCASE required)
  • Env var: GEMINI_API_KEY

OpenAI GPT Image 2

  • Model: gpt-image-2 (default, snapshot gpt-image-2-2026-04-21); gpt-image-1.5 available as previous flagship via --model
  • Strengths: Superior text rendering, transparent backgrounds, up to 16 input images for editing, quality tiers
  • Sizes: 1024x1024, 1536x1024 (landscape), 1024x1536 (portrait)
  • Quality: low (fast/cheap), medium, high (best fidelity)
  • Env var: OPENAI_API_KEY

xAI Grok Image

  • Model: grok-imagine-image-2.0 (default, flagship since 2026-08-07), grok-imagine-image-quality (May 2026 quality mode; grok-imagine-image-pro redirects here), grok-imagine-image (standard, 300 RPM)
  • Strengths: Prompt revision by chat model, flat per-image pricing, diverse style range, many aspect ratios
  • Aspect ratios: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2, 19.5:9, 9:19.5, 20:9, 9:20, 21:9, 5:2, auto
  • Resolution: --resolution takes 1k, 2k (LOWERCASE required, opposite of Gemini)
  • Quality: --quality takes low, medium, auto on grok-imagine-image-2.0; unset means auto (low for generation, medium for edits), billed as served
  • Editing: Dedicated /v1/images/edits endpoint; up to 5 input images passed as data URIs in an images array
  • Env var: XAI_API_KEY or GROK_API_KEY

Read the full file on GitHub · 239 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +49 lines · +14 tokens per session 9431508c8909
  2. 4d ago First seen · 190 lines · 113 tokens per session scan A 0c406971dd66

Subscribe to this mod's changes

image-generation is a skill published in the GitHub repository hex/claude-image-generation (8 stars, last pushed yesterday), licensed MIT. It adds 127 tokens to every session and 3,651 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

crossgen-artist

Use CrossGen to plan and execute image generation, editing, inpainting, model selection, job monitoring, Gallery inspection, and asset export through MCP or its JSON CLI.

Bliveren/CrossGen · 39 tokens

ima2

Use the ima2-gen CLI/server to generate, edit, inspect, and manage local AI image generation jobs.

lidge-jun/ima2-gen · 25 tokens

ima2-front

Frontend implementation skill for ima2 users. Use for any frontend, web UI, or visual implementation work — building, styling, or redesigning pages/components, responsive layouts, motion, component architecture, and production-surface polish. Pairs with ima2-uiux: load it first when design direction is vague; this…

lidge-jun/ima2-gen · 149 tokens

deep-execution

Executes agent-enhanced council queries by spawning parallel Claude subagents that each query a provider, evaluate response quality, ask follow-up questions, and return structured insights with confidence ratings and blind spot analysis. Invoked when the --agents flag is used or when complex architectural decisions…

hex/claude-council · 61 tokens

videoagent-image-studio

Tired of juggling 8 API keys? This skill gives you one-command access to Midjourney, Flux, Ideogram, and more, with zero setup. Use when you want to generate any image without worrying about API keys.

pexoai/pexo-skills · 53 tokens

video-perception

Use when the user mentions a video file (.mp4, .mov, .avi, .mkv, .webm), a YouTube URL, asks to watch/analyze/review a video, or references video content in conversation.

jordanrendric/claude-video-vision · 51 tokens