File: README.md
✨ Showcase
Type One Sentence, Get Complete Image & Text Posts
Step 1: Smart Outline Generation
Features:
- ✏️ Edit content for each page
- 🔄 Reorder pages (not recommended)
- ✨ Custom description per page (highly recommended)
🎨 Step 2: Cover Page Generation
Cover Highlights:
- 🎯 Matches your personal style
- 📝 Accurate text rendering
- 🌈 Visually consistent and coordinated
📚 Step 3: Batch Content Page Generation
Generation Notes:
- ⚡ Concurrent generation for all pages (up to 15 by default)
- ⚠️ Disable high concurrency in settings if your API doesn't support it
- 🔧 Regenerate individual pages you're not satisfied with
🏗️ Tech Stack
| ### 🔧 Backend
Technology Description
Language Python 3.11+
Framework Flask
Package Manager uv
Text AI Gemini 3
Image AI 🍌 Nano Banana Pro | ### 🎨 Frontend
Technology Description
Framework Vue 3 + TypeScript
Build Tool Vite
State Management Pinia
Styling Modern CSS |
| --- | --- |
📦 Deployment
Option 1: Docker (Recommended)
The simplest way — one command to start:
docker run -d -p 12398:12398 -v ./history:/app/history -v ./output:/app/output histonemax/redink:latestVisit http://localhost:12398 and configure your API Key in the Settings page.
Using docker-compose (optional):
Download docker-compose.yml, then:
docker-compose up -dDocker Notes:
- The container does not include any API Keys — configure them in the web UI
- Use
-v ./history:/app/historyto persist history - Use
-v ./output:/app/outputto persist generated images - Optional: mount custom config
-v ./text_providers.yaml:/app/text_providers.yaml
Option 2: Local Development
Prerequisites:
- Python 3.11+
- Node.js 18+
- pnpm
- uv
1. Clone the Repository
git clone https://github.com/HisMax/RedInk.git
cd RedInk2. Configure API Services
Copy the config templates:
cp text_providers.yaml.example text_providers.yaml
cp image_providers.yaml.example image_providers.yamlEdit the config files with your API Key and service settings, or configure them later via the Settings page in the web UI.
3. Install Backend Dependencies
uv sync4. Install Frontend Dependencies
cd frontend
pnpm install5. Start the Services
One-Click Start (Recommended)
Run the start script to automatically install dependencies and launch both frontend and backend:
- macOS:
start.shor double-clickscripts/start-macos.command - Linux:
./start.sh - Windows: Double-click
start.bat
The browser will automatically open at http://localhost:5173
Manual Start
Start Backend:
uv run python -m backend.appVisit: http://localhost:12398
Start Frontend:
cd frontend
pnpm devVisit: http://localhost:5173
🔧 Configuration
Configuration Methods
The project supports two configuration methods:
- Web UI (Recommended): Visual configuration via the Settings page after starting the service
- YAML Files: Edit config files directly
Text Generation Config
Config file: text_providers.yaml
# Active provider
active_provider: openai
providers:
# OpenAI or compatible API
openai:
type: openai_compatible
api_key: sk-xxxxxxxxxxxxxxxxxxxx
base_url: https://api.openai.com/v1
model: gpt-4o
# Google Gemini (native API)
gemini:
type: google_gemini
api_key: AIzaxxxxxxxxxxxxxxxxxxxxxxxxx
model: gemini-2.0-flashImage Generation Config
Config file: image_providers.yaml
# Active provider
active_provider: gemini
providers:
# Google Gemini image generation
gemini:
type: google_genai
api_key: AIzaxxxxxxxxxxxxxxxxxxxxxxxxx
model: gemini-3-pro-image-preview
high_concurrency: false
# OpenAI compatible API
openai_image:
type: image_api
api_key: sk-xxxxxxxxxxxxxxxxxxxx
base_url: https://your-api-endpoint.com
model: dall-e-3
high_concurrency: falseHigh Concurrency Mode
- Off (default): Images generated one by one — suitable for GCP $300 trial accounts or rate-limited APIs
- On: Images generated in parallel (up to 15 simultaneously) — faster but requires API support for high concurrency
⚠️ Not recommended for GCP $300 trial accounts — may trigger rate limits and cause generation failures.
⚠️ Notes
API Quota Limits:
- Be aware of Gemini and image generation API call quotas
- GCP trial accounts should keep high concurrency disabled
Generation Time:
- Outline generation usually takes 15-30 seconds
- Image generation takes time — please be patient (don't leave the page)
🤝 Contributing
Issues and Pull Requests are welcome!
If this project helps you, please give it a Star ⭐
Changelog
v1.4.3 (2026-06-30)
- ✨ Default outline length changed to 5 pages when the user does not specify a page count
- ✨ Added clearer outline generation loading copy: "please wait, this step usually takes 15-30 seconds"
- 🏗️ Modularized image provider logic with reusable provider policy, API client, response extractor, rate limiter, and history image merger
- 🔧 Fixed GPT Image and Nano Banana compatible image APIs by omitting
response_formatby default and supportingb64_json, data URLs, and temporary image URLs - 🔧 Added per-record image generation recovery so refreshes or retries reuse existing images instead of spending upstream quota again
- 🔧 Protected history records from empty image overwrites and status regressions; history reads can self-heal from task image folders
- ✨ Added structured Problem Details-style API errors and reusable frontend error cards with copyable diagnostics
- 🐛 Fixed provider connection tests for reasoning models that return
reasoning_contentor reasoning tokens without finalcontent - 🧪 Added backend coverage for image API compatibility, history merging, structured errors, cached generation, and reasoning-model connection tests
v1.4.2 (2026-03-15)
- ✨ Added English README as default with language toggle (中文/English)
- ✨ Added AI-generated English banner and showcase grid images
- ✨ Added Claude Opus 4.5 to acknowledgments
- ✨ Added shields.io badges (Stars, License, Docker Pulls, Release)
- ✨ Added GitHub Issue/PR templates for standardized contributions
- ✨ Added CONTRIBUTING.md and SECURITY.md
- 🐛 Fixed
rstrip('/v1')incorrectly stripping URL characters (e.g.api.openai.com→api.openai.co) — 5 occurrences across backend - 🐛 Fixed image API test connection failing for chat-based endpoints (Doubao/Volcengine) by using configured endpoint_type instead of hardcoded
/v1/models - 🐛 Fixed bare
except:clause replaced withexcept Exception:in history service - 🐛 Fixed SSE stream reader not released on error in frontend API layer (resource leak)
- 🐛 Fixed 5 uncleared
setTimeoutcalls in ContentDisplay component (memory leak) - 🐛 Fixed duplicate image regeneration requests by tracking in-progress indices
- 🐛 Fixed GenerateView redirect timer not cleared on component unmount
v1.4.1 (2025-12-29)
- ✨ Added one-click start scripts for macOS/Linux/Windows
- ✨ Added copywriting generation: auto-generate titles, body text, and tags
- 🔧 Fixed history saving: immediate save after outline generation, auto-save on edit (300ms debounce)
- 🔧 Optimized navigation: force-save unsaved changes before clicking "Start Generation"
- 🔧 Unified startup script port display to 12398
- 🔧 Cleaned up unused retry decorator code in backend generators
- 🔧 Fixed frontend CSS variable reference issues
- 🔧 Optimized checkHistoryExists API performance with dedicated endpoint
- 🔧 Standardized recordId assignment using setRecordId() method
v1.4.0 (2025-11-30)
- 🏗️ Backend refactored: split monolithic routes into modular blueprints (history, images, generation, outline, config)
- 🏗️ Frontend refactored: extracted reusable components (ImageGalleryModal, OutlineModal, ShowcaseBackground, etc.)
- ✨ Optimized homepage design, removed redundant content blocks
- ✨ Background image preloading with fade-in animation for better loading experience
- ✨ History persistence support (Docker deployment)
- 🔧 Fixed history preview and outline viewing
- 🔧 Optimized Modal component visibility control
- 🧪 Added 65 backend unit tests
v1.3.0 (2025-11-26)
- ✨ Added Docker support for one-click deployment
- ✨ Published official Docker image to Docker Hub:
histonemax/redink - 🔧 Flask auto-detects frontend build artifacts for single-container deployment
- 🔧 Docker image includes blank config templates to protect API Key security
- 📝 Updated README with Docker deployment instructions
v1.2.0 (2025-11-26)
- ✨ Added copyright info display on all pages
- ✨ Improved image regeneration with single image redraw support
- ✨ Regenerated images maintain style consistency with full context (cover, outline, user input)
- ✨ Fixed image cache issues — regenerated images refresh immediately
- ✨ Unified text generation client supporting Google Gemini and OpenAI-compatible APIs with auto-switching
- ✨ Added web UI configuration for visual API provider management
- ✨ Added high concurrency mode toggle for different API quotas
- ✨ API Key masking for security
- ✨ Auto-save configuration with instant effect
- 🔧 Adjusted default max_output_tokens to 8000 for broader model compatibility
- 🔧 Optimized frontend routing and page layout for better UX
- 🔧 Simplified config file structure, removed redundant parameters
- 🔧 Optimized history image display with thumbnails to save bandwidth
- 🔧 History regeneration auto-loads cover image from filesystem as reference
- 🐛 Fixed missing
store.updateImagemethod causing regeneration failure - 🐛 Fixed image URL concatenation error during history loading
- 🐛 Fixed raw image parameter handling in download function
- 🐛 Fixed image loading 500 error
Community & Support
- GitHub Issues: https://github.com/HisMax/RedInk/issues
Contact the Author
- Email: [email protected]
- WeChat: Histone2024 (please state your purpose)
- GitHub: @HisMax
Support the Project
Star History
📄 License
Personal Use - CC BY-NC-SA 4.0
This project is licensed under CC BY-NC-SA 4.0
You are free to:
- ✅ Personal Use — for learning, research, and personal projects
- ✅ Share — copy and redistribute the material in any medium or format
- ✅ Adapt — remix, transform, and build upon the material
Under the following terms:
- 📝 Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made
- 🚫 NonCommercial — You may not use the material for commercial purposes
- 🔄 ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license
Commercial License
If you wish to use this project for commercial purposes (including but not limited to):
- Providing paid services
- Integrating into commercial products
- Operating as a SaaS service
- Other for-profit uses
Please contact the author for a commercial license:
- 📧 Email: [email protected]
- 💬 WeChat: Histone2024 (please note "Commercial License Inquiry")
The author will provide flexible commercial licensing options based on your specific use case.
Disclaimer
This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability.
🙏 Acknowledgments
- Google Gemini — Powerful text generation capabilities
- Claude Opus 4.5 — Intelligent code assistance and development support
- Image generation service providers — Stunning image generation
- Linux.do — Excellent developer community
👨💻 Author
Mozi (Histone) - AI Entrepreneur
- 🏠 Location: Hangzhou, China
- 🚀 Status: Startup in progress
- 📧 Email: [email protected]
- 💬 WeChat: Histone2024 (personal WeChat — no tech support)
- 🐙 GitHub: @HisMax
"Let AI do the creative work for us"
If this project helped you, share it with others! ⭐
Questions or suggestions? Feel free to open an Issue!
File: README_zh.md
使用红墨生成的各类小红书封面 - AI驱动,风格统一,文字准确
✨ 效果展示
输入一句话,生成完整图文
Step 1: 智能大纲生成
功能特性:
- ✏️ 可编辑每页内容
- 🔄 可调整页面顺序(不建议)
- ✨ 自定义每页描述(强烈推荐)
🎨 Step 2: 封面页生成
封面亮点:
- 🎯 符合个人风格
- 📝 文字准确无误
- 🌈 视觉统一协调
📚 Step 3: 内容页批量生成
生成说明:
- ⚡ 并发生成所有页面(默认最多 15 张)
- ⚠️ 如 API 不支持高并发,请在设置中关闭
- 🔧 支持单独重新生成不满意的页面
🏗️ 技术架构
| ### 🔧 后端技术栈
技术 说明
语言 Python 3.11+
框架 Flask
包管理 uv
文案AI Gemini 3
图片AI 🍌 Nano banana Pro | ### 🎨 前端技术栈
技术 说明
框架 Vue 3 + TypeScript
构建工具 Vite
状态管理 Pinia
样式 Modern CSS |
| --- | --- |
📦 如何自己部署
方式一:Docker 部署(推荐)
最简单的部署方式,一行命令即可启动:
docker run -d -p 12398:12398 -v ./history:/app/history -v ./output:/app/output histonemax/redink:latest访问 http://localhost:12398,在 Web 界面的设置页面配置你的 API Key 即可使用。
使用 docker-compose(可选):
下载 docker-compose.yml 后:
docker-compose up -dDocker 部署说明:
- 容器内不包含任何 API Key,需要在 Web 界面配置
- 使用
-v ./history:/app/history持久化历史记录 - 使用
-v ./output:/app/output持久化生成的图片 - 可选:挂载自定义配置文件
-v ./text_providers.yaml:/app/text_providers.yaml
方式二:本地开发部署
前置要求:
- Python 3.11+
- Node.js 18+
- pnpm
- uv
1. 克隆项目
git clone https://github.com/HisMax/RedInk.git
cd RedInk2. 配置 API 服务
复制配置模板文件:
cp text_providers.yaml.example text_providers.yaml
cp image_providers.yaml.example image_providers.yaml编辑配置文件,填入你的 API Key 和服务配置。也可以启动后在 Web 界面的设置页面进行配置。
3. 安装后端依赖
uv sync4. 安装前端依赖
cd frontend
pnpm install5. 启动服务
一键启动(推荐)
双击运行启动脚本,自动安装依赖并启动前后端:
- macOS:
start.sh或双击scripts/start-macos.command - Linux:
./start.sh - Windows: 双击
start.bat
启动后自动打开浏览器访问 http://localhost:5173
手动启动
启动后端:
uv run python -m backend.app启动前端:
cd frontend
pnpm dev🔧 配置说明
配置方式
项目支持两种配置方式:
- Web 界面配置(推荐):启动服务后,在设置页面可视化配置
- YAML 文件配置:直接编辑配置文件
文本生成配置
配置文件: text_providers.yaml
# 当前激活的服务商
active_provider: openai
providers:
# OpenAI 官方或兼容接口
openai:
type: openai_compatible
api_key: sk-xxxxxxxxxxxxxxxxxxxx
base_url: https://api.openai.com/v1
model: gpt-4o
# Google Gemini(原生接口)
gemini:
type: google_gemini
api_key: AIzaxxxxxxxxxxxxxxxxxxxxxxxxx
model: gemini-2.0-flash图片生成配置
配置文件: image_providers.yaml
# 当前激活的服务商
active_provider: gemini
providers:
# Google Gemini 图片生成
gemini:
type: google_genai
api_key: AIzaxxxxxxxxxxxxxxxxxxxxxxxxx
model: gemini-3-pro-image-preview
high_concurrency: false # 高并发模式
# OpenAI 兼容接口
openai_image:
type: image_api
api_key: sk-xxxxxxxxxxxxxxxxxxxx
base_url: https://your-api-endpoint.com
model: dall-e-3
high_concurrency: false高并发模式说明
- 关闭(默认):图片逐张生成,适合 GCP 300$ 试用账号或有速率限制的 API
- 开启:图片并行生成(最多15张同时),速度更快,但需要 API 支持高并发
⚠️ GCP 300$ 试用账号不建议启用高并发,可能会触发速率限制导致生成失败。
⚠️ 注意事项
API 配额限制:
- 注意 Gemini 和图片生成 API 的调用配额
- GCP 试用账号建议关闭高并发模式
生成时间:
- 大纲生成通常需要 15-30 秒,请稍候
- 图片生成需要时间,请耐心等待(不要离开页面)
🤝 参与贡献
欢迎提交 Issue 和 Pull Request!
如果这个项目对你有帮助,欢迎给个 Star ⭐
更新日志
v1.4.3 (2026-06-30)
- ✨ 用户没有指定页数时,大纲默认改为 5 页
- ✨ 大纲生成中新增更明确的等待提示:这一步大概要 15-30 秒
- 🏗️ 图片服务商链路模块化:新增 Provider 策略、上游 API Client、响应解析器、限流器和历史图片合并器
- 🔧 修复 GPT Image 与 Nano Banana 兼容图片接口:默认不发送
response_format,同时支持b64_json、data URL 和临时图片 URL - 🔧 新增基于历史记录的生成恢复逻辑,刷新或重进页面不会重复消耗上游额度
- 🔧 保护历史记录图片列表,避免空数组覆盖已有图片,避免已完成/部分完成状态回退
- ✨ 新增结构化错误模型和前端错误卡片,支持友好提示、折叠诊断和复制诊断信息
- 🐛 修复思考模型连接测试:支持只返回
reasoning_content或 reasoning tokens、没有最终content的响应 - 🧪 补充图片 API 兼容、历史合并、结构化错误、缓存生成、思考模型连接测试等后端覆盖
v1.4.2 (2026-03-15)
- ✨ 新增英文版 README 并设为默认,支持中英文切换
- ✨ 新增 AI 生成的英文 banner 和 showcase 展示图片
- ✨ 致谢部分新增 Claude Opus 4.5
- ✨ 新增 shields.io 徽章(Stars、License、Docker Pulls、Release)
- ✨ 新增 GitHub Issue/PR 模板,规范化社区贡献
- ✨ 新增 CONTRIBUTING.md 贡献指南和 SECURITY.md 安全策略
- 🐛 修复
rstrip('/v1')错误删除 URL 字符的问题(如api.openai.com→api.openai.co),涉及后端 5 处 - 🐛 修复豆包/火山引擎等 chat 端点的图片 API 测试连接失败问题(使用配置的 endpoint_type 替代硬编码的
/v1/models) - 🐛 修复 history 服务中裸
except:改为except Exception: - 🐛 修复前端 SSE 流读取器在异常时未释放的资源泄漏
- 🐛 修复 ContentDisplay 组件 5 个 setTimeout 未清理的内存泄漏
- 🐛 修复图片重试可重复提交的问题(使用 Set 追踪进行中的索引)
- 🐛 修复 GenerateView 组件卸载后跳转定时器未清理
v1.4.1 (2025-12-29)
- ✨ 新增一键启动脚本,支持 macOS/Linux/Windows
- ✨ 新增文案生成功能,自动生成标题、正文和标签
- 🔧 修复历史记录保存机制:大纲生成后立即保存,编辑时自动保存(300ms防抖)
- 🔧 优化跳转逻辑:点击"开始生成"前强制保存未保存的修改
- 🔧 统一启动脚本端口显示为 12398
- 🔧 清理后端生成器未使用的重试装饰器代码
- 🔧 修复前端 CSS 变量引用问题
- 🔧 优化 checkHistoryExists 接口性能,使用专用端点
- 🔧 规范 recordId 赋值方式,统一使用 setRecordId() 方法
v1.4.0 (2025-11-30)
- 🏗️ 后端架构重构:拆分单体路由为模块化蓝图(history、images、generation、outline、config)
- 🏗️ 前端组件重构:提取可复用组件(ImageGalleryModal、OutlineModal、ShowcaseBackground等)
- ✨ 优化首页设计,移除冗余内容区块
- ✨ 背景图片预加载和渐入动画,提升加载体验
- ✨ 历史记录持久化支持(Docker部署)
- 🔧 修复历史记录预览和大纲查看功能
- 🔧 优化Modal组件可见性控制
- 🧪 新增65个后端单元测试
v1.3.0 (2025-11-26)
- ✨ 新增 Docker 支持,一键部署
- ✨ 发布官方 Docker 镜像到 Docker Hub:
histonemax/redink - 🔧 Flask 自动检测前端构建产物,支持单容器部署
- 🔧 Docker 镜像内置空白配置模板,保护 API Key 安全
- 📝 更新 README,添加 Docker 部署说明
v1.2.0 (2025-11-26)
- ✨ 新增版权信息展示,所有页面显示开源协议和项目链接
- ✨ 优化图片重新生成功能,支持单张图片重绘
- ✨ 重新生成图片时保持风格一致,传递完整上下文(封面图、大纲、用户输入)
- ✨ 修复图片缓存问题,重新生成的图片立即刷新显示
- ✨ 统一文本生成客户端接口,支持 Google Gemini 和 OpenAI 兼容接口自动切换
- ✨ 新增 Web 界面配置功能,可视化管理 API 服务商
- ✨ 新增高并发模式开关,适配不同 API 配额
- ✨ API Key 脱敏显示,保护密钥安全
- ✨ 配置自动保存,修改即时生效
- 🔧 调整默认 max_output_tokens 为 8000,兼容更多模型限制
- 🔧 优化前端路由和页面布局,提升用户体验
- 🔧 简化配置文件结构,移除冗余参数
- 🔧 优化历史记录图片显示,使用缩略图节省带宽
- 🔧 历史记录重新生成时自动从文件系统加载封面图作为参考
- 🐛 修复
store.updateImage方法缺失导致的重新生成失败问题 - 🐛 修复历史记录加载时图片 URL 拼接错误
- 🐛 修复下载功能中原图参数处理问题
- 🐛 修复图片加载 500 错误问题
交流讨论与赞助
- GitHub Issues: https://github.com/HisMax/RedInk/issues
联系作者
- Email: [email protected]
- 微信: Histone2024(添加请注明来意)
- GitHub: @HisMax
用爱发电,如果可以,请默子喝一杯☕️咖啡吧
Star History
📄 开源协议
个人使用 - CC BY-NC-SA 4.0
本项目采用 CC BY-NC-SA 4.0 协议进行开源
你可以自由地:
- ✅ 个人使用 - 用于学习、研究、个人项目
- ✅ 分享 - 在任何媒介以任何形式复制、发行本作品
- ✅ 修改 - 修改、转换或以本作品为基础进行创作
但需要遵守以下条款:
- 📝 署名 - 必须给出适当的署名,提供指向本协议的链接,同时标明是否对原始作品作了修改
- 🚫 非商业性使用 - 不得将本作品用于商业目的
- 🔄 相同方式共享 - 如果你修改、转换或以本作品为基础进行创作,你必须以相同的协议分发你的作品
商业授权
如果你希望将本项目用于商业目的(包括但不限于):
- 提供付费服务
- 集成到商业产品
- 作为 SaaS 服务运营
- 其他盈利性用途
请联系作者获取商业授权:
- 📧 Email: [email protected]
- 💬 微信: Histone2024(请注明"商业授权咨询")
默子会根据你的具体使用场景提供灵活的商业授权方案。
免责声明
本软件按"原样"提供,不提供任何形式的明示或暗示担保,包括但不限于适销性、特定用途的适用性和非侵权性的担保。在任何情况下,作者或版权持有人均不对任何索赔、损害或其他责任负责。
🙏 致谢
- Google Gemini - 强大的文案生成能力
- Claude Opus 4.5 - 智能代码辅助与开发支持
- 图片生成服务提供商 - 惊艳的图片生成效果
- Linux.do - 优秀的开发者社区
👨💻 作者
默子 (Histone) - AI 创业者
- 🏠 位置: 中国杭州
- 🚀 状态: 创业中
- 📧 Email: [email protected]
- 💬 微信: Histone2024 (私人微信不解答任何技术问题)
- 🐙 GitHub: @HisMax
"让 AI 帮我们做更有创造力的事"
如果这个项目帮到了你,欢迎分享给更多人! ⭐
有任何问题或建议,欢迎提 Issue !