К основному содержанию
скилл CX Codex

gpt-image-2 · glebis — скилл для Claude Code: что делает и как установить

Пошаговый генератор картинок через OpenAI GPT Image 2 API с готовыми стилями, режимом черновиков для экономии и проверкой промптов на ошибки.

MIT 213 установок ★ 414 обновлён 2026-10-23

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add glebis/claude-skills --skill gpt-image-2 -a claude-code
Открыть на GitHub

Что делает gpt-image-2

Скилл проводит пользователя через несколько шагов с вопросами: выбор формата (одиночный арт, обработка фото, варианты или карусель на 5-10 слайдов), подбор пресета из presets.yaml и настройка габаритов. Для экономии баланса по умолчанию запускается черновик с флагом --draft за $0.006, и только после утверждения композиции генерируется финал за $0.21 с тем же --seed.

Перед отправкой запроса запускается автоматическая проверка текста. Она собирает итоговую фразу из пресета и описания, после чего ищет внутренние противоречия — например, запрос светлого фона поверх пресета editorial, где жёстко зашит черный цвет. Проверка делается через llm CLI с моделью Haiku или через встроенную эвристику; при конфликте генерация останавливается, чтобы не тратить деньги впустую.

Флаг --platform не меняет реальное разрешение нейросети, а просто растягивает базовый квадрат 1024×1024, поэтому для вертикальных и горизонтальных кадров нужно сразу передавать --size 1024x1536 или --size 1536x1024.

Какие задачи решает

  • сократить расходы на подбор картинок через дешевые черновые генерации
  • собрать серию из 5-10 слайдов для соцсетей в едином стиле
  • перерисовать фото по файлу или буферу обмена через --edit
  • поймать конфликты фона и пресетов до списания денег за вызов API

Примеры запросов агенту

  • Сделай обложку для статьи в стиле blueprint
  • Собери карусель на 8 слайдов для LinkedIn про запуск проекта
  • Перерисуй эту фотографию через --preset risograph

Как установить gpt-image-2

1Через Skills CLI (Vercel)

npx skills add glebis/claude-skills --skill gpt-image-2 -a claude-code

2Вручную: положить файлы

~/.claude/skills/gpt-image-2/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/gpt-image-2/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о gpt-image-2

Как установить gpt-image-2 в Claude Code?

Выполните команду npx skills add glebis/claude-skills --skill gpt-image-2 -a claude-code. Конфигурация запишется в ~/.claude/skills/gpt-image-2/SKILL.md.

Что делает этот скилл?

Он организует интерактивный процесс генерации картинок через OpenAI GPT Image 2 API: подбирает пресеты, проверяет промпты на противоречия, сначала делает черновик за $0.006 и затем повышает качество до финального.

Почему флаг --platform искажает пропорции изображения?

Параметр --platform генерирует стандартный квадрат 1024×1024 и растягивает его под нужный формат. Чтобы избежать искажений, задавайте нативные размеры сразу через --size 1024x1536 или --size 1536x1024.

Исходный текст

SKILL.md · MIT
---
name: gpt-image-2
description: Generate and edit images using OpenAI's GPT Image 2 API. Interactive skill that guides users through image creation with style presets, cost-aware draft/final workflow, thinking mode, carousels, and photo editing. This skill should be used when the user requests image generation via OpenAI/GPT Image 2, wants to create social media carousels, edit photos into artistic styles, or needs images with readable text (infographics, diagrams, posters).
---

# GPT Image 2 — Interactive Image Generation

Generate and edit images via OpenAI's GPT Image 2 API with an interactive, guided workflow.

## Interactive Flow

When the user invokes this skill, guide them through these steps using AskUserQuestion. Do not skip steps — the interactive flow is the core experience.

### Step 1: What are we making?

Ask the user what they want to create. Offer these options:

- **Single image** — one image from a text prompt
- **Photo edit** — transform an existing photo into a style
- **Carousel** — 5-10 cohesive slides for LinkedIn/Instagram
- **Variants** — multiple versions of the same concept
- **Quick generate** — skip questions, just run the prompt

If the user already provided a clear prompt (e.g. "generate an editorial image of a rocket"), skip to Step 3.

### Step 2: Style selection

Show the user available presets grouped by category. Read `presets.yaml` and present them:

**Visual styles** (no text in image):
editorial, blueprint, ink, risograph, wireframe, constellation, brutalist, grain

**Text-heavy** (leverages GPT Image 2 text rendering):
infographic, slide, diagram, poster, menu, manga

**Community favorites:**
trading-card, pixar, app-mockup, isometric, action-figure, cinematic, panorama

**Reference-anchored:**
`vhs` — 1980s late-night infomercial title card: scanline-striped gradient italic caps on pure black. It auto-attaches a bundled reference image (`references/vhs-infomercial.png`), so the look stays consistent batch-to-batch. Pass the ad copy as the subject; for multi-line copy separate lines with ` / ` (e.g. `--preset vhs "THEY TRUSTED YOU / NOW / PROVE IT"`).

**Custom** — user describes their own style

Ask: "Which style? Or describe your own."

### Step 3: Platform & sizing

Ask where this will be used:
- YouTube thumbnail (1280×720)
- Instagram square (1080×1080)
- Slides/presentation (1920×1080)
- Blog hero (1200×630)
- X/Twitter (1600×900)
- Story (1080×1920)
- Custom size
- No resize (use API default)

**Aspect-ratio caveat:** `--platform` does NOT change the generation size — it generates at the configured size (default 1024×1024) and resizes/stretches afterwards, which distorts non-square targets (e.g. `--platform story` stretches a square to 1080×1920, cropping the composition's edges). For portrait or landscape compositions, pass the API-native size directly: `--size 1024x1536` (portrait) or `--size 1536x1024` (landscape).

**Preflight false positives:** the background-conflict heuristic trips on color words applied to non-background elements (e.g. "off-white text" in a dark-background prompt reads as a second background). If the flagged conflict is spurious, re-run with `--force`, or rephrase ("pale gray text").

### Step 3.5: Preflight prompt check (automatic)

Before **any** generation spend, the script now **composes the final prompt first**
(preset + subject + style), then **checks it for internal contradictions** — most often
a preset that hard-codes something the subject overrides (e.g. the `editorial` preset
forces *"on pure black background"* while your subject asks for a warm off-white ground).

The check prefers a fast **Haiku** call via the `llm` CLI; if Haiku is unavailable (no
`llm`, no Anthropic credit) it falls back to the configured `llm` default model, then to a
built-in static heuristic. The resolved prompt and the verdict are printed. **If a conflict
is found, generation is aborted before spending** — fix the prompt or preset and re-run, or
override with `--force` (generate anyway) or `--no-preflight` (skip the check). This is what
prevents the "generated on the wrong background, now regenerate" waste.

When composing prompts that set a background/palette, **don't combine a background-fixing
preset (`editorial`, `blueprint`, etc.) with a different requested background** — either drop
the preset and specify the full style yourself, or accept the preset's background.

### Step 4: Draft first, then final

**Always generate a draft first** unless the user says "skip draft" or uses `--draft false`.

1. Generate with `--draft` (quality=low, ~$0.006/image)
2. Show the image to the user using the Read tool
3. Ask: "Like this direction? I can: (a) generate final quality, (b) adjust the prompt, (c) try a different style, (d) regenerate with a new seed"
4. If approved, generate final with `--quality high` (~$0.21/image)
5. Use `--seed` from the draft to maintain composition when upgrading to final

This draft→final flow saves ~97% on iteration costs.

### Step 5: Show result and offer next actions

After generation, always:
1. Show the image using the Read tool
2. Open it with `open <path>` for full-resolution preview
3. Report the cost
4. Offer: "Want to (a) generate variants, (b) edit this further, (c) use as reference for more images, (d) done?"

## Carousel Workflow

When the user wants a carousel (5-10 slides):

### 1. Story arc
Ask: "What's the story? Give me the key message and I'll draft a 10-slide arc."

Then propose a slide-by-slide plan like:
```
Slide 1: [Cover] — hook headline + hero image
Slide 2: [Problem] — bold statement
Slide 3: [Context] — illustration + explanation
...
Slide 10: [CTA] — call to action with URL
```

Ask the user to approve or modify the plan.

### 2. Style consistency
Use the same preset + seed range across all slides. For carousels:
- Pick one visual style for all slides
- Use `--seed` to lock composition patterns
- Include pagination dots in prompts (e.g., "10 small dots at bottom, third dot highlighted orange")
- Maintain consistent color palette and typography

### 3. Draft batch
Generate all slides as drafts first ($0.006 × 10 = $0.06 total). Show them all to the user as a contact sheet or one by one. Ask which ones to regenerate or adjust.

### 4. Final batch
Only generate finals for approved slides. Offer to generate all at once with `-y` flag.

## Photo Edit Workflow

When the user wants to transform a photo:

1. Ask for the source image (file path or clipboard)
2. For clipboard: save with `osascript` to a temp file
3. Show available styles and ask which to try
4. Generate a draft edit first
5. Show result, ask if they want adjustments
6. Generate final when approved

Use `--edit <path>` for the API call.

## Cost Awareness

Always communicate costs before generating:

| Quality | Per image | 10-slide carousel |
|---------|-----------|-------------------|
| `--draft` (low) | $0.006 | $0.06 |
| medium | $0.05 | $0.50 |
| high (default) | $0.21 | $2.10 |
| high + thinking | $0.25-0.42 | $2.50-4.20 |

Thinking mode adds 20-100% cost. Only suggest it for text-heavy or complex compositions.

The script auto-confirms when cost < $0.50. Above that, it prompts the user.

## Prompt Engineering Tips

When helping users write prompts, apply these patterns:

1. **Structure**: Scene → Subject → Detail → Lighting → Constraint
2. **Front-load the subject**: put the main thing first
3. **For text in images**: quote exact text with single quotes: `'with the headline "Hello World"'`
4. **Character consistency**: maintain a 5-tuple: age + appearance + hairstyle + distinctive features + clothing
5. **Style tags at end**: append tags like `editorial-magazine`, `studio-product` to converge batches
6. **Use `--seed` for iteration**: lock composition, vary only the prompt details

## CLI Reference

```bash
# Basic generation
scripts/gpt_image_2.py "prompt" output.png

# With preset and platform
scripts/gpt_image_2.py --preset editorial --platform square "subject" out.png

# Draft mode (~$0.006/image)
scripts/gpt_image_2.py --draft "prompt" out.png

# With thinking for complex layouts
scripts/gpt_image_2.py --thinking medium --preset diagram "OAuth flow" out.png

# Seed for reproducibility
scripts/gpt_image_2.py --seed 42 "prompt" out.png

# Edit existing photo
scripts/gpt_image_2.py --edit photo.png "transform into constellation style" out.png

# Reference-anchored preset (auto-attaches its bundled reference image)
scripts/gpt_image_2.py --preset vhs --platform youtube "THEY TRUSTED YOU / NOW / PROVE IT" ad.png

# Variants with contact sheet
scripts/gpt_image_2.py --n 4 --preset ink "mountain" out.png

# Cost estimate
scripts/gpt_image_2.py --estimate --n 10 --quality high "batch test"

# Skip confirmation
scripts/gpt_image_2.py -y --n 10 "batch" out.png

# Dry run (show prompt without API call)
scripts/gpt_image_2.py --dry-run --preset editorial "test" out.png

# Preflight runs automatically before spend; override if needed
scripts/gpt_image_2.py --force "prompt with a known conflict" out.png    # generate anyway
scripts/gpt_image_2.py --no-preflight "prompt" out.png                   # skip the check
```

## Files

- `scripts/gpt_image_2.py` — main CLI (Python, requires PyYAML)
- `presets.yaml` — style presets (visual + text-heavy + community + reference-anchored). A preset may declare a `reference:` path (relative to the skill dir); it auto-attaches as a style anchor unless the user passes their own `--reference`. See the `vhs` preset.
- `platforms.yaml` — 8 platform sizing presets
- `references/api_reference.md` — full API documentation
- `references/vhs-infomercial.png` — bundled style anchor for the `vhs` preset
- `~/.config/gpt-image-2/config.yaml` — user defaults
- `~/.config/gpt-image-2/history.jsonl` — generation log
- `~/.config/gpt-image-2/last.json` — last run (for `again`)

© glebis · MIT · glebis/claude-skills

Похожие скиллы

Все скиллы по теме «Дизайн» →

Сначала — gpt-image-2 от других авторов.

gpt-image-2 prime-skills Генерирует и редактирует изображения через OpenAI GPT Image 2 на RunComfy. Точно встраивает текст, логотипы и многоязычную типографику — для e-commerce, рекламы и UI-макетов. CX Codex +1 95 100установок gpt-image-2 pilioai Агент создаёт картинки из текста или редактирует по референсам через API Pilio GPT Image 2. CX Codex +1 20 400установок gpt-image-2 acedatacloud Генерирует и редактирует изображения через AceDataCloud API модели OpenAI gpt-image-2. Встраивает реальные логотипы, скриншоты и QR-коды прямо в сцены с сохранением исходных форм. CX Codex +1 219установок gpt-image 101-skills Скилл для генерации и правки изображений через GPT-Image-2 от OpenAI. Работает через CLI belt от inference.sh. CX Codex +1 14 600установок gpt-image-1-5 intellectronica Генерирует и редактирует изображения через модель GPT Image 1.5 от OpenAI. Создаёт графику по описанию, заменяет фон и выполняет точечный инпейнтинг по маске. CX Codex +1 625установок gpt-image-2-skill reason-machines Скилл и CLI для Claude Code генерируют и редактируют изображения через OpenAI gpt-image-2, в том числе по референсам и маскам, и создают серии вариантов. CX Codex +1 325установок gpt-image-skill feiskyer Создаёт и редактирует изображения через OpenAI GPT Image API. Скилл срабатывает, когда вы явно просите OpenAI или GPT; для схем он не предназначен. CX Codex +1 156установок gpt-image-edit prime-skills Скилл gpt-image-edit редактирует изображения через GPT Image 2 (/edit endpoint ChatGPT Images 2.0) на RunComfy. Сохраняет лица и объекты, переписывает текст на любых языках (кириллица, иероглифы, арабская вязь), принимает до 10 референсов. CX Codex +1 447 000установок gpt-image-2-style-library freestylefly Скилл gpt-image-2-style-library превращает пользовательские идеи в готовые промпты для GPT-Image2 на основе библиотеки стилей awesome-gpt-image-2. Помогает сформировать композицию, теги и негативные ограничения. CX Codex +1 4 200установок

Из того же набора51

Весь набор →
meta Регистрирует обработчик команды /meta, чтобы запускать Claude Code Agent SDK прямо в каталоге бота telegram_agent и править его код из чата. CX Codex +1 228установок context-builder Скилл context-builder для Claude Code, Codex, Cursor и других платформ, который генерирует интерактивные промпты для сбора контекста у клиентов консалтинговых проектов по AI-трансформации. CX Codex +1 226установок wispr-analytics Скилл wispr-analytics подключается к локальной базе Wispr Flow для анализа истории голосовых заметок, проверки просодии речи и ведения словаря терминов. CX Codex +1 218установок nano-banana Скилл nano-banana для Claude Code создаёт и редактирует изображения через Gemini, применяет стили и размеры площадок. Создаёт обложки, слайды, изображения к статьям и серии вариантов. CX Codex +1 216установок tufte-report Скилл tufte-report собирает HTML-отчёты с интерактивными графиками и таблицами в стиле Эдварда Тафти — высокая плотность данных, минимум украшений, двухколоночная вёрстка с боковыми врезками. CX Codex +1 202установок temple-generator Скилл temple-generator превращает базу заметок Obsidian в трёхмерную интерактивную карту Three.js с кольцами сущностей, семантическим зумом и звуком. CX Codex +1 199установок meeting-processor Скилл meeting-processor разбирает транскрипты встреч из Fathom и Granola, определяет тип звонка и извлекает договорённости с контекстом переговоров. CX Codex +1 195установок session-search Скилл session-search для Claude Code ищет прошлые сессии по смыслу, ключевым словам и связанным понятиям. Находит старые отладки и исследования. CX Codex +1 192установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой