Generate article cover images with a simplified, deterministic workflow.
Backend
Single provider only:
- Endpoint:
http://localhost:5678/webhook/qwen_image_2512 - Method:
POST - Body:
{"prompt": string, "width": number, "height": number} - Response: PNG binary
Prompt Language
- Primary prompt language: Chinese.
- Prompt structure follows Qwen text-to-image guide: subject + scene + style, with optional lens language, atmosphere words, and detail modifiers.
Script
SKILL_DIR= directory containing thisSKILL.md- Run with:
npx -y bun ${SKILL_DIR}/scripts/main.ts
Usage
# From article file
npx -y bun ${SKILL_DIR}/scripts/main.ts path/to/article.md
# Direct content
npx -y bun ${SKILL_DIR}/scripts/main.ts --content "AI 时代如何深度思考..."
# 5D options
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --type conceptual --palette cool --rendering digital --text title-subtitle --mood bold
# Style preset (expands to palette + rendering)
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --style blueprint
# Aspect / output
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --aspect 2.35:1 --image output/cover.png
# Quick mode
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --quick
Options
| Option | Description |
|---|---|
--type <name> |
hero, conceptual, typography, metaphor, scene, minimal |
--palette <name> |
warm, elegant, cool, dark, earth, vivid, pastel, mono, retro |
--rendering <name> |
flat-vector, hand-drawn, painterly, digital, pixel, chalk |
--style <name> |
Style preset alias; see references/style-presets.md |
--text <level> |
none, title-only, title-subtitle, text-rich |
--mood <level> |
subtle, balanced, bold |
--aspect <ratio> |
16:9 (default), 2.35:1, 4:3, 3:2, 1:1, 3:4 |
--lang <code> |
auto (default), zh, en, ja, ... |
--no-title |
Alias of --text none |
--quick |
Compatibility flag (MVP keeps missing dimensions on auto-selection path by default) |
--content <text> |
Direct article content |
--image <path> |
Output image path override |
Workflow
- Load preferences from EXTEND.md (optional)
- Read source content (file path or direct content)
- Resolve dimensions with precedence: CLI > style preset expansion > EXTEND > defaults > auto-selection
- Generate
prompts/cover.md - Map aspect ratio to
width/height - Call Qwen API with JSON body
- Retry once on failure
- Save
cover.png
Default output root (when --image is not specified): Resources/Attachments/cover-image/<topic-slug>/
Preferences (EXTEND.md)
Lookup order:
.baoyu-skills/woa-cover-image/EXTEND.md$HOME/.baoyu-skills/woa-cover-image/EXTEND.md
Supported keys:
quick_modepreferred_typepreferred_palettepreferred_renderingpreferred_textpreferred_mooddefault_aspectdefault_output_dir(independent,same-dir,imgs-subdir)language
References
- Auto selection:
references/auto-selection.md - Style presets:
references/style-presets.md - Prompt structure:
references/prompt-template.md
Notes
- MVP currently uses non-interactive resolution: missing dimensions are auto-selected whether
--quickis provided or not. --quickis retained for forward compatibility with a future confirm/interactive mode.- Prompt generation is optimized for Chinese instructions and Qwen's complex text rendering strengths.
- Auto text strategy: technical/opinion content prefers
text=noneby default; use explicit--textto force title rendering.