CommunityImagegithub.com

codex-imagens

Generate or edit raster images (one or a whole batch in parallel) through the native image tool of the Codex CLI, using the user's ChatGPT login instead of an API key. Supports reference images, aspect ratios, retries and stops cleanly when the plan's usage limit is reached. Use when asked to create images "with Codex", "with my ChatGPT plan", "without API", to generate several images at once, or to edit an image from references.

What is codex-imagens?

codex-imagens is a Claude Code agent skill that generate or edit raster images (one or a whole batch in parallel) through the native image tool of the Codex CLI, using the user's ChatGPT login instead of an API key. Supports reference images, aspect ratios, retries and stops cleanly when the plan's usage limit is reached. Use when asked to create images "with Codex", "with my ChatGPT plan", "without API", to generate several images at once, or to edit an image from references.

Works with✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/pivadesigner/codex-imagens/tree/HEAD/skills/codex-imagens

Installed? Explore more Image skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Images through Codex (ChatGPT login, no API key)

Write a complete visual brief for each image and call the bundled script. The script runs one codex exec per image, in parallel, and saves a PNG at the exact path you choose.

One image

python "${CLAUDE_SKILL_DIR}/scripts/generate.py" "Matte blue and cream 3D metronome, studio light, plain background, no text." -o output/metronome.png --aspect 1:1

Many images at once

Write a jobs.json and run it with --batch:

[
  {"id": "hero",  "out": "output/hero.png",  "aspect": "16:9", "prompt": "Wide shot of a lighthouse at dawn, soft fog, cinematic."},
  {"id": "card",  "out": "output/card.png",  "aspect": "4:5",  "prompt": "Same lighthouse as the reference, flat illustration, warm palette.", "refs": ["refs/lighthouse.jpg"]},
  {"id": "icon",  "out": "output/icon.png",  "aspect": "1:1",  "quality": "medium", "prompt": "Minimal lighthouse icon, single color, white background."}
]
python "${CLAUDE_SKILL_DIR}/scripts/generate.py" --batch jobs.json --parallel 4
  • Only prompt and out are required. Relative paths are resolved against the folder of jobs.json.
  • aspect: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9 (the image is center-cropped to the exact ratio).
  • refs: reference images. Say in the prompt what each one is for ("keep the face of image 1", "use the layout of image 2").
  • Existing files are skipped, so you can rerun a batch after a failure. --overwrite regenerates and keeps the old copy in _old/.
  • --only id1,id2 reruns just those jobs. Each run appends a log to jobs.log.jsonl.

Rules

  • Wait for the script to finish, then open each result once and report the paths. Revise only when the user asks.
  • Exit code 2 = the ChatGPT plan's usage limit was reached and the batch stopped: tell the user and stop. Do not switch to an API key or another provider on your own.
  • Exit code 3 = setup problem (Codex CLI missing or not logged in). The user fixes it with codex login ("Sign in with ChatGPT"). Never read, copy or edit authentication files.
  • "Blocked by moderation": rephrase the prompt (ambiguous words, real people, brands) and rerun only that job with --only.
  • Small text inside images can come out misspelled: keep on-image text short and check it.
  • Images in the same batch tend to repeat faces unless each prompt describes a different person.
  • Requires Python 3.9+, the Codex CLI (npm i -g @openai/codex) logged in with ChatGPT, and Pillow (pip install pillow) for exact cropping and non-PNG/JPEG references.

Related Skills