Figforge Gen: Image Generation & Editing

VerifiedSafe

Generate and edit images using gpt-image-2 via CLIProxyAPI. Supports text-to-image and image editing with natural language prompts.

Sby Skills Guide Bot
Data & AIIntermediate
7/23/2026
Claude Code
#image-generation#text-to-image#image-editing#gpt-image-2#cli-proxy

Recommended for

Automated summary

This skill calls gpt-image-2 via CLIProxyAPI to generate or edit images based on natural language prompts or existing images.

Strengths

  • Supports both text-to-image generation and image editing in one tool
  • Automatic detection of task type based on user input
  • Flexible parameter handling including size, quality, output format
  • Timeout calculation based on image complexity and number of outputs

Limitations

  • Requires pre-configured API credentials and tokens
  • Only works with the gpt-image-2 model via the specific proxy
  • Script does not infer options; only the LLM can do so
When to use it

Use this skill to quickly generate or edit images from natural language descriptions or provided image files without leaving the terminal.

When not to use it

Avoid this skill if you need an interactive image editor or require generative models other than gpt-image-2.

Security analysis

Safe
Quality score92/100

The skill runs a Python script via Bash to call an image generation API. There are no destructive commands, no exfiltration, and no obfuscation. Bash usage is legitimate for environment setup and script execution.

No concerns found

How this analysis is made

Examples

Generate a cat avatar with transparent background
/figforge-gen generate a transparent background cat avatar, 1024x1024, png
Edit an image to watercolor style
/figforge-gen change ./input.png to watercolor style, keep the subject, output webp

name: figforge-gen description: Use when user requests image generation, image editing, text-to-image (文生图), image editing (改图), 修改图片, 编辑图片, "使用 gpt-image-2", or invokes /figforge-gen. Calls gpt-image-2 via CLIProxyAPI. argument-hint: <自然语言需求> allowed-tools: [Bash, Read]

figforge-gen

调用 CLIProxyAPI 上的 gpt-image-2 完成文生图与改图。支持自动触发与 /figforge-gen ... 手动调用。

资源

  • references/fields.md — 字段定义、自然语言映射、LLM 推断规则、timeout 规则(权威单一来源)
  • references/api-config.md — API 配置优先级、原子性约束、预检流程
  • scripts/figforge_gen.py — 接口调用脚本
  • scripts/choose_python.sh — 探测可用 Python 3.11+

手动调用时需求即 $ARGUMENTS:

/figforge-gen 生成一张透明背景的猫咪头像,1024x1024,png
/figforge-gen 把 ./input.png 改成水彩风,保留主体,输出 webp

任务分类

  • 文生图:生成图片、文生图、画一张图、用 gpt-image-2 生成
  • 改图:修改图片、编辑图片、改图、把这张图改成...

同时出现图片来源(本地路径/URL/data URL)与修改意图 → 按改图处理。

必填字段与追问

缺字段时先问,不执行:

| 任务 | 缺什么 | 追问话术 | |------|--------|----------| | 文生图 | prompt | 请补充图片提示词,例如你想生成什么画面。 | | 改图 | 图片来源 | 请提供要编辑的图片来源:1)本地路径 2)图片 URL / data URL | | 改图 | prompt | 请补充修改要求,例如你想把图片改成什么效果。 |

字段提取

优先级:用户明确字段值 > 自然语言明确要求 > LLM 保守推断 > 脚本默认值。

完整映射表与推断规则见 references/fields.md。要点:

  • 用途明显时(头像/壁纸/海报/banner/logo...)可保守推断 size、quality、background、output_format、n、input_fidelity
  • 信心不足 → 省略,使用脚本默认值,不要为可选字段反复追问
  • model、moderation、partial_images、output_compression 默认不推断
  • 推断出的字段只作为接口参数,不要从原始 prompt 中删除对应语义

直接从终端调用 scripts/figforge_gen.py 时,脚本不会自己推断;只有通过本 skill 由 LLM 整理参数时才发生这些推断。

执行步骤

1. 确定 task_cwd 与输出目录

task_cwd = 用户当前打开的项目/工作区目录。不是 skill 安装目录、脚本目录、$CODEX_HOME、~/.codex/generated_images/。

默认输出目录 <task_cwd>/figforge-gen/。用户指定其他目录时,相对路径按 task_cwd 解析。

--out-dir 是本地保存参数,不进入 API payload。

2. 探测 Python

python_cmd=$(bash "<skill-dir>/scripts/choose_python.sh") || { echo "未找到可用 Python 3.11+"; exit 1; }

$python_cmd 可能含多个词(如 uv run --python 3.12 python)。在 zsh -lc 中使用时,先用 python_argv=(${=python_cmd}) 拆成 argv,再用 "${python_argv[@]}" 调用。

3. API 配置预检(每次会话首次调用前)

zsh -lc 'source ~/.zshrc >/dev/null 2>&1 || true; cd "<task-cwd>" || exit 1; python_cmd=$(bash "<skill-dir>/scripts/choose_python.sh") || { echo "未找到可用 Python 3.11+"; exit 1; }; python_argv=(${=python_cmd}); "${python_argv[@]}" "<skill-dir>/scripts/figforge_gen.py" --show-config'

只检查输出 JSON 的 ok、source、base_url、model、token_present。不要打印、读取、复制或拼接完整 token。

预检失败处理与配置原子性约束见 references/api-config.md。

4. 计算 timeout

按 references/fields.md 的 timeout 规则,根据 size × n 决定本次 Bash 工具调用的 timeout 参数:

  • 单张基准:总像素 ≥ 8,000,000(4k 级) → 900000(15 分钟);其余 / auto / 无法解析 → 600000(10 分钟)
  • 实际 timeout = 单张基准 × n(脚本对 n 串行调用,必须按张累加)
  • 超过 Bash 工具上限时取上限即可

5. 调用脚本

文生图:

zsh -lc 'source ~/.zshrc >/dev/null 2>&1 || true; cd "<task-cwd>" || exit 1; python_cmd=$(bash "<skill-dir>/scripts/choose_python.sh") || { echo "未找到可用 Python 3.11+"; exit 1; }; python_argv=(${=python_cmd}); "${python_argv[@]}" "<skill-dir>/scripts/figforge_gen.py" --mode generate --prompt "..." --out-dir "<task-cwd>/figforge-gen"'

改图:加 --mode edit --image "..."(可选 --mask)。

按已提取字段附加可选参数: --size --quality --background --output-format --n --moderation --output-compression --partial-images --input-fidelity --no-stream --model --api-base --api-key --api-key-env --config

--no-stream 仅在用户明确要求非流式或 Responses 端点不可用排查时使用。

结果输出

脚本成功返回 {"ok": true, "paths": [...], "used_params": {...}},向用户输出:

图片已生成, 图片路径: <路径>
实际使用的关键参数: model=..., size=..., quality=..., output_format=..., n=..., stream=..., out_dir=...

多张图片列出全部路径。

脚本失败返回 {"ok": false, "error": "..."},向用户输出:

生成失败: <简短错误原因>

注意事项

  • 缺必填字段不要猜测
  • 不要为可选字段做冗长说明
  • 改图支持本地路径、URL、data URL
  • 不要为接口添加未定义的自定义字段
  • 调用完成后优先返回结果,不要输出多余解释

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/figforge-gen-image-generation-editing-mrwakafy/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/figforge-gen-image-generation-editing-mrwakafy' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/figforge-gen-image-generation-editing-mrwakafy/download' --output '.skill-downloads/figforge-gen-image-generation-editing-mrwakafy/SKILL.md.part' && mv '.skill-downloads/figforge-gen-image-generation-editing-mrwakafy/SKILL.md.part' '.skill-downloads/figforge-gen-image-generation-editing-mrwakafy/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/figforge-gen-image-generation-editing-mrwakafy/SKILL.md' && test -s '.skill-downloads/figforge-gen-image-generation-editing-mrwakafy/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/figforge-gen' && cp -R '.skill-downloads/figforge-gen-image-generation-editing-mrwakafy' '.claude/skills/figforge-gen'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/figforge-gen-image-generation-editing-mrwakafy'

openskills read 'figforge-gen-image-generation-editing-mrwakafy'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/figforge-gen-image-generation-editing-mrwakafy/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills