codex-image-gen

codex-image-gen is a skill for Claude Code, Codex from zjp1997720/zhijian-skills. It costs 126 tokens per session (1,375 once invoked), scanned A, original, MIT.

A local image-generation skill that uses an already authenticated Codex CLI account to create or edit PNG images.

In plain words
What is it for?
Creating illustrations, covers, posters, and other images from prompts, editing reference images, and saving the results locally.
Why use it?
It provides a reusable command-line way to generate visual assets without private dependencies, provided the required login and network access are available.

Skill for Claude CodeCodex

Written for Claude Code and Codex: disable-model-invocation in frontmatter, but also agents/openai.yaml present. Also seen: reads .claude/ paths; mentions Claude Code; mentions Codex.

Good fit Creating illustrations, covers, posters, and other images from prompts, editing reference images, and saving the results locally.

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

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 codex-image-gen

README.md
[![agentmods](https://agentmods.dev/badge/skills/zjp1997720/zhijian-skills/codex-image-gen/github.svg)](https://agentmods.dev/skills/zjp1997720/zhijian-skills/codex-image-gen)
Your own site
<a href="https://agentmods.dev/skills/zjp1997720/zhijian-skills/codex-image-gen"><img src="https://agentmods.dev/badge/skills/zjp1997720/zhijian-skills/codex-image-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 codex-image-gen

Your own site · 80×15
<a href="https://agentmods.dev/skills/zjp1997720/zhijian-skills/codex-image-gen"><img src="https://agentmods.dev/badge/skills/zjp1997720/zhijian-skills/codex-image-gen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 126 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,375 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 39
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 40
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
How audits are shown
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.00126 $0.01375
Opus 5 $0.00063 $0.00687
Sonnet 5 $0.00025 $0.00275
Haiku 4.5 $0.00013 $0.00137

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

Security

Grade A, and why

codex-image-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.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/codex_image.py, tests/test_codex_image.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/codex-image-gen/SKILL.md · 174 lines

How it starts

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

Codex Image Gen

目标:把“本机已登录的 Codex OAuth 生图能力”封装成一个零私有依赖的跨 Agent Skill。

它不依赖任何私有模块;任何能执行 python3 的 Agent,只要宿主机已经装好 Codex CLI 并执行过 codex auth login,就能直接调用 scripts/codex_image.py 生图或做图像编辑。

前置条件

必须同时满足:

  1. 本机已安装 Codex CLI
  2. 已执行过 codex auth login
  3. ~/.codex/auth.json 存在且可读
  4. 机器可访问:
    • https://chatgpt.com/backend-api/codex/responses
    • https://auth.openai.com/oauth/token

如果 ~/.codex/auth.json 不存在,不要猜测或绕过。直接提示用户先运行:

codex auth login

这个 skill 能做什么

  • 文生图
  • 配图 / 插图 / 封面图生成
  • image-to-image / 编辑
  • 把本地参考图编码成 data:image/...;base64,... 后发给 Codex Responses API
  • 自动检查 access token 是否过期
  • access token 过期时自动用 refresh token 刷新,并写回 ~/.codex/auth.json
  • 从 SSE 流里提取图片 base64,保存为本地 PNG

核心脚本

相对路径:scripts/codex_image.py

典型调用方式:

python3 scripts/codex_image.py --prompt "极简科技感课程封面,无文字" --aspect landscape

如果 Agent 不是在 skill 根目录执行,就显式传 skill 相对路径或绝对路径,例如:

python3 .claude/skills/codex-image-gen/scripts/codex_image.py \
  --prompt "商业文章封面插图,克制,干净,无文字" \
  --aspect landscape \
  --quality high \
  --out-dir ./outputs

CLI 参数

必填

二选一:

  • --prompt "..."
  • --prompt-file /path/to/prompt.txt

可选

  • --quality low|medium|high:默认 medium
  • --aspect landscape|square|portrait:默认 square
  • --out-dir /path/to/output-dir:默认当前目录
  • --image /path/to/image.png:主编辑图 / 输入图
  • --reference-image /path/to/ref.png:参考图,可重复传入
  • --model gpt-image-2:默认 gpt-image-2

推荐工作方式

1) 最短路径:文生图

python3 scripts/codex_image.py \
  --prompt "蓝白配色的 AI 课程封面插图,几何感,极简,无文字" \
  --aspect landscape \
  --quality high \
  --out-dir ./outputs

2) 用 prompt 文件

python3 scripts/codex_image.py \
  --prompt-file ./prompt.txt \
  --aspect portrait \
  --out-dir ./outputs

3) image-to-image / 编辑

python3 scripts/codex_image.py \
  --prompt "把这张草图做成干净的白板商业插图风格" \
  --image ./draft.png \
  --reference-image ./style-ref.png \
  --aspect landscape \
  --out-dir ./outputs

Agent 执行规则

Read the full file on GitHub · 174 lines

Files

What ships with it

5 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.

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. 12d ago First seen · 174 lines · 126 tokens per session scan A d686cfd083b6

Subscribe to this mod's changes

codex-image-gen is a skill published in the GitHub repository zjp1997720/zhijian-skills (680 stars, last pushed 6d ago), licensed MIT. It adds 126 tokens to every session and 1,375 once invoked, about $0.0006 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-30.

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