image-gen

image-gen is a skill for Claude Code, Codex from ayuayue/PiDeck. It costs 75 tokens per session (2,446 once invoked), scanned A, original, MIT.

Instructions for generating images such as illustrations, posters, avatars, and logos through an OpenAI-compatible image API. It explains how to select a configured image provider and save the result in the project.

In plain words
What is it for?
Use it when a user asks for a new image or visual asset, including requests that use a reference image, and when the generated file needs to be placed in the project.
Why use it?
It gives an agent a defined way to create image assets while keeping image-service settings separate from the conversation model settings.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when a user asks for a new image or visual asset, including requests that use a reference image, and when the generated file needs to be placed in the project.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ayuayue/pideck/image-gen
About the project

PiDeck is an open-source Electron desktop workbench for managing coding-agent conversations across local project directories, including pi and DSH sessions and imported Codex or Claude sessions. It is for developers who want one graphical workspace for multiple projects, session history, Git status, terminals, model settings, and extensions. Catalogue add-ons extend PiDeck's configuration and workflow capabilities.

ayuayue/PiDeck · 1,129 stars · on GitHub · pideck.caoayu.top

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ayuayue/PiDeck --skill image-gen
Clone the repo
git clone --depth 1 https://github.com/ayuayue/PiDeck

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for image-gen

README.md
[![agentmods](https://agentmods.dev/badge/skills/ayuayue/pideck/image-gen/github.svg)](https://agentmods.dev/skills/ayuayue/pideck/image-gen)
Your own site
<a href="https://agentmods.dev/skills/ayuayue/pideck/image-gen"><img src="https://agentmods.dev/badge/skills/ayuayue/pideck/image-gen/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for image-gen

Your own site · 80×15
<a href="https://agentmods.dev/skills/ayuayue/pideck/image-gen"><img src="https://agentmods.dev/badge/skills/ayuayue/pideck/image-gen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,446 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Data Exfiltration · line 74
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 87
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00075 $0.02446
Opus 5.5 $0.00030 $0.00978
Sonnet 5.5 $0.00015 $0.00489
Haiku 4.5 $0.00007 $0.00245

Measured 26d ago against content hash 44be5e6782d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

image-gen scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 26d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sS "$EP/generations" \
resources/skills/image-gen/SKILL.md · 174 lines

How it starts

The opening of the file, as written. The whole thing — 174 lines — stays where its author put it; the contents beside it link to each section on GitHub.

图片生成(image-gen)

这是什么

当用户说「帮我画一张图」「生成一张海报」「做一个 logo」等请求时,用本技能 直接调用生图 API 出图。生成的图片保存为本地文件,交给用户在项目里使用。

生图供应商配置与「会话 LLM」完全分离:生图用的是 PiDeck 的 imagegen.json (或用户直接提供的 baseUrl / apiKey / 模型),不碰 AI 对话用的模型配置。

第一步:确定模型与凭据

生图请求最少需要三样:baseUrl + apiKey + 模型 id。按优先级取:

  1. 读 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[] 里;如果有多个模型,让用户确认用哪个(用户会指定)。
  2. 读不到配置 / 用户不在 PiDeck 里:询问用户三样东西—— baseUrl、apiKey、模型 id。并顺手问是否需要参考图(图生图)。

第二步:确定是否有参考图

用户可能要求「基于这张图改一下」(图生图 / 局部编辑)。有参考图时:

  • 让用户提供图片的文件路径,或直接上传。
  • 把图片转成 base64 / data URI 备用(见下文各形态)。
  • 若供应商 referenceMode 是 none:该供应商不支持图生图,直接告诉用户 「这个供应商没开启参考图能力」,不要硬发图。

参考图约束(与 PiDeck 一致):≤ 4 张,支持 png/jpeg/webp。

第三步:拼端点 URL

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

Read the full file on GitHub · 174 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 26d ago Changed · +2 lines 44be5e6782d1
  2. 1mo ago First seen · 172 lines · 75 tokens per session scan A 4bd23311cb40

Subscribe to this mod's changes

image-gen is a skill published in the GitHub repository ayuayue/PiDeck (1,129 stars, last pushed yesterday), licensed MIT. It adds 75 tokens to every session and 2,446 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

article-writer

Multi-style article creation skill. Supports 5 writing styles (deep analysis, practical guide, story-driven, opinion, news brief), including complete workflow: material collection → outline → content → formatting. Activated when users mention "write article", "write post", "create", or "draft".

netease-youdao/LobsterAI · 62 tokens

skin-creator

Create and apply a two-asset LobsterAI visual skin from the user's style description. Use only when the AI Skin Designer kit supplies the structured skinpack workflow marker; do not use for ordinary theme or image requests.

netease-youdao/LobsterAI · 48 tokens

content-planner

WeChat Official Account topic planning and content calendar management. Based on WeChat article search and trending analysis, generates differentiated topic recommendations and outputs structured content calendars. Activated when users mention "topic", "planning", "content calendar", "trending", or "what to write next…

netease-youdao/LobsterAI · 63 tokens

weather

Get current weather and forecasts (no API key required).

netease-youdao/LobsterAI · 13 tokens

sn-ppt-dazzle

A workflow for turning an approved presentation outline into a single HTML deck that runs in a web browser. It creates a 1280-by-720 layout with animated backgrounds, page transitions, and keyboard navigation.

OpenSenseNova/SenseNova-Skills · 133 tokens

sn-search-academic

An academic research tool for finding papers and encyclopedia entries, reading papers in full or by section, and tracing references and citations. It supports structured literature research.

OpenSenseNova/SenseNova-Skills · 31 tokens