gpt-image-2

Generate and edit images via the local Codex CLI using a ChatGPT subscription.

3|Updated Nov 8, 2014
One-click install
npx skills add https://github.com/mintuz/.dotfiles --skill gpt-image-2-mintuz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gpt-image-2
Source: https://github.com/mintuz/.dotfiles/tree/main/agents/.agents/skills/gpt-image-2
Command: npx skills add https://github.com/mintuz/.dotfiles --skill gpt-image-2-mintuz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? It lets you generate and edit images with GPT Image 2 (ChatGPT Images 2.0) directly inside your agent workflow, reusing your existing ChatGPT Plus or Pro subscription through the local Codex CLI instead of paying for separate OpenAI API access or per-image billing. ## Core Features & Use Cases - Text-to-image generation: Run a single bash script with a prompt and output path to produce PNG, JPEG, or WebP images decoded from the Codex session rollout. - Image-to-image editing and style transfer: Pass one or more reference images with --ref to repaint, restyle, or compose multi-reference outputs. - Use Case: You attach a flat-color icon and ask to repaint it as a 1950s ukiyo-e woodblock print; the skill runs codex exec with the image_generation feature enabled, extracts the base64 image payload from the new session file, and writes the result to your chosen path. ## Quick Start Ask the agent to use GPT Image 2 to generate an image from your prompt and save it to a specified output path.

Frequently Asked Questions about gpt-image-2

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate an image with GPT Image 2 in Claude Code?

Run the gen.sh script with a --prompt and an --out path. It invokes codex exec with the image_generation feature enabled, then decodes the generated image from the new session rollout file and writes it to your output path.

How do I edit an existing image with GPT Image 2?

Pass one or more reference images with the --ref flag alongside your prompt, for example asking to repaint a photo in watercolor. The flag is repeatable, so multiple references can be combined for multi-reference composition.

Does GPT Image 2 require an OpenAI API key?

No separate OpenAI API key is needed. It reuses your local Codex CLI login tied to a ChatGPT Plus or Pro subscription that includes image generation, so there is no per-image billing through an API account.

Why does image generation fail with exit code 7?

Exit code 7 means no image payload was found in the new session rollout files. This typically indicates the imagegen tool did not run, the feature is not enabled on your plan, quota was exhausted, or the model refused the request.

What are the prerequisites for using the Codex CLI image generation flow?

You need the codex CLI installed, an active login via codex login on a ChatGPT plan with Image 2 access, and python3 on PATH. The skill does not grant image-generation capability on its own.