By leoleoasd
Generate and edit images with OpenAI's gpt-image-2 model, straight from Claude Code.
A Claude Code skill that generates and edits images with OpenAI's gpt-image-2 model — text-to-image, image editing, inpainting, and multi-image composition — without leaving your terminal.
Packaged as a Claude Code plugin so it installs with two commands.
In Claude Code:
/plugin marketplace add luyuxuanleo/gpt-image-2-skill
/plugin install gpt-image-2
Then give it your OpenAI API key. Easiest way — run the setup command and follow the prompt:
/gpt-image-2:setup
It saves the key to ~/.config/gpt-image-2/credentials (permissions 600) so you only do it
once. Prefer to manage it yourself? Either of these also works:
export OPENAI_API_KEY=sk-... # per shell session
printf '%s' sk-... | python3 plugins/gpt-image-2/skills/gpt-image-2/gpt_image.py set-key -
The skill checks OPENAI_API_KEY first, then the saved file.
Just ask Claude, e.g.:
photo.png to look like a vintage oil painting."product.png and beach.png into one product shot on the beach."Claude invokes the skill, saves the image next to your working directory, and gives you the path.
The skill is a single zero-dependency Python script (urllib only — no pip install):
python3 plugins/gpt-image-2/skills/gpt-image-2/gpt_image.py \
generate "a red fox in snow" --size 1024x1536 --quality high --out fox.png
python3 plugins/gpt-image-2/skills/gpt-image-2/gpt_image.py \
edit "make the sky a starry night" --image scene.png --mask sky.png --out night.png
| Option | Values |
|---|---|
--size | WxH or auto — edges multiple of 16, max 3840, ratio ≤ 3:1 (e.g. 1024x1024, 2048x2048, 3840x2160) |
--quality | low, medium, high, auto |
--background | transparent, opaque, auto |
--format | png, jpeg, webp |
--compression | 0-100 (jpeg/webp) |
--n | number of images |
--out | output path |
--model | override model id (or set GPT_IMAGE_MODEL) |
| Env var | Purpose |
|---|---|
OPENAI_API_KEY | required — your OpenAI API key |
GPT_IMAGE_MODEL | optional — override the model (default gpt-image-2) |
OPENAI_BASE_URL | optional — point at a compatible/proxy endpoint |
MIT
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub leoleoasd/gpt-image-2-skill --plugin gpt-image-2Multi-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.
Comprehensive UI/UX design plugin for mobile (iOS, Android, React Native) and web applications with design systems, accessibility, and modern patterns
Standalone image generation plugin using Nano Banana MCP server. Generates and edits images, icons, diagrams, patterns, and visual assets via Gemini image models. No Gemini CLI dependency required.
Write feature specs, plan roadmaps, and synthesize user research faster. Keep stakeholders updated and stay ahead of the competitive landscape.