Skip to content

mayocream/koharu

Repository files navigation

Koharu

ML-powered manga translator, written in Rust.

Koharu introduces a new workflow for manga translation, utilizing the power of ML to automate the process. It combines the capabilities of object detection, OCR, inpainting, and LLMs to create a seamless translation experience.

Under the hood, Koharu uses candle for high-performance inference, and uses Tauri for the GUI. All components are written in Rust, ensuring safety and speed.

Note

Koharu runs ML models locally on your machine, ensuring your data privacy. No data is sent to external servers. We guarantee that Koharu does not collect any user data.


screenshot-1 screenshot-2

Note

For help and support, please join our Discord server.

Features

  • Automatic speech bubble detection and segmentation
  • OCR for manga text recognition
  • Inpainting to remove original text from images
  • LLM-powered translation
  • Vertical text layout for CJK languages

Usage

Hot keys

  • Ctrl + Mouse Wheel: Zoom in/out
  • Ctrl + Drag: Pan the canvas
  • Del: Delete selected text block

Headless Mode

Koharu can be run in headless mode via command line, if you want to access it remotely or integrate it with ComicReadScript.

# macOS / Linux
koharu -b 0.0.0.0:5003
# Windows
koharu.exe -b 0.0.0.0:5003

You can now access Koharu Web UI at http://<your-server-ip>:5003, or use directly in ComicReadScript.

File association

On Windows, Koharu automatically associates .khr files, so you can open them by double-clicking. The .khr files can also be opened from as picture to view the thumbnails of the contained images.

GPU acceleration

CUDA and Metal are supported for GPU acceleration, significantly improving performance on supported hardware.

CUDA

Koharu is built with CUDA support, allowing it to leverage the power of NVIDIA GPUs for faster processing.

Koharu bundles CUDA toolkit 12.x and cuDNN 9.x, dylibs will be automatically extracted to the application data directory on first run.

Supported NVIDIA GPUs

Koharu supports NVIDIA GPUs with compute capability 7.5 or higher.

Please make sure your GPU is supported by checking the CUDA GPU Compute Capability and the cuDNN Support Matrix.

Metal

Koharu supports Metal for GPU acceleration on macOS with Apple Silicon (M1, M2, etc.). This allows Koharu to run efficiently on a wide range of Apple devices.

CPU fallback

You can always force Koharu to use CPU for inference:

# macOS / Linux
koharu --cpu
# Windows
koharu.exe --cpu

ML Models

Koharu relies on a mixin of computer vision and natural language processing models to perform its tasks.

Computer Vision Models

Koharu uses several pre-trained models for different tasks:

The models will be automatically downloaded when you run Koharu for the first time. Windows user can download the Koharu-win-CUDA-bundled.7z release package to get those models pre-bundled.

We convert the original models to safetensors format for better performance and compatibility with Rust. The converted models are hosted on Hugging Face.

Large Language Models

Koharu supports various quantized LLMs in GGUF format via candle, and preselect model based on system locale settings. Supported models and suggested usage:

For translating to English:

  • vntl-llama3-8b-v2: ~8.5 GB Q8_0 weight size and suggests >=10 GB VRAM or plenty of system RAM for CPU inference, best when accuracy matters most.
  • lfm2-350m-enjp-mt: ultra-light (≈350M, Q8_0); runs comfortably on CPUs and low-memory GPUs, ideal for quick previews or low-spec machines at the cost of quality.

For translating to Chinese:

  • sakura-galtransl-7b-v3.7: ~6.3 GB and fits on 8 GB VRAM, good balance of quality and speed.
  • sakura-1.5b-qwen2.5-v1.0: lightweight (≈1.5B, Q5KS); fits on mid-range GPUs (4–6 GB VRAM) or CPU-only setups with moderate RAM, faster than 7B/8B while keeping Qwen-style tokenizer behavior.

For other languages, you may use:

  • hunyuan-7b-mt-v1.0: ~6.3GB and fits on 8 GB VRAM, decent multi-language translation quality.

Also, OpenAI compatible endpoints are supported if you have access to those services.

LLMs will be automatically downloaded on demand when you select a model in the settings. Choose the smallest model that meets your quality needs if you are memory-bound; prefer the 7B/8B variants when you have sufficient VRAM/RAM for better translations.

Installation

You can download the latest release of Koharu from the releases page.

We provide pre-built binaries for Windows and macOS, for other platforms, you may need to build from source, see the Development section below.

Development

To build Koharu from source, follow the steps below.

Prerequisites

  • Rust (1.92 or later)
  • Bun (1.0 or later)

Install dependencies

bun install

Build

bun run build

The built binaries will be located in the target/release directory.

Sponsorship

If you find Koharu useful, consider sponsoring the project to support its development!

License

Koharu application is licensed under the GNU General Public License v3.0.

The sub-crates of Koharu are licensed under the Apache License 2.0.