Architectural specifications, local LLM integration instructions, script gate mechanics, and troubleshooting details for our in-browser manga translation app.
[DOC #01 // PRIVACY GUARANTEE]Privacy & Security
Q: Does Libre Manga Translator upload my manga images or reading activity?
In WebGPU Mode and API Mode: ABSOLUTELY NOT. All image decoding, RT-DETR bubble detection, PaddleOCR text extraction, and canvas inpainting run 100% locally on your machine in an isolated browser offscreen document.
In API Mode, only extracted text strings (no pixel data) are transmitted to your configured endpoint (such as your local Ollama or LM Studio instance). In Gemini Mode, the annotated manga page is sent directly from your browser to Google AI Studio using your personal API key — with zero proxy server or middleman in between.
Q: What data is sent if I enable anonymous improvement data sharing?
Data sharing is strictly opt-in and disabled by default. When enabled in Settings, LMT sends telemetry only when you manually correct or refine a bounding box.
The payload contains only the series name, chapter ID, page number, corrected bounding box coordinates (x1, y1, x2, y2), and image URL. No personal identifiers, IP logs, user accounts, or full page bitmaps are collected.
[DOC #03 // OFFLINE RUNTIME]Privacy & Security
Q: Can LMT run completely offline without an active internet connection?
Yes. Once you select WebGPU Mode and allow the initial model download (Qwen3 4B or 8B, RT-DETR bubble detector ONNX weights, and PaddleOCR models) to complete, all weights are cached permanently in browser Cache Storage and IndexedDB.
You can disconnect your network, enable airplane mode, and translate chapters offline without contacting any server.
API Mode works offline too when you point it at an OpenAI-compatible / LM Studio server on the same machine (e.g. Ollama at http://127.0.0.1:11434/v1 or LM Studio at http://127.0.0.1:1234/api/v1) — localhost traffic never needs the internet after setup. Remote LAN / VPS / cloud hosts still need connectivity.
[DOC #04 // WEBGPU SPECIFICATIONS]LLM Backends
Q: What are the hardware and browser requirements for WebGPU Mode?
WebGPU mode requires a Chromium browser (Chrome 113+, Edge 113+, Brave) or Firefox Nightly with dom.webgpu.enabled set to true in about:config.
Qwen3-4B-q4f16_1-MLC (Balanced): Requires ~3.4 GB available VRAM / unified memory. Recommended for most modern laptops and desktop GPUs.
Qwen3-8B-q4f16_1-MLC (Powerful): Requires ~5.7 GB available VRAM. Delivers richer literary nuance and idioms.
If your machine lacks a dedicated GPU or has insufficient VRAM, WebGPU mode will notify you and recommend switching to API Mode or Gemini Mode.
[DOC #05 // OLLAMA INTEGRATION]LLM Backends
Q: How do I connect LMT to a local Ollama server?
Ollama provides an OpenAI-compatible endpoint at port 11434. Follow these steps:
# 1. Pull the recommended translation model
ollama pull qwen3.5:4b
# 2. Start the Ollama server
ollama serve
Then open LMT Settings › Backend and set:
Backend Kind: API Mode
Host URL:http://127.0.0.1:11434/v1
Schema: OpenAI
Model Name:qwen3.5:4b
Click Test Connection to verify communication.
[DOC #06 // LM STUDIO INTEGRATION]LLM Backends
Q: How do I configure LM Studio with the Experimental Schema?
In LM Studio, navigate to the Developer / Local Server tab, select your preferred model (e.g. tiny-aya-global), and click Start Server on port 1234.
In LMT Settings › Backend:
Host URL:http://127.0.0.1:1234/api/v1
Schema:LM Studio (Experimental)
Model Name: Match the exact model identifier loaded in LM Studio
The experimental schema uses native prompt arrays (input + system_prompt) and parses JSON responses directly without forcing OpenAI-style wrapper envelopes.
[DOC #07 // RECOMMENDED LOCAL MODELS]LLM Backends
Q: What local model is good for translation via API Mode (Ollama / LM Studio)?
For API Mode we recommend a model that was built for translation rather than general chat: Tiny Aya Global for general multilingual translation, or Tiny Aya Fire when your reading is CJK-focused (Chinese / Japanese / Korean). Because they are purpose-trained for translation, they tend to produce cleaner, more consistent manga dialogue than a general-purpose model of the same size. Both are distributed as GGUF, so you can load either one in Ollama, LM Studio or llama.cpp and point LMT at your local host URL as usual.
[DOC #08 // GEMINI CLOUD SETUP]LLM Backends
Q: Where do I get a Gemini API key and does it cost money?
1. Sign in with your Google account at aistudio.google.com. 2. Click Get API key and copy your key. 3. In LMT, open Settings › Backend, select Gemini Mode, and paste the key.
Gemini 2.5 Flash, 3.1 Flash and 3.5 Flash handles both OCR and translation in a single pass with high speed. Your key is stored in browser local storage and never leaves your device except to authenticate directly with Google's API endpoints.
[DOC #09 // LANGUAGE SCRIPT GATE]Detection & OCR
Q: Why do some bubbles have a dashed outline and a "Translate anyway" button?
This is LMT's Language Script Gate in action. Before translation, a 3.7 MB on-device script-identification model (OSD LSTM) inspects the cropped text lines.
If a region contains sound effects (SFX), stylized artwork lettering, or English typesetting on a raw Japanese page, the gate holds it back to prevent the LLM from hallucinating nonsensical translations over artistic illustrations.
Held-back regions are left untouched with their original artwork intact — but keep their recognized text so you can still view and edit them. If the gate made a false negative call, click Translate anyway on that bubble card to override the filter with one click. Strict with an explicit CJK source language, page-majority voting under Auto-Detect. Gemini mode skips the gate (VLM path).
[DOC #10 // VERTICAL TEXT HANDLING]Detection & OCR
Q: How do I fix vertical Japanese text that PaddleOCR misses?
PaddleOCR was predominantly trained on horizontal line runs. For dense vertical Japanese manga, pick Manga-OCR in Settings › OCR — the Japanese manga specialist (~460 MB, ViT + BERT) handles vertical text and stylized lettering that PaddleOCR drops or misreads.
LMT still mitigates PaddleOCR misses with an automatic retry pass: empty regions are re-sliced with contrast boosting (boostContrast) and padding (padImageForOCR), with OCR Min Confidence at 0.7 (retry at 0.7×).
Japanese and vertical text are considered fixed via Manga-OCR. Chinese and Korean (manhua / manhwa / webtoon) coverage is the current OCR target.
[DOC #11 // BUBBLE SEQUENCING]Detection & OCR
Q: How does LMT determine the reading order of dialogue bubbles?
Manga is traditionally read from right to left, top to bottom. LMT builds deterministic regions (refineDetections: centre-in-box merge, speckle drop, overlap merge) then applies agglomerative horizontal band clustering (applyBboxesSort):
Calculates vertical centers for all bounding boxes and sorts strictly top-to-bottom.
Groups dialogue into horizontal panel bands using a gutter threshold (80% of average bubble height).
Sorts bubbles within each panel band using Japanese manga diagonal flow (Right-to-Left).
In the bubble editor overlay, you can manually reorder or refine any box before translation.
[DOC #12 // IN-PLACE EDITING]Detection & OCR
Q: Can I edit OCR text or fix translation typos without re-running inpainting?
Yes. On the results view, click the Edit button in the toolbar. This opens a modal displaying the raw OCR source text alongside the translated output for each numbered bubble.
When you tweak the wording and click Apply, LMT repaints the typography directly on top of the cached inpainted canvas. Inpainting is skipped entirely, delivering an instantaneous re-render.
[DOC #13 // INPAINTING LADDER]Inpainting & Fonts
Q: What is the Auto Inpainting Engine Ladder?
Traditional extensions run heavy blur or Fast Marching across the entire bounding box, leaving ugly rectangular gray patches and halo artifacts over screentones.
LMT solves this with a multi-stage engine ladder using text-shaped contour masks:
Rung 0 (Planar Fill): For flat white or uniform speech bubbles, samples the paper border and executes a smooth gradient fill. Zero noise.
Rung 1 (Bilateral Denoise): For grainy or JPEG-compressed scans, applies edge-preserving bilateral filtering to prevent ringing.
Rung 2 (LaMa Redraw, opt-in): For complex screentone, halftone and art behind text. One-time ~207 MB download, ~500 MB RAM/VRAM, ~1–2s per complex region (512² tiles, 128px overlap).
Rung 3 (Pure-JS Telea Fast-Marching): Real rebuilds where fill/denoise fail. MV3-safe, no unsafe-eval.
Every stage is evaluated against an image quality metric; if a rung degrades the page, it escalates to the next engine. Pick Auto (recommended), Telea (legacy full-region) or Fast (edge-blend) under Appearance › Inpainting.
[DOC #14 // UNPAINTED TEXT]Inpainting & Fonts
Q: Why wasn't text painted / repainted in some bubbles?
Three reasons leave original pixels intact by design. Declined quality: every inpaint rung scored worse than the surrounding artwork (e.g. extreme dark gradients or complex illustration details), so the region was left pixel-identical and flagged declined.
Gate-held: the script gate held back SFX, artwork lettering or wrong-script text — dashed outline with a one-click Translate anyway, recognized text kept. Skipped: no confirmed translated text (failed OCR or untranslated region), so inpainting never ran.
The debug panel shows per-region provenance plus per-rung counts (fill · denoise · telea · declined) and gate decisions — no image payloads.
[DOC #15 // CUSTOM TYPOGRAPHY]Inpainting & Fonts
Q: How do I load custom comic book fonts?
LMT ships with 3 bundled font families: Noto Sans, Bangers, and Comic Neue.
To use your own font:
Open extension Settings › Typography.
Drag-and-drop any .ttf, .otf, or .woff file into the dropzone.
Select your font from the active dropdown.
The font is parsed into browser font storage and dynamically rendered with automatic bubble fit scaling and high-contrast text outlines.
[DOC #16 // SITE ADAPTERS & RULES]Platform & Rules
Q: My favorite manga reading site isn't recognized. How do I add it?
LMT extracts the series title, chapter number, and page index using regex site rules:
AI Rule Generator: Open the manga chapter in your browser, click the LMT icon › Settings › Site Rules, and click Generate with AI. The active LLM will analyze the page title and URL structure to propose a working rule.
Submit a Pull Request: Copy src/lib/adapters/_example.ts to src/lib/adapters/<domain>.ts, fill in the 3 regex fields, and submit a PR on GitHub. It bundles into the next release automatically.
Q: Why does my unpacked Firefox extension disappear when Firefox restarts?
In standard consumer Firefox releases, extensions loaded through about:debugging are treated as temporary developer add-ons and are cleared on browser restart for Mozilla security policy compliance.
In Chrome/Edge/Brave, unpacked extensions loaded via chrome://extensions (Developer Mode) persist permanently across restarts.
An officially signed Firefox release submitted to Mozilla Add-ons (AMO) is in progress so Firefox readers will have permanent persistence without developer mode. Note: the Beta5 Firefox package still uses the old engine — only local WebGPU execution differs; Gemini and API Mode work identically. Chrome Web Store review is also underway.
[DOC #18 // DETECTION MODEL PICKER]Detection & OCR
Q: Which bubble detector should I pick in Settings › Detection?
Beta5 ships four selectable on-device detectors (Settings › Detection, Min Confidence 0.5, Auto-Update on):
YOLO26-Nano (default, 2.4 MB, MIT): Fast enough for interactive use; handles most manga.
YOLO26-Small (9.5 MB, MIT): More accurate on dense / small-text pages; roughly 2.5× slower than Nano.
Comic Bubble Detector RT-DETR-v2 (11.1 MB, Apache-2.0): Good at bubbles and free-floating text (bubble, text_bubble, text_free).
Comic Text Detector (94.7 MB, GPL-3.0): Text boxes plus a per-pixel segmentation mask ([1, 1, 1024, 1024]) that seeds fitMask() directly — best for dense vertical Japanese. Never bundled; downloads to your local browser cache only when you select it.
[DOC #19 // OCR ENGINE CHOICE]Detection & OCR
Q: PaddleOCR or Manga-OCR — which OCR engine should I use?
Pick in Settings › Text Recognition (OCR). PaddleOCR (~80 MB, default) is the fast multilingual generalist. Manga-OCR (~460 MB, opt-in) is the Japanese manga specialist (ViT encoder + BERT decoder) for vertical text and stylized lettering.
OCR Min Confidence defaults to 0.7 with a retry pass at 0.7× on failed crops; single characters demand ≥ max(minConfidence, 0.75) to suppress noise. Held-back regions keep their recognized text so you can still view and edit it.
[DOC #20 // LAMA REDRAW]Inpainting & Fonts
Q: When should I enable LaMa redraw under Appearance › Inpainting?
Enable LaMa Redraw for complex screentone, halftone and artwork behind text — where pure-JS fill / denoise / Telea would leave flat patches or smudges. One-time ~207 MB download, ~500 MB RAM/VRAM, ~1–2s per complex region (512² tiled inference, 128px overlap).
It plugs into the Auto ladder as rung 2 (planar → denoise → LaMa → Telea). Per-region provenance ({method, deviation, thickness, ms}) and per-rung counts surface in the debug panel.
[DOC #21 // MODEL STORAGE & PAGE CACHE]Platform & Rules
Q: How do Model Storage and the per-page translation cache work?
Settings › Model Storage lists every downloaded weight with its size, plus per-model delete and full cache clear. Onboarding includes a multi-model downloader with storage progress, and background prefetch (PREFETCH_MODEL) warms the cache.
Translation results are keyed by series + chapter + resolved page index (resolveImagePageIndex) + image hash (quickHash), so re-opening a translated chapter is instant.
[DOC #22 // HARDENING & LICENSES]Platform & Rules
Q: What hardening and third-party licenses ship in Beta5?
Overlay boxes are scaled against natural vs rendered image dimensions, and overlay keyboard input is isolated so it never triggers host reader shortcuts. Cross-origin and anti-hotlink images fall back through background declarativeNetRequest with magic-byte MIME sniffing (JPEG, PNG, WebP, GIF, AVIF).
LMT code is MIT (built on ComicTL; ladder/gate concepts studied from Manga Cleaner as an independent rewrite). Weights: YOLO26 MIT · RT-DETR Apache-2.0 · OSD gate Apache-2.0 · PaddleOCR / Manga-OCR Apache-2.0 · LaMa MIT · ComicTextDetector GPL-3.0 — on-demand.
Q: Ollama / LM Studio feels too bloated — any lighter recommendation?
Run llama.cpp directly as your local server. Both Ollama and LM Studio build on llama.cpp under the hood — going straight to the source drops the extra GUI layers while staying fully OpenAI-compatible for LMT's API Mode.
Start it with llama-server -m <model>.gguf, then in LMT Settings › Backend set Host to http://127.0.0.1:8080/v1, Schema to OpenAI, and click Test Connection as usual.
The payoff is freshness: new model architectures and GGUF quant releases land in llama.cpp first, so same-day model drops work without waiting for the wrappers to catch up.