niu-image-gen

niu-image-gen is a skill for Codex from borawong/AiMaMi. It costs 84 tokens per session (4,942 once invoked), scanned A, original, Apache-2.0.

An image-generation skill that uses the Niu Image Gen plugin to create or edit bitmap images, such as changing a background or removing an object.

In plain words
What is it for?
It helps generate images, modify existing images, create batches, and save the resulting files to disk.
Why use it?
It provides a configured workflow for checking image-generation settings and handling single or batch image requests.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit It helps generate images, modify existing images, create batches, and save the resulting files to disk.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/borawong/aimami/niu-image-gen
About the project

borawong/AiMaMi is a native desktop companion for OpenAI Codex that manages accounts, sessions, routing, local configuration, MCP entries, and Skills through one interface. It is for Codex users who want to handle these local workflows without manually editing TOML, JSON, and SQLite files. The catalogue skill supports working with AiMaMi.

borawong/AiMaMi · 1,540 stars · on GitHub

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 borawong/AiMaMi --skill niu-image-gen
Clone the repo
git clone --depth 1 https://github.com/borawong/AiMaMi

Made for: 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 niu-image-gen

README.md
[![agentmods](https://agentmods.dev/badge/skills/borawong/aimami/niu-image-gen/github.svg)](https://agentmods.dev/skills/borawong/aimami/niu-image-gen)
Your own site
<a href="https://agentmods.dev/skills/borawong/aimami/niu-image-gen"><img src="https://agentmods.dev/badge/skills/borawong/aimami/niu-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 niu-image-gen

Your own site · 80×15
<a href="https://agentmods.dev/skills/borawong/aimami/niu-image-gen"><img src="https://agentmods.dev/badge/skills/borawong/aimami/niu-image-gen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,942 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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 Excessive Agency · line 166
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Data Exfiltration · line 444
    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.00084 $0.04942
Opus 5.5 $0.00034 $0.01977
Sonnet 5.5 $0.00017 $0.00988
Haiku 4.5 $0.00008 $0.00494

Measured 1mo ago against content hash 0ea7820e5d56, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

niu-image-gen scanned grade A with 0 findings 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 1mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/niu-image-gen/skills/niu-image-gen/SKILL.md · 452 lines

How it starts

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

Niu Image Gen 🎨

AI image generation with persistent config, zero-confirmation quick mode, and batch mode.

Script location

SCRIPT="$HOME/plugins/niu-image-gen/scripts/generate.mjs"

🔴 输出规则(最高优先级,所有 Branch 都必须遵守)

  1. 脚本输出 = 最终展示内容:运行脚本后,将脚本的 stdout 输出原样展示给用户。不要改写、省略、翻译、合并或重新组织脚本的输出。
  2. 禁止代码块包裹:脚本输出是格式化好的纯文本,绝对不要用 ``` 代码块包裹。直接作为普通消息文本展示。
  3. 交互提示 = 原样输出:本文件中所有 「📋 原样输出」 标记后面的引用块(> 开头),必须逐字输出给用户,包括所有 emoji、表格、分隔线。不得用自己的话重新表述。
  4. 禁止纯文本降级:不要去掉 emoji,不要把表格改成逗号列表,不要把多行合并成一行。

⚠️ ENTRY LOGIC — ALWAYS START HERE

Every time this skill is triggered, run this first:

node "$SCRIPT" --get-config

The output is JSON:

{
  "hasKey": true,
  "keyPreview": "sk-1aa1...aa4d",
  "quickMode": { "quality": "2K", "ratio": "square", "count": 1 },
  "batchMode": { "quality": "2K", "ratio": "landscape", "concurrency": 3 }
}

Fields can be null if not yet configured.

Decision tree — pick the FIRST matching rule, top to bottom:

# Condition Go to
1 hasKey is false → Branch A: First-time Wizard
2 hasKey is true AND quickMode is null → Branch A2: Quick Mode Setup
3 User intent is to modify config (keywords: 修改配置、设置、更改参数、配置、settings) → Branch C: Modify Config
4 User intent is batch generation (keywords: 批量、batch) → Branch D: Batch Mode
5 User intent is to edit an existing image (keywords: 编辑、修改图片、改一下、换背景、去掉、加上、变成、改成、edit、remove、replace — AND references an image or a previous generation exists) → Branch F: Edit Image
6 quickMode exists AND user message contains a prompt → Branch B: Quick Mode
7 quickMode exists AND user message has no clear prompt → Branch E: Help

IMPORTANT: Rules are ORDERED. Rule 3 beats Rule 6 — if the user says "修改配置", go to Branch C even though quickMode exists. Rule 4 beats Rule 6 — "批量生成猫" goes to Branch D, not Branch B. Rule 5 beats Rule 6 — "把背景换成海边" after a generation goes to Branch F, not Branch B.

Read the full file on GitHub · 452 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago First seen · 452 lines · 84 tokens per session scan A 0ea7820e5d56

Subscribe to this mod's changes

niu-image-gen is a skill published in the GitHub repository borawong/AiMaMi (1,540 stars, last pushed 17d ago), licensed Apache-2.0. It adds 84 tokens to every session and 4,942 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. 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

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

component-fixtures

Use when creating or updating component fixtures for screenshot testing or their shared infrastructure, or when designing UI components to be fixture-friendly. Covers fixture file structure, theming, service setup, CSS scoping, async rendering, validation, and common pitfalls.

microsoft/vscode · 53 tokens