img-gen

img-gen is a skill for Claude Code, Codex from zztdandan/image-generate-mcp-remote. It costs 34 tokens per session (1,171 once invoked), scanned A, original, MIT.

An image-generation and image-editing tool that calls GPT Image 2 and Nano Banana 2 through direct web requests. It reads API keys from operating-system environment variables rather than relying on an intermediary service.

In plain words
What is it for?
Use it to generate images from text prompts, edit existing images, check API-key availability, and save the resulting files with selected sizes and aspect ratios.
Why use it?
It provides a defined command-line path for creating or changing images and checks whether the required API access is configured. It avoids adding an MCP middle layer for these requests.

Skill for Claude CodeCodex

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

Good fit Use it to generate images from text prompts, edit existing images, check API-key availability, and save the resulting files with selected sizes and aspect ratios.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zztdandan/image-generate-mcp-remote/img-gen
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 zztdandan/image-generate-mcp-remote --skill img-gen
Clone the repo
git clone --depth 1 https://github.com/zztdandan/image-generate-mcp-remote

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 img-gen

README.md
[![agentmods](https://agentmods.dev/badge/skills/zztdandan/image-generate-mcp-remote/img-gen/github.svg)](https://agentmods.dev/skills/zztdandan/image-generate-mcp-remote/img-gen)
Your own site
<a href="https://agentmods.dev/skills/zztdandan/image-generate-mcp-remote/img-gen"><img src="https://agentmods.dev/badge/skills/zztdandan/image-generate-mcp-remote/img-gen/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for img-gen

Your own site · 80×15
<a href="https://agentmods.dev/skills/zztdandan/image-generate-mcp-remote/img-gen"><img src="https://agentmods.dev/badge/skills/zztdandan/image-generate-mcp-remote/img-gen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,171 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00034 $0.01171
Opus 5 $0.00017 $0.00585
Sonnet 5 $0.00007 $0.00234
Haiku 4.5 $0.00003 $0.00117

Measured 6d ago against content hash 9d1bbab62031, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

img-gen 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 6d ago.

The scan reads SKILL.md. This mod also ships 19 executable files (scripts/check_env.py, scripts/img_gen.py, scripts/lib/__init__.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/img-gen/SKILL.md · 137 lines

How it starts

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

img-gen — 直接图像生成

通过 OS 环境变量读取 API key,直接发起 HTTP 请求生成/编辑图片。 不依赖 MCP 中间层,不依赖任何 .env 文件。

适用范围

  • 用户要求生成图片(GPT Image 2 / Nano Banana 2)
  • 用户要求编辑已有图片
  • gpt-icon-generate 等依赖生图能力的技能的下层实现

技能文件

所有脚本为技能自包含:

scripts/
├── img_gen.py              ← 统一 CLI(check / generate / edit)
├── check_env.py            ← .env 配置检测
├── lib/
│   ├── presets.py          ← 13 个 preset 配置 + 尺寸映射 + .env 加载
│   ├── openai_images.py    ← OpenAI Images 协议
│   └── gemini_gen.py       ← Gemini generateContent 协议
└── presets/
    ├── gpt/    (10 个)     ← 每个 preset 一个 Python 封装
    └── banana/ (3 个)

快速开始

Step 1 — 检测环境

python3 scripts/check_env.py

从 OS 环境变量读取配置,确认 API key 存在,报告各渠道可用状态。 不打印 token 值。如果失败,检查环境变量是否设置。

Step 2 — 生成图片

# 使用 GPT preset
python3 scripts/img_gen.py generate \
    --preset laozhang_gpt_image_2_default \
    --prompt "A futuristic steel plant" \
    --save output.png --size 2K --ratio 16:9

# 使用 Banana preset
python3 scripts/img_gen.py generate \
    --preset laozhang_nano_banana_pro \
    --prompt "传统中式园林" \
    --save garden.png --size 4K --ratio 16:9

Step 3 — 编辑图片

python3 scripts/img_gen.py edit \
    --preset laozhang_gpt_image_2_default \
    --image input.png --prompt "Add blue sky" \
    --save edited.png

Preset 专属脚本

每个 preset 有独立 Python 封装:

python3 scripts/presets/gpt/laozhang_gpt_image_2_default.py generate --prompt "..." --save out.png
python3 scripts/presets/banana/laozhang_nano_banana_pro.py generate --prompt "..." --save out.png

环境配置

通过 OS 环境变量配置(无需 .env 文件):

IMG_GEN_GPT_IMAGE_2_OFFICIAL_API_KEY=<token>
IMG_GEN_GPT_IMAGE_2_OFFICIAL_PRESET=laozhang_gpt_image_2_default
IMG_GEN_NANO_BANANA_2_OFFICIAL_API_KEY=<token>
IMG_GEN_NANO_BANANA_2_OFFICIAL_PRESET=laozhang_nano_banana_pro
IMAGE_OUTPUT_DIR=/home/base/images

安全说明:技能检测仅确认环境变量非空,不打印 token 值。

支持的 Preset

13 个 preset,详见 references/presets.md

协议 数量 Provider
OpenAI Images 10 laozhang, openai, apiyi, right_codes, copperai
Gemini 3 laozhang, apiyi, google

Read the full file on GitHub · 137 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. 6d ago First seen · 137 lines · 34 tokens per session scan A 9d1bbab62031

Subscribe to this mod's changes

img-gen is a skill published in the GitHub repository zztdandan/image-generate-mcp-remote (0 stars, last pushed 6d ago), licensed MIT. It adds 34 tokens to every session and 1,171 once invoked, about $0.0002 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-09-05.

Related

Other skills, from other repositories

webgl-holographic-foil

A self-contained WebGL2 hero: thin-film interference over a crushed-foil surface whose palette shifts with the viewing angle; move the cursor to tilt the film.

nexu-io/open-design · 41 tokens

general-video

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated…

heygen-com/hyperframes · 92 tokens

html-ppt-hermes-cyber-terminal

OpenDesign + BYOK: choosing and wiring your own model, hands-on — cost, quality, and the routing decision. Built as a decision-grade AI literacy deck for engineers, IT, applied-AI teams.

nexu-io/open-design · 53 tokens

html-ppt-taste-brutalist

16:9 HTML deck in tactical-telemetry / CRT-terminal taste. Deactivated-CRT charcoal slides, white-phosphor monospace, hazard-red accent, scanline overlay, ASCII syntax, density over decoration. Distilled from Leonxlnx/taste-skill brutalist-skill (Tactical Telemetry mode).

nexu-io/open-design · 78 tokens

chengfeng-check-updates

An environment manager for a video-editing system. It checks whether its skills and runtime—the software needed to run them—are installed and compatible.

Agentchengfeng/chengfeng-videocut-skills · 120 tokens

diagnostic-stem-delivery

Audio production with diagnostic analysis, timecode parsing from documents, and verified export workflow.

HKUDS/OpenSpace · 23 tokens