Sandbox
@wuyoscar/GPT-Image2-Skill

GPT Image skills, gallery, and CLI for Claude Code and Codex

This repo gives you reusable prompt patterns, reference-image examples, and two skills for GPT Image 2 and 2.5. One skill generates or edits images, and the other extracts a reusable prompt from a reference image; the CLI exposes the same workflows in a terminal.

5,290 stars458 forksPythonUpdated 8d ago
Who it's for

Builders who want Claude Code, Codex, or another skill runtime to generate and edit images from prompts or reference images.

What it delivers

You can turn image ideas and references into repeatable prompts, then generate or edit images with the same workflow across agents or the CLI.

What it does

Image generation and editing skill

`skills/gpt-image/` handles text-to-image, image edits, multi-image edits, and mask-based inpainting for GPT Image 2 and 2.5.

Prompt extraction skill

`skills/get-prompt-from-image/` turns a reference image into a reusable positive prompt and negative prompt.

CLI for GPT Image

`src/gpt_image_cli/` provides `gpt-image` for generation and edit requests from the terminal.

Prompt gallery and references

`docs/` includes numbered prompt examples, style collections, sample outputs, and reference notes for different image types.

Claude Code plugin packaging

`.claude-plugin/` contains plugin metadata for installing the skills into Claude Code.

How to get it

  1. 1Both 2.5 models add --quality xhigh / max and support transparent PNG/WebP output. Start…
    gpt-image --model gpt-image-2.5-flare \
      -p "An original flat leaf icon, centered with generous padding, transparent background" \
      --quality medium --background transparent --format png -f leaf.png
  2. 2Run
    gpt-image --model gpt-image-2.5-flare -p "a photorealistic convenience store at 10pm" --size 1k --quality high -f store.png
  3. 3Check for an existing skill or CLI before installing. Preserve existing skill folders…
    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)"
  4. 4Run
    /plugin marketplace add wuyoscar/gpt_image_2_skill
    /plugin install gpt-image@wuyoscar-skills
  5. 5The installer downloads each GitHub folder and places it under your Codex skills…
    ~/.codex/skills/gpt-image
    ~/.codex/skills/get-prompt-from-image
  6. 6If you prefer to install both manually, copy their skill folders into Codex's skills…
    git clone https://github.com/wuyoscar/gpt_image_2_skill.git
    cd gpt_image_2_skill
    
    mkdir -p "${CODEX_HOME:-$HOME/.codex}/skills"
    for skill in gpt-image get-prompt-from-image; do
      test -e "${CODEX_HOME:-$HOME/.codex}/skills/$skill" && echo "$skill already exists; stop before overwriting" && exit 1
      cp -R "skills/$skill" "${CODEX_HOME:-$HOME/.codex}/skills/"
    done

README

GPT Image 2/2.5 Prompt Gallery + Agent Skills + CLI

Prompts, reference images, two agent skills and a CLI for GPT Image 2 and 2.5.

English · 中文

License: MIT PRs Welcome Models: GPT Image 2 / 2.5 Python ≥ 3.11

GPTImage2Skill banner

Overview · 2.5 samples · Example · Quick start · Install · CLI reference · Guides · Gallery · Contribute

🧭 What about this report

ItemValue
Gallery size163 numbered entries across 31 categories, with selected images below
Surfaces2 Agent Skills + CLI: Claude Code / Codex, OpenClaw, Hermes Agent and other skill-capable agent runtimes
Last update2026-09-10
DocsEnglish + 中文

The repo keeps the GPT Image 2 prompt collection and gallery alongside 2.5 API support, reading material and task-specific references. The two skills handle image generation/editing and image-to-prompt extraction.

TBH, GPT Image 2.5 feels seriously capable. I prefer giving it a clear reference: a shape, a sketch or an image. Sometimes showing a layout from a PDF is more useful than describing it at length. It's how I like to work with GPT-6, too: minimize the prompt; make the reference clear.

I collect prompts, useful building blocks and references here to help you find a workflow that suits the job. Thanks for all the love this little gallery has received 🫶.

For the CLI, export the relevant PDF pages as PNG, WebP or JPG, then attach them with -i. See the supported image-reference formats. Keep required text and edit constraints explicit.

For PPT work, try vector-style diagrams, icons and slide layouts. The Image API outputs PNG, JPEG or WebP; editable SVG or PowerPoint shapes need a separate authoring step.

✨ Made with GPT Image 2.5

Two 2K samples: an exploded watch assembly with detailed callouts, and a multi-storey cafe cutaway built from a reference image. Both use gpt-image-2.5-sunburst, 2048x2048 and high.

Sunburst exploded mechanical watch with numbered component callouts A · Meridian 8 exploded assembly
2048x2048 · high · Curated
Sunburst isometric cafe district with illuminated cutaway interiors B · Night cafe cutaway
2048x2048 · high · Curated adaptation

A · No. 113 · Prompt

Create a premium technical exploded-view illustration of a fictional mechanical wristwatch called the Meridian 8, centered on a dark slate background with fine blueprint grid accents. Show the watch components separated vertically with precise spacing: sapphire crystal, dial, hands, chapter ring, movement plates, escapement, balance wheel, mainspring barrel, case, crown, and leather strap sections. Use realistic brushed steel, brass, ruby jewel accents, and deep navy dial details. Add crisp callouts and labels with the in-image text "Meridian 8", "Exploded Assembly", "42 mm Case", "25 Jewels", and "Power Reserve 72 h". Include numbered callouts "01" through "10" with short labels like "Balance Wheel", "Mainspring Barrel", and "Sapphire Crystal". The result should be highly detailed, technically believable, sharply rendered, and suitable for an industrial design plate with clean hierarchy, exact labeling, and refined material realism.

B uses the reference from No. 54, keeping the overall street layout while reworking the interiors, floors and lighting. Reference attribution: EvoLinkAI · Source.

Original isometric cafe district used as the edit reference

B · No. 54 · Edit prompt

Use the reference image as the layout anchor for a richly detailed isometric two-block cafe district at blue hour. Keep the street footprint, corner cafe, neighboring bookstore, bakery and fountain plaza recognizable. Transform it into a three-storey architectural cutaway diorama with coherent 30-degree isometric geometry.

Open the front-facing walls to reveal the cafe espresso bar and upstairs jazz lounge; bookshelves, reading nooks and a spiral staircase in the bookstore; pastry cases and a working oven in the bakery. Add a rooftop glass greenhouse, tiny terraces, copper plumbing, tiled stairs, balconies, hanging plants and warm lights visible through rain-speckled windows. At street level show wet cobbles, bicycles, the coffee cart, varied miniature pedestrians and reflections around the fountain. Every floor, doorway and staircase should connect plausibly.

Use warm amber interiors against deep teal evening shadows, tactile brick, glazed tiles, glass and brushed brass. Preserve crisp detail throughout the scene, with a clean dark navy background and room around the floating diorama. Give the scene depth through cutaway rooms and layered architecture. Use restrained, readable storefront lettering: "NIGHT OWL CAFE", "OPEN BOOKS", and "DAWN BAKERY". Keep the composition square and visually balanced.

See the sample record for settings, inputs and review notes.

🖼️ From reference image to result

Thanks to @LunarXuan for Get Prompt from Image. A vision-capable agent extracts a prompt from a reference image, then passes it to gpt-image or another generator. The contributor-provided reference and its generated result are shown below.

Contributor-provided snowy urban alley reference image Reference image · Contributor-provided ImageGen result generated from the reverse-engineered prompt Generated result · ImageGen output

Attach an image and invoke the skill with a 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.

📝 Extracted prompt used for the generated result

Positive Prompt

A highly polished semi-realistic Japanese narrative illustration rendered in a painterly digital style, using varied brush widths, a combination of hard edges and soft transitions, restrained contour lines, and controlled surface texture. The image should feel like a cold cinematic game-concept artwork. Use a wide 16:9 composition with strong depth in a snowy urban alley, where the snow-covered road narrows toward a distant vanishing point near the center. Place a large fluffy dark blue-gray wolfdog in the left foreground, shown in side profile facing right with its head raised, interacting with a hooded young woman kneeling near the center-right. She crouches in the snow facing left, gently touching the wolfdog’s muzzle or forehead with one gloved hand while the other rests near her knee for balance, creating a restrained and intimate gesture. She wears an oversized pale-gray winter hooded jacket with pointed ear-like details on top, dark gray panels, pockets, straps, and small muted red-orange accents, over black clothing, fitted black pants, and heavy dark boots. Short black or deep-brown hair falls from beneath the hood; her face is partly shadowed as she looks down at the wolfdog with a quiet, tired, yet gentle expression. Render the wolfdog’s fur with layered directional brushstrokes, making the back, neck, and tail thick and voluminous, with cool blue-gray shadows, pale highlights, and a subtle rim light along the silhouette. On the left, include metal fencing, utility boxes, and dense dark shrubs; in the distance, show tall urban buildings, street lamps, utility poles, and a blue-gray sky. On the right, include dark building facades, windows, snow-covered roof edges, evergreen branches, and foreground cardboard boxes and industrial clutter. Any environmental labels should remain blurred graphic marks with no readable text. Let the main light enter from the distant upper-left side of the alley, combining cold blue ambient shadows with warm golden reflections in the distance. Add subtle rim light to the snow, the woman, and the wolfdog, with medium-high contrast and warm orange clothing details acting as focal accents. Snow, slush, and shallow puddles in the foreground should show damp reflections. Use atmospheric perspective to soften distant buildings while keeping the woman and wolfdog clear. Establish depth through foreground, middle ground, background, occlusion, and perspective lines rather than strong blur. The mood is loneliness, trust, and a brief moment of tenderness in a frozen city. Preserve rough painterly strokes, cool-warm contrast, cinematic composition, and refined post-processing. Clearly remain a 2D semi-realistic painterly illustration, not photography, pure flat vector art, or 3D rendering.

Negative Prompt

photorealistic, 3D render, flat vector style, pure cel shading, watercolor bleed, oil painting impasto, chibi proportions, deformed anatomy, malformed hands, extra limbs, oversized wolf, sunny summer weather, cluttered composition, readable text, watermark

🚀 Quick start

TaskUse
Generate or edit an imagegpt-image
Extract a prompt from a referenceget-prompt-from-image
Work in a terminalCLI examples below, with the selected --model

🎛️ Choose a model

ModelBest starting point
gpt-image-2.5-flareFast, high-quality everyday generation
gpt-image-2.5-sunburstPrecise edits and reference-image workflows
gpt-image-2Retain the model used by existing workflows

The Skill offers this menu when the model is missing or ambiguous (for example, “GPT 2.5”), then confirms the choice before generating. An exact supported model choice proceeds directly. It always passes an explicit --model; the standalone CLI still defaults to gpt-image-2. Changing models or adding outputs requires the user's approval.

Both 2.5 models add --quality xhigh / max and support transparent PNG/WebP output. Start with low drafts; higher quality can increase latency and cost. For example, after choosing Flare:

gpt-image --model gpt-image-2.5-flare \
  -p "An original flat leaf icon, centered with generous padding, transparent background" \
  --quality medium --background transparent --format png -f leaf.png

See model compatibility and verification notes and GPT Image 2.5 prompt templates. Local output validation for these templates is pending. Existing gallery images keep their original model and source credits.

After install, every gallery entry below can be copy-pasted as gpt-image --model <CHOSEN_MODEL> -p "…" or requested from any skill-capable agent runtime in natural language, e.g. "generate the Boston Spring poster from the skill gallery".

Text → image

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

Under the hood: POST /v1/images/generations with the explicitly selected model.

Text + reference image → image (edit)

# 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

# Multi-reference edit: the edits endpoint accepts multiple input images
gpt-image --model gpt-image-2.5-sunburst -p "Place the dog from image 2 next to the woman in image 1. Match the same lighting, composition, and background. Do not change anything else." \
  -i woman.png -i dog.png --size portrait --quality medium -f woman-with-dog.png

# Mask-based inpaint: opaque = keep, transparent = regenerate
gpt-image --model gpt-image-2.5-sunburst -p "replace sky with aurora" \
  -i photo.jpg -m sky_mask.png -f aurora.png

Under the hood: POST /v1/images/edits (multipart form). GPT Image 2 and both 2.5 models use this endpoint, with multiple -i inputs and an optional -m mask. Read results from data[].b64_json and omit response_format. See model compatibility.

📥 Install

Choose either skill or install both: gpt-image generates and edits images, while get-prompt-from-image extracts prompts from reference images.

Check for an existing skill or CLI before installing. Preserve existing skill folders and API-key files. Use your runtime's skill list/status command when available, and ask before installing into a global or shared directory.

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)"
Claude Code
/plugin marketplace add wuyoscar/gpt_image_2_skill
/plugin install gpt-image@wuyoscar-skills
Codex

Codex ships with built-in skill helpers such as $skill-installer and $skill-creator. Open Codex and invoke the built-in installer with the GitHub skill-folder URL for each skill you want:

# gpt-image
$skill-installer
Install this skill from GitHub:
https://github.com/wuyoscar/gpt_image_2_skill/tree/main/skills/gpt-image

# get-prompt-from-image
$skill-installer
Install this skill from GitHub:
https://github.com/wuyoscar/gpt_image_2_skill/tree/main/skills/get-prompt-from-image

The installer downloads each GitHub folder and places it under your Codex skills directory, usually:

~/.codex/skills/gpt-image
~/.codex/skills/get-prompt-from-image

Restart Codex after installation so the new skills are loaded.

If you prefer to install both manually, copy their skill folders into Codex's skills directory:

git clone https://github.com/wuyoscar/gpt_image_2_skill.git
cd gpt_image_2_skill

mkdir -p "${CODEX_HOME:-$HOME/.codex}/skills"
for skill in gpt-image get-prompt-from-image; do
  test -e "${CODEX_HOME:-$HOME/.codex}/skills/$skill" && echo "$skill already exists; stop before overwriting" && exit 1
  cp -R "skills/$skill" "${CODEX_HOME:-$HOME/.codex}/skills/"
done
AgentSkills / npx skills

For runtimes supported by the cross-agent skills installer, select either skill or install both together from GitHub:

# Change --agent to claude-code, codex, opencode, openclaw, or another supported runtime.
npx --yes skills@latest add wuyoscar/gpt_image_2_skill \
  --skill gpt-image \
  --skill get-prompt-from-image \
  --agent codex --copy

These examples intentionally avoid --global. Add --global only when you explicitly want this skill installed into that runtime's global/shared skills directory.

Other runtimes can use the manual agent-skill installation below.

Manual agent-skill install

Set AGENT_SKILLS_DIR to the skills directory used by your agent runtime, then symlink one or both skill folders into it.

git clone https://github.com/wuyoscar/gpt_image_2_skill.git
cd gpt_image_2_skill

# Choose the skill directory for your runtime.
# Examples:
#   Codex:      ~/.codex/skills
#   Claude Code / OpenClaw / Hermes Agent / other runtimes: use that runtime's documented skills directory.
export AGENT_SKILLS_DIR="/path/to/your/agent/skills"

mkdir -p "$AGENT_SKILLS_DIR"
for skill in gpt-image get-prompt-from-image; do
  test -e "$AGENT_SKILLS_DIR/$skill" && echo "$skill already exists; stop before overwriting" && exit 1
  ln -s "$PWD/skills/$skill" "$AGENT_SKILLS_DIR/$skill"
done
CLI
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
gpt-image --model gpt-image-2.5-flare -p "a cat astronaut"
Update
# plugin: use Claude Code's update flow
# codex skill: rerun the installer
# manual git clone
cd gpt_image_2_skill && git pull

# CLI
uv tool upgrade gpt-image-cli

Reads OPENAI_API_KEY from process env, then .env, then ~/.env without overriding an already-set env var.

API keys: This CLI reads the process environment, .env and ~/.env. To avoid using a local key, check all three locations; unset OPENAI_API_KEY clears the process variable only. Codex users can choose its built-in image tool when they prefer platform-managed generation.

🛠️ CLI reference

Parameters, quality settings and SDK examples

Parameters (complete)

Show full parameter reference
FlagValuesDefaultApplies toNotes
-p, --promptstrrequiredbothFull prompt text.
--modelexact model ID abovegpt-image-2bothThe Skill always passes the confirmed model explicitly; the CLI default stays backward-compatible.
-f, --filepath./fig/YYYY-MM-DD-HH-MM-SS-<slug>.pngbothExplicit output path.
-i, --imagepath (repeatable)omittededitsPresence routes through /v1/images/edits.
-m, --maskpath (PNG, alpha)omittededitsOpaque = preserved, transparent = regenerated. Requires -i.
--input-fidelitylow · highomittededitsImage 2 cannot set it, so the CLI omits it. For 2.5, explicit values pass through but behavior remains unverified; see model notes.
--size1k · 2k · 4k · portrait · landscape · square · wide · tall · literal 1024x1024 etc.1024x1024bothLiterals must be 16-px multiples, max edge 3840, 3:1 cap, 655k-8.3M total pixels.
--qualityauto · low · medium · high · xhigh · maxhighbothxhigh / max require a 2.5 model; use low drafts to assess quality, latency, and cost first.
-n, --n1-101bothBatch generation. n>1 suffixes filenames _0, _1, …
--backgroundauto · opaque · transparentAPI defaultbothTransparency requires PNG/WebP; Image 2 transparency remains in preview.
--moderationauto · lowlowgenerationslow is the default here for broader prompt exploration; switch to auto if you want the stricter API-side default.
--formatpng · jpeg · webppngbothResponse encoding.
--compression0-100omittedbothJPEG/WebP only.

Budget / quality guide

Use --quality to manage the generation budget.

  • low = cheap draft / collect / many variants
  • medium = normal exploration / style probing
  • high = final posters, Chinese text, diagrams, paper figures, banners

If you are generating dozens of candidates, start at low and only rerun finalists at high. On 2.5, compare xhigh / max for detail-critical assets. Agree on additional outputs and costs before comparing settings.

From gallery prompt → CLI / SDK

Each entry includes a prompt and metadata ("size" · "quality" · source). Use the shared CLI/SDK pattern below. This example uses "portrait" and "high":

# CLI
gpt-image --model gpt-image-2.5-flare -p "<PROMPT FROM ENTRY>" --size portrait --quality high -f out.png
# OpenAI SDK — `size` is the literal pixels; the CLI shortcut maps to `1024x1536` for portrait
from openai import OpenAI
client = OpenAI()
result = client.images.generate(
    model="gpt-image-2.5-flare",
    prompt="<PROMPT FROM ENTRY>",
    size="1024x1536",
    quality="high",
)

For reference-based edits, add -i ref.png (repeatable) and optionally -m mask.png on the CLI, or call client.images.edit(...) with image=[open(p, "rb") for p in refs]. Shared output options stay the same. --moderation applies to generation; edit calls omit it.

Exit codes: 0 success · 1 API/refusal error (full response body echoed to stderr) · 2 bad args or missing OPENAI_API_KEY.

📚 Guides and reading

[!CAUTION] Use generated images as references, workflow sketches or style targets for research figures. Prepare and verify the final figure separately before including it in a paper; directly publishing a raw generation can mislead readers.

📖 Prompting Fundamentals

Show prompting notes

Shared techniques from the historical Image 2 Cookbook, with current 2.5 guidance organized in a separate official-source reference router. Image 2 retains gallery-first guidance. A precise, model-confirmed 2.5 request needs no reference loading; otherwise choose one short task slice. Migration notes are separate. API parameters stay in model notes; community templates remain separately attributed.

  1. Structure, then goal. Use a consistent order: background/scene → subject → key details → constraints, and **state the inten

Files in the repo

Repository payload17 top-level entries
  • .claude-plugin
  • .github
  • docs
  • skills
  • src
  • tests
  • .gitignore
  • CHANGELOG.md
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • LICENSE
  • pyproject.toml
  • README.md
  • README.zh.md
  • SECURITY.md
  • SUPPORT.md
  • TODO.md

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More skills

obra/
superpowers

An agentic skills framework & software development methodology that works.

285k
1 add

Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, every edge explained, no vector store.

117k
1 add
Vincentwei1021/
anything2explainer

Topic in, narrated explainer video out. A Claude Code / Codex skill that turns any topic into a black-canvas motion-graphics explainer video with TTS voiceover, subtitles and a chapter progress bar. Chinese or English; every frame drawn in code with Remotion.

666

Open-source AI job search: scan job portals, evaluate listings into a structured A-H report with a global 1-5 score, tailor your CV, track applications — runs locally in your AI coding CLI (Claude Code, Codex, OpenCode, Antigravity…)

71k