Browse documentation

Codex Images

Generate several images at once with Codex, free with a ChatGPT plan and no API key.

codex-images generates a whole batch of images in one go through Codex and its built-in image generator. It is free with your ChatGPT subscription and needs no API key. Use it for illustrations, generated B-roll, thumbnail variants, icon sets, or images built from your own photos.

Images inside a short are already generated by the editor, in your style. This skill is for everything else.

Invoke

Terminal
/codex-images 6 illustrations of a rocket, a desk at night, a phone...
/codex-images 3 variants of this cover idea
/codex-images a set of icons, from my photos in ~/Pictures/ref

Under the hood it runs one Codex job per image, in parallel:

Terminal
node <skill>/scripts/image_gen --prompts prompts.json --out "$PWD/images/catalog" --concurrency 3
node <skill>/scripts/image_gen --name cover --prompt "..." --count 3 --out "$PWD/images/cover"

What it does

  1. Writes one named prompt per image. Never several images in one prompt. Each prompt states the format (vertical 9:16, landscape 3:2, square), the subject, the style, the colors and the background.
  2. Runs a dry run to list the jobs, then generates them in parallel (about 45 seconds per image). Big batches run in the background and you are told how long they take.
  3. Collects the files into one output folder with clean names (001-desk-night.png, ...) and a manifest.json that links each image to its prompt, plus a log per job.
  4. Checks the result. The number of images must match the number of prompts, it opens a few to look at them, and gives you the folder. A failed job is fixed in its prompt and rerun alone.

Good to know:

  • No text inside the image unless you ask: generated text comes out wrong. Titles and numbers belong in the video.
  • Your own photos (your face, your product, a style to copy) are passed to Codex as references.
  • Variants of one prompt: ask for a count and get several takes of the same idea.

What you need

  • Codex installed and logged in with your ChatGPT account: npm i -g @openai/codex, then codex login (check with codex login status).
  • Node 20 or newer.

Next