Generate Xiaohongshu text-first images such as cover images, title cards, carousel pages, quote cards, and CTA end cards. Use when Codex needs to turn a topic, outline, draft, bullets, or long-form note into Xiaohongshu-ready visual pages, compress copy for mobile reading, choose a reusable layout/theme, or render ready-to-post SVG, PNG, or JPG assets.
Confirm four things before designing:
3:4 (1080x1440) for Xiaohongshu covers and carousel pages.If the user is vague, assume:
3:4Do not place raw paragraphs directly onto the card.
2-4 highlight chips from the copy instead of coloring entire sentences.Read references/content-patterns.md when the source material is long, repetitive, or badly structured.
Use one pattern consistently across a set:
cover: large title, optional subtitle, highlight chips, footer CTA.slide: tag or step label, smaller title, 3-5 bullet lines, optional footer.quote: oversized statement with minimal decoration.checklist: title plus stacked checklist items and a short CTA.Read references/visual-spec.md when you need spacing, hierarchy, safe-margin, or ratio guidance.
Use scripts/render_text_card_svg.py for deterministic output.
assets/themes/warm-note.json or assets/themes/sharp-contrast.json.assets/specs/example-cover.json or assets/specs/example-carousel.json instead of inventing the schema from scratch.--format svg for editable vector output.--format png or --format jpg for ready-to-post assets.--scale 2 when you want 2x raster output.Raster export uses a bundled macOS AppKit renderer through xcrun swift. It keeps the original canvas size and avoids the text clipping issues that Quick Look thumbnails introduced.
Example:
python3 scripts/render_text_card_svg.py \
--spec assets/specs/example-carousel.json \
--theme assets/themes/warm-note.json \
--format png \
--output-dir /tmp/xhs-demo
Inspect every generated page:
scripts/render_text_card_svg.py to generate SVG, PNG, or JPG cards from JSON specs.references/content-patterns.md for headline, hook, and carousel-copy heuristics.references/visual-spec.md for ratio, spacing, hierarchy, and readability rules.