From gpt-image
Use this skill whenever a user asks to generate, create, draw, render, or edit images with GPT Image 2 / gpt-image-2, text-to-image, reference-image editing, inpainting, posters, typography, Chinese text, UI mockups, diagrams, or gallery prompts. Analyze the user's prompt, search the bundled Reference Gallery/craft files for matching design patterns, confer on direction when useful, then call the packaged `gpt-image` CLI or bundled `scripts/generate.py`. Do not write new image-generation code unless explicitly asked to modify this repo.
How this skill is triggered — by the user, by Claude, or both
Slash command
/gpt-image:gpt-imageThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Agent runbook for GPT Image 2 generation/editing. Use the prompt library + packaged CLI. Do not reimplement image API code.
agents/openai.yamlreferences/craft.mdreferences/gallery-anime-and-manga.mdreferences/gallery-architecture-and-interior.mdreferences/gallery-beauty-and-lifestyle.mdreferences/gallery-brand-systems-and-identity.mdreferences/gallery-character-design.mdreferences/gallery-cinematic-and-animation.mdreferences/gallery-cinematic-film-references.mdreferences/gallery-data-visualization.mdreferences/gallery-edit-endpoint-showcase.mdreferences/gallery-events-and-experience.mdreferences/gallery-fashion-editorial.mdreferences/gallery-fine-art-painting.mdreferences/gallery-gaming.mdreferences/gallery-illustration.mdreferences/gallery-infographics-and-field-guides.mdreferences/gallery-ink-and-chinese.mdreferences/gallery-isometric.mdreferences/gallery-more-illustration-styles.mdAgent runbook for GPT Image 2 generation/editing. Use the prompt library + packaged CLI. Do not reimplement image API code.
generate, edit, inpaint, or multi-reference; identify asset type, exact text, aspect ratio, references, safety constraints, and budget/quality.references/gallery.md; load/search the closest references/gallery-<category>.md file(s). Read actual **Prompt** text before choosing a pattern.references/craft.md for dense text, diagrams, UI, data visualization, multi-panel layouts, weak prompts, or no close gallery match.command -v gpt-image), installed tool lists when the tool manager exists, or the runtime’s own skill registry when available. Do not assume a local home path in cloud/hosted runtimes..env, or write API keys unless the user explicitly requested setup. Global/shared installs are opt-in only.gpt-image or scripts/generate.py. Do not create a new generate.py, SDK wrapper, or ad-hoc script for normal image requests.Fast path: precise prompt + explicit “generate now” → quick reference/craft check, then CLI.
Preferred call order:
# Existing CLI on PATH
gpt-image -p "PROMPT" [-f OUT] [-i REF...] [-m MASK] [options]
# Installed skill folder; use runtime-provided skill path when available
uv run "$SKILL_DIR/scripts/generate.py" -p "PROMPT" [-f OUT] [-i REF...] [-m MASK] [options]
# Direct transient CLI when the user requested setup/one-off CLI execution
uvx --from git+https://github.com/wuyoscar/gpt_image_2_skill gpt-image -p "PROMPT" [options]
scripts/generate.py is a launcher: repo-local src/gpt_image_cli → installed gpt-image → PATH gpt-image → transient uvx/uv fallback.
codex exec --json --enable image_generation --cd <workdir> --model <model> and relies on the user's existing Codex login/subscription/session flow.--model selects the Codex model for the delegated run. Set GPT_IMAGE_CODEX_MODEL to change the default.~/.codex/generated_images/<thread_id>/, copies them to the requested output path(s), and verifies the files exist.--sandbox workspace-write. Use --dangerously-bypass-approvals-and-sandbox only when the local Codex policy blocks an otherwise trusted image job.--codex-timeout to cap long delegated runs. Default is 300 seconds.| Flag | Values | Use |
|---|---|---|
-p, --prompt | string | Required prompt/edit instruction |
-f, --file | path | Output path; auto-named if omitted |
-i, --image | repeatable path | Use edits endpoint; supports multiple references |
-m, --mask | PNG path | Inpaint with alpha mask; requires -i |
--model | default from GPT_IMAGE_CODEX_MODEL or gpt-5.4-mini | Codex model for the delegated run |
--size | 1k, 2k, 4k, portrait, landscape, square, wide, tall, or literal | Canvas size |
--quality | low, medium, high, auto | Cost/quality dial |
-n, --n | integer | Number of images |
--background | auto, opaque | Generation background |
--moderation | auto, low | Generation moderation setting |
--format | png, jpeg, webp | Output encoding |
--compression | 0-100 | JPEG/WebP compression |
--user | string | Optional end-user identifier |
--dangerously-bypass-approvals-and-sandbox | boolean | Forward Codex's dangerous bypass flag for trusted local runs only |
--codex-timeout | seconds | Timeout for the delegated Codex run |
--log-file | path | JSONL timing diagnostics path |
--no-log | boolean | Disable timing diagnostics |
Quality policy:
low: cheap drafts, broad exploration, many variants.medium: normal exploration, style probing, balanced cost.high: final assets, Chinese text, posters, diagrams, UI, paper figures, dense labels.Size policy:
1k / 1024x1024portraitlandscape2k4ktall| Mode | Trigger | Delegated Codex inputs |
|---|---|---|
| Text-to-image | no -i | prompt + requested output path(s) |
| Reference edit | one or more -i | prompt + attached reference image(s) |
| Inpaint | -i + -m | prompt + attached reference and mask image(s) |
Surface Codex CLI errors verbatim enough for debugging; exit codes: 0 success, 1 generation/refusal/missing output, 2 bad args/missing Codex CLI.
references/gallery.md: routing index for the 162-prompt Reference Gallery Atlas. Load first.references/gallery-*.md: concrete prompts, previews, paths, metadata, attribution. Load 1 category for normal requests; 2–3 for hybrids.references/craft.md: prompt-craft checklist. Load for prompt repair, exact text, UI/data/diagram grammar, edit invariants, and multi-panel consistency.references/openai-cookbook.md: official parameter/model semantics. Load for API behavior or model capability questions.Reference loading policy: load the smallest useful slice; never load all category files by default.
-i paths exist; verify -m exists when used.Preserve Curated vs Author + Source metadata when adapting examples. Add new collected prompts to the Reference Gallery before README promotion.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub leessju/get-image-2 --plugin gpt-image