codex-image

codex-image is a skill for Claude Code, Codex from jh941213/codex-lattice. It costs 259 tokens per session (2,019 once invoked), scanned A, original, MIT.

An image-generation skill for the OpenAI Codex command-line tool. It can create one image or up to five images at the same time using Codex’s built-in image tool.

In plain words
What is it for?
Creating one or several PNG images from text prompts, saving them into a chosen workspace folder, and producing image variations in batches.
Why use it?
It avoids writing separate API scripts or managing a separate API key when Codex is already signed in. Parallel generation can reduce the time needed to produce several images.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads ~/.codex paths; runs codex exec; mentions Codex.

Good fit Creating one or several PNG images from text prompts, saving them into a chosen workspace folder, and producing image variations in batches.

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/jh941213/codex-lattice/codex-image"><img src="https://agentmods.dev/badge/skills/jh941213/codex-lattice/codex-image.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 259 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,019 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.00259 $0.02019
Opus 5.5 $0.00104 $0.00808
Sonnet 5.5 $0.00052 $0.00404
Haiku 4.5 $0.00026 $0.00202

Measured 1mo ago against content hash c70a75c5bddc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

codex-image 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 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/codex_imagegen_batch.sh), 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.

Makes network callslowCapability

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

- **인증 단순화**: codex 가 ChatGPT OAuth 로 이미 로그인돼 있으면 별도 OPENAI_API_KEY · Python SDK · curl 스크립트가 모두 불필요. 단순 자연어 프롬프트 한 줄로 끝.
skills/codex-image/SKILL.md · 133 lines

How it starts

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

Codex Image Generation (병렬)

OpenAI Codex CLI 의 내장 image_generation 툴을 활용해 최대 5장까지 이미지를 동시에 생성하는 스킬. (codex-cli 0.128 / 2026-05 실측 기준)

왜 이 스킬인가

  • 병렬 처리: codex exec 를 백그라운드 N개로 띄우면 OpenAI 서버가 N개를 동시 처리. 5장 동시 시 직렬 대비 약 2.85배 빠름 (실측: 직렬 추정 450초 → 병렬 158초).
  • 인증 단순화: codex 가 ChatGPT OAuth 로 이미 로그인돼 있으면 별도 OPENAI_API_KEY · Python SDK · curl 스크립트가 모두 불필요. 단순 자연어 프롬프트 한 줄로 끝.
  • 워크스페이스 통합: 결과 PNG 가 지정 디렉토리에 자동 저장 (codex 가 ~/.codex/generated_images/<session>/ 에서 작업 폴더로 복사).

사전 점검

codex --version           # 0.128+ 권장
codex login status        # "Logged in using ChatGPT" 확인
codex features list | grep image_generation   # stable / true 인지 확인

미로그인 시 codex login 실행을 사용자에게 요청. 이 스킬 호출 전에 한 번만.

핵심 패턴 1 — 단일 이미지 (베이스라인)

codex exec \
  --sandbox workspace-write \
  --skip-git-repo-check \
  --cd <work_dir> \
  -o /tmp/codex-img-single.md \
  "이미지 생성 도구로 '<프롬프트>' 이미지를 생성하고 ./<출력>.png 로 저장. 파일 경로만 한 줄로 보고."
  • 평균 소요: 약 80~110초/장 (모델 응답 분산 큼)
  • 기본 해상도: 1254×1254 또는 1536×1024 — codex 가 프롬프트에 따라 자동 결정
  • 해상도 강제는 어려움. 정확한 해상도가 필요하면 gpt-image2 사용

핵심 패턴 2 — N장 병렬 (N ≤ 5)

Bash run_in_background: true 로 동일 명령을 N개 띄운다. 핵심은 출력 파일명을 다르게 하는 것.

# 한 메시지 안에서 5개 Bash 도구 호출을 동시에 실행
codex exec --sandbox workspace-write --skip-git-repo-check --cd <work_dir> \
  -o /tmp/codex-img-1.md \
  "이미지 생성 도구로 '<프롬프트1>' 이미지를 생성하고 ./<output1>.png 로 저장. 경로만 한 줄로 보고."
# ... 같은 패턴으로 2~5번째도 run_in_background: true 로 띄움

각 작업은 독립 codex 세션이므로 진정한 병렬. 완료 알림은 백그라운드 작업 통지로 자동 수신 — sleep 폴링 금지.

실측 (2026-05 기준)

동시 작업 수 가장 느린 작업 wall-clock 직렬 대비
1장 89.7초 1.00×
3장 110.9초 2.43×
5장 158.5초 2.84×

5장이 3장보다 가장 느린 작업이 ~47초 늘어남. 큐잉 흔적이지만 명확한 직렬화는 없음.

핵심 패턴 3 — N > 5 배치 처리

ChatGPT 플랜의 동시 요청 한도와 안정적 응답 시간을 고려해 5개씩 묶어 순차 배치를 권장.

# 12장 = 5 + 5 + 2 의 3배치
# 배치1: 5개 동시 → 완료 대기
# 배치2: 다음 5개 동시 → 완료 대기
# 배치3: 마지막 2개 동시

배치 헬퍼 스크립트는 scripts/codex_imagegen_batch.sh 참고.

헬퍼 스크립트

Read the full file on GitHub · 133 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. 1mo ago First seen · 133 lines · 259 tokens per session scan A c70a75c5bddc

Subscribe to this mod's changes

codex-image is a skill published in the GitHub repository jh941213/codex-lattice (19 stars, last pushed 5mo ago), licensed MIT. It adds 259 tokens to every session and 2,019 once invoked, about $0.0010 per session on Opus 5.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.

Related

Other skills, from other repositories

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Optimize the meaningful UI available immediately from a Next.js route on an initial load (hard navigation) or named client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route and entry point at a time; the shipped test then guards…

vercel/next.js · 123 tokens