Skip to content
2026 Rust · ML · Web Live

XianScan

A self-contained, local-first comic translation studio built in Rust and SvelteKit. It automates the entire manga, manhwa, and manhua translation lifecycle, from single-click web reader capture to local neural OCR, AI translation with dialogue memory, inpainting, typesetting, and streaming directly to mobile devices over home Wi-Fi.

Open-source translation engine with browser & Mihon extensions

XianScan screenshot

The problem

Translating raw webtoons and comics has traditionally required a fragmented chain of manual steps. Readers and scanlators had to take screenshots, run external OCR tools, manually clone-stamp artwork in Photoshop to remove text, translate line by line without context between pages, and manually align text layers in image editors. Long-strip webtoons also created seam errors when sliced across dialogue bubbles, and existing desktop translation software required complex Python runtimes, CUDA configurations, or paid cloud APIs.

The solution

I built XianScan as an end-to-end translation server packaged into a single standalone executable. The engine embeds all neural network models, OCR dictionaries, and the SvelteKit web interface directly into the Rust binary, requiring no Python environment or external runtime. It handles vertical gutter reslicing, RF-DETR speech bubble segmentation, multi-language OCR across ten languages, LaMa neural inpainting, and Google Skia typesetting. Translation is driven by local LLMs or cloud providers using an elastic five-page dialogue memory tracker and Aho-Corasick glossaries to keep character pronouns and names consistent. A companion browser extension provides single-click chapter capture with in-place live translation on web readers, while a dedicated Mihon extension streams finished chapters directly to mobile devices over local Wi-Fi.

Key features

1 Standalone single-binary architecture with embedded ONNX models, OCR dictionaries, SQLite database, and SvelteKit web interface without external dependencies
2 Webtoon gutter reslicing algorithm that analyzes vertical whitespace to split strips along natural panel gutters, preventing dialogue bubbles from being cut across seams
3 Speech bubble and panel segmentation using Koharu RF-DETR Seg 2XL and RT-DETR transformer models to extract dialogue areas with instance masks
4 Multi-language OCR engine supporting Chinese, Japanese, Korean, English, and six additional languages, with reading order heuristics for RTL manga, vertical columns, and webtoons
5 Context-aware LLM translation with an elastic five-page sliding dialogue context window to maintain speaker identity, tone, and pronouns across page turns
6 Aho-Corasick domain glossary compiler for instant term lookup, enforcing cultivation terminology and character naming consistency
7 Neural artwork inpainting using LaMa Fast Fourier Convolutions with localized patch extraction, erasing dialogue while reconstructing underlying textures and gradients
8 Automated typography and typesetting engine using Google Skia, with binary-search font fitting, multi-line wrapping, text stroke outlines, and bubble tilt alignment
9 Interactive Studio Inspector allowing users to inspect raw OCR bounding boxes, view character confidence scores, edit translation text, and trigger selective retypesetting
10 Browser Web Importer extension for Chrome, Edge, and Firefox, enabling single-click chapter import and real-time in-place panel replacement directly on online reader sites
11 Mihon and Tachiyomi Android extension repository for browsing, synchronizing covers, and streaming translated chapters over local Wi-Fi
12 Hardware-adaptive inference engine tuned for multi-threaded SIMD on standard CPUs (AVX2, AVX-512, ARM NEON), with hardware fallback to DirectML, CoreML, and CUDA

What I learned

1 Architecting an embedded ML runtime in Rust, managing ONNX Runtime sessions, memory-mapped tensor buffers, and thread pools without leaking memory
2 Handling long-strip webtoon geometry and boundary-expansion algorithms to ensure speech bubbles near panel edges remain intact during slicing
3 Implementing localized patch inpainting with LaMa, cropping only active text masks to keep neural cleaning lightweight on CPU hardware
4 Designing a five-page sliding dialogue context tracker that provides LLMs with conversational continuity across page boundaries
5 Cross-platform GPU acceleration nuances, handling DirectML on Windows, CoreML on macOS, and CUDA on Linux alongside CPU SIMD fallbacks
6 Browser extension architecture with isolated content scripts and in-memory streaming to navigate Private Network Access restrictions cleanly
7 Reverse-engineering the Tachiyomi and Mihon extension repository format to deliver custom local source streaming directly to Android readers

Tech stack

Rust ONNX Runtime SvelteKit TypeScript Tailwind CSS Google Skia DirectML / CUDA SQLite Web Extensions Mihon Android

Demo

XianScan automated translation studio demo

Screenshots

XianScan screenshot 1XianScan screenshot 2XianScan screenshot 3XianScan screenshot 4XianScan screenshot 5XianScan screenshot 6