AgentSkillsCN

generating-hero-images

当您需要借助 Pollinations.ai 的 nanobanana 模型生成或验证博客主图、利用 OCR 对像素艺术中的文字进行拼写校验,或通过重新生成图片来修正诸如 simemap/HTPS/PRIVILIGES 等拼写错误时,可使用此功能。

SKILL.md
--- frontmatter
name: generating-hero-images
description: Use when generating or validating blog hero images with Pollinations.ai nanobanana model, OCR validating text in pixel art for spelling errors, or regenerating images to fix typos like simemap/HTPS/PRIVILIGES

Hero Images

Generate and OCR-validate blog hero images using Pollinations.ai nanobanana pixel art model.

The Character

Steampunk techno wizard: grey goatee, dark hair, rectangular rim-less glasses. Action matches blog post content.

Quick Reference

TaskCommand
Generatecurl -s "https://gen.pollinations.ai/image/steampunk%20pixelart%20wizard%20grey%20goatee%20glasses%20<<ACTION>>?model=nanobanana&width=1024&height=512&nologo=true&seed=<<SEED>>&image=https://mcj-coder.github.io/_astro/martin-jarvis.DLkCWo3V.jpg" -o "src/assets/blog/hero-images/[SLUG].jpg"
ValidateRead unique file → OCR with mcp__4_5v_mcp__analyze_image → Check spelling
RegenerateChange seed, use unique filename, re-OCR

Known Hallucinations (use synonyms)

Problem TermAppears AsUse Instead
sitemapsimemap"xml url list", "site links"
troubleshootinggrouskboning"diagnosing", "fixing"
PRIVILEGESPRIVILIGES"permissions", "access rights"
HTTPSHTPS"SSL", "secure web"

OCR Validation Workflow

Copy and track:

code
- [ ] Generate ONE seed with unique filename (append seed)
- [ ] Upload unique file to CDN via Read tool
- [ ] OCR with mcp__4_5v_mcp__analyze_image
- [ ] Validate text is appropriate to blog content (not exact match)
- [ ] If typo: regenerate with NEW single seed, repeat from step 1
- [ ] Copy valid image to final filename
- [ ] Delete temporary unique files

Critical: Single Seed Generation

Only generate ONE seed at a time. Parallel generation:

  • Wastes API credits when you find a good image on the first try
  • May trigger rate limiting

Generate → OCR validate → if wrong, THEN try next seed.

Critical: CDN Cache Bypass

The Read tool's CDN caches by filename. Same filename = cached image = stale OCR results.

Always use unique filenames during validation:

bash
# Use seed as unique identifier
curl -s "..." -o "src/assets/blog/hero-images/[SLUG]_${SEED}.jpg"
# Read the _${SEED} file for fresh CDN upload
# OCR validates → then cp to original filename

Example

bash
# Generate with seed and reference image
curl -s "https://gen.pollinations.ai/image/steampunk%20pixelart%20wizard%20grey%20goatee%20glasses%20holding%20golden%20key?model=nanobanana&width=1024&height=512&nologo=true&seed=1234&image=https://mcj-coder.github.io/_astro/martin-jarvis.DLkCWo3V.jpg" \
  --header "Authorization: Bearer ${POLLINATIONS_API_KEY}" \
  -o "src/assets/blog/hero-images/my-post_1234.jpg"

# Read file → get CDN URL → OCR → verify text → copy to my-post.jpg