Loading...
Loading...
Insert AI illustrations into documents in-place. After reading the document, plan insertion points globally, generate all images in parallel, and insert them back into the original document asynchronously. Supports cover images, custom aspect ratios, and three styles. Use when: Users request to generate illustrations for documents/articles/notes. Also trigger when user mentions: add illustrations, illustrations, illustration, generate images, document images, add images to articles.
npx skill4agent add lovstudio/skills lovstudio-document-illustratorBackup → Global insertion point planning → Parallel image generation → Asynchronous insertion into original document → Backup cleanupimport shutil
backup_path = f"{doc_path}.illustrator-backup"
shutil.copy2(doc_path, backup_path)Insertion Plan:
[1] After line 15 | Anchor: "## Birth of Rules" | Topic: Evolution of Rules
[2] After line 42 | Anchor: "## Commands Packaging" | Topic: Workflow packaging
[3] After line 78 | Anchor: "## MCP Dynamic Capabilities" | Topic: Third-party integration
...
[cover] Before line 1 | Cover image | Topic: Full document summaryFor each item in the insertion plan, start an Agent simultaneously:
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
...## Birth of Rules![...]()images/{doc_path}.illustrator-backupCompleted: 6/6 illustrations have been inserted into the original document
Backup file cleaned up| Option | Values | Default |
|---|---|---|
| Image Aspect Ratio | 16:9 / 3:4 | 16:9 |
| Include Cover Image | Yes/No | No |
| Number of Content Illustrations | 3-10 | Recommended based on document length |
| Style | gradient-glass / ticket / vector-illustration | gradient-glass |
| Style | Keywords | Suitable For |
|---|---|---|
| gradient-glass | Glass morphism, aurora gradient, tech vibe | Technical documents, product introductions |
| ticket | Black-white contrast, ticket structure, minimalism | Data reports, infographics |
| vector-illustration | Flat illustration, retro color scheme, geometric | Tutorials, stories, branding |
styles/| Item | Value |
|---|---|
| API Model | Gemini 2.0 Flash Image Preview |
| 16:9 Resolution | 2560x1440 (2K) / 3840x2160 (4K) |
| 3:4 Resolution | 1920x2560 (2K) / 2880x3840 (4K) |
| Single Image Time | ~10-20s |
| Parallel Processing Time | ~10-20s (total, not multiplied by N) |
| Dependencies | |
| API Key | |
scripts/generate_single_image.pyscripts/generate_illustrations.py