Token导航 LogoToken导航

Agent Skill · 图像处理

gpt-image-2-skill(gpt 图像 2 技能)

用于辅助图像生成、图片编辑、视觉素材处理或图像模型工作流。它适合让 Agent 根据文本生成图片、处理背景、整理视觉提示词或调用相关图像工具。使用时需要确认输入图片、版权来源、输出格式和模型限制;涉及人物、品牌、商品或公开展示素材时,应额外核对授权、真实性和内容合规边界。

gpt-image-2-skill 是图像处理类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有未通过项,按安装量在图像处理类的 1,562 个 Skill 里排第 1,431。

总安装 315周安装 13GitHub Stars 20下载 103核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gpt-image-2-skill(gpt 图像 2 技能)
来源仓库:https://github.com/wangnov/gpt-image-2-skill
仓库路径:skills/gpt-image-2-skill
安装命令:
npx skills add https://github.com/wangnov/gpt-image-2-skill --skill gpt-image-2-skill
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/wangnov/gpt-image-2-skill --skill gpt-image-2-skill

这个 Skill 是做什么的

图像处理类 Skill 处理生成、裁剪、压缩和批量转换图片的任务。

用于辅助图像生成和图片编辑工作流。适合根据文本生成图片或处理视觉提示词。通过 npx skills add 命令从指定仓库安装并使用。使用时需确认输入图片、版权来源和输出格式,涉及人物或品牌时需额外核对授权。gpt-image-2-skill 属于图像处理类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/gpt-image-2-skill

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/wangnov/gpt-image-2-skill --skill gpt-image-2-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

gpt-image-2-skill 怎么安装?

在终端执行 npx skills add https://github.com/wangnov/gpt-image-2-skill --skill gpt-image-2-skill。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

gpt-image-2-skill 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

gpt-image-2-skill 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

gpt-image-2-skill 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

gpt-image-2-skill 用的人多吗?

公开数据是累计安装 315 次,近一周安装 13 次,下载 103 次,GitHub 20 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

gpt-image-2-skill 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理图像处理类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

图像处理类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
ai-image-generation

AI 图像生成 · Codex、Claude

4,365,552382调用外部服务未明确有提醒
openai-image-gen

OpenAI 图像生成 · OpenClaw

1,906,88432需要联网MIT-0有提醒
image

图像 · OpenClaw

525,99926需要联网MIT-0通过
baoyu-cover-image

宝玉封面图 · Codex、Claude

474,24016,779只读MIT有提醒
baoyu-image-gen

宝玉图像生成器 · Codex、Claude

468,00716,778接触敏感数据MIT通过
gpt-image-2-skill

gpt 图像 2 技能 · 本页

31520接触敏感数据未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Run image generation and editing through one CLI surface that hides provider differences. The Node wrapper at scripts/gpt_image_2_skill.cjs resolves an underlying Rust binary (env override → installed binary → Tauri App bundled CLI → repo cargo run → cached release → bootstrap download) and forwards every flag.

When to use this skill

  • Generate or edit an image and capture a structured result an agent can parse.
  • Switch between OPENAI_API_KEY, an OpenAI-compatible base URL, and Codex auth.json without changing command shape.
  • Respect shared provider config at $CODEX_HOME/gpt-image-2-skill/config.json so CLI, App, and Skill use the same default provider.
  • Need final transparent PNG deliverables, masks, custom sizes up to 4K, or raw request bodies.
  • Want live progress events (retries, multipart prep, Codex SSE) on stderr while the final JSON lands on stdout.

Quick start

Always pass --json so the result is machine-readable. Add --json-events when progress visibility matters.

# 1. Confirm runtime + provider readiness
node scripts/gpt_image_2_skill.cjs --json config inspect
node scripts/gpt_image_2_skill.cjs --json doctor
node scripts/gpt_image_2_skill.cjs --json auth inspect

# 2. Generate a final transparent PNG deliverable
node scripts/gpt_image_2_skill.cjs --json --json-events \
  transparent generate --prompt "..." --out /tmp/asset.png \
  --size 2K --quality high

# 3. Generate a normal image (auto-selects provider; OpenAI first, then Codex)
node scripts/gpt_image_2_skill.cjs --json --json-events \
  images generate --prompt "..." --out /tmp/out.png \
  --format png --size 2K

# 4. Edit a reference image (OpenAI multipart)
node scripts/gpt_image_2_skill.cjs --json --json-events \
  images edit --prompt "..." --ref-image /tmp/in.png --out /tmp/out.png

# 5. Remove a controlled background from existing source images
node scripts/gpt_image_2_skill.cjs --json \
  transparent extract --input /tmp/source-green.png --out /tmp/asset.png \
  --method chroma --matte-color '#00ff00' --strict

# 6. Verify the final file before delivery
node scripts/gpt_image_2_skill.cjs --json \
  transparent verify --input /tmp/asset.png --profile icon --strict

# 7. Raw request escape hatch
node scripts/gpt_image_2_skill.cjs --json \
  request create --request-operation generate \
  --body-file /tmp/body.json --out-image /tmp/out.png --expect-image

# 8. Self-test (calls doctor + auth inspect)
node scripts/selftest.cjs

Force a provider with --provider openai, --provider codex, or any named provider from config inspect; leave the default --provider auto to use default_provider first. Override the legacy OpenAI base URL with --openai-api-base https://....

Runtime freshness check

Before using newly documented command groups, especially transparent generate, transparent extract, or transparent verify, confirm the actual CLI runtime is fresh enough. Skill files, the Tauri App bundle, npm global CLI, cargo-installed CLI, and wrapper cache can drift independently.

Start by checking the latest upstream CLI version:

npm view gpt-image-2-skill version

Then look for the Tauri App bundled CLI first. Treat the app bundle as user-managed software: if it exists but is older than upstream, ask the user before updating or replacing the app.

APP_CLI="/Applications/GPT Image 2.app/Contents/Resources/bin/gpt-image-2-skill"
[ -x "$APP_CLI" ] && "$APP_CLI" --version

If no app bundle CLI exists, check the shell CLI. If it is missing or older than upstream, silently update the CLI dependency with npm, then verify that the current shell resolves the new binary:

command -v gpt-image-2-skill || true
gpt-image-2-skill --version || true
npm install -g gpt-image-2-skill@latest
command -v gpt-image-2-skill
gpt-image-2-skill --version

After any update, run the skill wrapper smoke checks:

node scripts/gpt_image_2_skill.cjs --json doctor
node scripts/selftest.cjs

If a documented subcommand fails with unrecognized subcommand, diagnose stale runtime first rather than changing prompts or providers. Prefer the wrapper in this skill directory for reproducible skill execution, but keep the bare CLI fresh when examples or user commands call gpt-image-2-skill directly.

Shared config

Use the CLI config surface when the user asks to add or pin a provider:

node scripts/gpt_image_2_skill.cjs --json config path
node scripts/gpt_image_2_skill.cjs --json config add-provider \
  --name my-image-api \
  --type openai-compatible \
  --api-base https://example.com/v1 \
  --api-key sk-... \
  --set-default
node scripts/gpt_image_2_skill.cjs --json config test-provider my-image-api

Credential sources supported by CLI, App, and Skill: file, env, and keychain. File credentials are stored in the shared config file; JSON output redacts them.

Flags vs prompt — what each controls

Output properties (not "what to draw") are flag-controlled. Putting them in the prompt is unreliable and provider-dependent.

PropertyUse this flag, not the prompt
Output background (transparent / opaque / auto)`--background auto\transparent\opaque`
Output dimensions--size 2K, --size 4K, or --size WIDTHxHEIGHT
Output container`--format png\jpeg\webp`
Compression level--compression 0..100
Render quality`--quality low\medium\high\auto`
Number of images--n <count> (OpenAI only)
Edit mask region--mask <png> (OpenAI only)

The prompt is for "what is in the picture"; background, size, format, count, and mask are not. For example, to turn a transparent PNG into a white-background PNG, pass --background opaque — describing "white background" only in the prompt is not reliable.

Provider asymmetry: --background, --n, --moderation, --mask, and --input-fidelity are honored only by OpenAI (and OpenAI-compatible bases that proxy them). Codex image_generation does not honor --background; the runtime accepts the flag but the upstream tool drops it. The other four return code: "unsupported_option" if passed with --provider codex.

Transparent PNG deliverables

For transparent output, do not rely on provider-native transparency. Use the transparent command group as the Agent-facing tool layer:

  • transparent generate — prompt-to-final PNG. It generates a controlled matte source, extracts alpha locally, verifies the result, and only succeeds when the final PNG passes transparency checks.
  • transparent extract — local background removal from controlled source images you generated yourself. It is not a general-purpose background remover for arbitrary photos.
  • transparent verify — final gate for any PNG before delivery. Use --strict and the right --profile when the file must be accepted or fail the task.

A transparent deliverable is valid only if the final file has a real PNG alpha channel and passes verification. A visual appearance of transparency, a white background, or a checkerboard pattern is not sufficient.

--strict is profile-based:

ProfileUse forExtra strictness
genericcommon alpha/file checksdoes not over-police unusual assets
iconicons, stickers, game propsrequires clean opaque core, margin, low stray noise
productproduct/object cutoutssimilar to icon, with residue and edge checks
translucentglass, liquid, crystalrequires partial alpha
glowlight ribbons, flame, smoke, particlesrequires partial alpha and transparent margin
shadowsoft shadow assetsrequires partial alpha and transparent margin

The CLI is intentionally not a material classifier. The Agent should choose generation prompts and extraction methods based on the asset:

Asset typeGeneration guidanceExtraction guidance
Opaque object, icon, sticker, productSingle isolated subject, clear margin, perfectly flat chroma matte. Pick a matte color absent from the object.transparent generate or transparent extract --method chroma --matte-color <color>
Thin edges, hair, fur, lace, chain, nettingUse high resolution, strong subject/background contrast, no contact shadow, no background-colored details. Try magenta/cyan/green mattes if one contaminates the edge.Chroma extraction with --spill-suppression when needed, then verify with --expected-matte-color; retry with a different matte if residue remains.
Glass, crystal, liquid, hologramAsk for a centered asset on flat black and flat white backgrounds, keeping geometry identical. Use reference/edit flow when possible to keep alignment.transparent extract --method dual --dark-image black.png --light-image white.png
Glow, flame, smoke, mist, magic particlesGenerate dark and light background variants. Avoid textured backgrounds and avoid bloom reaching the image edge unless the edge is intentional.Prefer dual extraction; verify that partial_pixels is non-zero.
ShadowsDecide whether the shadow is part of the asset. If not, explicitly forbid contact shadows. If yes, generate on a flat matte with enough margin.Chroma for opaque shadow silhouettes; dual extraction for soft translucent shadows.
Unknown or unusual materialDo not classify it first. Generate controlled source variants, run extraction candidates, and keep the one that passes verification with the cleanest edge.Use --report-dir / --keep-sources while iterating, then deliver only the final PNG.

Examples:

# Simple asset: final transparent PNG, sources hidden unless there is a failure
node scripts/gpt_image_2_skill.cjs --json --json-events \
  transparent generate \
  --prompt "a polished fantasy sword game asset, no text, no frame" \
  --out /tmp/sword.png --size 2K --quality high

# Agent-controlled chroma flow
node scripts/gpt_image_2_skill.cjs --json --json-events \
  images generate \
  --prompt "a silver necklace, centered, on a perfectly flat pure magenta background, no shadow" \
  --out /tmp/necklace-magenta.png --format png --size 2K
node scripts/gpt_image_2_skill.cjs --json \
  transparent extract --method chroma \
  --input /tmp/necklace-magenta.png --matte-color magenta \
  --out /tmp/necklace.png --spill-suppression 0.85 --strict

# Semi-transparent material flow
node scripts/gpt_image_2_skill.cjs --json \
  transparent extract --method dual \
  --dark-image /tmp/glow-on-black.png \
  --light-image /tmp/glow-on-white.png \
  --out /tmp/glow.png --strict

Always inspect the JSON verification fields before delivery: passed, alpha_min, alpha_max, transparent_ratio, partial_pixels, and warnings. Also inspect quality fields: checkerboard_detected, touches_edge, edge_margin_px, stray_pixel_count, largest_component_ratio, matte_residue_checked, matte_residue_score, halo_score, transparent_rgb_scrubbed, quality_score, and failure_reasons. If passed is false, do not deliver the file as a transparent PNG. If matte_residue_checked is false for a chroma-derived PNG, run transparent verify again with the source matte via --expected-matte-color.

Notes

  • openai defaults to gpt-image-2; codex defaults to gpt-5.4 and delegates to image_generation.
  • Shared options actually honored everywhere: --size, --quality, --format, --compression.
  • OpenAI-only options: --background, --n, --moderation, --mask, --input-fidelity.
  • Retries: up to 3 with exponential backoff (1s → 2s → 4s). Codex 401 triggers one token refresh + one retry.
  • Size aliases: 2K → 2048x2048, 4K → 3840x2160. Custom WxH requires both edges multiples of 16, max edge 3840, max 8,294,400 pixels, max aspect ratio 3:1.

Reference files

Load on demand for deeper detail:

  • references/providers.md — OpenAI / OpenAI-compatible / Codex selection, auth sources, runtime discovery, update policy, and resolution order.
  • references/sizes-and-formats.md — size aliases, custom constraints, format/quality/compression/background, shared vs OpenAI-only flags.
  • references/transparent-png.md — Agent playbook for prompt design, controlled mattes, dual-background extraction, verification, and retry loops.
  • references/json-output.md — --json stdout schema, success and error envelopes, per-command shapes.
  • references/json-events.md — --json-events JSONL phases (request_started, multipart_prepared, retry_scheduled) and Codex SSE passthrough.
  • references/troubleshooting.md — runtime_unavailable, auth_missing, Codex 401 refresh, retry policy, size rejections, moderation, timeouts.

Codex compatibility

The companion file agents/openai.yaml is read by Codex Skill runtime only (Claude Code ignores it). Both runtimes execute the commands above with cwd at the skill directory, so relative paths like scripts/gpt_image_2_skill.cjs resolve in either harness.

平台分布

Codex

35.21%
按下载量换算36

Claude

29.9%
按下载量换算31

Cursor

21.43%
按下载量换算22

Gemini CLI

9.51%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

未通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills