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 skills add zztdandan/image-generate-mcp-remote --skill img-gengit clone --depth 1 https://github.com/zztdandan/image-generate-mcp-remoteWrote 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.
[](https://agentmods.dev/skills/zztdandan/image-generate-mcp-remote/img-gen)<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.
<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>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00048 | $0.04118 |
| Opus 5.5 | $0.00019 | $0.01647 |
| Sonnet 5.5 | $0.00010 | $0.00824 |
| Haiku 4.5 | $0.00005 | $0.00412 |
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 12d 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 — 258 lines — stays where its author put it; the contents beside it link to each section on GitHub.
img-gen — 直接图像生成
通过进程环境变量读取 API key,直接发起 HTTP 请求生成/编辑图片。
不依赖 MCP 中间层,也不读取任何 .env 文件。
适用范围
- 用户要求生成图片(GPT-Image 2.5 / Nano Banana 2)
- 用户要求编辑已有图片
- gpt-icon-generate 等依赖生图能力的技能的下层实现
配置门禁(先读这一节)
技能只认进程环境变量。变量由宿主在启动时注入(DSH 启动时注入,见「环境配置」), 技能自身不解析文件、不落盘、不缓存 token。
每次任务开始先跑:
python3 scripts/check_env.py # 或 python3 scripts/img_gen.py check
- 两个 key 都是 ✗ → 停下,不要继续。 直接告诉用户缺哪个变量,并给出可复制的
export ...(或「启动 DSH 前注入」)做法,等用户补齐后再重跑本检查。 这一条优先于其它所有步骤:不要猜 key、不要去翻别人的配置文件、不要换 provider 硬试、不要因为「上次能用」就假设这次也有。 - 至少一个 ✓ → 继续,默认走
--preset auto。 - 只有 nano-banana 的 key 时,
generate仍可跑 Gemini 协议 preset(--preset显式指定, 或 auto 链里只剩 banana 路线)。
计费模型与默认路线
| 路线 | 模型名 | 计费 | 定位 |
|---|---|---|---|
| 便宜路线 | gpt-image-2.5-vip(别名 sunburst-vip)、-flare-vip、-sunburst-vip、gpt-image-2-vip |
$0.03/张,按次;1K/2K/4K 与 quality 都不加价 | 日常唯一默认 |
| 贵路线 | gpt-image-2.5-flare / -sunburst、gpt-image-2(无 -vip) |
官转,按输出 token 计费,明显更贵 | 最后手段 |
规则:
- 默认用
--preset auto(不写--preset即是 auto)。auto 只走 $0.03/张 的-vip路线,顺序为 apiyi → laozhang,同价互为备份。 - 不要主动用贵路线。 贵路线 preset 标记为
tier=last_resort,只有两种入口: 显式写 preset 名,或 auto 加--allow-expensive。CLI 命中时会打印[!] LAST-RESORT ROUTE警告。 - 只有当所有 $0.03 路线都失败(配额不足、分组饱和、5xx、超时)时才考虑
--allow-expensive;用了必须在交付说明里写明「本次走了按 token 计费的官转路线」。 - 参数写错(HTTP 400)不换路线重试——所有路线都会同样失败,直接改参数。
当前实测状态(2026-10-26)
- apiyi
apiyi_gpt_image_2_5_vip(gpt-image-2.5-vip)实测可用: 1280×720 + low 生成 29.9 s,2048×1152 + low 编辑 29.8 s,1280×1280 + url 响应 39.6 s,返回尺寸与请求逐像素一致。 - 同一 key 当天早些时候曾报
403 配额不足 / insufficient_quota,随后恢复——说明该错误 是账号配额波动。auto 链遇到 403 会自动落到下一条同价路线,无需改配置。 - laozhang 网关在 02:11 可用(27 s 出图),02:20 起对本机 TLS 直接断连
(
SSL: UNEXPECTED_EOF_WHILE_READING,openssl 握手同样被 reset)。这是 laozhang 侧 的可用性问题,不是技能代码问题;laozhang 的-vippreset 仍保留为同价备份。 - 环境变量
IMG_GEN_GPT_IMAGE_2_OFFICIAL_PRESET现为apiyi_gpt_image_2_5_vip($0.03/张)。
技能文件
所有脚本为技能自包含:
scripts/
├── img_gen.py ← 统一 CLI(check / generate / edit),--preset auto 链路
├── check_env.py ← 环境变量检测(缺变量时给出具体设置指引)
├── lib/
│ ├── presets.py ← preset 目录 + tier/计费/quality/size 校验 + auto 链
│ ├── openai_images.py ← OpenAI Images 协议(360 s 超时、url/b64 双兜底)
│ └── gemini_gen.py ← Gemini generateContent 协议
└── presets/
├── gpt/ (20 个) ← 每个 preset 一个 Python 封装
└── banana/ (3 个)
What ships with it
33 files 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.
- .skillhub/metadata.json 178 B
- references/presets.md 6.5 KB
- references/protocols.md 4.3 KB
- references/size-mapping.md 1.8 KB
- scripts/check_env.py 2.2 KB runs code
- scripts/img_gen.py 15 KB runs code
- scripts/lib/__init__.py 117 B runs code
- scripts/lib/gemini_gen.py 4.2 KB runs code
- scripts/lib/openai_images.py 8.4 KB runs code
- scripts/lib/presets.py 21 KB runs code
- scripts/presets/banana/apiyi_nano_banana_2.py 787 B runs code
- scripts/presets/banana/google_nano_banana.py 783 B runs code
- scripts/presets/banana/laozhang_nano_banana_pro.py 811 B runs code
- scripts/presets/gpt/apiyi_gpt_image_2_5_flare_vip.py 896 B runs code
- scripts/presets/gpt/apiyi_gpt_image_2_5_flare.py 897 B runs code
- scripts/presets/gpt/apiyi_gpt_image_2_5_sunburst_vip.py 900 B runs code
- scripts/presets/gpt/apiyi_gpt_image_2_5_sunburst.py 899 B runs code
- scripts/presets/gpt/apiyi_gpt_image_2_5_vip.py 893 B runs code
- scripts/presets/gpt/apiyi_gpt_image_2_vip.py 849 B runs code
- scripts/presets/gpt/apiyi_gpt_image_2.py 815 B runs code
- scripts/presets/gpt/copperai_gpt_image_2.py 772 B runs code
- scripts/presets/gpt/laozhang_gpt_image_2_5_flare_vip.py 917 B runs code
- scripts/presets/gpt/laozhang_gpt_image_2_5_flare.py 884 B runs code
- scripts/presets/gpt/laozhang_gpt_image_2_5_sunburst_vip.py 921 B runs code
- scripts/presets/gpt/laozhang_gpt_image_2_5_sunburst.py 902 B runs code
- scripts/presets/gpt/laozhang_gpt_image_2_default.py 873 B runs code
- scripts/presets/gpt/laozhang_gpt_image_2_enterprise.py 848 B runs code
- scripts/presets/gpt/laozhang_gpt_image_2_sora_official.py 863 B runs code
- scripts/presets/gpt/laozhang_gpt_image_2_vip.py 862 B runs code
- scripts/presets/gpt/openai_gpt_image_2.py 838 B runs code
- scripts/presets/gpt/right_codes_gpt_image_2_vip.py 824 B runs code
- scripts/presets/gpt/right_codes_gpt_image_2.py 784 B runs code
- scripts/presets/gpt/right_codes_nano_with_image_api_images.py 861 B runs code
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.
- 12d ago Changed · +121 lines · +14 tokens per session 884ba81c9d03
- 2mo ago First seen · 137 lines · 34 tokens per session scan A 9d1bbab62031
img-gen is a skill published in the GitHub repository zztdandan/image-generate-mcp-remote (0 stars, last pushed 12d ago), licensed MIT. It adds 48 tokens to every session and 4,118 once invoked, about $0.0002 per session on Opus 5.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.
img-gen compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| img-genzztdandan/image-generate-mcp-remote | Skill | 0 | 12d ago | MIT | A | 48 | Claude Code, Codex |
| imagegenopenai/codex | Skill | 134k | today | Apache-2.0 | A | 113 | Codex |
| local-ai-agentsmicrosoft/ai-agents-for-beginners | Skill | 79k | yesterday | MIT | A | 200 | Claude Code, Codex |
| playwright-climicrosoft/playwright | Skill | 100k | yesterday | Apache-2.0 | A | 19 | Claude Code |
| browser-automationopenclaw/openclaw | Skill | 394k | today | MIT | A | 36 | Claude Code |
| systematic-debuggingobra/superpowers | Skill | 315k | 5d ago | MIT | A | 21 | Claude Code |
| next-cache-components-adoptionvercel/next.js | Skill | 143k | today | MIT | A | 95 | Claude Code |