con un clic
lovstudio-document-illustrator
// 为文档原地插入 AI 配图。读取文档后全局规划插入点,并行生成所有图片, 异步插回原文。支持封面图、自定义比例和三种风格。 Use when: 用户要求为文档/文章/笔记生成配图、插图。 Also trigger when user mentions: 配图、插图、illustration、 generate images、document images、为文章加图。
// 为文档原地插入 AI 配图。读取文档后全局规划插入点,并行生成所有图片, 异步插回原文。支持封面图、自定义比例和三种风格。 Use when: 用户要求为文档/文章/笔记生成配图、插图。 Also trigger when user mentions: 配图、插图、illustration、 generate images、document images、为文章加图。
Analyze articles for AI-generated content indicators and rewrite to pass WeChat's 3.27 non-human automated content creation detection. Checks for template phrases, transition word density, sentence uniformity, paragraph pattern repetition, and other signals that WeChat uses to flag AI content. Outputs a risk report and an optional humanized rewrite. Use when the user wants to check if an article looks AI-generated, make an article more human-like, bypass WeChat AI detection, or humanize AI-written content. Also trigger when the user mentions "去AI痕迹", "人性化润色", "微信AI检测", "anti-ai-check", "humanize article", "公众号发文检查".
Generate professional slide deck images from content (Markdown, text, URLs). Creates outlines with style instructions, then generates individual slide images. Supports 16 visual styles, CJK/Latin mixed text, branding overlays, and PPTX/PDF export. Use when the user asks to "create slides", "make a presentation", "generate deck", "slide deck", "PPT", "做PPT", "生成幻灯片", "制作演示文稿", or wants to turn content into a visual slide deck.
Use when the user needs multi-source research with citation tracking, evidence persistence, and structured report generation. Triggers on "deep research", "comprehensive analysis", "research report", "compare X vs Y", "analyze trends", or "state of the art". Not for simple lookups, debugging, or questions answerable with 1-2 searches.
Create event posters, exhibition posters, flyers, and promotional graphics from a brief. Outputs print-ready high-resolution PNG. Trigger words: 海报, poster, event poster, 展览海报, 展架, 活动海报, 宣传图, promotional, banner, flyer
Extract invoice data from images or text descriptions and generate a categorized Excel expense report. Supports receipt photos, scanned invoices, and manual text input. Auto-classifies into: business entertainment (客户餐费), travel-transport (机票/火车票/打车), travel-accommodation (酒店), travel-meals, office supplies, communication, and other. Use when the user mentions "发票报销", "expense report", "报销单", "发票整理", "invoice", "报销汇总", "发票分类", "reimbursement", or has invoice images to process.
Fetch a company/product logo from public sources (Clearbit, og:image, favicon) given a brand name or URL, score candidates (wide-aspect + transparent preferred), and archive the best + runner-ups to the configured logo collection directory. Trigger when the user says "find logo", "找 logo", "抓 logo", "收集 logo", "brand asset", "需要 <brand> 的 logo", or wants logos laid out for a website/PPT/poster.
| name | lovstudio-document-illustrator |
| category | Content Processing |
| tagline | 为文档原地插入 AI 配图。全局规划插入点,并行生成,异步插回原文。 |
| description | 为文档原地插入 AI 配图。读取文档后全局规划插入点,并行生成所有图片, 异步插回原文。支持封面图、自定义比例和三种风格。 Use when: 用户要求为文档/文章/笔记生成配图、插图。 Also trigger when user mentions: 配图、插图、illustration、 generate images、document images、为文章加图。 |
| allowed-tools | ["Read","Write","Edit","Bash(python:*)","Glob","Agent","AskUserQuestion"] |
| model | claude-opus-4-5-20251101 |
| metadata | {"version":"0.2.1","author":"lovstudio","tags":"document-illustration image-generation markdown"} |
| license | MIT |
| compatibility | >=1.0 |
基于 AI 智能分析的文档配图生成工具。全局规划、并行生成、异步插入,高效为文档添加配图。
备份 → 全局规划插入点 → 并行生成图片 → 异步插入原文 → 清理备份
在修改前先创建备份,确保安全回滚:
import shutil
backup_path = f"{doc_path}.illustrator-backup"
shutil.copy2(doc_path, backup_path)
所有后续操作直接在原文件上进行。
读取完整文档,一次性规划所有图片的插入位置:
插入计划:
[1] 行 15 后 | 锚点: "## Rules 的诞生" | 主题: Rules 演化历程
[2] 行 42 后 | 锚点: "## Commands 打包" | 主题: 工作流打包
[3] 行 78 后 | 锚点: "## MCP 动态能力" | 主题: 第三方集成
...
[cover] 行 1 前 | 封面图 | 主题: 全文概要
关键:插入锚点使用上下文文本(而非纯行号),这样即使前面的插入导致行号偏移,后续插入仍可通过锚点定位。
用 Agent 工具并行启动所有图片生成子任务:
对每个插入计划项,同时启动一个 Agent:
Agent 1: generate_single_image.py --title "..." --content "..." --output images/illustration-01.png
Agent 2: generate_single_image.py --title "..." --content "..." --output images/illustration-02.png
Agent 3: generate_single_image.py --title "..." --content "..." --output images/illustration-03.png
...
每个 Agent 完成后立即插入,不等待其他 Agent:

位置偏移处理:
## Rules 的诞生)而非行号来定位所有图片插入完成后:
![...]() 引用都已插入images/ 目录{doc_path}.illustrator-backup完成: 6/6 张配图已插入原文档
已清理备份文件
执行前 Claude 会询问(或从用户消息中推断):
| 选项 | 值 | 默认 |
|---|---|---|
| 图片比例 | 16:9 / 3:4 | 16:9 |
| 是否封面图 | 是/否 | 否 |
| 内容配图数量 | 3-10 | 根据文档长度推荐 |
| 风格 | gradient-glass / ticket / vector-illustration | gradient-glass |
如果用户在请求中已指定(如"竖屏、票据风格、8张"),直接使用,不再询问。
| 风格 | 关键词 | 适合 |
|---|---|---|
| gradient-glass | 玻璃拟态、极光渐变、科技感 | 技术文档、产品介绍 |
| ticket | 黑白对比、票券结构、极简 | 数据报告、信息图表 |
| vector-illustration | 扁平插画、复古配色、几何化 | 教程、故事、品牌 |
风格文件位于 styles/ 目录。
| 项目 | 值 |
|---|---|
| API 模型 | Gemini 2.0 Flash Image Preview |
| 16:9 分辨率 | 2560x1440 (2K) / 3840x2160 (4K) |
| 3:4 分辨率 | 1920x2560 (2K) / 2880x3840 (4K) |
| 单张耗时 | ~10-20s |
| 并行耗时 | ~10-20s(总,不乘 N) |
| 依赖 | pip install google-genai pillow python-dotenv |
| API Key | .env 中 GEMINI_API_KEY 或环境变量 |
scripts/generate_single_image.py — 单张图片生成(供 Agent 并行调用)scripts/generate_illustrations.py — 旧版批量顺序生成(保留兼容)