dorkhub

koharu

ML-powered manga translator, written in Rust.

mayocream
Rust5k317 forksGPL-3.0updated 1 day ago
visit the demogit clone https://github.com/mayocream/koharu.gitmayocream/koharu

Koharu

ML-powered manga translator, written in Rust.

GitHub Downloads (all assets, all releases)

mayocream%2Fkoharu | Trendshift

Getting Started · Docs · Bug reports · Discord

日本語 | 简体中文

Koharu introduces a local-first 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.

Note

Koharu runs its vision models and LLMs locally on your machine to keep your data private and secure.


screenshot

Note

Support and discussion are available on the Discord server.

Features

  • Automatic detection of text regions, speech bubbles, and cleanup masks
  • OCR for manga dialogue, captions, and other page text
  • Inpainting to remove source lettering from the page
  • Translation with local or remote LLM backends
  • Advanced text rendering with vertical CJK and RTL support
  • Layered PSD export with editable text

GPU Acceleration

Koharu supports CUDA, ROCm / HIP, Metal, and Vulkan. CPU fallback is always available when the accelerated path is unavailable or not worth the setup cost on your system.

CUDA

Koharu supports NVIDIA GPUs on Windows and Linux through CUDA. Ensure you have the latest NVIDIA driver installed.

HIP / ROCm

Koharu supports AMD GPUs on Windows through ROCm and HIP. Ensure you have the latest AMD driver installed.

Metal

Koharu supports Metal on Apple Silicon Macs.

Vulkan

Koharu also supports Vulkan on Windows and Linux as an alternative to CUDA and HIP.

CPU Fallback

You can always force Koharu to use CPU for inference:

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

Machine Learning Models

Koharu uses a staged stack of vision and language models instead of trying to solve the entire page with a single network.

Computer Vision Models

Koharu uses multiple pretrained models, each tuned for a specific part of the page pipeline.

Detection and Layout

Koharu uses object detection to find text regions, speech bubbles, and segmentation masks.

OCR

These models recognize source text after detection.

Inpainting

These models remove source lettering before translated text is rendered back onto the page.

Large Language Models

Koharu has a flexible LLM backend that can run locally or connect to a remote API.

General-Purpose Local Models

Uncensored Local Models

Cloud Providers

Koharu supports hosted APIs from Atlas Cloud, OpenAI, Gemini, Claude, DeepSeek, and OpenRouter.

Machine Translation Providers

For pure machine-translation use cases, Koharu also supports DeepL, Google Cloud Translation, and Caiyun.

OpenAI-Compatible Providers

Koharu supports any provider that implements the OpenAI-compatible API.

Installation

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

We provide prebuilt binaries for Windows, macOS, and Linux.

WinGet

On Windows, you can install Koharu with winget:

winget install koharu

Homebrew

On macOS, you can install Koharu with Homebrew:

brew install --cask koharu

Troubleshooting

Koharu provides a diagnostic mode that outputs detailed logs and system information to help identify issues with installation, GPU acceleration, model loading, and more. To enable it, run:

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

You can also set the RUST_LOG environment variable to debug or trace to see more verbose logs:

# macOS / Linux
RUST_LOG=debug koharu
# Windows (PowerShell)
$env:RUST_LOG="debug"; koharu.exe

Development

To build Koharu from source, follow the steps below.

Prerequisites

  • Rust 1.95 or later (Rust 2024 edition)
  • Bun 1.0 or later
  • LLVM 15 or later
  • ninja 1.11 or later

Install dependencies

bun install

Development

bun dev

Build

bun run build

The built binaries are written to target/release.

Sponsorship

If Koharu is useful in your workflow, consider sponsoring the project.

sponsors

Contributors ❤️

Thanks to all the contributors who have helped make Koharu better!

License

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

more like this

anne-key

Firmware for Anne Pro Keyboard written in Rust

Rust572

search

search projects, people, and tags