AI Image Generation and Editing
zhayujie/CowAgent
Generates or edits images from text prompts through a Python script that picks an image backend based on which API keys are configured.
Calls an OpenAI-compatible image generation API using PiDeck's separate image-provider config, then saves the result as a local file.
SKILL.md written in Chinese; this summary is our English description.
$ npx skills add ayuayue/PiDeck --skill image-gen -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ayuayue/PiDeck image-gen --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ayuayue/PiDeck.git skills-src && mkdir -p .claude/skills && cp -r skills-src/resources/skills/image-gen .claude/skills/image-gen && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "image-gen" agent skill from https://github.com/ayuayue/PiDeck/tree/main/resources/skills/image-gen into .claude/skills/image-gen/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "image-gen", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ayuayue/PiDeck/tree/main/resources/skills/image-genType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ayuayue/PiDeck --skill image-gen -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ayuayue/PiDeck image-gen --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ayuayue/PiDeck.git skills-src && mkdir -p .agents/skills && cp -r skills-src/resources/skills/image-gen .agents/skills/image-gen && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "image-gen" agent skill from https://github.com/ayuayue/PiDeck/tree/main/resources/skills/image-gen into .agents/skills/image-gen/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "image-gen", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ayuayue/PiDeck --skill image-gen -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ayuayue/PiDeck image-gen --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ayuayue/PiDeck.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/resources/skills/image-gen .cursor/skills/image-gen && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "image-gen" agent skill from https://github.com/ayuayue/PiDeck/tree/main/resources/skills/image-gen into .cursor/skills/image-gen/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "image-gen", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ayuayue/PiDeck.git --path resources/skills/image-gen--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ayuayue/PiDeck --skill image-gen -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ayuayue/PiDeck image-gen --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ayuayue/PiDeck.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/resources/skills/image-gen .gemini/skills/image-gen && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "image-gen" agent skill from https://github.com/ayuayue/PiDeck/tree/main/resources/skills/image-gen into .gemini/skills/image-gen/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "image-gen", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ayuayue/PiDeck image-genInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ayuayue/PiDeck --skill image-gen -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ayuayue/PiDeck.git skills-src && mkdir -p .github/skills && cp -r skills-src/resources/skills/image-gen .github/skills/image-gen && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "image-gen" agent skill from https://github.com/ayuayue/PiDeck/tree/main/resources/skills/image-gen into .github/skills/image-gen/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "image-gen", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ayuayue/PiDeck --skill image-gen -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ayuayue/PiDeck image-gen --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ayuayue/PiDeck.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/resources/skills/image-gen .opencode/skills/image-gen && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "image-gen" agent skill from https://github.com/ayuayue/PiDeck/tree/main/resources/skills/image-gen into .opencode/skills/image-gen/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "image-gen", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
image-genCalls an OpenAI-compatible image generation API using PiDeck's separate image-provider config, then saves the result as a local file.
This skill reads credentials and the model choice from PiDeck's own image-generation config, kept deliberately separate from the chat model configuration, falling back to the last-used provider and model or asking the user directly when that file can't be found. If the user wants image-to-reference editing, it asks for the reference image path and checks the provider actually supports it before sending one.
It builds the generation endpoint URL from the base URL by rule rather than guessing, appending the generations path or swapping in an edits path for reference-image requests, and sends the request in whichever of three OpenAI-compatible dialects the provider needs, always keeping the API key in the request header and never in logs, filenames, or echoed text.
2 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 3b93468. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
curlFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
api.openai.comark.cn-beijing.volces.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
PiDeck Image Generation Connector loads about 1.3k tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 283 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from ayuayue/PiDeck at commit 3b93468, republished under its MIT licence (© ayuayue). 283 words, ~1,307 tokens.
.claude/skills/image-gen/SKILL.md (or your agent's skills folder).当用户说「帮我画一张图」「生成一张海报」「做一个 logo」等请求时,用本技能 直接调用生图 API 出图。生成的图片保存为本地文件,交给用户在项目里使用。
生图供应商配置与「会话 LLM」完全分离:生图用的是 PiDeck 的 imagegen.json
(或用户直接提供的 baseUrl / apiKey / 模型),不碰 AI 对话用的模型配置。
生图请求最少需要三样:baseUrl + apiKey + 模型 id。按优先级取:
读 PiDeck 生图配置(如果用户在用 PiDeck):
| 平台 | 配置路径 |
|---|---|
| Windows 安装版 | %APPDATA%\PiDeck\imagegen.json(即 C:\Users\<用户>\AppData\Roaming\PiDeck\imagegen.json) |
| Windows 便携版 | <exe 同目录>\data\imagegen.json |
| macOS | ~/Library/Application Support/PiDeck/imagegen.json |
| Linux | ~/.config/PiDeck/imagegen.json |
旧版数据目录名为 pi-desktop,新首启已自动改名为 PiDeck;若 PiDeck 下没有该文件,再回退查同名 pi-desktop 路径。
文件结构:
{
"providers": [
{
"id": "ig-1",
"name": "OpenAI 或 Ark",
"baseUrl": "https://api.openai.com", // 根地址,端点按规则推导(见下)
"apiKey": "sk-xxxx",
"models": ["gpt-image-1"], // 该供应商可选模型
"extraParams": { "size": true, "output_format": false, "watermark": true },
"referenceMode": "none | edits | image-field", // 参考图 API 形态
"apiStyle": "openai | siliconflow" // 字段名/响应方言
}
],
"activeProviderId": "ig-1", // 用户上次选中的供应商
"activeModel": "gpt-image-1" // 用户上次选中的模型
}activeProviderId + activeModel:用户上次选的,通常是想要的。models[] 里;如果有多个模型,让用户确认用哪个(用户会指定)。读不到配置 / 用户不在 PiDeck 里:询问用户三样东西——
baseUrl、apiKey、模型 id。并顺手问是否需要参考图(图生图)。
用户可能要求「基于这张图改一下」(图生图 / 局部编辑)。有参考图时:
referenceMode 是 none:该供应商不支持图生图,直接告诉用户
「这个供应商没开启参考图能力」,不要硬发图。参考图约束(与 PiDeck 一致):≤ 4 张,支持 png/jpeg/webp。
baseUrl 是根地址,生图端点按下面规则推导(不要盲猜):
/images/generations 结尾 → 直接用。/v1、/v1beta、/api、/api/v3 等)→ 直接追加 /images/generations。https://ark.cn-beijing.volces.com/api/v3 → .../api/v3/images/generations/v1 再追加。https://api.openai.com → https://api.openai.com/v1/images/generations参考图走 edits 形态时,把上面结果里的尾段 /images/generations 换成 /images/edits。
鉴权一律 Authorization: Bearer <apiKey>。apiKey 只放 header,绝不写进日志、对话回显、生成的文件名或注释里。
无参考图或 referenceMode=image-field 时用这个:
curl -sS "$EP/generations" \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"model":"gpt-image-1","prompt":"<提示词>","n":1,"response_format":"b64_json"}'可选字段只在用户/配置显式开启时才发(避免未知字段 400):
size:官方尺寸,如 "1024x1024"(OpenAI)或 "2K"(方舟);watermark:true/false(方舟支持,OpenAI 官方不支持);output_format:"png" / "jpeg"(文件编码,seedream 5.0 支持)。response_format:"b64_json" 固定要发:图片直接以 base64 返回,不依赖 24h 临时 url。
参考图(image-field):方舟 seedream 风格,图片作为 data URI 数组放进 JSON 体:
{ "model": "...", "prompt": "...", "n": 1, "response_format": "b64_json",
"image": ["data:image/png;base64,<base64>"] }响应取图:data[0].b64_json;如果只有 data[0].url,则再 GET 该 url 下载图片字节。
参考图多张、局部编辑走 multipart 到 /images/edits:
curl -sS "$EP/edits" \
-H "Authorization: Bearer $KEY" \
-F "model=gpt-image-1" -F "prompt=<提示词>" -F "n=1" \
-F "image[]=@ref1.png" -F "image[]=@ref2.png"image[] 可多张;size 同样只在开启时才加 -F "size=..."。data[0].b64_json 或 data[0].url。字段名与响应结构都不同:
curl -sS "$EP/generations" \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"model":"<模型>","prompt":"<提示词>"}'image_size(不是 size),且仍只在开启 size 时发;
如 "image_size":"1024x1024"。"image":"data:image/png;base64,<base64>"。images[0].url(无 b64_json、无 data 数组)→ GET 下载该 url 得到图片字节。若响应只给了 url:curl -sS "<url>" -o out.bin,把返回字节当图片内容保存
(url 一般与 baseUrl 同源,直接取即可)。
把图片字节/解码后的 base64 写进当前项目目录:
assets/ 或 images/;没有就建,或按用户指定路径。hero-banner.png、app-icon.png;
重复则不覆盖,加 -2 后缀。图片格式(png / jpeg)以返回内容为准;base64 解码示例:
# 假设 base64 已存在变量 B64 里(去掉可能的 data:...;base64, 前缀)
printf '%s' "$B64" | base64 -d > assets/hero-banner.png完成后告诉用户文件保存路径,并把图片信息(尺寸、格式、路径)简述一句。
| 现象 | 原因 | 处理 |
|---|---|---|
| 401 / 403 | apiKey 错或没权限 | 让用户核对 key |
| 404 / 405 | baseUrl 拼错端点 | 按第三步规则重算 URL |
| 400 unknown field | 发了厂商不支持的字段(size/watermark/output_format) | 去掉未开启的可选字段重试 |
| 返回空、没有图片 | 方言不匹配(如把 SiliconFlow 当 OpenAI 读) | 按第四步对应方言解析响应 |
| 网络不通 | 需要代理 | 国内访问 OpenAI 官方可提示用代理(本地端口 7890) |
© ayuayue, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in resources/skills/image-gen of ayuayue/PiDeck.
Open the folder on GitHubat commit 3b93468
PiDeck Image Generation Connector next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| PiDeck Image Generation Connector this skillayuayue/PiDeck | 1k | — | ~1.3k | Automated safety check: Pass | MIT | |
| AI Image Generation and Editingzhayujie/CowAgent | 47k | — | ~1.3k | Automated safety check: Pass | MIT | |
| GPT Image Generation CLIwuyoscar/GPT-Image2-Skill | 5.7k | — | ~2.5k | Automated safety check: Notes | MIT | |
| Imagegentheowenyoung/home | 115 | 4 repos | ~4.8k | Automated safety check: Pass | Apache-2.0 | |
| Openai Image Gentrpc-group/trpc-agent-go | 1.9k | 12 repos | ~843 | Automated safety check: Pass | Apache-2.0 | |
| Image Generationonyx-dot-app/onyx | 32k | 1 repos | ~1.7k | Automated safety check: Pass | Custom licence |
zhayujie/CowAgent
Generates or edits images from text prompts through a Python script that picks an image backend based on which API keys are configured.
wuyoscar/GPT-Image2-Skill
Generates and edits images with GPT Image 2 or 2.5 through a packaged CLI and a prompt gallery, after settling which model fits the request.
theowenyoung/home
Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts.
trpc-group/trpc-agent-go
Batch-generate images via OpenAI Images API. An agent skill from trpc-group/trpc-agent-go.
onyx-dot-app/onyx
Generate or edit raster images (photos, illustrations, textures, sprites, mockups, logos, infographics) using the workspace's configured image-generation provider via onyx-cli image.
BlockRunAI/ClawRouter
Generates or edits images through ClawRouter's local image API, with a choice of models and sizes and payment handled automatically through x402.
ayuayue/PiDeck
帮用户接入/配置 MCP(Model Context Protocol)服务。当用户说「帮我接 MCP」「连上某个服务的 MCP」「配置 Model Context Protocol」「加个工具服务器」「为什么 MCP 连不上」等时使用。按服务官方文档把配置写进 pi 的 mcp.json,并用 pi mcp list 验证连接,全程不破坏用户已有配置。
ayuayue/PiDeck
Helps show a model provider's usage, balance or quota in PiDeck: checks built-in support, points to the dialog templates, or writes a custom probe entry.
ayuayue/PiDeck
Diagnoses problems in the PiDeck desktop app from a redacted environment report, matching health checks to known failure patterns with fix steps.
Works with
Categories
Calls an OpenAI-compatible image generation API using PiDeck's separate image-provider config, then saves the result as a local file. This skill reads credentials and the model choice from PiDeck's own image-generation config, kept deliberately separate from the chat model configuration, falling back to the last-used provider and model or asking the user directly when that file can't be found. If the user wants image-to-reference editing, it asks for the reference image path and checks the provider actually supports it before sending one.
PiDeck Image Generation Connector fits situations like: generating an image, poster, or avatar from a text prompt; editing an existing image using a reference-image-capable provider; switching between different OpenAI-compatible image providers.
Run `npx skills add ayuayue/PiDeck --skill image-gen -a claude-code`. Or copy the skill folder (resources/skills/image-gen in ayuayue/PiDeck) into .claude/skills/image-gen in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ayuayue/PiDeck --skill image-gen -a codex`. Or copy the skill folder (resources/skills/image-gen in ayuayue/PiDeck) into .agents/skills/image-gen in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ayuayue/PiDeck --skill image-gen -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/image-gen, .gemini/skills/image-gen, .github/skills/image-gen and .opencode/skills/image-gen in your project.
Going by SKILL.md and its folder, PiDeck Image Generation Connector needs the command-line tools its instructions call (curl). Our summary lists: baseUrl, apiKey, and model id for an OpenAI-compatible image API.
SKILL.md names 2 domains. In commands or code: api.openai.com and ark.cn-beijing.volces.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
PiDeck Image Generation Connector is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with PiDeck Image Generation Connector: AI Image Generation and Editing (zhayujie/CowAgent, 47k stars), GPT Image Generation CLI (wuyoscar/GPT-Image2-Skill, 5.7k stars), Imagegen (theowenyoung/home, 115 stars) and Openai Image Gen (trpc-group/trpc-agent-go, 1.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
ayuayue (a GitHub user) maintains it in ayuayue/PiDeck, which has 1,034 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 9, 2026.
Source: ayuayue/PiDeck on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.