image-generator

image-generator is a skill for Claude Code, Codex from ethanolivertroy/my-agent-stuff. It costs 47 tokens per session (3,817 once invoked), scanned A, original, MIT.

A skill for creating and editing images with Google's Gemini image models. It can be used for visuals such as photos, logos, product mockups, and edited images.

In plain words
What is it for?
Use it when generating a new image or changing an existing one. It requires a GEMINI_API_KEY environment variable and can read the model choice from GEMINI_IMAGE_MODEL.
Why use it?
It gives the coding agent a defined way to handle image requests, while making the required Google API setup explicit.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when generating a new image or changing an existing one. It requires a GEMINI_API_KEY environment variable and can read the model choice from GEMINI_IMAGE_MODEL.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ethanolivertroy/my-agent-stuff/image-generator
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.

Any agent
npx skills add ethanolivertroy/my-agent-stuff --skill image-generator
Clone the repo
git clone --depth 1 https://github.com/ethanolivertroy/my-agent-stuff

Made for: Claude Code, Codex.

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-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/ethanolivertroy/my-agent-stuff/image-generator.svg)](https://agentmods.dev/skills/ethanolivertroy/my-agent-stuff/image-generator)
Your own site
<a href="https://agentmods.dev/skills/ethanolivertroy/my-agent-stuff/image-generator"><img src="https://agentmods.dev/badge/skills/ethanolivertroy/my-agent-stuff/image-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,817 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00047 $0.03817
Opus 5 $0.00023 $0.01909
Sonnet 5 $0.00009 $0.00763
Haiku 4.5 $0.00005 $0.00382

Measured 7d ago against content hash 7e87923410a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

image-generator scanned grade A with 1 finding 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 7d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -X POST \
skills/image-generator/SKILL.md · 489 lines

How it starts

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

Image Generator

This skill generates and edits images using Gemini image models. Default to gemini-3-pro-image-preview for high-quality asset production unless the user or environment specifies a different model.

IMPORTANT: Setup Required

Before using this skill, the user must set the GEMINI_API_KEY environment variable:

  1. Get a free API key from Google AI Studio
  2. Export the key in your shell profile (~/.zshrc, ~/.bashrc, etc.):
    export GEMINI_API_KEY="your_api_key_here"
    
  3. Restart your terminal or run source ~/.zshrc (or ~/.bashrc)

The skill will not work without this configuration.

Pre-flight Check

Before making any API call, verify the key is set:

if [ -z "$GEMINI_API_KEY" ]; then
  echo "ERROR: GEMINI_API_KEY is not set. Please export it in your shell profile."
  exit 1
fi

If the key is missing, stop and tell the user to set it using the instructions above.

Configuration

Model: Read from GEMINI_IMAGE_MODEL, defaulting to gemini-3-pro-image-preview.

API Key: Read from the GEMINI_API_KEY environment variable

Iterating on User-Provided Images

When the user provides a path to an image they want to edit or iterate on, use this workflow:

Step 1: Read and encode the image to base64

# Get the image path from user
IMG_PATH="/path/to/user/image.png"

# Detect mime type
if [[ "$IMG_PATH" == *.png ]]; then
    MIME_TYPE="image/png"
elif [[ "$IMG_PATH" == *.jpg ]] || [[ "$IMG_PATH" == *.jpeg ]]; then
    MIME_TYPE="image/jpeg"
elif [[ "$IMG_PATH" == *.webp ]]; then
    MIME_TYPE="image/webp"
else
    MIME_TYPE="image/png"
fi

# Encode to base64 (works on both macOS and Linux)
if [[ "$(uname)" == "Darwin" ]]; then
    IMG_BASE64=$(base64 -i "$IMG_PATH")
else
    IMG_BASE64=$(base64 -w0 "$IMG_PATH")
fi

Step 2: Send image with edit prompt (File-Based Approach)

IMPORTANT: Always use a file-based approach for the request body. Base64-encoded images are too large for command-line arguments and will cause "argument list too long" errors.

Read the full file on GitHub · 489 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. 7d ago First seen · 489 lines · 47 tokens per session scan A 7e87923410a2

Subscribe to this mod's changes

image-generator is a skill published in the GitHub repository ethanolivertroy/my-agent-stuff (11 stars, last pushed 1mo ago), licensed MIT. It adds 47 tokens to every session and 3,817 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.