gpt-image-2
Use when generating or editing raster images through GPT Image 2 / ChatGPT Images 2.0 using the user's ChatGPT subscription.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when generating or editing raster images through GPT Image 2 / ChatGPT Images 2.0 using the user's ChatGPT subscription.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Use when any oasis7 user request starts and must bind the canonical worktree, GitHub-backed task truth, and owner before routing.
Use when a branch is about to create a PR and needs fresh involved-role review.
Use when implementation is verified and the branch must proceed through review, PR, merge, and cleanup.
Use when a task has written repo truth and implementation should proceed step by step with evidence.
Use when about to claim a task is complete, tests passed, a branch is ready for PR, or a PR is ready to merge. Requires fresh verification, direct output inspection, and use of `./scripts/pm/claim-ready.sh` when the claim can be mapped to one verification command.
Use when a bound oasis7 task needs the next repo-owned workflow phase selected.
| name | gpt-image-2 |
| displayName | 🪞 GPT Image 2 — Image Generation via Your ChatGPT Subscription |
| description | Use when generating or editing raster images through GPT Image 2 / ChatGPT Images 2.0 using the user's ChatGPT subscription. |
| emoji | 🪞 |
| homepage | https://agentspace.so |
| license | MIT |
Use this skill when:
Do not use this skill when:
Generate images with GPT Image 2 (ChatGPT Images 2.0) inside your agent, using your existing ChatGPT Plus or Pro subscription — no separate OpenAI access, no Fal or Replicate tokens, no per-image billing.
Text-to-image, image-to-image editing, style transfer, and multi-reference composition. Runs entirely through the local codex CLI you're already logged into.
Heads up — this skill requires a ChatGPT Plus or Pro subscription plus the Codex CLI installed locally. If you have neither, you can use GPT Image 2 in the browser via RunComfy instead — hosted, no ChatGPT subscription or local install needed (RunComfy account required):
- Text-to-image: runcomfy.com/models/openai/gpt-image-2/text-to-image
- Image edit (i2i): runcomfy.com/models/openai/gpt-image-2/edit
The rest of this document covers the local Codex CLI flow for agents whose user has a ChatGPT subscription.

Example output: a plain flat-color icon repainted via --ref in ukiyo-e style — composition preserved, rendering swapped, period-appropriate red seal added by the model unprompted.
Trigger when the user explicitly asks for GPT Image 2 via their ChatGPT subscription, for example:
Do not auto-trigger for a plain "generate an image" request if the user didn't specify this route. If they did specify it, do not silently fall back to HTML mockups, screenshots, or a different image model.
A single bash script handles everything: runs codex exec with the right flags, retries nested sessions when the capability is flaky, then decodes the generated image from the persisted session rollout or other direct image-return paths the session emitted.
Text-to-image:
bash scripts/gen.sh \
--prompt "<user's raw prompt>" \
--out <absolute/path/to/output.png>
Image-to-image (reference flag is repeatable for multi-reference composition):
bash scripts/gen.sh \
--prompt "<user's raw prompt, e.g. 'repaint in watercolor'>" \
--ref /absolute/path/to/reference.png \
--out <absolute/path/to/output.png>
Optional:
--timeout-sec 300 (default 300)--attempts 5 (default 5)game_visual_interaction_designer slice or task brief rather than a direct user wording request, preserve the slice's explicit constraints and evidence target instead of mechanically using only the user's raw sentence../image-<YYYYMMDD-HHMMSS>.png in the current working directory if the user didn't specify.codex login and a valid ChatGPT subscription with image-generation entitlement.codex CLI installed — brew install codex or see openai/codex.codex login.python3 on PATH (ships with macOS; apt install python3 on Linux).This skill does not grant image-generation capability on its own. It exposes the capability the user already has through their ChatGPT subscription.
| code | meaning |
|---|---|
| 0 | success — output path printed on stdout |
| 2 | bad args |
| 3 | codex or python3 CLI missing |
| 4 | --ref file does not exist |
| 5 | codex exec failed (auth? network? model?) |
| 6 | no new session file detected |
| 7 | imagegen did not produce an image payload (feature not enabled, quota, or capability refused) |
On failure, name the layer in one sentence instead of dumping the full stderr at the user.
The codex CLI reuses the logged-in ChatGPT session and exposes an imagegen tool (gated behind the image_generation feature flag). The script:
~/.codex/sessions/ before the runcodex exec --enable image_generation --sandbox read-only ... (with -i <file> for each reference image)--attemptsscripts/extract_image.py to scan every new rollout JSONL plus the direct exec logs for an image payloaddata:image/... content--outTwo non-obvious flags other wrappers get wrong on codex-cli 0.111.0+:
--enable image_generation is required; the feature is still under-development and off by default.--ephemeral must not be used — ephemeral sessions aren't persisted, so the image payload has nowhere to live.The script is narrowly scoped on purpose:
~/.codex/sessions/* history out of scope, but attribution is still snapshot-based rather than cryptographically bound; run one invocation at a time if other local codex activity could write sessions concurrently.mktemp -d directory that are auto-deleted on exit.$HOME to locate ~/.codex/sessions. No other environment variables are used. No credentials are requested. No other paths under ~/.codex/ are accessed.image.pollinations.ai today); those downloads are host-restricted and size-capped before bytes are written locally. The main outbound traffic is still the codex CLI call to OpenAI using the user's existing ChatGPT login.Not a direct OpenAI API client. Not a capability grant — it depends on the user's working Codex CLI login. Not a multi-tenant service, and not concurrency-safe across simultaneous local invocations; treat it as a one-invocation-at-a-time helper.