SuperAPI AI Directory

illustration-generator

Design & creation

View repository

Updated 10-16 05:52

About this skill

Illustration Generator (unified illustration skill)

One skill solves all illustration needs.

⚠️ Important: Automated workflow

When the user asks you to generate illustrations for an article, you must follow these steps:

Step 1: Analyze the article structure

python3 ~/.claude/skills/illustration-generator/scripts/generate.py article.md --preview

This analyzes the article and recommends styles, but does not generate images.

Step 2: Read and fill in visual_config.json

After the analysis is complete, read the generated visual_config.json file. For each section where visual_description is empty, you need to:

  1. Read the section's content_summary
  2. Based on the section content, generate aspecific visual scene description(50-150 characters)
  3. The description should include: specific visual elements such as scene, subject, action, atmosphere, color tone, etc.

Example:

  • Section content: "How AI changes workflows"
  • visual_description: "A modern office scene, with a glowing AI robot assistant at the center, surrounded by multiple floating workflow icons (calendar, email, document), blue-purple technological glow radiating outward from the robot, with a semi-transparent data stream in the background"

Step 3: Update the configuration file

Use the Edit tool to update visual_config.json, filling in all visual_description.

Step 4: Generate images

python3 ~/.claude/skills/illustration-generator/scripts/generate.py article.md --style <chosen_style>

Quick example

# 1. 预览分析
python3 ~/.claude/skills/illustration-generator/scripts/generate.py article.md --preview

# 2. 读取配置,手动填写 visual_description(你来完成)
# 3. 生成图片
python3 ~/.claude/skills/illustration-generator/scripts/generate.py article.md --style tech

Features

  • 🔍 Automatic analysis: analyze the Markdown article and identify positions that need illustrations
  • 🎨 3-variant preview: recommend 3 style variants to choose from
  • ⚡ Parallel generation: multithreaded generation + MD5 cache
  • 🔄 Single image modification: regenerate a certain illustration
  • ➕ Add illustration: add a new image at a specified position
  • 🗑️ Delete illustration: remove unwanted images
  • 📖 Cover generation: generate a cover image separately
  • 📱 Xiaohongshu mode: generate a 1-10 infographic series

Usage

1. Article illustrations (complete workflow)

/illustration-generator article.md

2. Specify style

/illustration-generator article.md --style tech

3. Generate cover only

/illustration-generator article.md --cover-only

4. Single image modification

/illustration-generator article.md --regenerate illustration_03.png

5. Add/delete illustrations

/illustration-generator article.md --add "在第二章后添加流程图"
/illustration-generator article.md --remove illustration_05.png

6. Xiaohongshu mode (new)

# 小红书图片系列
/illustration-generator content.md --mode xhs

# 指定风格和图片数量
/illustration-generator content.md --mode xhs --style cute --count 5

# 指定布局
/illustration-generator content.md --mode xhs --style notion --layout dense

20 styles

Category Style Description
Classic newyorker New Yorker magazine, minimalist lines
Classic ukiyoe Japanese ukiyo-e, Eastern aesthetics
Tech tech Tech digital, dark + neon
Tech blueprint Technical blueprint, engineering drawing
Tech pixel-art Pixel art, 8-bit game
Minimalist notion Minimalist hand-drawn, knowledge sharing
Minimalist minimal Minimalist Zen, lots of whitespace
Minimalist flat Flat illustration, general commercial use
Warm warm Warm and friendly, soft color tones
Warm playful Lively and cute, fun for beginners
Warm cute Cute and sweet, Xiaohongshu style
Artistic watercolor Watercolor style, artistic feel
Artistic sketch Hand-drawn sketch, creative ideas
Retro vintage Retro distressed, nostalgic aesthetics
Retro retro 80s neon, pop culture
Professional elegant Refined and elegant, business professional
Professional scientific Academic and scientific, paper charts
Professional editorial Magazine editorial, infographics
Educational chalkboard Blackboard chalk, education and training
Natural nature Natural and organic, eco-friendly and healthy

5 general layouts

Layout Description Use cases
single Single scene Covers, general supporting images
infographic Infographic Multiple key points, feature lists
comparison Comparison chart Left-right comparison, pros and cons
flow Flowchart Steps, timelines
scene Scene image Narrative, character stories

Xiaohongshu-specific layouts

Layout Density Use cases
sparse 1-2 points Covers, quote intros
balanced 3-4 points Regular content pages
dense 5-8 points Knowledge cards, practical tips
list 4-7 items Lists, rankings, steps
comparison 2 sides Pros and cons, A vs B
flow 3-6 steps Processes, timelines

Xiaohongshu workflow

用户输入内容
      ↓
┌─────────────────────────┐
│ Step 1: 内容分析         │
│ - 识别内容类型          │
│ - 推荐风格+布局         │
│ - 识别Hook类型          │
│ - 估算图片数量          │
└─────────────────────────┘
      ↓
┌─────────────────────────┐
│ Step 2: 3变体预览        │
│ 1. cute - 可爱甜美       │
│ 2. notion - 知识卡片     │
│ 3. warm - 温暖生活       │
└─────────────────────────┘
      ↓
┌─────────────────────────┐
│ Step 3: 生成大纲         │
│ - 封面(sparse)         │
│ - 内容页(balanced/dense)│
│ - 结尾(sparse + CTA)   │
└─────────────────────────┘
      ↓
┌─────────────────────────┐
│ Step 4: 批量生成         │
│ - 竖版 3:4 比例         │
│ - 手绘插画风格          │
│ - 信息图排版            │
└─────────────────────────┘

Content type mapping

Content type Recommended style Recommended layout
Product recommendation cute balanced
Practical tips sharing notion dense
Review comparison tech comparison
Tutorial steps playful flow
Pitfall avoidance guide bold list
List roundup minimal list
Personal story warm balanced

Hook types

Type Example
Number hook "5 methods", "Learn in 3 minutes", "99% of people don't know"
Pain point hook "Pitfalls I've stepped on", "Wish I'd known earlier", "Stop..."
Curiosity hook "So it turns out...", "Surprisingly...", "Didn't expect..."
Benefit hook "Save money", "Get prettier", "Double your efficiency"
Identity hook "A must-read for office workers", "Students", "New moms"

Call shared-lib

from illustration import (
    # 通用配图
    IllustrationGenerator,
    recommend_styles,
    analyze_article,
    
    # 小红书专用
    XhsGenerator,
    analyze_xhs_content,
    generate_xhs_outline,
    recommend_xhs_styles
)

# 小红书内容分析
analysis = analyze_xhs_content("5个AI工具推荐")
print(analysis['content_type'])  # 干货分享
print(analysis['recommended_style'])  # notion

# 生成大纲
outline = generate_xhs_outline(content, style="notion", image_count=5)

# 推荐风格
styles = recommend_xhs_styles("美妆护肤分享")

Output

Article illustrations

article_dir/
├── article.md
├── visual_config.json
└── images/illustrations/
    ├── cover.png
    ├── illustration_01.png
    └── ...

Xiaohongshu images

xhs-images/{topic}/
├── analysis.md           # 内容分析
├── outline.md            # 图片大纲
├── 01-cover-{slug}.png   # 封面
├── 02-content-{slug}.png # 内容页
├── ...
└── 05-ending-{slug}.png  # 结尾