Red Ink - A one-stop Xiaohongshu image-and-text generator based on the πNano Banana Proπ, "One Sentence, One Image: Generate Xiaohongshu Text and Images."
δΈζ | English

Official Site β Redink.top

Various social media covers generated with RedInk - AI-powered, consistent style, accurate text
β¨ 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:latest
Visit http://localhost:12398 and configure your API Key in the Settings page.
Using docker-compose (optional):
Download docker-compose.yml, then:
docker-compose up -d
Docker 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 ./textproviders.yaml:/app/textproviders.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 RedInk
2. Configure API Services
Copy the config templates:
cp textproviders.yaml.example textproviders.yaml cp imageproviders.yaml.example imageproviders.yaml
Edit 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 sync
4. Install Frontend Dependencies
cd frontend
pnpm install
5. 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
Manual Start
Start Backend:
uv run python -m backend.app Visit: http://localhost:12398
Start Frontend:
cd frontend pnpm dev Visit: 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-flash
Image 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: false
High 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
β οΈ Notes
- API Quota Limits:
- Generation Time:
π€ 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
responseformatby default and supportingb64json, 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 maxoutputtokens 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: histonemax@gmail.com
- 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
- π 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
- π§ Email: histonemax@gmail.com
- π¬ WeChat: Histone2024 (please note "Commercial License Inquiry")
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: histonemax@gmail.com
- π¬ WeChat: Histone2024 (personal WeChat β no tech support)
- π GitHub: @HisMax
If this project helped you, share it with others! β
Questions or suggestions? Feel free to open an Issue!