
Cover Image
- 77 installs
- 340 repo stars
- Updated March 3, 2026
- notedit/happy-skills
Helps with ai & agent building tasks.
About
cover-image is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.
- cover-image
- AI & Agent Building
- AI-coding skill
Cover Image by the numbers
- 77 all-time installs (skills.sh)
- +3 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #5,386 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/notedit/happy-skills --skill cover-imageAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 77 |
|---|---|
| repo stars | ★ 340 |
| Last updated | March 3, 2026 |
| Repository | notedit/happy-skills ↗ |
What it does
Helps with ai & agent building tasks.
Files
Cover Image Generator
Generate elegant cover images for articles with 5-dimensional customization. Supports Chinese text rendering.
Usage
# Auto-select dimensions based on content
/cover-image path/to/article.md
# Quick mode: skip confirmation
/cover-image article.md --quick
# Specify dimensions
/cover-image article.md --type conceptual --palette warm --rendering flat-vector
# WeChat Official Account cover
/cover-image article.md --aspect 2.35:1
# Specify provider
/cover-image article.md --provider qwen
# Use style preset
/cover-image article.md --style tech-dark
# Large font for better visibility
/cover-image article.md --font-size large
# Generate multiple options
/cover-image article.md --n 3
# With reference images (Google/OpenAI only)
/cover-image article.md --ref style-ref.png
# Direct content input
/cover-image --palette mono --aspect 1:1 --quick
[paste content]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 |
--text <level> | none, title-only, title-subtitle, text-rich |
--mood <level> | subtle, balanced, bold |
--font <name> | clean, handwritten, serif, display |
--font-size <size> | small, medium (default), large, xlarge |
--aspect <ratio> | 16:9 (default), 2.35:1 (公众号封面), 4:3, 3:2, 1:1, 3:4 |
--provider <name> | qwen (default), openai, google |
--style <preset> | tech-dark, tech-clean, lifestyle-warm, business-elegant, announcement-bold, minimal-zen, creative-playful, retro-vintage |
--lang <code> | Title language (en, zh, ja, etc.) |
--no-title | Alias for --text none |
--n <count> | Number of images to generate (1-4) |
--quick | Skip confirmation, use auto-selection |
--ref <files...> | Reference images for style/composition guidance |
Providers
| Provider | Model | Text Rendering | Chinese Support | Price |
|---|---|---|---|---|
qwen | qwen-image-plus | Excellent | Native Chinese | 0.2 CNY/image |
openai | gpt-image-1 | Good | Limited | ~$0.04/image |
google | gemini-2.0-flash-exp | Good | Limited | Free tier available |
Provider Selection Logic
1. --provider specified -> use it 2. Chinese title detected -> auto-select qwen 3. Reference images provided -> use google or openai 4. Default -> qwen
Qwen-Image (Default)
Best for Chinese text rendering. Native support for Chinese characters.
API Endpoint: https://dashscope.aliyuncs.com/api/v1/services/aigc/text2image/image-synthesis
Environment Variable: DASHSCOPE_API_KEY
Supported Sizes: 1664*928, 1024*1024, 928*1664, 1472*1104, 1104*1472
OpenAI
Good for English text and creative designs.
Environment Variable: OPENAI_API_KEY
Supported Sizes: 1024x1024, 1536x1024, 1024x1536
Good for multimodal generation with reference images.
Environment Variable: GOOGLE_API_KEY
Supported Sizes: Various aspect ratios supported
Five Dimensions
| Dimension | Values | Default |
|---|---|---|
| Type | hero, conceptual, typography, metaphor, scene, minimal | auto |
| Palette | warm, elegant, cool, dark, earth, vivid, pastel, mono, retro | auto |
| Rendering | flat-vector, hand-drawn, painterly, digital, pixel, chalk | auto |
| Text | none, title-only, title-subtitle, text-rich | title-only |
| Mood | subtle, balanced, bold | balanced |
| Font | clean, handwritten, serif, display | clean |
Auto-selection rules: references/auto-selection.md
Galleries
Types: hero, conceptual, typography, metaphor, scene, minimal -> Details: references/types.md
Palettes: warm, elegant, cool, dark, earth, vivid, pastel, mono, retro -> Details: references/palettes/
Renderings: flat-vector, hand-drawn, painterly, digital, pixel, chalk -> Details: references/renderings/
Text Levels: none (pure visual) | title-only (default) | title-subtitle | text-rich (with tags) -> Details: references/dimensions/text.md
Mood Levels: subtle (low contrast) | balanced (default) | bold (high contrast) -> Details: references/dimensions/mood.md
Fonts: clean (sans-serif) | handwritten | serif | display (bold decorative) -> Details: references/dimensions/font.md
File Structure
Output directory per default_output_dir preference:
same-dir:{article-dir}/imgs-subdir:{article-dir}/imgs/independent(default):cover-image/{topic-slug}/
<output-dir>/
├── source-{slug}.{ext} # Source files
├── refs/ # Reference images (if provided)
│ ├── ref-01-{slug}.{ext}
│ └── ref-01-{slug}.md # Description file
├── prompts/cover.md # Generation prompt
└── cover.png # Output imageSlug: 2-4 words, kebab-case. Conflict: append -YYYYMMDD-HHMMSS
Workflow
Progress Checklist
Cover Image Progress:
- [ ] Step 1: Analyze content + save refs + determine output dir
- [ ] Step 2: Confirm options (6 dimensions + provider) unless --quick
- [ ] Step 3: Create prompt
- [ ] Step 4: Generate image
- [ ] Step 5: Resize for platform (if needed)
- [ ] Step 6: Completion reportStep 1: Analyze Content
1. Save reference images (if provided) -> references/workflow/reference-images.md 2. Save source content (if pasted, save to source.md) 3. Analyze content: topic, tone, keywords, visual metaphors 4. Deep analyze references: Extract specific, concrete elements 5. Detect language: Compare source, user input 6. Determine output directory: Per File Structure rules 7. Auto-select provider: Based on language and references
Step 2: Confirm Options
Full confirmation flow: references/workflow/confirm-options.md
| Condition | Skipped | Still Asked |
|---|---|---|
--quick | 6 dimensions + provider | Aspect ratio (unless --aspect) |
All 6 + --aspect + --provider specified | All | None |
Step 3: Create Prompt
Save to prompts/cover.md. Template: references/workflow/prompt-template.md
CRITICAL - References in Frontmatter:
- Files saved to
refs/-> Add to frontmatterreferenceslist - Style extracted verbally (no file) -> Omit
references, describe in body - Before writing -> Verify:
test -f refs/ref-NN-{slug}.{ext}
Reference elements in body MUST be detailed, prefixed with "MUST"/"REQUIRED", with integration approach.
Step 4: Generate Image
1. Backup existing cover.png if regenerating 2. Select provider based on language and options 3. Process references from prompt frontmatter:
directusage -> pass reference images directly (google/openai only)style/palette-> extract traits, append to prompt
4. Generate via provider API:
- Qwen: POST to dashscope API, poll for result
- OpenAI: Use ImageGen tool or API
- Google: Use ImageGen tool with reference images
5. On failure: auto-retry once
Step 5: Resize for Platform
Resize generated image to target platform size:
| Platform | Target Size | Aspect Ratio |
|---|---|---|
| 公众号封面 | 900x383 | 2.35:1 |
| 博客/视频 | 1920x1080 | 16:9 |
| 小红书 | 1080x1080 | 1:1 |
| 手机海报 | 1080x1440 | 3:4 |
Step 6: Completion Report
Cover Generated!
Provider: [provider]
Topic: [topic]
Type: [type] | Palette: [palette] | Rendering: [rendering]
Text: [text] | Mood: [mood] | Font: [font] | Aspect: [ratio]
Title: [title or "visual only"]
Language: [lang]
References: [N images or "extracted style" or "none"]
Location: [directory path]
Files:
- source-{slug}.{ext}
- prompts/cover.md
- cover.png
- cover-{platform}.png (if resized)Composition Principles
- Whitespace: 40-60% breathing room
- Visual anchor: Main element centered or offset left
- Characters: Simplified silhouettes; NO realistic humans
- Title: Use exact title from user/source; never invent
Aspect Ratios
| Ratio | Platform | Use Case |
|---|---|---|
2.35:1 | 微信公众号封面 | 公众号首图,900x383px |
16:9 | 通用宽屏 | 博客、视频封面 |
1:1 | 社交媒体 | 微博、小红书、Instagram |
4:3 | 经典比例 | 演示文稿、传统媒体 |
3:2 | 摄影标准 | 照片风格封面 |
3:4 | 竖版 | 手机端、海报 |
Environment Variables
| Variable | Required For | Get From |
|---|---|---|
DASHSCOPE_API_KEY | Qwen (default) | https://bailian.console.aliyun.com |
OPENAI_API_KEY | OpenAI | https://platform.openai.com |
GOOGLE_API_KEY | https://aistudio.google.com |
References
Dimensions: text.md | mood.md | font.md Palettes: references/palettes/ Renderings: references/renderings/ Types: references/types.md Style Presets: references/style-presets.md Auto-Selection: references/auto-selection.md Visual Elements: references/visual-elements.md Workflow: confirm-options.md | prompt-template.md | reference-images.md | qwen-api.md
Auto-Selection Rules
When a dimension is omitted, select based on content signals.
Auto Type Selection
| Signals (EN/CN) | Type |
|---|---|
| Product, launch, announcement, release, reveal / 产品发布, 公告, 上线 | hero |
| Architecture, framework, system, API, technical, model / 架构, 框架, 系统, 技术 | conceptual |
| Quote, opinion, insight, thought, headline, statement / 观点, 金句, 见解 | typography |
| Philosophy, growth, abstract, meaning, reflection / 哲学, 成长, 思考 | metaphor |
| Story, journey, travel, lifestyle, experience, narrative / 故事, 旅程, 生活 | scene |
| Zen, focus, essential, core, simple, pure / 极简, 核心, 本质 | minimal |
Auto Palette Selection
| Signals (EN/CN) | Palette |
|---|---|
| Personal story, emotion, lifestyle, human / 个人故事, 情感, 生活 | warm |
| Business, professional, thought leadership, luxury / 商业, 专业, 奢侈 | elegant |
| Architecture, system, API, technical, code / 架构, 系统, 代码 | cool |
| Entertainment, premium, cinematic, dark mode / 娱乐, 高端, 电影感 | dark |
| Nature, wellness, eco, organic, travel / 自然, 健康, 环保 | earth |
| Product launch, gaming, promotion, event / 产品发布, 游戏, 推广 | vivid |
| Fantasy, children, gentle, creative, whimsical / 童趣, 创意, 梦幻 | pastel |
| Zen, focus, essential, pure, simple / 禅意, 纯粹, 简洁 | mono |
| History, vintage, retro, classic, exploration / 历史, 复古, 经典 | retro |
Auto Rendering Selection
| Signals (EN/CN) | Rendering |
|---|---|
| Clean, modern, tech, WeChat, icon-based, infographic / 现代, 科技, 图标 | flat-vector |
| Sketch, note, personal, casual, doodle, warm / 手绘, 笔记, 随意 | hand-drawn |
| Art, watercolor, soft, dreamy, creative, fantasy / 艺术, 水彩, 梦幻 | painterly |
| Data, dashboard, SaaS, corporate, polished / 数据, 企业, 精致 | digital |
| Gaming, retro, 8-bit, nostalgic / 游戏, 复古, 像素 | pixel |
| Education, tutorial, classroom, teaching / 教育, 教程, 课堂 | chalk |
Auto Text Selection
| Signals (EN/CN) | Text Level |
|---|---|
| Visual-only, photography, abstract, art / 纯视觉, 摄影, 抽象 | none |
| Article, blog, standard cover / 文章, 博客, 标准封面 | title-only |
| Series, tutorial, technical with context / 系列, 教程, 技术文 | title-subtitle |
| Announcement, features, multiple points, infographic / 公告, 特性, 信息图 | text-rich |
Default: title-only
Auto Mood Selection
| Signals (EN/CN) | Mood Level |
|---|---|
| Professional, corporate, thought leadership, academic, luxury / 专业, 学术, 高端 | subtle |
| General, educational, standard, blog, documentation / 通用, 教育, 文档 | balanced |
| Launch, announcement, promotion, event, gaming, entertainment / 发布, 推广, 游戏 | bold |
Default: balanced
Auto Font Selection
| Signals (EN/CN) | Font |
|---|---|
| Personal, lifestyle, human, warm, friendly, story / 个人, 生活, 温暖 | handwritten |
| Technical, professional, clean, modern, minimal, data / 技术, 专业, 现代 | clean |
| Editorial, academic, luxury, classic, literary / 编辑, 学术, 经典 | serif |
| Announcement, entertainment, promotion, bold, event, gaming / 公告, 娱乐, 游戏 | display |
Default: clean
Auto Provider Selection
| Signals | Provider |
|---|---|
| Chinese title detected | qwen |
| Reference images provided | google (or openai) |
--style tech-* preset | qwen |
| Default | qwen |
Font Dimension
Controls typography style and character feel.
Values
| Font | Visual Style | Line Quality | Character |
|---|---|---|---|
clean | Geometric sans-serif | Sharp, uniform | Modern, precise, neutral |
handwritten | Hand-lettered, brush | Organic, varied | Warm, personal, friendly |
serif | Classic serifs, elegant | Refined, structured | Editorial, authoritative |
display | Bold, decorative | Heavy, expressive | Attention-grabbing, playful |
Detail
clean
Modern, universal typography with neutral character.
Characteristics:
- Geometric sans-serif letterforms
- Sharp, uniform line weight
- Clean edges, no flourishes
- High readability at all sizes
- Minimal personality, maximum clarity
Use Cases:
- Technical documentation
- Professional/corporate content
- Minimal design approaches
- Data-driven articles
- Modern brand aesthetics
Prompt Hints:
- Use clean geometric sans-serif typography
- Modern, minimal letterforms
- Sharp edges, uniform stroke weight
- High contrast against background
handwritten
Warm, organic typography with personal character.
Characteristics:
- Hand-lettered or brush style
- Organic, varied line weight
- Natural imperfections
- Approachable, human feel
- Casual yet intentional
Use Cases:
- Personal stories
- Lifestyle content
- Wellness and self-improvement
- Creative tutorials
- Friendly brand voices
Prompt Hints:
- Use warm hand-lettered typography with organic brush strokes
- Friendly, personal feel
- Natural variation in stroke weight
- Approachable, human character
serif
Classic, elegant typography with editorial authority.
Characteristics:
- Traditional serif letterforms
- Refined, structured strokes
- Elegant proportions
- Timeless sophistication
- Formal, trustworthy feel
Use Cases:
- Editorial content
- Academic articles
- Luxury brand content
- Historical topics
- Literary pieces
Prompt Hints:
- Use elegant serif typography with refined letterforms
- Classic, editorial character
- Structured, proportional spacing
- Authoritative, sophisticated feel
display
Bold, decorative typography for maximum impact.
Characteristics:
- Heavy, expressive letterforms
- Decorative elements
- Strong visual presence
- Playful or dramatic character
- Designed for headlines
Use Cases:
- Announcements
- Entertainment content
- Promotional materials
- Event marketing
- Gaming topics
Prompt Hints:
- Use bold decorative display typography
- Heavy, expressive headlines
- Strong visual impact
- Attention-grabbing character
Default
clean -- Universal, pairs well with most rendering styles.
Rendering Compatibility
| Font x Rendering | flat-vector | hand-drawn | painterly | digital | pixel | chalk |
|---|---|---|---|---|---|---|
| clean | yes++ | no | no | yes++ | yes | no |
| handwritten | yes | yes++ | yes++ | yes | no | yes++ |
| serif | yes | no | yes | yes++ | no | no |
| display | yes++ | yes | yes | yes++ | yes++ | yes |
yes++ = highly recommended | yes = compatible | no = not recommended
Type Compatibility
| Font x Type | hero | conceptual | typography | metaphor | scene | minimal |
|---|---|---|---|---|---|---|
| clean | yes | yes++ | yes++ | yes | no | yes++ |
| handwritten | yes++ | yes | yes | yes++ | yes++ | yes |
| serif | yes | yes | yes++ | yes | yes | yes |
| display | yes++ | yes | yes++ | yes | yes | no |
Palette Interaction
Font style adapts to palette characteristics:
| Palette Category | clean | handwritten | serif | display |
|---|---|---|---|---|
| Warm (warm, earth, pastel) | Softer weight | Natural fit | Warm tones | Playful energy |
| Cool (cool, mono, elegant) | Perfect match | Contrast | Classic pairing | Bold statement |
| Dark (dark, vivid) | High contrast | Glow effects | Dramatic | Maximum impact |
| Vintage (retro) | Modern contrast | Nostalgic fit | Period-appropriate | Retro headlines |
Auto Selection
When --font is omitted, select based on signals:
| Signals | Font |
|---|---|
| Personal, lifestyle, human, warm, friendly, story | handwritten |
| Technical, professional, clean, modern, minimal, data | clean |
| Editorial, academic, luxury, classic, literary | serif |
| Announcement, entertainment, promotion, bold, event, gaming | display |
Default: clean
Mood Dimension
Controls emotional intensity and visual weight of cover images.
Values
| Value | Contrast | Saturation | Weight | Energy |
|---|---|---|---|---|
subtle | Low | Muted | Light | Calm |
balanced | Medium | Normal | Medium | Moderate |
bold | High | Vivid | Heavy | Dynamic |
Detail
subtle
Calm, understated visual presence.
Characteristics:
- Low contrast between elements
- Muted, desaturated colors
- Light visual weight
- Gentle, refined aesthetic
- Soft edges and transitions
Use Cases:
- Thought leadership content
- Professional/corporate communications
- Meditation, wellness topics
- Academic or scholarly articles
- Luxury brand aesthetics
Color Guidance:
- Pastels, earth tones, neutrals
- Low saturation (30-50%)
- Soft gradients
- Minimal color variety (2-3 colors)
balanced
Versatile, harmonious visual presence.
Characteristics:
- Medium contrast
- Natural saturation levels
- Balanced visual weight
- Clear but not aggressive
- Standard aesthetic approach
Use Cases:
- General articles (default)
- Most blog content
- Educational material
- Product documentation
- News and updates
Color Guidance:
- Standard saturation (50-70%)
- Complementary color schemes
- Clear foreground/background separation
- Moderate color variety (3-4 colors)
bold
Dynamic, high-impact visual presence.
Characteristics:
- High contrast between elements
- Vivid, saturated colors
- Heavy visual weight
- Energetic, attention-grabbing
- Sharp edges and strong shapes
Use Cases:
- Product launches
- Promotional announcements
- Event marketing
- Call-to-action content
- Entertainment/gaming topics
Color Guidance:
- High saturation (70-100%)
- Vibrant, primary colors
- Strong contrast ratios
- Dynamic color combinations (4+ colors)
Type Compatibility
| Type | subtle | balanced | bold |
|---|---|---|---|
| hero | yes | yes++ | yes++ |
| conceptual | yes++ | yes++ | yes |
| typography | yes | yes++ | yes++ |
| metaphor | yes++ | yes++ | yes |
| scene | yes++ | yes++ | yes |
| minimal | yes++ | yes++ | no |
yes++ = highly recommended | yes = compatible | no = not recommended
Palette Interaction
Mood modifies the base palette characteristics:
| Palette Category | subtle | balanced | bold |
|---|---|---|---|
| Warm palettes (warm, earth, pastel) | More whitespace, softer tones | Standard colors | Deeper, richer warm tones |
| Cool palettes (cool, mono, elegant) | Lighter lines, muted colors | Standard colors | Stronger contrast, sharper definition |
| Dark palettes (dark, vivid) | Reduced contrast, softer glow | Standard colors | Maximum impact, vivid saturation |
| Vintage palettes (retro) | More faded, sepia-heavy | Standard colors | Bolder retro contrasts |
Rendering Interaction
Mood adjusts rendering characteristics:
| Rendering | subtle | balanced | bold |
|---|---|---|---|
| flat-vector | Thinner strokes, lighter fills | Standard weight | Thicker strokes, stronger fills |
| hand-drawn | Lighter pencil pressure, more space | Standard strokes | Heavier marker strokes, denser elements |
| painterly | Diluted washes, more white | Standard brush | Thicker paint, saturated strokes |
| digital | Reduced shadows, lower contrast | Standard rendering | Stronger shadows, sharper edges |
| pixel | Fewer colors, simpler shapes | Standard palette | More colors, denser pixel detail |
| chalk | Lighter chalk, more board showing | Standard chalk | Heavy chalk, vivid colors, dense marks |
Auto Selection
When --mood is omitted, select based on signals:
| Signals | Mood Level |
|---|---|
| Professional, corporate, thought leadership, academic, luxury | subtle |
| General, educational, standard, blog, documentation | balanced |
| Launch, announcement, promotion, event, gaming, entertainment | bold |
Default: balanced
Text Dimension
Controls text density and information hierarchy on cover images.
Values
| Value | Title | Subtitle | Tags | Visual Area |
|---|---|---|---|---|
none | - | - | - | 100% |
title-only | yes | - | - | 85% |
title-subtitle | yes | yes | - | 75% |
text-rich | yes | yes | yes (2-4) | 60% |
Detail
none
Pure visual cover with no text elements.
Use Cases:
- Photography-focused covers
- Abstract art pieces
- Visual-only social sharing
- When title added externally
Composition:
- Full visual area available
- No reserved text zones
- Emphasis on visual metaphor
title-only
Single headline, maximum impact.
Use Cases:
- Most article covers (default)
- Clear single message
- Strong brand recognition
Composition:
- Title: prominent placement
- Reserved zone: top or bottom 15%
- Visual supports title message
Title Guidelines:
- Use exact title from source content or user-provided title
- Do NOT invent or modify titles
- Match content language
title-subtitle
Title with supporting context.
Use Cases:
- Technical articles needing clarification
- Series with episode/part info
- Content with dual messages
Composition:
- Title: primary element
- Subtitle: secondary element
- Reserved zone: 25%
- Clear hierarchy between title/subtitle
Subtitle Guidelines:
- Clarify or contextualize title
- Can include series name, author, date
- Smaller, less prominent than title
text-rich
Information-dense cover with multiple text elements.
Use Cases:
- Infographic-style covers
- Event announcements with details
- Promotional material with features
- Content with multiple key points
Composition:
- Title: primary focus
- Subtitle: supporting info
- Tags: 2-4 keyword labels
- Reserved zone: 40%
- Clear visual hierarchy
Tag Guidelines:
- 2-4 tags maximum
- Short keywords (1-2 words each)
- Positioned as badges/labels
- Can highlight: category, date, author, key features
Type Compatibility
| Type | none | title-only | title-subtitle | text-rich |
|---|---|---|---|---|
| hero | yes | yes++ | yes++ | yes |
| conceptual | yes++ | yes++ | yes | yes |
| typography | no | yes | yes++ | yes++ |
| metaphor | yes++ | yes | yes | no |
| scene | yes++ | yes | yes | no |
| minimal | yes++ | yes++ | yes | no |
yes++ = highly recommended | yes = compatible | no = not recommended
Auto Selection
When --text is omitted, select based on signals:
| Signals | Text Level |
|---|---|
| Visual-only, photography, abstract, art | none |
| Article, blog, standard cover | title-only |
| Series, tutorial, technical with context | title-subtitle |
| Announcement, features, multiple points, infographic | text-rich |
Default: title-only
cool
Calm, professional, technical
Color Palette
| Role | Color | Hex |
|---|---|---|
| Primary 1 | Deep Blue | #2B6CB0 |
| Primary 2 | Sky Blue | #4299E1 |
| Primary 3 | Teal | #38B2AC |
| Background | Light Gray | #F7FAFC |
| Background Alt | Ice Blue | #EBF8FF |
| Accent 1 | Navy | #1A365D |
| Accent 2 | Cyan | #00B5D8 |
Decorative Hints
- Circuit patterns, code snippets
- Geometric shapes, clean lines
- Data visualization elements
- Subtle tech iconography
Best For
Technology, SaaS, APIs, architecture, data science, engineering
dark
Dramatic, premium, cinematic
Color Palette
| Role | Color | Hex |
|---|---|---|
| Primary 1 | Deep Navy | #1A202C |
| Primary 2 | Charcoal | #2D3748 |
| Primary 3 | Slate | #4A5568 |
| Background | Near Black | #0D1117 |
| Background Alt | Dark Gray | #161B22 |
| Accent 1 | Electric Blue | #3B82F6 |
| Accent 2 | Neon Green | #10B981 |
Decorative Hints
- Glowing effects, neon accents
- Gradient overlays
- Dramatic lighting
- Tech/futuristic patterns
Best For
Entertainment, gaming, premium products, dark mode interfaces
earth
Natural, organic, grounded
Color Palette
| Role | Color | Hex |
|---|---|---|
| Primary 1 | Forest Green | #276749 |
| Primary 2 | Sage | #68D391 |
| Primary 3 | Moss | #48BB78 |
| Background | Warm Sand | #FDF5E6 |
| Background Alt | Light Sage | #F0FFF4 |
| Accent 1 | Brown | #744210 |
| Accent 2 | Olive | #68D391 |
Decorative Hints
- Leaf and plant motifs
- Natural textures (wood, stone)
- Organic shapes and curves
- Nature-inspired patterns
Best For
Nature, wellness, sustainability, travel, organic products
elegant
Sophisticated, refined, professional
Color Palette
| Role | Color | Hex |
|---|---|---|
| Primary 1 | Deep Purple | #553C9A |
| Primary 2 | Soft Violet | #805AD5 |
| Primary 3 | Dusty Rose | #B83280 |
| Background | Off White | #FAFAFA |
| Background Alt | Light Lavender | #F3E8FF |
| Accent 1 | Charcoal | #2D3748 |
| Accent 2 | Gold | #D69E2E |
Decorative Hints
- Abstract geometric patterns
- Elegant gradients
- Minimalist decorative lines
- Luxurious textures
Best For
Business, luxury brands, thought leadership, professional services
mono
Clean, minimal, focused
Color Palette
| Role | Color | Hex |
|---|---|---|
| Primary 1 | Near Black | #1A1A1A |
| Primary 2 | Dark Gray | #4A4A4A |
| Primary 3 | Medium Gray | #7A7A7A |
| Background | Pure White | #FFFFFF |
| Background Alt | Light Gray | #F5F5F5 |
| Accent 1 | Black | #000000 |
| Accent 2 | Silver | #C0C0C0 |
Decorative Hints
- Minimal lines and shapes
- Strong typography focus
- Clean geometric patterns
- Subtle textures
Best For
Minimalist design, zen topics, focus, essential concepts
pastel
Soft, gentle, dreamy
Color Palette
| Role | Color | Hex |
|---|---|---|
| Primary 1 | Soft Pink | #FBB6CE |
| Primary 2 | Lavender | #C4B5FD |
| Primary 3 | Mint | #9AE6B4 |
| Background | Cream White | #FFFBF0 |
| Background Alt | Light Pink | #FFF5F7 |
| Accent 1 | Dusty Rose | #D53F8C |
| Accent 2 | Soft Blue | #63B3ED |
Decorative Hints
- Soft clouds, bubbles
- Gentle gradients
- Cute character elements
- Whimsical patterns
Best For
Children, fantasy, creative projects, gentle topics, dreamlike content
retro
Nostalgic, vintage, classic
Color Palette
| Role | Color | Hex |
|---|---|---|
| Primary 1 | Burnt Orange | #C05621 |
| Primary 2 | Mustard | #B7791F |
| Primary 3 | Rust | #9C4221 |
| Background | Cream | #FFFBEB |
| Background Alt | Sepia | #FEEBC8 |
| Accent 1 | Deep Brown | #744210 |
| Accent 2 | Teal | #285E61 |
Decorative Hints
- Vintage patterns
- Grain and texture overlays
- Classic typography elements
- Nostalgic decorative borders
Best For
History, nostalgia, vintage topics, classic design, exploration
vivid
Energetic, vibrant, attention-grabbing
Color Palette
| Role | Color | Hex |
|---|---|---|
| Primary 1 | Bright Pink | #ED64A6 |
| Primary 2 | Electric Orange | #F56565 |
| Primary 3 | Sunny Yellow | #ECC94B |
| Background | White | #FFFFFF |
| Background Alt | Light Yellow | #FEFCBF |
| Accent 1 | Deep Purple | #6B46C1 |
| Accent 2 | Bright Blue | #4299E1 |
Decorative Hints
- Bold geometric shapes
- Dynamic gradients
- Playful patterns
- Energetic movement lines
Best For
Product launches, events, gaming, youth brands, announcements
warm
Friendly, approachable, human-centered
Color Palette
| Role | Color | Hex |
|---|---|---|
| Primary 1 | Warm Orange | #ED8936 |
| Primary 2 | Golden Yellow | #F6AD55 |
| Primary 3 | Terracotta | #C05621 |
| Background | Cream | #FFFAF0 |
| Background Alt | Soft Peach | #FED7AA |
| Accent 1 | Deep Brown | #744210 |
| Accent 2 | Soft Red | #E53E3E |
Decorative Hints
- Sun rays, warm lighting effects
- Rounded shapes, organic curves
- Hearts, smiling faces, friendly icons
- Warm gradient overlays
Best For
Personal growth, lifestyle, education, human stories, emotion, community
chalk
Educational, classroom, textured
Core Characteristics
Chalk-on-blackboard aesthetic with dusty texture, hand-drawn feel, and educational character. Think classroom boards, workshop presentations, and tutorial graphics.
Lines
- Chalk-like stroke quality
- Slightly rough edges
- Varied opacity (pressure simulation)
- Visible texture in strokes
Texture
- Chalk dust and smudges
- Blackboard texture
- Erased line remnants
- Grainy surface feel
Depth
- Flat with texture variation
- Layering through opacity
- Smudging for soft effects
- No traditional shadows
Element Vocabulary
- Hand-drawn diagrams
- Chalk-style icons
- Mathematical/educational symbols
- Decorative: arrows, boxes, underlines
- Chart and diagram elements
Typography Approach
- Chalk handwriting style
- Slightly irregular letters
- Educational, approachable feel
- Visible texture in text
digital
Polished, precise, modern
Core Characteristics
Clean digital aesthetic with subtle gradients, soft shadows, and polished finish. Think modern UI design, tech illustrations, and SaaS graphics.
Lines
- Crisp, precise edges
- Smooth bezier curves
- Consistent weight or subtle variation
- Perfect corners and endings
Texture
- Subtle noise or grain (optional)
- Soft gradients
- Clean fills with polish
- Glass-like surfaces
Depth
- Soft drop shadows
- Subtle gradients for dimension
- Layered with transparency
- 3D-style depth through shadows
Element Vocabulary
- Precision icons and symbols
- Gradient-filled shapes
- Glass-morphism elements
- Decorative: glows, highlights, reflections
- Tech-inspired patterns
Typography Approach
- Modern sans-serif fonts
- Crisp, clean rendering
- Subtle shadows or glows
- Professional appearance
flat-vector
Clean, modern, geometric illustration
Core Characteristics
Flat design with clean outlines, uniform fills, and no texture or depth. Think modern app icons, infographic illustrations, and vector-based editorial art.
Lines
- Clean outlines with uniform stroke weight
- Closed shapes (coloring-book style)
- Rounded line endings, avoid sharp corners
- Consistent stroke width throughout
Texture
- None: smooth, flat color fills only
- No gradients, shadows, or noise
- Solid color blocks
Depth
- Flat: no shadows, no perspective
- 2D layering with overlap for depth illusion
- Optional 2.5D isometric layering (front/back occlusion, no atmospheric perspective)
- No 3D effects or bevels
Element Vocabulary
- Geometric icons and simple shapes
- Bold outlined objects with clean fills
- Geometric simplification: complex objects -> basic shapes (trees -> lollipop/triangle, buildings -> rectangles)
- "Toy model" aesthetic: cute, rounded proportions
- Decorative: dots, lines, sunbursts, pill-shaped clouds, small stars
- Isolated elements on clean backgrounds
Typography Approach
- Clean sans-serif or bold geometric lettering
- Strong readability, consistent weight
- Easily scalable at any size
hand-drawn
Organic, personal, sketch-like
Core Characteristics
Hand-crafted appearance with visible line quality, natural imperfections, and warm character. Think editorial sketches, notebook doodles, and artisan illustration.
Lines
- Varied stroke weight (pressure sensitivity)
- Slightly wobbly, organic curves
- Pencil or marker quality
- Visible line endings (not perfectly capped)
Texture
- Light paper grain
- Pencil smudges or marker bleeds
- Optional cross-hatching for shading
- Scanned paper feel
Depth
- Minimal: flat with line weight variation
- Overlapping strokes for layering
- Optional simple drop shadows (hand-drawn style)
Element Vocabulary
- Sketchy icons and doodles
- Objects with character and quirk
- Wobbly circles and imperfect shapes
- Decorative: stars, swirls, arrows, speech bubbles
- White space as design element
Typography Approach
- Hand-lettered or marker-style fonts
- Varied weight and width
- Casual, friendly character
- Organic baseline (slightly wavy)
painterly
Artistic, soft, brush-textured
Core Characteristics
Traditional art media appearance with visible brushstrokes, soft edges, and artistic texture. Think watercolor paintings, digital art, and editorial illustration.
Lines
- Soft, blurry edges
- Brush stroke quality
- Varied weight from pressure
- Painted, not drawn
Texture
- Visible brush strokes
- Paper or canvas texture
- Paint splatters or drips
- Layered translucent washes
Depth
- Soft edges, atmospheric perspective
- Layered translucent colors
- Gradient washes
- Depth through color intensity
Element Vocabulary
- Painted illustrations
- Organic, flowing shapes
- Soft-edged icons and symbols
- Decorative: splashes, dots, strokes
- Blurred boundaries between elements
Typography Approach
- Painted or brush-script fonts
- Soft edges on text
- Hand-painted feel
- Artistic character
pixel
Retro, nostalgic, 8-bit
Core Characteristics
Grid-based pixel art aesthetic with chunky squares, limited color palette, and nostalgic feel. Think classic video games, retro computing, and 8-bit art.
Lines
- Sharp, blocky edges (no curves)
- Grid-aligned pixels
- Jagged diagonal lines
- Uniform square pixels
Texture
- None: pure pixels
- Dithering for shading
- Limited color palette
- Grid visibility
Depth
- Flat: no shadows
- Depth through layering
- Isometric perspective common
- Parallax-style depth layers
Element Vocabulary
- Pixel-art icons and characters
- Blocky shapes and objects
- Sprite-style elements
- Decorative: pixel stars, hearts, coins
- Game UI elements (health bars, buttons)
Typography Approach
- Pixel/bitmap fonts
- Grid-aligned letters
- Chunky, blocky appearance
- Retro gaming feel
Style Presets
Quick style presets for common use cases. Use --style <preset> to apply.
Available Presets
| Preset | Type | Palette | Rendering | Mood | Best For |
|---|---|---|---|---|---|
tech-dark | conceptual | dark | digital | bold | 科技文章、技术博客 |
tech-clean | conceptual | cool | flat-vector | balanced | API文档、系统架构 |
lifestyle-warm | scene | warm | painterly | subtle | 生活方式、个人故事 |
business-elegant | hero | elegant | digital | subtle | 商业文章、专业报告 |
announcement-bold | hero | vivid | flat-vector | bold | 产品发布、活动公告 |
minimal-zen | minimal | mono | flat-vector | subtle | 极简设计、哲学思考 |
creative-playful | metaphor | pastel | hand-drawn | balanced | 创意内容、儿童话题 |
retro-vintage | scene | retro | painterly | subtle | 怀旧话题、历史内容 |
Preset Details
tech-dark
科技感黑色系,适合技术博客和科技文章。
type: conceptual
palette: dark
rendering: digital
mood: bold
font: cleanPrompt hints:
- Deep black background (#000000)
- Electric blue accents (#3B82F6)
- Circuit patterns, geometric shapes
- Large bold title with glow effect
tech-clean
清爽科技风,适合技术文档和架构图。
type: conceptual
palette: cool
rendering: flat-vector
mood: balanced
font: cleanPrompt hints:
- Light gray background (#F7FAFC)
- Deep blue primary (#2B6CB0)
- Clean geometric icons
- Minimal decoration
lifestyle-warm
温馨生活风,适合生活方式和个人故事。
type: scene
palette: warm
rendering: painterly
mood: subtle
font: handwrittenPrompt hints:
- Warm cream background (#FFFAF0)
- Soft orange accents (#ED8936)
- Organic shapes, gentle gradients
- Friendly, approachable feel
business-elegant
商务优雅风,适合商业文章和专业报告。
type: hero
palette: elegant
rendering: digital
mood: subtle
font: serifPrompt hints:
- Off-white background (#FAFAFA)
- Deep purple accents (#553C9A)
- Clean lines, professional layout
- Elegant typography
announcement-bold
醒目公告风,适合产品发布和活动公告。
type: hero
palette: vivid
rendering: flat-vector
mood: bold
font: displayPrompt hints:
- White or vibrant background
- Bold primary colors
- Dynamic shapes, high contrast
- Large impactful title
minimal-zen
极简禅意风,适合哲学思考和核心概念。
type: minimal
palette: mono
rendering: flat-vector
mood: subtle
font: cleanPrompt hints:
- Pure white background (#FFFFFF)
- Black or dark gray accents
- Single focal element
- Maximum whitespace (60%+)
creative-playful
创意童趣风,适合创意内容和轻松话题。
type: metaphor
palette: pastel
rendering: hand-drawn
mood: balanced
font: handwrittenPrompt hints:
- Light pink/cream background
- Soft pastel colors
- Playful doodles, organic lines
- Friendly, whimsical feel
retro-vintage
复古怀旧风,适合历史内容和怀旧话题。
type: scene
palette: retro
rendering: painterly
mood: subtle
font: serifPrompt hints:
- Sepia-toned background
- Burnt orange, mustard colors
- Vintage textures, grain overlay
- Classic typography
Usage
# Using preset
/cover-image article.md --style tech-dark
# Preset with custom aspect
/cover-image article.md --style announcement-bold --aspect 2.35:1
# Override preset dimensions
/cover-image article.md --style tech-dark --palette coolCustom Presets
Users can create custom presets by adding to their EXTEND.md:
style_presets:
my-brand:
type: hero
palette: elegant
rendering: digital
mood: subtle
font: clean
custom_prompt_hints: |
Use brand colors: primary #FF6B35, background #1A1A2E
Include subtle brand pattern in backgroundType Composition Guidelines
Type Gallery
| Type | Description | Best For |
|---|---|---|
hero | Large visual impact, title overlay | Product launch, brand promotion, major announcements |
conceptual | Concept visualization, abstract core ideas | Technical articles, methodology, architecture design |
typography | Text-focused layout, prominent title | Opinion pieces, quotes, insights |
metaphor | Visual metaphor, concrete expressing abstract | Philosophy, growth, personal development |
scene | Atmospheric scene, narrative feel | Stories, travel, lifestyle |
minimal | Minimalist composition, generous whitespace | Zen, focus, core concepts |
Type-Specific Composition
| Type | Composition Guidelines |
|---|---|
hero | Large focal visual (60-70% area), title overlay on visual, dramatic composition |
conceptual | Abstract shapes representing core concepts, information hierarchy, clean zones |
typography | Title as primary element (40%+ area), minimal supporting visuals, strong hierarchy |
metaphor | Concrete object/scene representing abstract idea, symbolic elements, emotional resonance |
scene | Atmospheric environment, narrative elements, mood-setting lighting and colors |
minimal | Single focal element, generous whitespace (60%+), essential shapes only |
Visual Elements Library
Icon and symbol vocabulary organized by topic. Use these as building blocks for cover compositions.
Tech & Development
| Element | Use For |
|---|---|
| Code window / Terminal | Programming, development |
| Gear / Cog | Engineering, settings, process |
| Circuit board / Chip | Hardware, AI, computing |
| Binary / Data stream | Data, algorithms |
API brackets </> | Web development, APIs |
| Cloud | Cloud computing, SaaS |
| Lock / Shield | Security, privacy |
| Network nodes | Distributed systems, connections |
Ideas & Innovation
| Element | Use For |
|---|---|
| Lightbulb | Ideas, insights, innovation |
| Rocket | Launch, growth, startups |
| Target / Bullseye | Goals, precision, focus |
| Puzzle piece | Problem solving, integration |
| Key | Solutions, access, unlocking |
| Magnifying glass | Analysis, search, discovery |
| Chart / Graph | Data, trends, growth |
| Arrow / Path | Direction, journey, progress |
Communication & Collaboration
| Element | Use For |
|---|---|
| Speech bubble | Communication, dialogue |
Chat dots ... | Conversation, messaging |
| Handshake | Partnership, agreement |
| Team / Figures | Collaboration, community |
| Mail / Envelope | Notifications, outreach |
| Megaphone | Announcements, marketing |
| Network / Web | Social, connections |
Nature & Growth
| Element | Use For |
|---|---|
| Plant / Sprout | Growth, organic, sustainability |
| Tree | Established, structure, branching |
| Leaf | Eco, natural, fresh |
| Sun / Rays | Energy, positivity, new beginnings |
| Mountain | Challenge, achievement, scale |
| Wave | Flow, change, rhythm |
| Seed -> Plant | Transformation, potential |
Tools & Actions
| Element | Use For |
|---|---|
| Wrench / Hammer | Building, fixing, tools |
| Pencil / Pen | Writing, creation, editing |
| Brush | Design, creativity, art |
| Scissors | Cutting, editing, trimming |
| Clock / Timer | Time, scheduling, deadlines |
| Calendar | Planning, events, milestones |
| Checklist / Checkbox | Tasks, completion, validation |
Abstract Concepts
| Element | Use For |
|---|---|
| Infinity | Continuous, endless, loops |
| Yin-yang | Balance, duality, harmony |
| Spiral | Evolution, recursion, cycles |
| Stack / Layers | Depth, hierarchy, structure |
| Bridge | Connection, transition, spanning |
| Door / Portal | Opportunity, entry, access |
| Mirror / Reflection | Self-improvement, analysis |
Combination Patterns
Create visual metaphors by combining elements:
| Combination | Represents |
|---|---|
| Lightbulb + Gear | Innovative engineering |
| Plant + Code | Organic tech growth |
| Rocket + Target | Precise acceleration |
| Key + Lock | Security solutions |
| Bridge + People | Team connections |
| Magnifier + Data | Analytics, insights |
Rendering-Specific Treatment
| Rendering | Element Style |
|---|---|
flat-vector | Geometric, simple shapes, uniform fills |
hand-drawn | Sketchy, organic, doodle-like |
painterly | Soft edges, brush strokes |
digital | Precise, gradient hints, polished |
pixel | 8-bit chunky, grid-aligned |
chalk | Dusty, textured, board style |
Confirm Options Workflow
Step 2: Confirm Options
After analyzing content, confirm the 6 dimensions and provider with the user.
Skip Conditions
| Condition | What's Skipped | What's Still Asked |
|---|---|---|
--quick flag | All 6 dimensions + provider | Aspect ratio (unless --aspect specified) |
All 6 dimensions + --aspect + --provider specified | Everything | Nothing |
| Some dimensions specified | Only specified ones | Unspecified dimensions + aspect ratio |
Confirmation Flow
1. Display auto-selected options
2. Ask user to confirm or modify
3. If modified, validate choice
4. Proceed to prompt creationConfirmation Message Template
Cover Image Options:
Content: [title/topic]
Language: [detected language]
Dimensions:
- Type: [type] -- [brief reason]
- Palette: [palette] -- [brief reason]
- Rendering: [rendering] -- [brief reason]
- Text: [text level]
- Mood: [mood]
- Font: [font]
Provider: [provider] -- [brief reason]
Aspect: [ratio] (default: 16:9)
Output: [directory path]
Proceed? [y/n] or modify: [type=X palette=Y provider=Z ...]Quick Mode
When --quick is set, skip confirmation entirely:
1. Auto-select all dimensions 2. Auto-select provider based on language and references 3. Use default aspect ratio (16:9) unless --aspect specified 4. Proceed directly to prompt creation 5. Show selections in completion report
Dimension Validation
When user provides a value, validate it exists:
| Dimension | Valid Values |
|---|---|
| Type | hero, conceptual, typography, metaphor, scene, minimal |
| Palette | warm, elegant, cool, dark, earth, vivid, pastel, mono, retro |
| Rendering | flat-vector, hand-drawn, painterly, digital, pixel, chalk |
| Text | none, title-only, title-subtitle, text-rich |
| Mood | subtle, balanced, bold |
| Font | clean, handwritten, serif, display |
| Provider | qwen, openai, google |
| Aspect | 16:9, 2.35:1, 4:3, 3:2, 1:1, 3:4 |
If invalid, show valid options and ask again.
Provider Selection
When provider is not specified, auto-select based on signals:
| Signals | Provider |
|---|---|
| Chinese title detected | qwen |
| Reference images provided | google (or openai) |
| No special signals | qwen (default) |
Aspect Ratio Selection
When aspect ratio is not specified, ask separately:
Aspect Ratio Options:
- 16:9 (default) -- Widescreen, blog posts
- 2.35:1 -- 公众号封面 (900x383px)
- 4:3 -- Classic, presentations
- 3:2 -- Photography standard
- 1:1 -- Square, social media
- 3:4 -- Portrait, mobile
Select aspect ratio: [default: 16:9]Platform Mapping
| Ratio | Platform | Size |
|---|---|---|
2.35:1 | 微信公众号封面 | 900x383px |
16:9 | 通用宽屏 | 1920x1080px |
1:1 | 小红书/Instagram | 1080x1080px |
3:4 | 手机海报 | 1080x1440px |
Step 3: Prompt Template
Save to prompts/cover.md:
---
type: cover
palette: [confirmed palette]
rendering: [confirmed rendering]
references:
- ref_id: 01
filename: refs/ref-01-{slug}.{ext}
usage: direct | style | palette
---
# Content Context
Article title: [full original title from source]
Content summary: [2-3 sentence summary of key points and themes]
Keywords: [5-8 key terms extracted from content]
# Visual Design
Cover theme: [2-3 words visual interpretation]
Type: [confirmed type]
Palette: [confirmed palette]
Rendering: [confirmed rendering]
Font: [confirmed font]
Text level: [confirmed text level]
Mood: [confirmed mood]
Aspect ratio: [confirmed ratio]
Language: [confirmed language]
# Text Elements
[Based on text level:]
- none: "No text elements"
- title-only: "Title: [exact title from source or user]"
- title-subtitle: "Title: [title] / Subtitle: [context]"
- text-rich: "Title: [title] / Subtitle: [context] / Tags: [2-4 keywords]"
# Mood Application
[Based on mood level:]
- subtle: "Use low contrast, muted colors, light visual weight, calm aesthetic"
- balanced: "Use medium contrast, normal saturation, balanced visual weight"
- bold: "Use high contrast, vivid saturated colors, heavy visual weight, dynamic energy"
# Font Application
[Based on font style:]
- clean: "Use clean geometric sans-serif typography. Modern, minimal letterforms."
- handwritten: "Use warm hand-lettered typography with organic brush strokes. Friendly, personal feel."
- serif: "Use elegant serif typography with refined letterforms. Classic, editorial character."
- display: "Use bold decorative display typography. Heavy, expressive headlines."
# Composition
Type composition:
- [Type-specific layout and structure]
Visual composition:
- Main visual: [metaphor derived from content meaning]
- Layout: [positioning based on type and aspect ratio]
- Decorative: [palette-specific elements that reinforce content theme]
Color scheme: [primary, background, accent from palette definition, adjusted by mood]
Rendering notes: [key characteristics from rendering definition]
Type notes: [key characteristics from type definition]
Palette notes: [key characteristics from palette definition]
[Reference images section if provided]Reference-Driven Design
When reference images are provided, they are the primary visual input and MUST strongly influence the output.
Passing `--ref` alone is NOT enough. Image generation models often ignore reference images unless the prompt text explicitly describes what to reproduce. Always combine --ref with detailed textual instructions.
Type-Specific Composition
| Type | Composition Guidelines |
|---|---|
hero | Large focal visual (60-70% area), title overlay on visual, dramatic composition |
conceptual | Abstract shapes representing core concepts, information hierarchy, clean zones |
typography | Title as primary element (40%+ area), minimal supporting visuals, strong hierarchy |
metaphor | Concrete object/scene representing abstract idea, symbolic elements, emotional resonance |
scene | Atmospheric environment, narrative elements, mood-setting lighting and colors |
minimal | Single focal element, generous whitespace (60%+), essential shapes only |
Title Guidelines
When text level includes title:
- Source: Use the exact title provided by user, or extract from source content
- Do NOT invent titles: Stay faithful to the original
- Match confirmed language
Reference Image Handling
When user provides reference images (--ref or pasted images):
Reference Analysis Template
| Aspect | Analysis Points |
|---|---|
| Brand elements | Logos, wordmarks, distinctive typography |
| Signature patterns | Unique motifs, textures, geometric patterns |
| Colors | Exact hex values or close approximations |
| Layout | Spatial zones, banner placement, proportions |
| Typography | Font style, weight, case, spacing, position |
| Rendering | Line quality, texture, depth treatment |
| Elements | Icon vocabulary, decorative motifs |
Output: Each extracted element should be written as a copy-pasteable prompt instruction prefixed with "MUST" or "REQUIRED".
Qwen Image API 调用指南
API 端点
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/text2image/image-synthesis环境变量
DASHSCOPE_API_KEY=your-api-keyPython 调用示例
import requests
import os
import json
import time
def generate_cover(prompt, output_path, size='1664*928'):
"""
使用 Qwen-Image-Plus 生成封面图片
Args:
prompt: 图片描述提示词
output_path: 输出图片路径
size: 图片尺寸 (1664*928, 1024*1024, 928*1664, 1472*1104, 1104*1472)
Returns:
str: 生成的图片路径
"""
api_key = os.environ.get('DASHSCOPE_API_KEY')
headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json',
'X-DashScope-Async': 'enable' # 异步模式
}
payload = {
'model': 'qwen-image-plus',
'input': {
'prompt': prompt
},
'parameters': {
'size': size,
'n': 1
}
}
# 1. 提交任务
url = 'https://dashscope.aliyuncs.com/api/v1/services/aigc/text2image/image-synthesis'
response = requests.post(url, headers=headers, json=payload)
result = response.json()
if 'output' not in result or 'task_id' not in result['output']:
raise Exception(f"Task creation failed: {result}")
task_id = result['output']['task_id']
# 2. 轮询任务状态
for i in range(60): # 最多等待 3 分钟
time.sleep(3)
query_url = f'https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}'
query_response = requests.get(query_url, headers={'Authorization': f'Bearer {api_key}'})
query_result = query_response.json()
status = query_result.get('output', {}).get('task_status', 'UNKNOWN')
if status == 'SUCCEEDED':
# 3. 下载图片
image_url = query_result['output']['results'][0]['url']
img_response = requests.get(image_url)
with open(output_path, 'wb') as f:
f.write(img_response.content)
return output_path
elif status == 'FAILED':
raise Exception(f"Generation failed: {query_result}")
raise Exception("Generation timeout after 3 minutes")
def resize_for_wechat(input_path, output_path):
"""
将图片调整为公众号封面尺寸 900x383
Args:
input_path: 输入图片路径
output_path: 输出图片路径
"""
from PIL import Image
img = Image.open(input_path)
# 缩放并裁剪
img_resized = img.resize((900, 502), Image.LANCZOS)
top = (502 - 383) // 2
img_crop = img_resized.crop((0, top, 900, top + 383))
img_crop.save(output_path)
return output_path错误处理
| 错误码 | 说明 | 处理方式 |
|---|---|---|
Throttling.RateQuota | 请求限流 | 等待 60 秒后重试 |
InvalidParameter | 参数错误 | 检查 prompt 和 size 参数 |
DataInspectionFailed | 内容审核失败 | 修改 prompt 内容 |
尺寸映射
| 目标比例 | Qwen Size | 公众号适配 |
|---|---|---|
| 16:9 | 1664*928 | 裁剪为 900x383 |
| 1:1 | 1024*1024 | 裁剪为 900x383 |
| 2.35:1 | 1664*928 | 直接缩放 |
| 4:3 | 1472*1104 | 裁剪适配 |
Reference Images Workflow
Step 1: Save Reference Images
When user provides reference images, save them systematically:
<output-dir>/refs/
├── ref-01-{slug}.{ext} # Reference image file
├── ref-01-{slug}.md # Analysis/notes file
├── ref-02-{slug}.{ext}
├── ref-02-{slug}.md
└── ...Naming Convention
ref-NN: Sequential number (01, 02, 03...){slug}: 2-4 word kebab-case describing the reference{ext}: Original file extension (png, jpg, etc.)
Step 2: Analyze Reference Images
For each reference image, extract:
| Aspect | What to Extract |
|---|---|
| Style | Rendering technique, line quality, texture |
| Composition | Layout, visual hierarchy, focal points |
| Color mood | Palette characteristics |
| Elements | Key visual elements and symbols used |
| Typography | Font style, treatment (if applicable) |
| Mood | Emotional tone and visual weight |
Step 3: Generate Analysis File
Create a .md file for each reference with analysis:
# Reference 01: [name]
## Visual Style
- Rendering: [flat-vector/hand-drawn/etc.]
- Line quality: [description]
- Texture: [description]
## Composition
- Layout: [description]
- Focal point: [description]
- Whitespace: [percentage/feel]
## Colors
- Primary: [hex values]
- Secondary: [hex values]
- Background: [hex values]
## Elements
- [List of visual elements]
## Integration Notes
- [How to use this reference in generation]Step 4: Add to Prompt Frontmatter
When reference files are saved, add to prompt frontmatter:
---
type: cover
palette: warm
rendering: flat-vector
references:
- ref_id: 01
filename: refs/ref-01-style-reference.png
usage: style
- ref_id: 02
filename: refs/ref-02-color-reference.jpg
usage: palette
---Usage Types
| Usage | When to Use | Generation Action |
|---|---|---|
direct | Reference matches desired output closely | Pass reference image directly to generation |
style | Extract visual style characteristics only | Describe style in prompt text |
palette | Extract color palette only | Include colors in prompt |
Step 5: Embed in Prompt Body
CRITICAL: Passing --ref alone is NOT enough. You MUST write detailed textual instructions.
# Reference Style -- MUST INCORPORATE
CRITICAL: The generated cover MUST visually reference the provided images.
## From Ref 1 ([filename]) -- REQUIRED elements:
- [Brand element]: [Specific description]
- [Signature pattern]: [Specific description]
- [Colors]: [Exact hex values]
- [Typography]: [Specific treatment]
- [Layout element]: [Specific spatial element]
## Integration approach:
[Specific layout instruction describing how reference elements combine]Guidelines
- Each visual element gets its own bullet with "MUST" or "REQUIRED"
- Descriptions must be specific enough to reproduce
- The integration approach must describe exact spatial arrangement
- After generation, verify reference elements are visible; if not, strengthen and regenerate