Codex Can Generate Images. I Wanted a Contact Sheet.

Generating one image with Codex is fine. Generating five candidates, comparing them, finding the prompt that produced the good one, attaching a reference, re-rolling, and saving the winner is where the workflow starts shedding parts.

The image tool runs inside an agent turn. There is no standalone imagegen command to build a normal shell loop around. A headless codex exec works, but a folder full of UUID-shaped files is not much of an art direction interface (unless confusion is the desired aesthetic).

That gap became imgen: one terminal application for the whole comparison loop.

Prompt, preview, re-roll, save

On Apple Silicon macOS, install the prebuilt binary from my tap:

brew install AndrewDongminYoo/tap/imgen

It uses your existing authenticated Codex CLI, and Codex's image-generation feature must be enabled. Confirm the prerequisite before launching it:

codex features list | grep image_generation
# image_generation stable true

Launch it with:

imgen

Write a prompt, generate a candidate, move through the gallery, and press r to run the selected prompt again. Press s to save the selected image into the current directory or c to copy the image.

The application also reads Codex's existing generated-image directory, so previous output appears in the same gallery. Images created by imgen get an exact prompt record in ~/.config/imgen/prompts.json; older images remain visible even when their historical prompt cannot be recovered reliably.

That last limitation is intentional. I sampled the surviving Codex session data and found several different tool-call shapes with no dependable session index mapping. Rather than attach a plausible-but-wrong prompt to an image, the gallery records forward and stays honest about the past.

Let Codex improve the prompt before spending the image turn

A rough prompt is often useful, but not ready:

a fox on a bicycle

Pressing tab asks Codex to fill in composition, framing, lighting, colour, medium, mood, and aspect ratio while preserving the subject. The rewrite replaces the text in the editor. It does not immediately generate an image.

You can read it, change it, or reject it before paying for the slower image turn. Quietly converting a rewrite into a generation would be convenient right until it misunderstood the assignment (the most expensive kind of autocomplete).

Reference images should be visible before they travel

Paste an image from the clipboard and imgen attaches it to the next prompt. The references appear as thumbnails above the status line, so the input is visible instead of represented by a mysterious counter.

Terminal paste behavior is messy: some terminals paste a file path, while others expose only image data. The tool accepts both shapes and provides v as an explicit clipboard-read fallback.

The preview tells the truth about the terminal

Warp can display true pixels through the kitty graphics protocol. Other terminals may support sixel. A terminal with neither gets a 24-bit half-block preview.

The header says which protocol was detected. The block fallback is coarse, but it is enough to compare candidates and choose one. The gallery, prompt history, generation, and saving still work.

There is no fake progress percentage either. A generation is a full Codex turn and the child process does not publish completion percentages. imgen shows elapsed time and the latest output line instead.

Keep the creative loop in one place

imgen does not generate images by itself, reduce Codex latency, or remove usage costs. It gives the existing image tool a workflow designed around comparison rather than a single result.

imgen is for the workflow that currently reads “generate, find the file, open it, rename it, lose the prompt, repeat.” The model still makes the picture. The terminal finally keeps the contact sheet.