跳到正文
cccskills
免费在 GitHub 公开

gpt-image

Generate images, edit reference images, or redraw selected areas using GPT Image 2 or 2.5 through a packaged command-line tool. Resolve the model, image size, and quality settings, with reference examples available to guide the request.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Generate or edit images with GPT Image 2 or 2.5 through the packaged CLI and Reference Gallery. Use for image requests including imprecise 'GPT 2.5' model names, posters, typography, reference edits, and inpainting; resolve the model choice before generation.

集成工具OpenAI
查看安装方法

适用场景

  • Creating posters and images with text
  • Editing an existing image using references
  • Redrawing a selected area with a mask
  • Creating an image from multiple references

包含的文件(44)

  • SKILL.md10.0 KB
  • agents/openai.yaml297 B
  • references/craft.md19.4 KB
  • references/gallery-anime-and-manga.md15.2 KB
  • references/gallery-architecture-and-interior.md6.5 KB
  • references/gallery-beauty-and-lifestyle.md2.4 KB
  • references/gallery-brand-systems-and-identity.md3.3 KB
  • references/gallery-character-design.md1.9 KB
  • references/gallery-cinematic-and-animation.md5.9 KB
  • references/gallery-cinematic-film-references.md7.4 KB
  • references/gallery-data-visualization.md6.4 KB
  • references/gallery-edit-endpoint-showcase.md3.0 KB
  • references/gallery-events-and-experience.md2.5 KB
  • references/gallery-fashion-editorial.md8.7 KB
  • references/gallery-fine-art-painting.md5.9 KB
  • references/gallery-gaming.md8.5 KB
  • references/gallery-illustration.md2.3 KB
  • references/gallery-infographics-and-field-guides.md10.9 KB
  • references/gallery-ink-and-chinese.md2.5 KB
  • references/gallery-isometric.md4.6 KB
  • references/gallery-more-illustration-styles.md6.6 KB
  • references/gallery-official-openai-cookbook-examples.md3.8 KB
  • references/gallery-photography.md6.9 KB
  • references/gallery-pixel-art.md1.8 KB
  • references/gallery-product-and-food.md5.9 KB
  • references/gallery-research-paper-figures.md28.2 KB
  • references/gallery-retro-and-cyberpunk.md4.8 KB
  • references/gallery-scientific-and-educational.md8.6 KB
  • references/gallery-screen-photography.md3.2 KB
  • references/gallery-tattoo-design.md4.3 KB
  • references/gallery-technical-illustration.md7.0 KB
  • references/gallery-typography-and-posters.md14.9 KB
  • references/gallery-ui-ux-mockups.md6.3 KB
  • references/gallery-watercolor.md2.3 KB
  • references/gallery.md4.7 KB
  • references/models.md6.8 KB
  • references/openai-cookbook.md46.1 KB
  • references/openai-image-2.5-editing.md3.5 KB
  • references/openai-image-2.5-generation.md2.9 KB
  • references/openai-image-2.5-layout-and-text.md2.9 KB
  • references/openai-image-2.5-migration.md2.8 KB
  • references/openai-image-2.5.md1.4 KB
  • references/templates-gpt-image-2.5.md6.6 KB
  • scripts/generate.py2.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

gpt-image

Agent runbook for GPT Image 2 / 2.5 generation/editing. Use the prompt library + packaged CLI. Do not reimplement image API code.

Operating loop

  1. Classify request and resolve model: generate, edit, inpaint, or multi-reference; identify asset type, exact text, aspect ratio, references, safety constraints, and budget/quality. Apply the model-choice rules below before any API call.
  2. Choose the reference path: Image 2 keeps the gallery-first workflow below. For 2.5, a precise brief needs no reference loading; otherwise choose one short task slice.
  3. Refine only as needed: preserve the brief. Add a specific gallery case, craft section or template only to fill a concrete gap; do not load them as a bundle for 2.5.
  4. Confer when useful: before costly/ambiguous/high-polish calls, present 1–3 matched directions plus planned size/quality; ask at most one concise question at a time. Skip long discussion for precise “generate now” requests with a resolved model.
  5. Preflight, no side effects: use existing CLI/skill if present. Check command availability (command -v gpt-image), installed tool lists when the tool manager exists, or the runtime’s own skill registry when available. Do not assume a local home path in cloud/hosted runtimes.
  6. No blind setup: do not reinstall, overwrite skill folders, create/modify .env, or write API keys unless the user explicitly requested setup. Global/shared installs are opt-in only.
  7. Execute via CLI only: call gpt-image or scripts/generate.py with an explicit --model. Do not create a new generate.py, SDK wrapper, or ad-hoc script for normal image requests.
  8. Report: output file path(s), key flags, and one concise refinement suggestion if useful.

Fast path: confirmed 2.5 model + precise prompt + “generate now” → preflight and CLI, without a mandatory reference/craft pass. Do not reconfirm an exact valid model.

Model choice and prompt adaptation

ChoiceAPI model IDSuggested use
Flaregpt-image-2.5-flareFast general generation and drafts
Sunburstgpt-image-2.5-sunburstPrecise reference edits and detailed control
Image 2gpt-image-2Existing Image 2 workflows and compatibility
  • If the model is absent, ambiguous (such as “GPT 2.5”), or misspelled, ask one clear question offering Flare, Sunburst, and Image 2 with these trade-offs, then wait. For a typo, suggest the likely intended choice without silently correcting it. Do not treat gpt-image-2.5 as an API model ID.
  • Use an exact supported model ID, an unambiguous choice from this menu, or the user's already confirmed choice for the current task without asking again. If the user explicitly says “you choose,” explain the pick briefly and proceed; consider their task and budget rather than always selecting the most expensive settings.
  • Always pass the chosen ID through --model. The CLI retains gpt-image-2 as its backward-compatible default, but that default is not a substitute for the agent resolving the user's choice.
  • Keep model confirmation, cost discussion, and API flags separate from the final image prompt. Use the model-specific reference path below only when it helps the task. Preserve the user's exact text, intended content, reference identity, and edit invariants; obtain confirmation before material prompt changes.
  • Generate one image unless the user requested more. Do not silently switch models, change material prompt content, or run multiple model/prompt variants or comparisons. Ask before additional paid variants. For an authorized same-prompt comparison, keep the prompt, size, and quality identical unless the user asks to vary them.
  • Consult references/models.md when parameter support or validation status needs checking. On an invalid-model, access/403, quota, or policy failure, report the failure and stop; do not switch models or rewrite the prompt to retry automatically.

CLI resolution

Preferred call order:

# Existing CLI on PATH
gpt-image --model MODEL_ID -p "PROMPT" [-f OUT] [-i REF...] [-m MASK] [options]

# Installed skill folder; use runtime-provided skill path when available
uv run "$SKILL_DIR/scripts/generate.py" --model MODEL_ID -p "PROMPT" [-f OUT] [-i REF...] [-m MASK] [options]

# Direct transient CLI when the user requested setup/one-off CLI execution
uvx --from git+https://github.com/wuyoscar/gpt_image_2_skill gpt-image --model MODEL_ID -p "PROMPT" [options]

scripts/generate.py is a launcher: repo-local src/gpt_image_cli → installed gpt-image → PATH gpt-image → transient uvx/uv fallback.

Key and cost rules

  • CLI reads OPENAI_API_KEY from process env, then .env, then ~/.env without overriding existing env; successful API calls may bill the user’s OpenAI account.
  • If host/runtime has native platform-managed image generation and the user wants that path, use the host tool instead of this CLI.
  • If OPENAI_API_KEY is unset, report missing key or use host-native generation when requested; do not write secrets.
  • If user wants to avoid local-key use, respect unset OPENAI_API_KEY; if a key exists in .env/~/.env, tell them to remove/rename it for the session rather than working around it.
  • Never print secret values.

Flags

FlagValuesUse
-p, --promptstringRequired prompt/edit instruction
-f, --filepathOutput path; auto-named if omitted
-i, --imagerepeatable pathUse edits endpoint; supports multiple references
-m, --maskPNG pathInpaint with alpha mask; requires -i
--modelgpt-image-2, gpt-image-2.5-flare, gpt-image-2.5-sunburstAgent must pass the resolved choice explicitly
--size1k, 2k, 4k, portrait, landscape, square, wide, tall, or literalCanvas size
--qualitylow, medium, high, auto; 2.5 also xhigh, maxCost/quality dial; check model-specific limits
-n, --nintegerNumber of images
--backgroundauto, opaque; 2.5 also transparentTransparency requires PNG or WebP, not JPEG
--input-fidelitylow, high; omitted by defaultEdit-only; explicit 2.5 values are forwarded to the API, not assumed supported
--moderationauto, lowGeneration moderation setting
--formatpng, jpeg, webpOutput encoding
--compression0-100JPEG/WebP compression
--userstringOptional end-user identifier

Quality starting points (not guarantees; keep the user's agreed setting). For 2.5, these take precedence over fixed quality advice in older craft references:

  • low: cheap drafts and broad exploration; multiple variants require user authorization.
  • medium: normal exploration, style probing, balanced cost.
  • high: CLI default and a candidate for final assets, dense text, diagrams and UI. On 2.5, evaluate against the task requirements; do not assume medium fails or a higher setting always wins.
  • xhigh / max: 2.5-only options for higher-quality work; discuss the cost trade-off before increasing an already agreed quality. Do not use them automatically for budget-conscious requests.

Size policy:

  • default/social square: 1k / 1024x1024
  • poster/mobile/beauty: portrait
  • landscape/gameplay/photo: landscape
  • print/paper figure: 2k
  • widescreen hero: 4k
  • vertical story/banner: tall

Endpoint routing

ModeTriggerEndpoint
Text-to-imageno -i/v1/images/generations
Reference editone or more -i/v1/images/edits
Inpaint-i + -m/v1/images/edits with mask

Surface API errors verbatim enough for debugging; exit codes: 0 success, 1 API/refusal, 2 bad args/missing key.

Reference loading

  • Image 2: open references/gallery.md, then one matching references/gallery-*.md category and its actual prompt text. Read only relevant sections of references/craft.md or the historical references/openai-cookbook.md when needed.
  • Image 2.5: no mandatory references for a precise brief. If guidance is needed, choose one directly: references/openai-image-2.5-generation.md (photo/product/illustration), references/openai-image-2.5-layout-and-text.md (text/UI/diagrams/panels), or references/openai-image-2.5-editing.md (references/masks/translation).
  • Other questions: references/openai-image-2.5.md is an optional index; references/openai-image-2.5-migration.md covers migration/comparison; references/models.md owns current API parameters and validation status.
  • Extra inspiration only: gallery cases, a targeted craft section, or references/templates-gpt-image-2.5.md (community adaptations, not verified outputs). Do not preload them or the old Cookbook for 2.5.

Load the smallest useful slice, not both model routes. Add a second task slice only for a genuine hybrid. Historical examples do not override current API notes or the user's model/settings.

Verification

  • Before API call: check the resolved model and explicit --model, endpoint mode, size, quality, output path, and required reference/mask files. Omit --input-fidelity unless explicitly needed; do not assume 2.5 always uses or accepts high.
  • After CLI call: report path(s) printed by the CLI and surface stderr on failure.
  • For edits/inpaints: verify -i paths exist; verify -m exists when used.

Preserve Curated vs Author + Source metadata when adapting examples. Add new collected prompts to the Reference Gallery before README promotion.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Turn reference images into prompts for AI image generation by describing composition, lighting, colors, and materials. Receive a main prompt and a negative prompt that specifies unwanted features, tailored to the image’s visual medium.

中文简介正在准备中。当前显示英语简介。

  • Recreating a reference photo’s composition and lighting
  • Turning an illustration’s visual style into a prompt
  • Describing materials and backgrounds in product images
wuyoscar/GPT-Image2-Skill58362026年9月30日 更新

查看 wuyoscar 的全部技能

报告此技能的问题