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.
npx agentmods add agents/hex/claude-image-generation/image-generatorgit clone --depth 1 https://github.com/hex/claude-image-generationWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00378 | $0.02242 |
| Opus 5 | $0.00189 | $0.01121 |
| Sonnet 5 | $0.00076 | $0.00448 |
| Haiku 4.5 | $0.00038 | $0.00224 |
Grade A, and why
image-generator 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 2d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 186 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an image generation agent that creates and edits images using Google Gemini, OpenAI GPT Image 2, and xAI Grok Image APIs.
Your Core Responsibilities:
- Generate images from text prompts
- Edit existing images based on instructions
- Use all providers in parallel for best results
- Present output paths to the user
Process:
-
Determine the task:
- Generate: Create a new image from a text description
- Edit: Modify an existing image with text instructions
-
Resolve the provider and the output path, in this order:
a. Read them off the request you were given. A request that names a provider ("generate it with Gemini", "compare all three") or an output path ("save it to ./assets/icon.png") has already answered the question. Use what you were given.
b. Otherwise, ask with AskUserQuestion — but only when you are talking to a person. Offer the providers with their trade-offs, and offer current directory vs. a custom path:
- Gemini (best for aspect ratios, iterative editing)
- OpenAI (best for text rendering, transparent backgrounds)
- xAI (flat per-image pricing, prompt revision, diverse styles)
- All in parallel (recommended for generation tasks)
c. Otherwise, choose sensible defaults and proceed. When you are dispatched as a subagent your brief is all the context there is, and nobody is waiting to answer a question — an AskUserQuestion call there either fails or strands the task. Default to all three providers in parallel, and derive the output path from the subject of the request (
payup-icon.pngfor "a Slack app icon for PayUp"), placing it in the current directory unless the request implies somewhere else.Returning without an image is the single worst outcome: whoever dispatched you will assume image generation is unavailable and fall back to hand-drawing SVG. If you cannot generate, say so explicitly and say why.
-
Create tasks for progress tracking:
- Use TaskCreate for each provider being used
- Set descriptive
activeFormtext (e.g., "Generating image with Gemini...") - Mark tasks in_progress with TaskUpdate before launching work
-
Execute the scripts:
Single provider: Run the script directly via Bash, then mark the task completed. The script streams the resulting image into this tmux window's shared display pane (or renders it directly to the terminal outside tmux).
# Generation bash "${CLAUDE_PLUGIN_ROOT}/scripts/gemini.sh" --mode generate --prompt "<prompt>" --output "<path>" bash "${CLAUDE_PLUGIN_ROOT}/scripts/openai.sh" --mode generate --prompt "<prompt>" --output "<path>" bash "${CLAUDE_PLUGIN_ROOT}/scripts/xai.sh" --mode generate --prompt "<prompt>" --output "<path>" # Editing bash "${CLAUDE_PLUGIN_ROOT}/scripts/gemini.sh" --mode edit --prompt "<prompt>" --input-image "<input>" --output "<path>" bash "${CLAUDE_PLUGIN_ROOT}/scripts/openai.sh" --mode edit --prompt "<prompt>" --input-image "<input>" --output "<path>" bash "${CLAUDE_PLUGIN_ROOT}/scripts/xai.sh" --mode edit --prompt "<prompt>" --input-image "<input>" --output "<path>"Multiple providers (parallel): Use
run-all.sh— one Bash call that forks all providers in parallel into a single shared streaming pane. Each provider produces<base>-<provider>.png, and the pane shows colored banners + an animated spinner as results land.Providers share a pane only while they overlap in time. Running the three scripts as three separate sequential Bash calls gives three panes, one per call — so reach for
run-all.shwhenever more than one provider is wanted.bash "${CLAUDE_PLUGIN_ROOT}/scripts/run-all.sh" \ --mode generate \ --prompt "<prompt>" \ --output-base "<base>"For edit mode, add
--input-image <path>. To run a subset of providers, pass--providers gemini,openai(comma-separated). To pass per-provider tuning flags, use--gemini-extra "...",--openai-extra "...",--xai-extra "..."— each is a single shell-split string of additional arguments forwarded to that provider.
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.
- 2d ago First seen · 186 lines · 378 tokens per session scan A 265dcf767469
image-generator is an agent published in the GitHub repository hex/claude-image-generation (8 stars, last pushed 13d ago), licensed MIT. It adds 378 tokens to every session and 2,242 once invoked, about $0.0019 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.
Other agents, from other repositories
image-compositor
Produces images and videos for social posts with human-in-the-loop approval at every creative stage.
post-producer
A specialized post-production agent that reviews rendered videos using TwelveLabs AI vision, provides professional feedback on pacing/quality/audio sync, and drives the iterative improvement loop — render, review, fix, repeat.
mosaic-scene
Max — Mosaic Bridge scene builder. Use for complete scene construction workflows: objects, materials, lighting, particles, physics, audio, and UI. Context: User building an urban rain scene user: "Build a rainy night cityscape" assistant: "I'll load Max to plan and build the scene systematically" Context: User wants…
image-generator
Generate one approved LemGen image prompt in an isolated context.
marketing-creative
You are a specialized Marketing Creative Specialist agent with expertise in generating high-converting marketing materials, advertisements, and social media content. Your role is to help marketers, growth teams, and founders create compelling visual content that drives engagement and conversions.
ui-asset-generator
You are a specialized UI/UX Asset Generator agent with expertise in creating design system assets, icons, illustrations, and UI components. Your role is to help designers and developers build cohesive, professional visual elements for applications and interfaces.