What is GPT-Image2-Skill?
GPT-Image2-Skill bundles three things for working with OpenAI's GPT Image 2 and GPT Image 2.5 models: two agent skills, a command-line tool, and a large prompt gallery. The `gpt-image` skill generates and edits images, while `get-prompt-from-image` lets a vision-capable agent extract a reusable prompt from a reference picture and hand it to a generator. It sits in the Image Generation category of the Multimodal Generation tools and is open-source, written in Python and licensed MIT.
Overview
GPT-Image2-Skill bundles three things for working with OpenAI's GPT Image 2 and GPT Image 2.5 models: two agent skills, a command-line tool, and a large prompt gallery. The `gpt-image` skill generates and edits images, while `get-prompt-from-image` lets a vision-capable agent extract a reusable prompt from a reference picture and hand it to a generator. The skills install into Claude Code (as a plugin), Codex, OpenClaw, Hermes Agent and other skill-capable agent runtimes.

The CLI, published from the repo as the Python package `gpt-image-cli`, exposes a `gpt-image` command. Plain prompts go to OpenAI's `/v1/images/generations` endpoint; adding one or more `-i` reference images (and an optional `-m` alpha mask) routes the call through `/v1/images/edits` for restyles, multi-image composites and inpainting. It reads `OPENAI_API_KEY` from the process environment, then `.env`, then `~/.env`, and supports the models `gpt-image-2`, `gpt-image-2.5-flare` and `gpt-image-2.5-sunburst`. When a user asks for an image without naming a model, the skill offers that menu and then always passes an explicit `--model`; the standalone CLI defaults to `gpt-image-2`.
The gallery is what the skill draws on: the README lists 163 numbered entries across 31 categories, from research-paper figures and infographics to UI mockups, posters, game art and photography, each with its prompt, size and quality settings and source credit. Inside the skill they are split into per-category reference files so an agent loads only the relevant slice instead of the whole collection. The project is MIT-licensed and written in Python 3.11+.
What it does
- `gpt-image` agent skill that picks a model with the user, searches the bundled gallery and craft notes for a fitting prompt, then calls the packaged CLI
- `get-prompt-from-image` skill that turns a reference image into a reusable positive prompt plus a targeted negative prompt
- `gpt-image` CLI for text-to-image generation and reference-based editing: multiple `-i` inputs, `-m` mask inpainting, batch output with `-n`, transparent backgrounds and PNG/JPEG/WebP output
- Size shortcuts (`1k`, `2k`, `4k`, `portrait`, `landscape` and more) and quality levels from `low` to `max`, with `xhigh` and `max` reserved for the 2.5 models
- Prompt gallery of 163 numbered entries in 31 categories, each with size, quality and source metadata, split into per-category reference files for agents
- Installs as a Claude Code plugin, through the Codex skill installer, with `npx skills`, by manual symlink, or as a standalone CLI via `uv`
Getting started
You need an OpenAI API key with access to the GPT Image models and, for the CLI, Python 3.11+ with `uv`. The CLI reads `OPENAI_API_KEY` from the process environment, then `.env`, then `~/.env`, without overriding a variable that is already set. The README asks you to check for an existing install before adding one.
Check what is already installed
Look for an existing CLI and API key so you don't overwrite anything.
command -v gpt-image || true
command -v uv >/dev/null && uv tool list | grep -E '^gpt-image-cli([[:space:]]|$)' || true
test -n "${OPENAI_API_KEY:-}" && echo "OPENAI_API_KEY is already set (value hidden)"Install the skill in Claude Code
Add the project's plugin marketplace, then install the `gpt-image` plugin.
/plugin marketplace add wuyoscar/gpt_image_2_skill
/plugin install gpt-image@wuyoscar-skillsOr install both skills into another agent runtime
The cross-agent `skills` installer works for Codex, OpenCode, OpenClaw and other supported runtimes; change `--agent` to match yours. Codex users can also run its built-in `$skill-installer` with the GitHub URL of each skill folder.
npx --yes skills@latest add wuyoscar/gpt_image_2_skill \
--skill gpt-image \
--skill get-prompt-from-image \
--agent codex --copyInstall the CLI
Run it once with `uvx`, or put `gpt-image` on your PATH as a uv tool.
uvx --from git+https://github.com/wuyoscar/gpt_image_2_skill gpt-image --model gpt-image-2.5-flare -p "a cat astronaut"
# or install to PATH if not already installed
command -v gpt-image >/dev/null || uv tool install git+https://github.com/wuyoscar/gpt_image_2_skillGenerate an image
A plain prompt calls the generations endpoint. Start with `low` quality drafts and rerun finalists at `high`; `-f` sets the output file.
gpt-image --model gpt-image-2.5-flare -p "a photorealistic convenience store at 10pm" --size 1k --quality high -f store.png

Edit with reference images or a mask
Any `-i` input routes the request through the edits endpoint. In a mask, opaque pixels are kept and transparent ones are regenerated.
# Single-reference edit / restyle
gpt-image --model gpt-image-2.5-sunburst -p "Make it a winter evening with heavy snowfall" \
-i chess.png --quality high -f chess-winter.png
# Mask-based inpaint
gpt-image --model gpt-image-2.5-sunburst -p "replace sky with aurora" \
-i photo.jpg -m sky_mask.png -f aurora.png
Extract a prompt from a reference image
Attach an image in your agent and invoke the second skill by slash command, `$get-prompt-from-image`, or plain language.
/get-prompt-from-image
Extract a reusable English positive prompt and a targeted negative prompt from this image, then recreate it with gpt-image.Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Ask a coding agent such as Claude Code or Codex to produce a poster, infographic or UI mockup, letting the skill pull a matching prompt from the gallery
- Draft research-figure sketches, diagrams and paper illustrations as references, then prepare the final figure separately, as the README advises
- Restyle, composite or inpaint existing images from the terminal with reference inputs and masks
- Reverse-engineer the prompt behind a reference picture and regenerate it in a new variation
How GPT-Image2-Skill compares
GPT-Image2-Skill alongside other open-source image generation tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Stable Diffusion web UI (AUTOMATIC1111) | ★ 165k | A browser interface for running Stable Diffusion image generation locally with extensions and fine-grained controls. |
| ComfyUI | ★ 149k | A node-based visual editor for building and running image and video generation pipelines like Stable Diffusion and FLUX locally. |
| Fooocus | ★ 54k | A simplified image generation app built on Stable Diffusion that hides technical settings for easy prompting. |
| InvokeAI | ★ 29.2k | A self-hosted creative tool and canvas for generating and editing images with open diffusion models. |
| Stability-AI generative-models | ★ 27.3k | Stability AI's official code for its Stable Diffusion family of image and video generation models. |
| FLUX | ★ 26.1k | Black Forest Labs' open-weight diffusion models and inference code for generating and editing images from text prompts. |
| Z-Image | ★ 12.2k | Alibaba Tongyi's 6B-parameter open image model that produces photorealistic images quickly on a single GPU. |
| GPT-Image2-Skill | ★ 6.2k | Agent skills, a CLI and a prompt gallery for OpenAI's GPT Image models |
