# RedInk

> A self-hosted web app that turns one sentence into a complete Xiaohongshu-style image-and-text post: outline, cover, content pages and copy

- Category: Multimodal Generation / Image Generation
- Language: Python
- Licence: CC BY-NC-SA 4.0 (non-commercial use only; commercial use requires a separate licence from the author)
- Repository: https://github.com/HisMax/RedInk
- Website: https://redink.top
- Canonical page: https://ai-tldr.dev/tools/redink/

## In short

RedInk (红墨) is a web app for producing Xiaohongshu (RedNote) image-and-text posts from a single sentence. It sits in the Image Generation category of the Multimodal Generation tools and is open-source, written in Python and licensed CC BY-NC-SA 4.0 (non-commercial use only; commercial use requires a separate licence from the author).

## Overview

RedInk (红墨) is a web app for producing Xiaohongshu (RedNote) image-and-text posts from a single sentence. You type a topic, a text model drafts a page-by-page outline, and an image model then renders a cover and every content page as finished graphics with the text laid out on them. The README describes the output as covers with a consistent style and accurate text rendering, and a later release added copywriting generation for the post's title, body text and tags.

The workflow runs in three steps. First, you edit the outline: change each page's content, reorder pages, and add a custom description per page, which the README strongly recommends. Second, the cover is generated. Third, the content pages are generated in a batch, up to 15 at once when high-concurrency mode is on, and any page you don't like can be regenerated on its own, keeping the style of the cover and outline. Finished sets can be downloaded, and each run is kept in a history view.

The backend is Python 3.11+ with Flask and uv, and the frontend is Vue 3 + TypeScript with Vite and Pinia. The project is built around Gemini for text and Nano Banana Pro for images, but providers are configurable: text can come from Google Gemini or any OpenAI-compatible API, and images from Google GenAI or an OpenAI-compatible image API. You set API keys in the web UI's Settings page or in YAML files, and the Docker image ships with no keys. Check the licence before building on it. RedInk is released under CC BY-NC-SA 4.0 for personal, non-commercial use, and paid services, commercial products or SaaS use need a separate commercial licence from the author.

## What it does

- One sentence in, full post out: an editable multi-page outline, a styled cover and a batch of content-page images
- Outline editor where you edit each page's text, reorder pages and add a custom visual description per page
- Concurrent content-page generation (up to 15 at once) with a toggle to generate one by one for rate-limited or trial API accounts
- Per-page regeneration that reuses the cover, outline and your input so redrawn pages stay in style
- Copywriting generation for the post's title, body text and tags
- Pluggable providers: Google Gemini or any OpenAI-compatible API for text, and Google GenAI or an OpenAI-compatible image API for images, all configured from a web Settings page or YAML
- History of past generations, persisted across restarts when you run it in Docker with mounted volumes

## Getting started

The project recommends Docker: a single container serves both the backend and the built frontend. You bring your own text and image API keys and set them in the web UI.

1. Run the Docker image

   The two volumes keep your history and generated images across restarts. Then open http://localhost:12398 and add your API keys on the Settings page. The container does not include any keys.

```bash
docker run -d -p 12398:12398 -v ./history:/app/history -v ./output:/app/output histonemax/redink:latest
```

2. Or run from source

   Local development needs Python 3.11+, Node.js 18+, pnpm and uv. Copy the provider templates and fill in your keys, or leave them for the Settings page.

```bash
git clone https://github.com/HisMax/RedInk.git
cd RedInk
cp text_providers.yaml.example text_providers.yaml
cp image_providers.yaml.example image_providers.yaml
uv sync
cd frontend
pnpm install
```

3. Start the services

   On Linux, ./start.sh installs dependencies and launches both halves, then opens http://localhost:5173. On macOS use start.sh or scripts/start-macos.command, and on Windows start.bat. To start them by hand, run the backend (port 12398) and the frontend dev server (port 5173) separately.

```bash
uv run python -m backend.app

# in another terminal
cd frontend
pnpm dev
```

4. Pick your providers

   text_providers.yaml and image_providers.yaml each name an active_provider. Text can use an OpenAI-compatible API or native Google Gemini, and images can use Google GenAI or an OpenAI-compatible image API. Leave high_concurrency off for GCP trial accounts or rate-limited APIs.

```yaml
active_provider: gemini

providers:
  gemini:
    type: google_genai
    api_key: AIzaxxxxxxxxxxxxxxxxxxxxxxxxx
    model: gemini-3-pro-image-preview
    high_concurrency: false
```

## When to use it

- Draft a complete multi-page Xiaohongshu post (cover, content pages, title, body and tags) from a single topic sentence
- Produce a set of social-media graphics that share one visual style, redrawing only the pages that miss
- Run a personal, self-hosted post generator on your own Gemini or OpenAI-compatible API keys instead of a hosted service
