Core Features
An AI-driven illustration planning system that automatically analyzes article structure, identifies positions that need visual assistance, and calls the project's built-in Doubao Seedream 4.5 API to generate high-quality illustrations.
Style System
Supports 14 fine-grained styles:
Existing styles (5)
- tech - Professional tech (AI, programming, technical documentation)
- fresh - Fresh and lively (life sharing, study notes)
- minimal - Minimalist (philosophical thinking, in-depth viewpoints)
- warm - Warm and healing (emotional articles, growth reflections)
- business - Business professional (data reports, market analysis)
New styles (9, from Baoyu)
- elegant - Elegant and refined (business analysis, leadership content)
- bold - High-contrast impact (opinion articles, important reminders)
- playful - Playful and fun (tutorial guides, light content)
- nature - Natural and organic (environmental health, nature themes)
- sketch - Hand-drawn sketch (brainstorming, creative process)
- notion - Notion minimalist (knowledge sharing, concept explanation)[Default]
Workflow
Step 1: Analyze Content and Select Style
-
Read article content
- Use the
read_filetool to read the article file - Extract the title, section structure, and core themes
- Use the
-
Automatic style matching
- Analyze the article title and content keywords
- Match the best style (based on the style keyword library)
- If unspecified, use notion style by default
-
Content type identification
- Technical articles → tech/elegant
- Growth reflections → warm/nature
- Tutorial guides → playful/fresh
- Opinion articles → bold
- Knowledge sharing → notion/minimal
Step 2: Identify Illustration Positions
Three Main Purposes of Illustrations:
- Information supplement: Help understand abstract concepts
- Concept visualization: Turn abstract ideas into concrete visuals
- Imagination guidance: Create atmosphere and enhance the reading experience
Content Suitable for Illustrations:
- ✅ Abstract concepts that need visualization (such as "microservice architecture", "recursive algorithm")
- ✅ Processes/steps that need diagrams (such as "deployment process", "operation steps")
- ✅ Content that needs visual comparison (such as "Plan A vs Plan B")
- ✅ Core arguments that need reinforcement (such as "3 key reasons")
- ❌ Existing images or code screenshots
- ❌ Pure text paragraphs
Principles for Illustration Quantity:
- At least 1 per major section
- More is better than fewer, avoid excess
- Suggested: 3-5 images (for medium-length articles)
Step 3: Generate an illustration plan
Create a structured illustration plan (in markdown format):
# 插图计划
## 元信息
- 文章路径:`{{article_path}}`
- 风格:{{matched_style}}
- 插图数量:{{count}} 张
- 生成时间:{{timestamp}}
## 插图列表
### 插图 1:{{illustration_title}}
- **插入位置**:{{chapter_name}} 章节,第 X 段落后
- **用途**:{{purpose}}(如:解释微服务的三层架构)
- **视觉内容**:{{visual_description}}(如:从上到下依次是API网关、业务服务、数据层,箭头表示数据流向)
- **尺寸**:1792x1024(16:9横版)
- **文件名**:`assets/images/01-{{slug}}.png`
- **提示词草稿**:{{prompt_draft}}
---
### 插图 2:...
Step 4: Call the image-generation skill
For each image that needs to be generated:
Important: you must use the run_command tool to execute the command; you cannot only generate a script.
- Build the complete command:
python resources/skills/image-generation/scripts/doubao_image_gen.py \
--prompt "{{从插图计划提取的提示词}}" \
--size "1792x1024" \
--quality "hd" \
--output "assets/images/01-{{slug}}.png"
- Execute using the run_command tool:
Call format:
使用 run_command 工具执行上述命令
- Confirm generation succeeded:
- Check whether the returned information contains "Successfully wrote to"
- Confirm that the file has been created at the specified path
- Handle errors:
-
If it prompts "DOUBAO_API_KEY environment variable is not set":
- Tell the user they need to configure the Doubao API Key in the settings panel
- Provide configuration guidance: Open the app → Settings → API Configuration → Doubao API Key
-
If it prompts "No such file or directory":
- Use
run_commandto create the directory:mkdir -p assets/images - Then re-execute the image generation command
- Use
-
If other errors are prompted:
- Record the complete error information
- Provide alternative solutions (use cover-generator or online tools)
Environment variable injection:
DOUBAO_API_KEY: automatically read from ConfigStore- The Agent runtime automatically handles environment variable injection
- No manual setup required
Step 5: Update the article
Insert image references at the specified positions in the article:
## 微服务架构概述
微服务是一种架构风格...

如上图所示,微服务架构分为三层...
Step 6: Output a summary
Summary report after generation is complete:
✅ 插图生成完成
**文章**:{{article_path}}
**风格**:{{matched_style}}
**生成数量**:{{count}} 张
**生成清单**:
1. ✅ {{illustration_1}} - assets/images/01-xxx.png
2. ✅ {{illustration_2}} - assets/images/02-xxx.png
...
**插图计划**:`assets/illustration-plan.md`
**文章已更新**:图片已插入到指定位置
Error handling
Image generation failed
- Provide detailed error information
- Recommend using alternative solutions (cover-generator, Canva, etc.)
- Save the images that were successfully generated
File writing failed
- Check file permissions
- Provide alternative path suggestions
Style matching failed
- Use the notion style by default
- Inform the user that the style can be specified manually
Best practices
- Analyze first, then generate: ensure illustration positions are reasonable and avoid blind generation
- Batch generation limit: generate at most 5 images each time to avoid timeouts
- File organization: save all images in the article project's
assets/images/directory - Naming conventions:
{序号}-{slug}.png, for easy management
Example scenarios
Example 1: Automatic illustration for a technical article
User input:
为我的文章《深入理解微服务架构》生成配图
AI execution process:
- Read the article content and identify it as a technical article
- Automatically match the tech style
- Analyze the article structure and identify the positions that need illustrations:
- "Microservices Architecture Overview" → needs an architecture diagram
- "Inter-service Communication" → needs a communication flow diagram
- "Data Consistency" → needs a comparison diagram
- Generate 3 illustrations and insert them into the article
- Output a summary report
Example 2: Illustration for a personal growth reflection article
User input:
给文章《我的2023年成长总结》配图,使用温暖治愈风格
AI execution process:
- Read the article; the user specifies the warm style
- Identify key growth milestones; 2 accompanying images are needed:
- "Early-year confusion period" → a warm departure image
- "Year-end harvest" → a results image full of hope
- Generate accompanying images and insert them
- Complete summary
Reference documents
- Style system details:
resources/skills/image-generation/SKILL.md - Doubao API documentation:https://www.volcengine.com/docs/82379/1541523
- Baoyu skill library:https://github.com/JimLiu/baoyu-skills