generate-image

generate-image is a command for coding agents from hex/claude-image-generation. It costs 14 tokens per session (806 once invoked), scanned A, original, MIT.

A command for generating new images or editing an image file with Gemini, OpenAI, or xAI image services.

In plain words
What is it for?
Creating an image from a prompt or modifying an existing image supplied with an edit path.
Why use it?
It turns a plain-language image request into a guided generation or editing process, including choosing a provider and save location. The input does not specify the full set of supported options.

Command

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 commands/hex/claude-image-generation/generate-image
Clone the repo
git clone --depth 1 https://github.com/hex/claude-image-generation

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 generate-image

README.md
[![agentmods](https://agentmods.dev/badge/commands/hex/claude-image-generation/generate-image.svg)](https://agentmods.dev/commands/hex/claude-image-generation/generate-image)
Your own site
<a href="https://agentmods.dev/commands/hex/claude-image-generation/generate-image"><img src="https://agentmods.dev/badge/commands/hex/claude-image-generation/generate-image.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 806 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.00014 $0.00806
Opus 5 $0.00007 $0.00403
Sonnet 5 $0.00003 $0.00161
Haiku 4.5 $0.00001 $0.00081

Measured 3d ago against content hash 4f77b188fa86, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

generate-image 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 3d 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.

commands/generate-image.md · 72 lines

How it starts

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

Generate or edit an image based on the user's request.

Process

  1. Parse the arguments:

    • The main text is the image prompt
    • If --edit is present, the next argument is the path to an input image for editing
    • Determine mode: "edit" if --edit flag is present, otherwise "generate"
  2. Ask the user which provider to use with AskUserQuestion:

    • Gemini (gemini-3-pro-image-preview): Premium quality, professional asset production, up to 14 reference images
    • OpenAI (gpt-image-2): Best for text rendering and transparent backgrounds
    • xAI (grok-imagine-image-pro): Premium tier, higher quality, flat per-image pricing
    • All in parallel: Generate with all available providers and pick the best result
  3. Ask the user where to save the output with AskUserQuestion:

    • Current directory (e.g., ./generated-image.png)
    • Custom path (let them type)
  4. Execute the generation using tasks for progress tracking:

    If single provider selected: a. Create a task with TaskCreate:

    • subject: "Generate image with "
    • activeForm: "Generating image with ..." b. Mark it in_progress with TaskUpdate c. Run the script via Bash:
    bash "${CLAUDE_PLUGIN_ROOT}/scripts/<provider>.sh" \
      --mode <generate|edit> \
      --prompt "<prompt>" \
      --output "<output-path>" \
      [--input-image "<input-path>"]
    

    d. Mark the task completed (or note the error if it failed)

    If multiple providers selected: a. Create one task tracking the whole parallel run with TaskCreate:

    • subject: "Generate image with all providers in parallel"
    • activeForm: "Generating with Gemini, OpenAI, and xAI..." b. Mark it in_progress with TaskUpdate. c. Run scripts/run-all.sh in a single Bash call — it opens the streaming pane, forks all providers in parallel, captures their stdio under $DISPLAY_PANE_DIR/logs/, and closes the pane when every provider has returned:
    bash "${CLAUDE_PLUGIN_ROOT}/scripts/run-all.sh" \
      --mode <generate|edit> \
      --prompt "<prompt>" \
      --output-base "<base>" \
      [--input-image "<input-path>"]
    

    Each provider produces <base>-gemini.png, <base>-openai.png, <base>-xai.png. To run a subset, pass --providers gemini,openai. To pass per-provider tuning, use --gemini-extra "...", --openai-extra "...", --xai-extra "...". d. Mark the task completed when run-all.sh exits. Its exit status reports whether any provider failed; per-provider error details are in $DISPLAY_PANE_DIR/logs/<provider>.err and shown inline in the streaming pane as a red error banner.

  5. After generation completes, confirm the output path(s) to the user. If multiple were generated, let the user know all files are available so they can compare.

Read the full file on GitHub · 72 lines

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. 3d ago First seen · 72 lines · 14 tokens per session scan A 4f77b188fa86

Subscribe to this mod's changes

generate-image is a command published in the GitHub repository hex/claude-image-generation (8 stars, last pushed 14d ago), licensed MIT. It adds 14 tokens to every session and 806 once invoked, about $0.0001 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 commands, from other repositories

media

Understand an audio / video / image file — Antigravity (agy/Gemini) transcribes and analyzes it, returning a timestamped digest while the full transcript goes to a file.

yuting0624/antigravity-for-claude-code · 38 tokens

watch-video

Watch and analyze a video file or YouTube URL — extracts frames and audio for understanding.

jordanrendric/claude-video-vision · 17 tokens

media

Ask a question about an AUDIO, VIDEO or IMAGE file (or a YouTube/remote URL) with Antigravity (agy / Gemini 3.x multimodal). Beyond transcription — "what decisions were made in this meeting?", "what happens at 2:30 in the video?", "what's the tone of this voice note?". Claude Code can't see/hear media; agy can.

MarcosNahuel/antigravity-plugin-cc · 80 tokens

transcribe

Transcribe and summarize an AUDIO or VIDEO file (or a YouTube/remote URL) with Antigravity (agy / Gemini 3.x multimodal) — something Claude can't do natively. Voice notes, meetings, calls, screencasts. Faithful transcript + summary; timestamps for video/URLs. Saves to docs/agy/transcripts/.

MarcosNahuel/antigravity-plugin-cc · 71 tokens

video

WATCH a video and return a structured VISUAL breakdown (not just a transcript) with Antigravity (agy / Gemini 3.x, natively multimodal in video). Scene-by-scene segments with timestamps, on-screen text/OCR (slides, charts, UI, captions), key visual events, and a summary. For screencasts, tutorials, presentations…

MarcosNahuel/antigravity-plugin-cc · 96 tokens

gemini-imagegen

Generate or edit an image via a Gemini (agy) session — Gemini's generateimage tool does what Claude cannot.

Vallykrie/gemini-swarm-skill · 22 tokens