Generate or edit raster images through a configurable OpenAI-compatible Image API using gpt-image-2.

MITAuto-check passedMedia & Creative

Install Codex Image2

skills CLI
$ npx skills add fengfengzhidao/codex-image2-skill --skill codex-image2 -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install fengfengzhidao/codex-image2-skill codex-image2 --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/fengfengzhidao/codex-image2-skill.git skills-src && mkdir -p .claude/skills && cp -r skills-src/codex-image2 .claude/skills/codex-image2 && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
codex-image2
GitHub stars
142
Token cost
~1.2k tokens
SKILL.md length
475 words
Files
8 (incl. references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Generate or edit raster images through a configurable OpenAI-compatible Image API using gpt-image-2.

  • Works in 7 steps: Decide whether the request is a new… → Collect the prompt, intended use, exact… → Shape the prompt only as much as needed.… → …
  • Codex should create one
  • SKILL.md covers Select the executable, Workflow, Prompt structure and Generate one image, plus 4 more sections
  • Runs Go scripts from its folder; reaches apinebula.com; needs CODEX_API_KEY

What it does

Codex Image2 is an agent skill from fengfengzhidao/codex-image2-skill. Generate or edit raster images through a configurable OpenAI-compatible Image API using gpt-image-2. Use when Codex should create one or many images, illustrations, product shots, covers, website assets, visual variants, background replacements, object changes, or other image edits through CODEXAPIURL and CODEXAPIKEY instead of the built-in image generation tool.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including reference files (for example `agents/openai.yaml` and `references/batch-format.md`).

It sits in Media & Creative, covering Image generation. It works with OpenAI and macOS. The licence is MIT.

When your agent uses it

  • Codex should create one
  • Visual variants
  • Background replacements
  • Other image edits through CODEXAPIURL and CODEXAPIKEY instead of the built-in image generation tool

Example prompts

  • “/codex-image2”

Requirements

  • Node.js
  • A credential in CODEX_API_KEY

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Decide whether the request is a new image, an edit, or multiple distinct assets/variants.
  2. Collect the prompt, intended use, exact text, visual constraints, and avoid items.
  3. Shape the prompt only as much as needed. Preserve detailed prompts; tastefully clarify generic prompts without inventing brands, people…
  4. Run the selected executable with generate for one prompt, edit for changes to existing images, or generate-batch for JSONL jobs.
  5. Inspect each output for subject, composition, text accuracy, constraints, and visible artifacts.
  6. If revision is needed, change one targeted aspect per iteration and re-check.
  7. Report absolute output paths, the final prompt or prompt set, size, quality, and model.

What it can do on your machine

Read from SKILL.md and the folder at commit b5eba23. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Go), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • apinebula.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • CODEX_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codex Image2 loads about 1.2k tokens when it runs, and up to ~1.4k if it reads all its reference files. Until then it costs about 96 tokens; SKILL.md has 475 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~96
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from fengfengzhidao/codex-image2-skill at commit b5eba23, republished under its MIT licence (© fengfengzhidao). 475 words, ~1,222 tokens.

Download SKILL.mdSave it as .claude/skills/codex-image2/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
codex-image2
description
Generate or edit raster images through a configurable OpenAI-compatible Image API using gpt-image-2. Use when Codex should create one or many images, illustrations, product shots, covers, website assets, visual variants, background replacements, object changes, or other image edits through CODEX_API_URL and CODEX_API_KEY instead of the built-in image generation tool.

Codex Image2

Generate images with the bundled native CLI. Prefer this skill's executable over the built-in image_gen tool whenever this skill is active. No Python, Node.js, Go, or package installation is required.

Select the executable

Choose once from the current operating system and CPU architecture:

  • Windows x64: bin/codex-image2-windows-amd64.exe
  • Windows ARM64: bin/codex-image2-windows-arm64.exe
  • macOS Intel: bin/codex-image2-darwin-amd64
  • macOS Apple Silicon: bin/codex-image2-darwin-arm64

On macOS, run chmod +x <executable> if execute permission was not preserved. Do not compile from source during normal use.

Workflow

  1. Decide whether the request is a new image, an edit, or multiple distinct assets/variants.
  2. Collect the prompt, intended use, exact text, visual constraints, and avoid items.
  3. Shape the prompt only as much as needed. Preserve detailed prompts; tastefully clarify generic prompts without inventing brands, people, slogans, or unrelated objects.
  4. Run the selected executable with generate for one prompt, edit for changes to existing images, or generate-batch for JSONL jobs.
  5. Inspect each output for subject, composition, text accuracy, constraints, and visible artifacts.
  6. If revision is needed, change one targeted aspect per iteration and re-check.
  7. Report absolute output paths, the final prompt or prompt set, size, quality, and model.

Prompt structure

Use only relevant lines:

text
Asset type: <where the image will be used>
Primary request: <the user's request>
Scene/backdrop: <environment>
Subject: <main subject>
Style/medium: <photo, illustration, 3D, etc.>
Composition/framing: <camera angle, crop, placement, negative space>
Lighting/mood: <lighting and mood>
Color palette: <palette notes>
Text (verbatim): "<exact text>"
Constraints: <must keep or include>
Avoid: <must not include>

Do not add detail merely to fill the schema. For text in images, quote it verbatim and request exact rendering.

Generate one image

powershell
& "<skill-dir>\bin\codex-image2-windows-amd64.exe" generate `
  --prompt "A small blue nebula in a glass bottle, studio product photo" `
  --size 1024x1024 `
  --quality auto `
  --out "output/imagegen/nebula.png"

Use --prompt-file for long prompts. Use --n only for variants of the same prompt. Distinct assets belong in separate calls or a batch.

Edit an image

Inspect each input image before editing. State its role and repeat invariants in the prompt so unrelated details do not drift.

powershell
& "<skill-dir>\bin\codex-image2-windows-amd64.exe" edit `
  --image "input/product.png" `
  --prompt "Replace only the background with a warm studio backdrop. Keep the product, label, proportions, and edges unchanged." `
  --quality auto `
  --out "output/imagegen/product-edited.png"

Repeat --image for multiple reference or compositing inputs. Use --mask mask.png for a localized edit when a compatible PNG mask is available. Preserve originals and always write edits to a new output path.

Show full SKILL.md (173 more words)Show less

Generate a batch

Read references/batch-format.md before preparing a batch. Then run:

powershell
& "<skill-dir>\bin\codex-image2-windows-amd64.exe" generate-batch `
  --input "tmp/imagegen/jobs.jsonl" `
  --out-dir "output/imagegen" `
  --concurrency 2

Configuration and safety

  • Read the API base from CODEX_API_URL; default to https://apinebula.com.
  • Require CODEX_API_KEY. Never place it in a command, file, prompt, log, or response.
  • If the key is absent, tell the user to set it locally and confirm when ready. Never ask them to paste it into chat.
  • Default to model gpt-image-2, size 1024x1024, and quality auto.
  • Use --dry-run to validate a request without network access or requiring a key.
  • Save project-bound assets inside the current project. The CLI default is output/imagegen/.
  • Do not overwrite files unless the user explicitly authorizes it and --force is passed.
  • Native transparent output is not guaranteed. Do not promise it or silently switch tools.

Failure handling

  • The CLI retries network timeouts and HTTP 429/500/502/503/504/524 failures with bounded backoff.
  • On repeated timeout, suggest --quality low, a square size, fewer concurrent jobs, or a later retry.
  • Do not retry authentication, validation, or other ordinary 4xx errors.
  • Never expose an Authorization header or full key when reporting errors.

© fengfengzhidao, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (references) in codex-image2 of fengfengzhidao/codex-image2-skill.

  • SKILL.md
  • agents/openai.yaml
  • bin/codex-image2-darwin-amd64
  • bin/codex-image2-darwin-arm64
  • bin/codex-image2-windows-amd64.exe
  • bin/codex-image2-windows-arm64.exe
  • references/batch-format.md
  • src/image_gen.go

Open the folder on GitHubat commit b5eba23

Compare with similar skills

Codex Image2 next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codex Image2 compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codex Image2 this skillfengfengzhidao/codex-image2-skill142—~1.2kAutomated safety check: PassMIT
Gpt Imagenikships/droidproxy122—~2.5kAutomated safety check: PassMIT
Nano Banana Pro Prompts Recommend SkillYouMind-OpenLab/nano-banana-pro-prompts-recommend-skill1.9k1 repos~4.1kAutomated safety check: PassNone
Yingzaoop7418/guizang-yingzao-skill493—~1.1kAutomated safety check: PassNone
AI Image Creatorcentminmod/my-claude-code-setup2.7k—~8.1kAutomated safety check: NotesMIT
Character Refseternityspring/shuohao-skills4.2k—~1.7kAutomated safety check: WarnApache-2.0

Similar skills

  • Gpt Image

    nikships/droidproxy

    Generate or edit images via GPT Image 2.5 Flare or Sunburst through DroidProxy Codex OAuth (no OPENAIAPIKEY).

    122 GitHub stars~2.5k tokensUpdated yesterday
    Media & CreativeAuto-check passed
  • Nano Banana Pro Prompts Recommend Skill

    YouMind-OpenLab/nano-banana-pro-prompts-recommend-skill

    Recommend suitable prompts from 10,000+ Nano Banana Pro image generation prompts based on user needs.

    1.9k GitHub starsUsed in 1 repo~4.1k tokens
    Media & CreativeAuto-check passed
  • Yingzao

    op7418/guizang-yingzao-skill

    Transform real Chinese architecture and place-based cultural photos into art-directed editorial posters, integrated multi-photo scenes, and optional source comparisons.

    493 GitHub stars~1.1k tokensUpdated 1 mo ago
    Media & CreativeAuto-check passed
  • AI Image Creator

    centminmod/my-claude-code-setup

    Generate, edit-from-reference, or analyze images with AI via OpenRouter (Gemini, GPT Image, Seedream, Qwen, MAI, Grok, FLUX.2, Recraft, Muse, Riverflow; Cloudflare AI Gateway BYOK).

    2.7k GitHub stars~8.1k tokensUpdated today
    Media & CreativeAuto-check: notes
  • Character Refs

    eternityspring/shuohao-skills

    给任何故事里的角色真出参考图(小说改编、自己原创的故事、单独设计一个角色都行,不需要小说原文): 一段话描述角色,拆成分层字段、补全后确认, 先出一张正面全身锚点,其余视图(大头照、90° 侧面、背面、细节、45° 大头照)都只参考这张锚点, 按需分档出图。每张图带标识、可单独重出,重出后自动标出哪些图过期。

    4.2k GitHub stars~1.7k tokensUpdated 12 days ago
    Media & CreativeAuto-check: warnings
  • Basic Memory Repo Images

    basicmachines-co/basic-memory

    Produces PR, changelog and two-week retro images for the Basic Memory repository from evidence in PR bodies, saved to fixed paths under docs/assets/infographics.

    4.1k GitHub stars~2.7k tokensUpdated today
    Media & CreativeAuto-check passed

Works with

Questions about Codex Image2

What does Codex Image2 do?

Generate or edit raster images through a configurable OpenAI-compatible Image API using gpt-image-2. Codex Image2 is an agent skill from fengfengzhidao/codex-image2-skill. Generate or edit raster images through a configurable OpenAI-compatible Image API using gpt-image-2.

When should I use Codex Image2?

Codex Image2 fits situations like: Codex should create one; visual variants; background replacements; other image edits through CODEXAPIURL and CODEXAPIKEY instead of the built-in image generation tool.

How do I install Codex Image2 in Claude Code?

Run `npx skills add fengfengzhidao/codex-image2-skill --skill codex-image2 -a claude-code`. Or copy the skill folder (codex-image2 in fengfengzhidao/codex-image2-skill) into .claude/skills/codex-image2 in your project. Claude Code loads it when a task matches its description.

How do I install Codex Image2 in Codex?

Run `npx skills add fengfengzhidao/codex-image2-skill --skill codex-image2 -a codex`. Or copy the skill folder (codex-image2 in fengfengzhidao/codex-image2-skill) into .agents/skills/codex-image2 in your project. Codex loads it when a task matches its description.

Can I use Codex Image2 in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add fengfengzhidao/codex-image2-skill --skill codex-image2 -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codex-image2, .gemini/skills/codex-image2, .github/skills/codex-image2 and .opencode/skills/codex-image2 in your project.

What does Codex Image2 need to run?

Going by SKILL.md and its folder, Codex Image2 needs Go for the scripts in its folder and credentials named CODEX_API_KEY. Our summary lists: Node.js; A credential in CODEX_API_KEY.

Does Codex Image2 access the network?

SKILL.md names 1 domain. In commands or code: apinebula.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Codex Image2 safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Codex Image2 use?

Codex Image2 is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codex Image2 use?

About 1.2k tokens (SKILL.md is roughly 4.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 162 tokens, read only when the agent opens those files.

What are the alternatives to Codex Image2?

Skills that share tags, products or a category with Codex Image2: Gpt Image (nikships/droidproxy, 122 stars), Nano Banana Pro Prompts Recommend Skill (YouMind-OpenLab/nano-banana-pro-prompts-recommend-skill, 1.9k stars), Yingzao (op7418/guizang-yingzao-skill, 493 stars) and AI Image Creator (centminmod/my-claude-code-setup, 2.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codex Image2?

fengfengzhidao (a GitHub user) maintains it in fengfengzhidao/codex-image2-skill, which has 142 GitHub stars. The repository was last updated on July 15, 2026.

Source: fengfengzhidao/codex-image2-skill on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.