gpt-image-2
Generate images via your ChatGPT subscription using text-to-image, image editing, and style transfer.
- Requires a local
codexCLI login and active ChatGPT Plus or Pro subscription with image-generation entitlement; no separate OpenAI API keys or per-image billing needed. - Supports text-to-image generation, image-to-image editing, and multi-reference composition via repeatable
--refflags. - Invoked through a single bash script that snapshots the Codex session directory, runs
codex execwith image generation enabled, and extracts the base64 PNG payload from the session rollout. - Pass user prompts through raw without rewriting unless requested; deliver the output image file directly rather than stopping at a path reference.
πͺ GPT Image 2 β Image Generation via Your ChatGPT Subscription
Generate images with GPT Image 2 (ChatGPT Images 2.0) inside your agent, using your existing ChatGPT Plus or Pro subscription β no separate OpenAI access, no Fal or Replicate tokens, no per-image billing.
Text-to-image, image-to-image editing, style transfer, and multi-reference composition. Runs entirely through the local codex CLI you're already logged into.
Heads up β this skill requires a ChatGPT Plus or Pro subscription plus the Codex CLI installed locally. If you have neither, you can use GPT Image 2 in the browser via RunComfy instead β hosted, no ChatGPT subscription or local install needed (RunComfy account required):
- Text-to-image: runcomfy.com/models/openai/gpt-image-2/text-to-image
- Image edit (i2i): runcomfy.com/models/openai/gpt-image-2/edit
The rest of this document covers the local Codex CLI flow for agents whose user has a ChatGPT subscription.

Example output: a plain flat-color icon repainted via --ref in ukiyo-e style β composition preserved, rendering swapped, period-appropriate red seal added by the model unprompted.