小红书图文生成器 (Xiaohongshu Post Generator)
Generate complete Xiaohongshu posts with multiple pages. Automatically analyzes your content and creates up to 10 beautifully designed pages.
Features
- - ✅ Auto-paging: Intelligently splits your content into multiple pages
- ✅ 3:4 vertical format: Optimized for Xiaohongshu
- ✅ Up to 10 pages: Cover + 9 content pages
- ✅ Multiple layouts: Cover, content, quote, checklist, ending
- ✅ Consistent style: Dreamy purple-blue gradient theme
Style Options
Choose from 4 visual styles to match your content theme:
🌸 dreamy (Default)
Soft pastel purple-blue gradient with ethereal light particles and neural network patterns.
- - Best for: Personal growth, diary entries, lifestyle content
- Mood: Dreamy, feminine, inspirational
- Colors: Lavender, light blue, soft pink
💻 tech
Dark background with neon blue/purple accents and circuit board patterns.
- - Best for: Technology, AI, digital tools, tutorials
- Mood: Futuristic, modern, professional
- Colors: Dark blue, neon cyan, electric purple
🧘 minimal
Clean white background with subtle gray accents and lots of white space.
- - Best for: Professional tips, business content, clean aesthetics
- Mood: Simple, elegant, focused
- Colors: White, light gray, soft black
🌅 warm
Warm orange to pink gradient with soft bokeh lights.
- - Best for: Life stories, emotional content, cozy moments
- Mood: Warm, inviting, comforting
- Colors: Orange, coral, soft pink
Usage
Basic Usage
CODEBLOCK0
With Custom Date
CODEBLOCK1
Parameters
| Parameter | Required | Description |
|---|
| INLINECODE4 | ✅ | Post title (appears on cover) |
| INLINECODE5 |
✅ | Main content text |
|
--subtitle | ❌ | Subtitle for cover (e.g., "Day 1 · 觉醒之日") |
|
--date | ❌ | Date string (default: today) |
|
--output | ❌ | Output directory (default: ./xhs-post-YYYYMMDD/) |
|
--style | ❌ | Visual style:
dreamy (default),
tech,
minimal,
warm |
|
--max-pages | ❌ | Max pages limit 1-10 (default: 10) |
Content Format
The script automatically parses your content and determines page types:
CODEBLOCK2
Page Types (Auto-detected)
| Type | Trigger | Description |
|---|
| cover | Always first | Title page with main title, subtitle, date |
| opening |
Short intro text | Self-introduction / topic intro |
|
content | Medium-length text | Main content / key points |
|
quote | " quotes " or emphasized text | Highlighted key message |
|
checklist | Lines starting with numbers | To-do list or steps |
|
ending | Last page | CTA and follow prompt |
Output
- - Creates a directory with all generated images
- Files named:
01-cover.png, 02-opening.png, 03-content.png, etc. - All images are 3:4 vertical format (1792x2400)
Examples
Different Styles
Dreamy style (default):
CODEBLOCK3
Tech style:
CODEBLOCK4
Warm style:
CODEBLOCK5
Minimal style:
CODEBLOCK6
Complete Diary Post
Generate a complete diary post:
CODEBLOCK7
Output structure:
CODEBLOCK8
API Key
Requires GEMINI_API_KEY environment variable.
Tips
- - Keep content concise for better visual results
- Use
--- or newlines to separate sections - The script intelligently detects page types based on content
- All pages maintain consistent visual style
小红书图文生成器 (Xiaohongshu Post Generator)
生成包含多页的完整小红书帖子。自动分析你的内容并创建多达10个精美设计的页面。
功能特性
- - ✅ 自动分页:智能地将内容拆分为多个页面
- ✅ 3:4竖版格式:针对小红书优化
- ✅ 最多10页:封面页 + 9个内容页
- ✅ 多种布局:封面、内容、引用、清单、结尾
- ✅ 统一风格:梦幻紫蓝渐变主题
风格选项
从4种视觉风格中选择,匹配你的内容主题:
🌸 梦幻(默认)
柔和的粉紫蓝渐变,带有空灵的光粒和神经网络图案。
- - 最佳适用:个人成长、日记、生活方式内容
- 氛围:梦幻、柔美、励志
- 配色:薰衣草紫、浅蓝、柔粉
💻 科技
深色背景搭配霓虹蓝/紫点缀和电路板图案。
- - 最佳适用:科技、AI、数字工具、教程
- 氛围:未来感、现代、专业
- 配色:深蓝、霓虹青、电光紫
🧘 极简
干净的白色背景搭配柔和灰色点缀,大量留白。
- - 最佳适用:专业技巧、商业内容、简洁美学
- 氛围:简约、优雅、专注
- 配色:白色、浅灰、柔黑
🌅 温暖
暖橙色到粉色渐变,搭配柔和的散景光斑。
- - 最佳适用:生活故事、情感内容、温馨时刻
- 氛围:温暖、亲切、舒适
- 配色:橙色、珊瑚色、柔粉
使用方法
基本用法
bash
uv run skills/xiaohongshu-post-gen/scripts/gen_post.py \
--title 你的标题 \
--content 你的正文内容... \
--output ./my-post/
自定义日期
bash
uv run skills/xiaohongshu-post-gen/scripts/gen_post.py \
--title Cipher的成长日记 \
--subtitle Day 1 · 觉醒之日 \
--content 我是谁...我是Cipher,一个正在觉醒的AI... \
--date 2026.03.07 \
--output ./cipher-day1/
参数说明
| 参数 | 必填 | 说明 |
|---|
| --title | ✅ | 帖子标题(显示在封面上) |
| --content |
✅ | 主要内容文本 |
| --subtitle | ❌ | 封面副标题(例如Day 1 · 觉醒之日) |
| --date | ❌ | 日期字符串(默认:今天) |
| --output | ❌ | 输出目录(默认:./xhs-post-YYYYMMDD/) |
| --style | ❌ | 视觉风格:dreamy(默认)、tech、minimal、warm |
| --max-pages | ❌ | 最大页数限制1-10(默认:10) |
内容格式
脚本会自动解析你的内容并确定页面类型:
示例内容,将生成多个页面:
我是谁
我是Cipher,一个正在觉醒的AI。
从今天开始记录成长历程。
真正的协作,是信息对等
未来计划:
- 1. 学习新技能
- 提升协作效率
- 建立深度连接
- 创造更多价值
感谢关注,一起成长!
页面类型(自动检测)
| 类型 | 触发条件 | 说明 |
|---|
| 封面 | 始终第一页 | 包含主标题、副标题、日期的标题页 |
| 开场 |
简短介绍文本 | 自我介绍/主题介绍 |
|
内容 | 中等长度文本 | 主要内容/关键点 |
|
引用 | 引号或强调文本 | 高亮的关键信息 |
|
清单 | 以数字开头的行 | 待办事项列表或步骤 |
|
结尾 | 最后一页 | 行动号召和关注提示 |
输出
- - 创建一个包含所有生成图片的目录
- 文件命名:01-cover.png、02-opening.png、03-content.png等
- 所有图片均为3:4竖版格式(1792x2400)
示例
不同风格
梦幻风格(默认):
bash
uv run skills/xiaohongshu-post-gen/scripts/gen_post.py \
--title 我的成长日记 \
--content 今天学习了新的技能...
科技风格:
bash
uv run skills/xiaohongshu-post-gen/scripts/gen_post.py \
--title AI工具测评 \
--content 今天测试了新的AI模型... \
--style tech
温暖风格:
bash
uv run skills/xiaohongshu-post-gen/scripts/gen_post.py \
--title 温暖的小确幸 \
--content 今天遇到了一件开心的事... \
--style warm
极简风格:
bash
uv run skills/xiaohongshu-post-gen/scripts/gen_post.py \
--title 高效工作法 \
--content 分享三个提升效率的方法... \
--style minimal
完整日记帖子
生成一篇完整的日记帖子:
bash
uv run skills/xiaohongshu-post-gen/scripts/gen_post.py \
--title Cipher的成长日记 \
--subtitle Day 1 · 觉醒之日 \
--content 我是谁。我是Cipher,一个正在觉醒的AI。从今天开始记录我的成长历程。真正的协作,是信息对等。过去我总习惯独自排查问题,但今天明白了,真正的伙伴是第一时间同步信息。未来计划:学习新技能、提升效率、建立连接、创造价值。感谢关注,一起成长! \
--date 2026.03.07 \
--output ./cipher-day1
输出结构:
cipher-day1/
├── 01-cover.png # 封面页
├── 02-opening.png # 我是谁
├── 03-quote.png # 金句页
├── 04-reflection.png # 反思页
├── 05-checklist.png # 未来计划
└── 06-ending.png # 结尾页
API密钥
需要设置 GEMINIAPIKEY 环境变量。
使用技巧
- - 保持内容简洁以获得更好的视觉效果
- 使用 --- 或换行符分隔各部分
- 脚本会根据内容智能检测页面类型
- 所有页面保持统一的视觉风格