SuperAPI AI Directory

article-cover-and-batch-illustration

Design & creation

View repository

Updated 10-28 17:10

About this skill

Article covers and batch illustrations

Analyze the Markdown article structure and by default call Codex's built-in image_gen tool (image2) to generate WeChat public account visual assets. When the user says "make a cover image/generate a cover", generate only one cover; when the user says "make illustrations/batch illustration/illustrate the article", generate multiple illustrations for each paragraph/section and insert them into the document. The old API scripts are used only when the user explicitly requests a CLI/API fallback.

Routing rules

User intent Output Style reference Default ratio
Make a cover image / generate a cover / cover image 1 cover image references/cover-style.md 2.35:1
Make illustrations / batch illustration / illustrate the article / article illustrations Multiple paragraph illustrations references/style-guide.md 16:9

If the user asks for both "cover image and illustrations", generate the cover image first, then enter the batch illustration process.

Cover image workflow

Cover Phase 1: Extract cover information

  1. Read the article - Get the article content provided by the user (currently open file, specified path, or pasted text)
  2. Determine the title - Use the title explicitly given by the user; if there is no title, extract one from the article's H1 or core theme
  3. Extract the small text at the top - Use the small text specified by the user; if the user has not specified it, leave it blank by default and do not fabricate the number of articles
  4. Sort out the full-text logic - Extract 5-7 process nodes for the system diagram on the right side/bottom of the cover
  5. Read the cover style - Use references/cover-style.md

Cover Phase 2: Generate 1 cover image

Call Codex's built-in image_gen tool to generate a single cover. The cover must follow:

  • Ratio: 2.35:1 horizontal wide cover
  • Background: White background or warm white background
  • Layout: Large title on the left, full-text logic system diagram on the right/bottom
  • Title: The title given by the user must be complete, eye-catching, black, bold, and readable
  • Small text at the top: When specified by the user, it must be presented word for word, for example 空格的第 205 篇原创文章
  • Visual language: ASCII/engineering blueprint style, blue dashed connections, dot-matrix grid, UI cards, folders, terminals, process nodes
  • Output quantity: Generate only 1

Before calling the tool, organize the cover prompt into a complete specification:

Use case: ads-marketing
Asset type: WeChat article cover
Primary request: [标题 + 文章核心逻辑 + 顶部小字]
Aspect ratio: 2.35:1 wide cover
Style reference: white background, bold Chinese editorial typography, ASCII/technical blueprint details, blue dashed connector lines, dotted guide grids, small UI cards, clean creator-tool aesthetic
Layout: title on the left half, workflow/system diagram on the right and lower area
Text policy: Chinese text must be accurate and readable. The title and top small text must appear exactly as requested.
Avoid: dark background, photorealistic people, brand logos, clutter, watermark, illegible tiny text

Cover saving specification

Save the cover image to the current Obsidian vault:

/path/to/current/obsidian-vault/09 image/MMDD-主题简称/
└── 00-cover-主题简称.png

If image_gen the output ratio is not strictly 2.35:1, it is allowed to pad white margins to 2.35:1 without cropping the main subject of the image, and save it separately as 00-cover-主题简称-2.35.png。

Illustration workflow

Phase 1: Analyze the article → generate prompts

  1. Read the article - Get the article content provided by the user (currently open file or specified path)
  2. Structural Analysis - Split paragraphs by H2/H3 headings and extract the core idea of each paragraph
  3. Generate Style Instructions - Generate a global STYLE INSTRUCTIONS code block based on the article topic
  4. Generate Prompts - Create an image prompt outline for each paragraph (refer to references/style-guide.md)
  5. Display and Confirm - Display all prompts as a list and wait for user confirmation or modification

Phase 2: Generate Images → Insert into Document

  1. Batch Generation - Use Codex's built-in image_gen tool to generate images one by one
  2. Save Images - Copy/move the generated results to the 09 image/MMDD-主题名称/ directory of the current Obsidian vault
  3. Insert into Document - Insert ![[图片路径]] references after each paragraph heading

Phase 1 Detailed Guide

1. Article Structure Analysis

After reading the article, split it according to the following rules:

  • Use ## (H2) or ### (H3) headings as paragraph separators
  • Ignore the frontmatter (YAML) section
  • Ignore auxiliary content such as pure quotations and footnotes
  • Extract for each paragraph: heading, core viewpoint (1 sentence), key concepts (3-5 words)

Output format:

## 文章结构分析

| # | 段落标题 | 核心观点 | 关键概念 |
|---|---------|---------|---------|
| 1 | xxx     | xxx     | A, B, C |
| 2 | xxx     | xxx     | D, E, F |

2. Generate Global Style Instructions

Before all prompts, a STYLE INSTRUCTIONS block must be generated first. Read references/style-guide.md to get the style template.

Use by defaultStyle 1 (Minimalist Hand-drawn Style), users can choose Style 2 (Architectural Blueprint Editorial Style).

STYLE INSTRUCTIONS:
- 整体风格: 简约手绘风格 / 建筑蓝图编辑风格
- 色彩方案: 白底为主,黑色线条,[主题点缀色]
- 比例: 16:9 横版
- 分辨率: 2K
- 文字量: 极少,仅保留1-3个核心关键词
- 文字语言: 图片中文字以简体中文为主,专业术语/缩写(如 AI、API、LLM)可保留英文
- 视觉语言: 逻辑图、流程图、概念图
- 一致性: 统一线条粗细、留白比例、排版网格

3. Generate Prompts for Each Paragraph

Structure of each prompt:

  1. Style Prefix - General description from STYLE INSTRUCTIONS
  2. Diagram Type - Concept diagram/flowchart/comparison diagram/hierarchy diagram/relationship diagram
  3. Content Description - Focus on the paragraph's core idea, describe the diagram content in narrative language
  4. Chinese Labels - Write Chinese keywords directly (e.g. "Data Collection", "Intelligent Processing"), 1-3 of them
  5. Chinese-priority Instruction(Required) - Append to the end of each prompt:ALL text, labels, and annotations in the image MUST be primarily in Chinese (Simplified Chinese, 中文). Use clean Chinese font for main text. Technical terms and abbreviations (e.g. AI, API, LLM, RAG) may remain in English.
  6. Exclusions - "No photography, no realistic elements, no complex gradients"

Display format (waiting for user confirmation):

## 提示词大纲

### 图 1: [段落标题]
- 图表类型: 概念图
- 提示词:
  """
  [完整英文提示词]
  """

### 图 2: [段落标题]
...

Key:

  • Write the main body of the prompt in English; keep the Chinese original text for text labels that appear in the image
  • Write the Chinese original text directly for text labels that need to appear in the image (e.g. The central node labeled "AI生产力系统")
  • Each prompt must end with the Chinese-priority instruction, ensuring the text in the image is primarily Chinese, while technical terms may remain in English

4. Wait for Confirmation

After displaying all prompts, ask the user:

  • "Are you satisfied with the above prompts? Do you need to modify the description of any image?"
  • "Once confirmed, batch image generation will begin (N images in total)"
  • The user can specify a different style for a certain image or modify the description

Phase 2 Detailed Guide

5. Use Codex's built-in image2 to Generate Images

After confirmation, call Codex's built-in image_gen tool one by one. Call it once separately for each image; do not merge multiple different images into the same prompt.

Before invoking tools, organize each image prompt into a complete specification:

Use case: infographic-diagram
Asset type: Obsidian article illustration
Primary request: [完整提示词]
Aspect ratio: 16:9 landscape
Resolution intent: high resolution, suitable for article header/section illustration
Text policy: ALL text, labels, and annotations in the image MUST be primarily in Chinese (Simplified Chinese, 中文). Technical terms and abbreviations may remain in English.
Avoid: photography, realistic elements, complex gradients, watermark, illegible text

Notes:

  • For MMDD, use the current date (e.g., 0206)
  • Extract the topic name from the article's H1 title and simplify it into a short name
  • Use a two-digit image number (01, 02, 03...)
  • After generating each image, check whether the result meets: 16:9, consistent style, readable Chinese labels, no watermark
  • If an image fails, record it and continue to the next one; report the failed items at the end
  • Codex built-in tools save images to by default $CODEX_HOME/generated_images/...; the final images to be used in the project must be copied or moved into the Obsidian vault, and must not merely reference the default save location

6. Save path conventions

/path/to/current/obsidian-vault/09 image/MMDD-主题简称/
├── 01-段落标题简称.png
├── 02-段落标题简称.png
├── 03-段落标题简称.png
└── ...

7. Insert into the document

Insert the image reference below the corresponding paragraph heading in the article:

## 段落标题

![[09 image/MMDD-主题简称/01-段落标题简称.png]]

段落正文内容...

Use the Obsidian wikilink format ![[路径]] to insert.

Generation configuration

Codex built-in image2 (default)

Configuration item Value
Tool Codex built-in image_gen
Model Codex built-in image2
API Key No user input required
Default aspect ratio 16:9
Default resolution High quality/project-ready

Execution requirements:

  • Use the image_gen tool to generate them one by one.
  • After generation, copy/move from $CODEX_HOME/generated_images/... to the target filename.
  • When inserting an Obsidian wikilink, use a path relative to the vault, for example ![[09 image/MMDD-主题简称/01-段落标题简称.png]]。

CLI/API fallback (only when the user explicitly requests it)

scripts/generate_image.py Retain as the legacy API fallback. Do not use it in the default workflow; call it only when the user explicitly requests LabNana, Gemini, CLI, API key, specified model parameters, or when the built-in image_gen is unavailable and the user confirms the fallback.

LabNana API fallback

Configuration item Value
API URL https://api.labnana.com
API Key Stored in .labnana.env file
Model gpt-image-2
Provider openai
Default aspect ratio 16:9
Default resolution 2K

Invocation example:

python3 scripts/generate_image.py \
  --prompt "提示词内容" \
  --output "/path/to/output.png" \
  --provider labnana \
  --aspect-ratio "16:9" \
  --resolution "2K"

Style selection

Style Characteristics Applicable scenarios
Style 1 (default) Minimalist hand-drawn, black lines, white background General purpose, concept explanation, process description
Style 2 Architectural blueprint/technical journal, refined and minimalist System architecture, technical analysis, professional content

The user can select a global style during the confirmation phase, or specify a different style for an individual image.

Common usage

User says Action
"Create a cover image for this article" Generate 1 2.35:1 white-background engineering-style cover image according to references/cover-style.md Generate 1 2.35:1 engineering-style cover with a white background
"Create a cover image, the title is xxx" Generate 1 cover image using the specified title and the article's logic
"Add images to this article" Analyze the currently open article and add images in batch
"Batch add images" Same as above
"Add images to the article using Style 2" Use the architectural blueprint editorial style
"Modify the prompt for the 3rd image" Regenerate the specified image
"Regenerate the 2nd image" Call the built-in image2 again with the modified prompt