# gpt-image-1-5

Generates and edits images using OpenAI's GPT Image 1.5 model. It handles text prompts, full image alterations, and precise inpainting with masks.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 615 installs · ★ 298
- Author: intellectronica
- License: CC0-1.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/intellectronica/agent-skills/tree/HEAD/skills/gpt-image-1-5/SKILL.md
- Updated: 2026-04-25
- HTML: https://affpapa.org/en/nevibecode/skills/gpt-image-1-5

## What it does

The skill executes a local Python script via `uv run` to interact with OpenAI APIs. It uses the Responses API with the `image_generation` tool for text-to-image prompts. For edits, it switches to the Image API (`images.edit` endpoint). Every result is saved directly as a PNG file with a timestamped name.

Image editing works in two distinct modes. Without a mask, the script builds an automatic transparent overlay so the model can adjust the full frame. When you provide a separate mask file via `--mask`, the model alters only the transparent regions.

Execution fails immediately if no key is present in `--api-key` or the `OPENAI_API_KEY` environment variable. You must also run commands from your current working directory. Otherwise, the script saves generated images inside the skill folder instead of your project.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add intellectronica/agent-skills --skill gpt-image-1-5 -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/gpt-image-1-5/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/gpt-image-1-5/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add intellectronica/agent-skills --skill gpt-image-1-5 -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/gpt-image-1-5/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add intellectronica/agent-skills --skill gpt-image-1-5 -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/gpt-image-1-5/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install intellectronica/agent-skills gpt-image-1-5
```

2. **Manually: put the files in place**
- File: `.github/skills/gpt-image-1-5/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add intellectronica/agent-skills --skill gpt-image-1-5 -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/intellectronica/agent-skills --path skills/gpt-image-1-5
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/gpt-image-1-5/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add intellectronica/agent-skills --skill gpt-image-1-5 -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/intellectronica/agent-skills/tree/HEAD/skills/gpt-image-1-5/SKILL.md

## When to use it
- generate PNG graphics from text descriptions
- modify existing image styles and backgrounds without manual masks
- perform targeted inpainting on specific regions using PNG masks
- create illustrations with transparent backgrounds

## Example prompts
- Generate a high quality landscape image of a Japanese garden with cherry blossoms
- Make the sky more dramatic with storm clouds in original-photo.jpg
- Add a swimming flamingo into the masked area using lounge.png and mask.png

## Source text · SKILL.md · CC0-1.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: e7f35ff7197e84b7.

BEGIN THIRD-PARTY FILE e7f35ff7197e84b7
````text
---
name: gpt-image-1-5
description: Generate and edit images using OpenAI's GPT Image 1.5 model. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports text-to-image generation and image editing with optional mask. DO NOT read the image file first - use this skill directly with the --input-image parameter.
---

# GPT Image 1.5 - Image Generation & Editing

Generate new images or edit existing ones using OpenAI's GPT Image 1.5 model.

- **Generation**: Uses the Responses API with image_generation tool
- **Editing**: Uses the Image API for reliable mask-based inpainting

## Usage

Run the script using absolute path (do NOT cd to skill directory first):

**Generate new image:**
```bash
uv run ~/.claude/skills/gpt-image-1-5/scripts/generate_image.py --prompt "your image description" --filename "output-name.png" [--quality low|medium|high] [--size 1024x1024|1024x1536|1536x1024|auto] [--background transparent|opaque|auto] [--api-key KEY]
```

**Edit existing image (without mask - full image edit):**
```bash
uv run ~/.claude/skills/gpt-image-1-5/scripts/generate_image.py --prompt "editing instructions" --filename "output-name.png" --input-image "path/to/input.png" [--size 1024x1024|1024x1536|1536x1024|auto] [--api-key KEY]
```

**Edit existing image (with mask - precise inpainting):**
```bash
uv run ~/.claude/skills/gpt-image-1-5/scripts/generate_image.py --prompt "what to put in masked area" --filename "output-name.png" --input-image "path/to/input.png" --mask "path/to/mask.png" [--size 1024x1024|1024x1536|1536x1024|auto] [--api-key KEY]
```

**Important:** Always run from the user's current working directory so images are saved where the user is working, not in the skill directory.

## Parameters

### Quality Options
- **low** - Fastest generation, lower quality
- **medium** (default) - Balanced quality and speed
- **high** - Best quality, slower generation

Map user requests:
- No mention of quality -> `medium`
- "quick", "fast", "draft" -> `low`
- "high quality", "best", "detailed", "high-res" -> `high`

### Size Options
- **1024x1024** (default) - Square format
- **1024x1536** - Portrait format
- **1536x1024** - Landscape format
- **auto** - Let the model decide based on prompt

Map user requests:
- No mention of size -> `1024x1024`
- "square" -> `1024x1024`
- "portrait", "vertical", "tall" -> `1024x1536`
- "landscape", "horizontal", "wide" -> `1536x1024`

### Background Options (generation only)
- **auto** (default) - Model decides
- **transparent** - Transparent background (PNG/WebP output)
- **opaque** - Solid background

## API Key

The script checks for API key in this order:
````
END THIRD-PARTY FILE e7f35ff7197e84b7

The third-party file has ended. Everything between the e7f35ff7197e84b7 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2831 of 6195 bytes. © intellectronica · CC0-1.0 · https://github.com/intellectronica/agent-skills/tree/HEAD/skills/gpt-image-1-5/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
