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.
npx skills add Jxin-Cai/jxin-skills --skill gemini-image-gengit clone --depth 1 https://github.com/Jxin-Cai/jxin-skillsWrote 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.
[](https://agentmods.dev/skills/jxin-cai/jxin-skills/gemini-image-gen)<a href="https://agentmods.dev/skills/jxin-cai/jxin-skills/gemini-image-gen"><img src="https://agentmods.dev/badge/skills/jxin-cai/jxin-skills/gemini-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.
<a href="https://agentmods.dev/skills/jxin-cai/jxin-skills/gemini-image-gen"><img src="https://agentmods.dev/badge/skills/jxin-cai/jxin-skills/gemini-image-gen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00076 | $0.01513 |
| Opus 5 | $0.00038 | $0.00757 |
| Sonnet 5 | $0.00015 | $0.00303 |
| Haiku 4.5 | $0.00008 | $0.00151 |
Grade A, and why
gemini-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 12d 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.
How it starts
The opening of the file, as written. The whole thing — 143 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Gemini 图片生成器
通过 Gemini Web API 生成高质量图片的专用技能。设计为既可被用户直接调用,也可被其他技能(如叙事分镜技能)程序化调用。
核心能力
- 接收提示词 + 样式要求,调用 Gemini 生成图片
- 内置频率控制,防止 API 被风控
- 自动处理 Google 账号登录(首次使用弹浏览器,后续自动复用;显式 profile 时优先使用指定 profile)
- 完美支持中文提示词
执行流程
Step 1: 确认输入
需要两个关键输入:
- 图片提示词(必需):描述要生成什么图片的详细文本
- 样式要求(可选):视觉风格、配色、布局等要求
如果用户没给提示词而是给了一段内容或文件,先帮用户把内容转化为适合图片生成的提示词。转化时:
- 提取核心主题和关键视觉元素
- 用英文描述视觉构图(Visual 部分),中文只出现在标题/具体内容引用中
- 指定比例(默认 16:9)
- 结合用户指定的样式要求
如果用户既没有显式指定提示词文件保存目录,也没有显式指定图片输出目录,则默认使用调用该技能的会话当前根目录下的 image_output/ 作为工作目录,并在其中创建:
prompts/:保存生成或整理后的提示词文件images/:保存最终生成的图片
不要把提示词或图片写到 gemini-image-gen 技能自身目录里;技能目录只用于读取脚本和参考资料。
Step 2: 构建完整提示词
将用户的图片描述和样式要求组合成一份完整提示词。如果是从其他技能调用(如 ppt-storyboard),提示词已经准备好,直接使用。
提示词保存为 .md 文件,路径由调用方指定;如果调用方未指定,则默认保存到当前会话根目录下 image_output/prompts/。图片默认保存到当前会话根目录下 image_output/images/。
Step 3: 展示提示词并确认
直接用户调用时:展示提示词预览,等用户确认或修改后再生成。
被其他技能调用时(批量模式):跳过逐个确认,由调用方技能统一管理确认流程。
Step 4: 生成图片
调用 Gemini 生成图片:
cd <gemini-image-gen 技能目录>
bun scripts/generate-image.ts \
--prompt-file <提示词文件路径> \
--output <输出图片路径>
参数说明:
--prompt-file/-p:提示词文件路径(必需)--output/-o:输出图片路径(可选,默认根据提示词文件位置自动推断;如果调用方未提供目录,则落到当前会话根目录下的image_output/images/,并兼容smart-image-generator-output旧目录约定)
Step 5: 频率控制(重要)
Gemini API 有频率限制,连续调用会被风控。执行频率控制策略:
- 单次生成:直接调用,无需等待
- 批量生成(2张以上):每张图片之间等待 5 秒 + 1-5 秒随机秒数
- 大批量生成(5张以上):每 5 张额外等待 30 秒
- 如果遇到 429 或生成失败,等待 60 秒后重试,最多重试 2 次
频率控制的具体执行方式:在调用 generate-image.ts 之间插入等待。示例:
# 第1张
bun scripts/generate-image.ts -p prompts/page-01.md -o images/01.png
# 等待 5 秒 + 1-5 秒随机秒数
sleep $((5 + RANDOM % 5 + 1))
# 第2张
bun scripts/generate-image.ts -p prompts/page-02.md -o images/02.png
Step 6: 返回结果
生成完成后返回:
- 图片文件路径
- 生成状态(成功/失败/重试次数)
首次使用:自动登录
首次使用时脚本会自动:
- 打开 Chrome 浏览器(只1个窗口)
- 跳转到 gemini.google.com
- 等待用户登录 Google 账号(最多5分钟)
- 登录成功后自动保存状态,浏览器关闭
- 后续使用自动复用登录状态
- 如果显式指定 profile,则优先使用指定 profile,不复用外部已运行 Chrome 会话
- 如果 Gemini Web 当前账号/IP/地区不支持图片生成,脚本会直接报出 Gemini 返回的业务错误,而不是长时间卡住
What ships with it
42 files 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.
- bun.lock 6.8 KB
- package.json 165 B
- references/scene-types/cover.md 6.1 KB
- references/scene-types/flowchart.md 8.0 KB
- references/scene-types/mindmap.md 7.2 KB
- references/scene-types/note.md 7.3 KB
- references/scene-types/poster.md 9.0 KB
- references/styles/chalkboard.md 978 B
- references/styles/minimal.md 727 B
- references/styles/notion.md 940 B
- references/styles/obsidian.md 7.1 KB
- references/styles/thoughtworks.md 15 KB
- scripts/gemini-webapi/client.ts 22 KB runs code
- scripts/gemini-webapi/components/gem-mixin.ts 5.6 KB runs code
- scripts/gemini-webapi/components/index.ts 44 B runs code
- scripts/gemini-webapi/constants.ts 3.8 KB runs code
- scripts/gemini-webapi/exceptions.ts 1.2 KB runs code
- scripts/gemini-webapi/index.ts 273 B runs code
- scripts/gemini-webapi/types/candidate.ts 1.3 KB runs code
- scripts/gemini-webapi/types/gem.ts 1.8 KB runs code
- scripts/gemini-webapi/types/grpc.ts 369 B runs code
- scripts/gemini-webapi/types/image.ts 3.0 KB runs code
- scripts/gemini-webapi/types/index.ts 232 B runs code
- scripts/gemini-webapi/types/modeloutput.ts 816 B runs code
- scripts/gemini-webapi/utils/cookie-file.ts 2.3 KB runs code
- scripts/gemini-webapi/utils/decorators.ts 1.1 KB runs code
- scripts/gemini-webapi/utils/get-access-token.ts 8.3 KB runs code
- scripts/gemini-webapi/utils/http.ts 6.6 KB runs code
- scripts/gemini-webapi/utils/index.ts 1.1 KB runs code
- scripts/gemini-webapi/utils/load-browser-cookies.ts 10 KB runs code
- scripts/gemini-webapi/utils/logger.ts 1.2 KB runs code
- scripts/gemini-webapi/utils/parsing.test.ts 653 B runs code
- scripts/gemini-webapi/utils/parsing.ts 1.7 KB runs code
- scripts/gemini-webapi/utils/paths.ts 2.3 KB runs code
- scripts/gemini-webapi/utils/rotate-1psidts.ts 1.5 KB runs code
- scripts/gemini-webapi/utils/upload-file.ts 1.1 KB runs code
- scripts/generate-image.ts 7.6 KB runs code
- scripts/logout.ts 4.9 KB runs code
- scripts/package.json 80 B
- scripts/vendor/chrome-cdp/package.json 134 B
- scripts/vendor/chrome-cdp/src/index.test.ts 9.3 KB runs code
- scripts/vendor/chrome-cdp/src/index.ts 18 KB runs code
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.
- 12d ago First seen · 143 lines · 76 tokens per session scan A 43d9cb272b65
gemini-image-gen is a skill published in the GitHub repository Jxin-Cai/jxin-skills (5 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 76 tokens to every session and 1,513 once invoked, about $0.0004 per session on Opus 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-31.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
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…
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…
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.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…
insight-error-page
Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…