# GPT-Image2-Skill

> Agent skills, a CLI and a prompt gallery for OpenAI's GPT Image models

- Category: Multimodal Generation / Image Generation
- Language: Python
- Licence: MIT
- Repository: https://github.com/wuyoscar/GPT-Image2-Skill
- Canonical page: https://ai-tldr.dev/tools/gpt-image2-skill/
- Updated: 2026-04-25

## In short

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.

1. Check what is already installed

   Look for an existing CLI and API key so you don't overwrite anything.

```bash
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)"
```

2. Install the skill in Claude Code

   Add the project's plugin marketplace, then install the `gpt-image` plugin.

```text
/plugin marketplace add wuyoscar/gpt_image_2_skill
/plugin install gpt-image@wuyoscar-skills
```

3. Or 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.

```bash
npx --yes skills@latest add wuyoscar/gpt_image_2_skill \
  --skill gpt-image \
  --skill get-prompt-from-image \
  --agent codex --copy
```

4. Install the CLI

   Run it once with `uvx`, or put `gpt-image` on your PATH as a uv tool.

```bash
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_skill
```

5. Generate an image

   A plain prompt calls the generations endpoint. Start with `low` quality drafts and rerun finalists at `high`; `-f` sets the output file.

```bash
gpt-image --model gpt-image-2.5-flare -p "a photorealistic convenience store at 10pm" --size 1k --quality high -f store.png
```

6. 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.

```bash
# 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
```

7. 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.

```text
/get-prompt-from-image
Extract a reusable English positive prompt and a targeted negative prompt from this image, then recreate it with gpt-image.
```

## 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

## Version history

- 2026-04-25 v0.2.0: Split the prompt gallery into category-level reference files the skill loads on demand, refreshed the README showcase and clarified Codex skill installation.
