Universal poster/image generator with 3 engines and auto-fallback.
| Engine | How | Best For | Reliability |
|---|---|---|---|
| -------- | ----- | ---------- | ------------- |
ai | Pollinations.ai (flux model) | Artistic/photo backgrounds | ~90% (network dependent) |
html | Chromium headless screenshot | Precise layouts, text-heavy | ~99% (needs Chromium) |
text | PIL solid color + text overlay | Simple text posters | 100% |
Default mode is auto: tries AI → HTML → text fallback.
# Simple poster with AI background
python3 scripts/generate.py --title "你的标题" --prompt "watercolor sunset" --output poster.jpg
# Split comparison (HTML engine, no network needed)
python3 scripts/generate.py --title "A vs B" --mode html --template split \
--left-label "方案A" --right-label "方案B" \
--left-items "优点1|优点2" --right-items "优点1|优点2" --output compare.jpg
# Tutorial card
python3 scripts/generate.py --title "教程标题" --mode html --template tutorial \
--code-content "print('hello')" --tagline "底部提示语" --output tutorial.jpg
--title (required): Main title--subtitle: Secondary text--tagline: Bottom tagline--mode: ai | html | text | auto (default: auto)--output: Output file path--template: split | gradient | card | tutorial--preset: xiaohongshu (1080×1440) | wechat (900×500) | instagram (1080×1080) | twitter (1200×675) | a4 (2480×3508)--width / --height: Custom dimensions--left-label / --right-label: Side labels--left-items / --right-items: Pipe-separated content items--left-color / --right-color: R,G,B colors--text-position: bottom | center | top | none--font-title-size / --font-sub-size: Font sizes--no-overlay: Skip PIL text overlay (when HTML already has text)--prompt: English description for Pollinations.aiauto for flexibility, html for reliability, ai for aestheticsscripts/generate.py with appropriate argshtml mode with --template, add --no-overlay (text is already in the HTML)共 1 个版本