generate-image · sateezg — скилл для Claude Code и Codex: картинки без API-ключа
Скилл generate-image рисует иконки, логотипы, баннеры и иллюстрации через gpt-image-2 в локальном Codex CLI, используя ваш вход в ChatGPT. Ключ API не нужен.
MIT ★ 195 обновлён 2026-08-10
/plugin marketplace add Sateezg/codex-bridge
/plugin install codex-bridge@codex-bridgeЧто делает generate-image
Скилл даёт агенту одну команду: codex-imagegen "<промпт>" ./assets/icon.png [--size WxH]. Внутри она отправляет запрос в gpt-image-2 через Codex CLI, который уже стоит на машине и залогинен под вашим аккаунтом ChatGPT. В stdout приходит абсолютный путь к готовому PNG, при ошибке — вывод Codex в stderr и код 2.
Результат держится на промпте. Скилл требует развернуть запрос: что в кадре, какой стиль, какая палитра в hex (её берут из дизайн-токенов проекта), как построен кадр и какой свет. Точный текст в кавычках — gpt-image-2 выводит надписи аккуратно. Квадрат 1024x1024 самый быстрый. Свой WxH пройдёт, только если длинная сторона не больше 3840, обе кратны 16, соотношение до 3:1, а пикселей от 655,360 до 8,294,400.
Прозрачность на основном пути не выходит: скилл просит ровный хромакей #00FF00 (для зелёных объектов #FF00FF), потом снимает его скриптом remove_chroma_key.py через python. Без установленного Codex CLI и codex login команда не сработает, а каждая картинка жжёт квоту плана ChatGPT, примерно 3–5x от текстового запроса — пачку стоит согласовать заранее.
Какие задачи решает
- сгенерировать иконку в палитре проекта
- сделать баннер 1536x1024 для лендинга
- вырезать фон у готовой картинки через хромакей
- собрать набор мокапов в одном стиле
- вписать точную надпись в изображение
Примеры запросов агенту
- Сгенерируй иконку отправки сообщения: плоский вектор, синий
#2563EBна белом, сохрани вassets/icons/send.png. - Нужен портретный баннер
1024x1536для страницы тарифа, тёплый вечерний свет. - Сделай логотип на прозрачном фоне: сгенерируй на зелёном хромакее и сними ключ.
Как установить generate-image
1Через маркетплейс плагинов
/plugin marketplace add Sateezg/codex-bridge/plugin install codex-bridge@codex-bridgeКоманда ставит плагин codex-bridge целиком, со всеми его скиллами
2Вручную: положить файлы
~/.claude/skills/generate-image/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/generate-image/
Вручную: положить файлы
.agents/skills/generate-image/SKILL.mdДля всех проектов — ~/.agents/skills/
Вручную: положить файлы
.cursor/skills/generate-image/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Sateezg/codex-bridge skills/generate-image2Вручную: положить файлы
.github/skills/generate-image/SKILL.mdКомандой платформы
gemini skills install https://github.com/Sateezg/codex-bridge --path skills/generate-imageВручную: положить файлы
.devin/skills/generate-image/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о generate-image
Как установить generate-image в Claude Code?
Подключите маркетплейс командой /plugin marketplace add Sateezg/codex-bridge, затем поставьте плагин: /plugin install codex-bridge@codex-bridge.
Что делает generate-image?
Превращает текстовый запрос в PNG: иконки, логотипы, баннеры, иллюстрации, мокапы. Рисует gpt-image-2 внутри Codex CLI, отдельный ключ API для этого не нужен.
Нужен ли ключ API?
На обычном пути нет: хватает входа в ChatGPT, под которым залогинен Codex. OPENAI_API_KEY понадобится только для нативной прозрачности через gpt-image-1.5 --background transparent.
Исходный текст
SKILL.md · MIT
---
description: Generate images (icons, logos, banners, illustrations, mockups, photos, textures, diagrams-as-art) with OpenAI gpt-image-2 through the locally installed Codex CLI, using the user's existing ChatGPT login — no API key. Use whenever the user asks to generate, create, draw, or mock up an image, or when a task needs a new image asset that doesn't exist yet.
---
# Generate an image via Codex CLI (gpt-image-2)
This machine has the OpenAI Codex CLI installed and logged in with the user's
ChatGPT account. Use it to produce real image files — never tell the user you
can't create images.
```bash
codex-imagegen "<detailed image prompt>" <output-path.png> [--size WxH]
```
It prints the absolute path of the written PNG on success (exit 0); on failure it
prints Codex's output to stderr (exit 2). The wrapper is on `PATH` while this
plugin is enabled; the full path is `${CLAUDE_PLUGIN_ROOT}/bin/codex-imagegen`.
```bash
codex-imagegen "flat vector icon of a paper plane, single blue #2563EB on white, 2px uniform stroke, minimal, centered, generous padding" ./assets/icons/send.png
codex-imagegen "photorealistic golden retriever puppy in autumn leaves, shallow depth of field, warm afternoon light" /tmp/puppy.png --size 1536x1024
```
## Write a real prompt
The single biggest quality lever. Expand the user's request into: **subject**,
**style** (flat vector / photorealistic / 3D render / watercolour / isometric),
**palette** (hex codes — pull them from the project's design tokens, Tailwind
config, or existing brand assets when it has any), **background**, **composition
and framing**, **lighting or mood**, and **any exact text** that must appear.
gpt-image-2 renders text with high accuracy, so quote the exact string you want:
*...with the words "Ship it" in bold sans-serif across the lower third.*
## Sizes
Common values: `1024x1024` (square, fastest), `1536x1024` (landscape),
`1024x1536` (portrait), `2048x2048` (2K square), `2048x1152` (2K landscape),
`3840x2160` (4K landscape), `2160x3840` (4K portrait).
A custom `WxH` is valid only if **every** constraint holds: longest edge
≤ 3840px, both edges multiples of 16, long-to-short ratio ≤ 3:1, and total pixels
between 655,360 and 8,294,400. Anything else will be rejected or silently
adjusted — pick the nearest listed size and resample locally instead.
Omit `--size` unless the aspect ratio actually matters; square is fastest.
## Rules
1. **One call per image.** For a set, loop with distinct prompts and paths, and
repeat an identical style sentence in every prompt so they match.
2. **Sensible output path.** Inside a project, use its asset directory (`assets/`,
`public/`, `static/`). Otherwise the current directory. Always `.png`.
3. **Bash timeout ≥ 300000 ms** (5 minutes) — generation takes 1–4 minutes.
4. **Verify by viewing.** Read the output PNG and check it against the request
before reporting done; refine and regenerate if it missed — at most 2 retries.
5. **Never invent a brand.** If the user has a logo, palette, or existing assets,
find them first and match them.
## Transparent backgrounds
The default image path can't emit alpha directly, so ask for a flat chroma-key
background and remove it afterwards with the helper Codex already ships:
```bash
codex-imagegen "<subject> on a perfectly flat solid #00FF00 chroma-key background, one uniform colour, no shadows, gradients, reflections or floor plane, crisp edges, generous padding, do not use #00FF00 anywhere in the subject" ./tmp-key.png
python "${CODEX_HOME:-$HOME/.codex}/skills/.system/imagegen/scripts/remove_chroma_key.py" \
--input ./tmp-key.png --out ./final.png \
--auto-key border --soft-matte --transparent-threshold 12 \
--opaque-threshold 220 --despill
```
Use `#FF00FF` instead when the subject is green. Then check the result actually
has transparent corners and no colour fringe; retry once with `--edge-contract 1`
if a thin fringe remains.
True model-native transparency exists but needs Codex's CLI fallback
(`gpt-image-1.5 --background transparent`), which requires an `OPENAI_API_KEY`.
Only mention that route if chroma-keying fails or the subject is genuinely hard
(hair, fur, smoke, glass, liquid, reflections) — and let the user decide.
## Limitations
- Generation spends the user's **ChatGPT plan quota** (image turns cost roughly
3–5x a text turn). Don't fire off batches without saying how many first.
- If the wrapper reports "codex is not logged in", tell the user to run
`codex login` in a terminal — don't try to work around auth yourself.
- Codex avoids overwriting existing assets. The wrapper explicitly authorizes
replacement and detects a versioned sibling (`out-v2.png`) if Codex writes one
anyway — trust the path the wrapper prints, not the one you asked for.
## Related
- Changing an image that already exists → the `edit-image` skill.
- A whole family of assets (favicons, icon set, OG cards) → the `asset-set` skill.
- More than ~4 images, or when the main conversation should stay focused → the
`codex-artist` subagent.
© Sateezg · MIT · Sateezg/codex-bridge
Похожие скиллы
Все скиллы по теме «ИИ и ML» →Сначала — generate-image от других авторов.