gpt-image-2
面向 GPT Image 2 的图像生成 / 编辑技能。可在 3 种环境下使用:(A) Garden 本地模式,通过 OpenAI 兼容接口直接出图并落盘;(B) Host-Native 模式,把本 Skill 当作提示词工程指引,把渲染好的 prompt 交给宿主 Agent 自带的图像工具出图;(C) Advisor 模式,宿主无任何图像工具时退化为高质量 prompt 顾问。涵盖 18 大类、80+ 个结构化模板,覆盖海报 / UI / 产品 / 信息图 / 学术图 / 技术架构图 / 漫画 / 头像 / 流程板 / 电影分镜 / IP 周边 / 编辑工作流等场景。
Security Assessment
Detected risks:
About gpt-image-2
GPT Image 2 is a focused AI skill for image generation and editing powered by the GPT Image 2 model. It operates across three distinct runtime modes to adapt to different environments: Mode A (Garden local mode) provides full end-to-end image generation by calling the OpenAI-compatible API directly and saving outputs to disk; Mode B (Host-Native delegation) acts as a prompt engineering guide when the host agent already has its own image generation tools; and Mode C (Advisor mode) degrades gracefully to a high-quality prompt consultant when no image tooling is available. This adaptive design ensures the skill remains useful regardless of the deployment context.
The skill covers 18 major categories and 80+ structured prompt templates, spanning posters, UI mockups, product visuals, infographics, academic diagrams, technical architecture charts, comics, avatars, storyboards, film storyboards, IP merchandise, and editorial workflows. It exposes two core API operations — text-to-image generation (`POST /images/generations`) and image editing (`POST /images/edits`) — and includes a lightweight mode-detection script (`check-mode.js`) that must be run first to determine the correct behavior. Prompts and images are saved under a consistent naming convention with task slugs and timestamps to prevent collisions and support version management.
This skill is designed for developers, designers, and AI agent builders who need a reliable, environment-aware image generation layer. It is particularly valuable in agentic pipelines where the execution environment may vary — from a fully configured local Garden setup with an API key, to a hosted agent platform with native image tools, to a bare environment where only prompt crafting is possible. The configurable `OPENAI_BASE_URL` also makes it compatible with third-party OpenAI-compatible gateways beyond the official API.
FAQ
How do I know which mode the skill is running in?
Run `node skills/gpt-image-2/scripts/check-mode.js` before doing anything else. It detects whether `ENABLE_GARDEN_IMAGEGEN` is set and whether an `OPENAI_API_KEY` is present, then outputs the current mode (A, B, or C) along with a recommendation. Use the `--json` flag for structured output.
Can I use this skill with a third-party OpenAI-compatible image API?
Yes. Set `OPENAI_BASE_URL` to point to your gateway endpoint and optionally set `OPENAI_IMAGE_MODEL` to the model name your gateway supports (e.g., `gpt-image-1`, `dall-e-3`). The skill does not hardcode any specific third-party provider.
What happens if I enable Mode A but don't provide an API key?
The skill enters an ambiguous 'A?' state. It will not call the generation scripts and will prompt you to provide an `OPENAI_API_KEY`. Once the key is available, it will proceed with full Mode A behavior.
Does the skill generate images in Mode C?
No. In Mode C the skill acts purely as a prompt advisor. It renders a high-quality prompt from the selected template, saves it to `garden-gpt-image-2/prompt/<task-slug>-<timestamp>.md`, and instructs the user to run it in their own image tool (e.g., ChatGPT, Midjourney, DALL·E). It will not claim to have generated an image.
Where are generated files saved, and can I change the output path?
By default, prompts are saved to `garden-gpt-image-2/prompt/` and images (Mode A only) to `garden-gpt-image-2/image/`, both relative to the current working directory. You can override these paths by specifying them explicitly when invoking the skill. Directories are created automatically in Mode A if they do not exist.
All Files
103 filesInstall gpt-image-2
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
conardli/garden-skills