Mayo commited on
Commit
e706cf6
·
unverified ·
1 Parent(s): 353b8ed

docs: rephrase

Browse files
README.md CHANGED
@@ -20,12 +20,12 @@ Under the hood, Koharu uses [candle](https://github.com/huggingface/candle) and
20
 
21
  ## Features
22
 
23
- - Automatic text block detection, speech bubble detection, and segmentation masks
24
- - OCR for manga text recognition
25
- - Inpainting to remove original text from images
26
- - LLM-powered translation
27
- - Vertical text layout for CJK languages
28
- - Export to layered PSD with editable text
29
  - Local HTTP API and MCP server for automation
30
 
31
  If you just want to get started, see [Install Koharu](https://koharu.rs/how-to/install-koharu/) and [Translate Your First Page](https://koharu.rs/tutorials/translate-your-first-page/).
@@ -40,13 +40,13 @@ If you just want to get started, see [Install Koharu](https://koharu.rs/how-to/i
40
 
41
  ### Export
42
 
43
- Koharu can export the current page as a rendered image or as a layered Photoshop PSD. PSD export preserves helper layers and writes translated text as editable text layers, which makes manual cleanup much easier when the automatic pass gets most of the way there.
44
 
45
  For export behavior, PSD contents, and file naming, see [Export Pages and Manage Projects](https://koharu.rs/how-to/export-and-manage-projects/).
46
 
47
  ### MCP Server
48
 
49
- Koharu has a built-in MCP server for AI agents. By default it listens on a random port, but you can pin it with the `--port` flag.
50
 
51
  ```bash
52
  # macOS / Linux
@@ -61,7 +61,7 @@ For local setup and the available tools, see [Run GUI, Headless, and MCP Modes](
61
 
62
  ### Headless Mode
63
 
64
- Koharu can also run without the desktop window.
65
 
66
  ```bash
67
  # macOS / Linux
@@ -70,17 +70,17 @@ koharu --port 4000 --headless
70
  koharu.exe --port 4000 --headless
71
  ```
72
 
73
- You can then open the web UI at `http://localhost:4000`.
74
 
75
  For runtime modes, ports, and local endpoints, see [Run GUI, Headless, and MCP Modes](https://koharu.rs/how-to/run-gui-headless-and-mcp/).
76
 
77
  ## GPU acceleration
78
 
79
- Koharu supports CUDA, Metal, and Vulkan for acceleration. CPU fallback is always available if the accelerated path is unavailable or not worth the trouble on your system.
80
 
81
  ### CUDA (NVIDIA GPUs on Windows)
82
 
83
- Koharu is built with CUDA support on Windows so it can use NVIDIA GPUs for the full local pipeline.
84
 
85
  Koharu bundles CUDA Toolkit 13.1. The required DLLs are extracted to the application data directory on first run.
86
 
@@ -95,13 +95,13 @@ If you want to confirm GPU support, see [CUDA GPU Compute Capability](https://de
95
 
96
  ### Metal (Apple Silicon on macOS)
97
 
98
- Koharu supports Metal on Apple Silicon Macs. That gives you local acceleration without any extra setup beyond the normal app install.
99
 
100
  ### Vulkan (Windows and Linux)
101
 
102
- Koharu also supports Vulkan on Windows and Linux. This path is mainly used for OCR and local LLM inference.
103
 
104
- Detection and inpainting still depend on CUDA or Metal, so Vulkan is helpful but not a full replacement for the main accelerated path. AMD and Intel GPUs can still benefit from it, but the best all-around experience is still NVIDIA on Windows or Apple Silicon on macOS.
105
 
106
  ### CPU fallback
107
 
@@ -118,11 +118,11 @@ For backend selection, fallback behavior, and model runtime support, see [Accele
118
 
119
  ## ML Models
120
 
121
- Koharu uses a mix of computer vision and language models rather than trying to solve the whole page with one model.
122
 
123
  ### Computer Vision Models
124
 
125
- Koharu uses several pre-trained models for different parts of the pipeline:
126
 
127
  - [comic-text-bubble-detector](https://huggingface.co/ogkalu/comic-text-and-bubble-detector) for joint text block and speech bubble detection
128
  - [comic-text-detector](https://huggingface.co/mayocream/comic-text-detector) for text segmentation masks
@@ -137,19 +137,19 @@ Optional built-in alternatives available in **Settings > Engines** include:
137
  - [Manga OCR](https://huggingface.co/mayocream/manga-ocr) and [MIT 48px OCR](https://huggingface.co/mayocream/mit48px-ocr) as alternative OCR engines
138
  - [lama-manga](https://huggingface.co/mayocream/lama-manga) as an alternative inpainter
139
 
140
- The models are downloaded automatically when you run Koharu for the first time.
141
 
142
- Some models are consumed directly from upstream Hugging Face repos, while Rust-friendly safetensors conversions are hosted on [Hugging Face](https://huggingface.co/mayocream) when Koharu needs a converted bundle.
143
 
144
  For a closer look at the pipeline, see [Models and Providers](https://koharu.rs/explanation/models-and-providers/) and the [Technical Deep Dive](https://koharu.rs/explanation/technical-deep-dive/).
145
 
146
  ### Large Language Models
147
 
148
- Koharu supports both local and remote LLM backends, and it tries to preselect a sensible model based on your system locale when possible.
149
 
150
  #### Local LLMs
151
 
152
- Koharu supports quantized GGUF models through [llama.cpp](https://github.com/ggml-org/llama.cpp). These models run on your machine and are downloaded on demand when you select them in Settings. Supported models and suggested usage:
153
 
154
  For translating to English:
155
 
@@ -165,7 +165,7 @@ For other languages, you can use:
165
 
166
  - [hunyuan-7b-mt-v1.0](https://huggingface.co/Mungert/Hunyuan-MT-7B-GGUF): around 6.3 GB, with decent multilingual translation quality
167
 
168
- LLMs are downloaded on demand when you pick a model in Settings. If you are memory-bound, start small. If you have enough VRAM or RAM, the 7B and 8B models usually produce better translations.
169
 
170
  #### Remote LLMs
171
 
@@ -177,9 +177,9 @@ Koharu can also translate through remote or self-hosted API providers instead of
177
  - DeepSeek
178
  - OpenAI Compatible, including LM Studio, OpenRouter, or any endpoint that exposes the OpenAI-style `/v1/models` and `/v1/chat/completions` APIs
179
 
180
- Remote providers are configured in **Settings > API Keys**. OpenAI-compatible providers also need a custom base URL. API keys are optional for local servers such as LM Studio, but usually required for hosted services such as OpenRouter.
181
 
182
- Use a remote provider if you do not want to download local models, if you want to keep VRAM and RAM usage down, or if you already have a hosted model endpoint. Keep in mind that the OCR text selected for translation is sent to the provider you configured.
183
 
184
  For LM Studio, OpenRouter, and other OpenAI-style endpoints, see [Use OpenAI-Compatible APIs](https://koharu.rs/how-to/use-openai-compatible-api/). For provider configuration, see [Settings Reference](https://koharu.rs/reference/settings/).
185
 
@@ -187,7 +187,7 @@ For LM Studio, OpenRouter, and other OpenAI-style endpoints, see [Use OpenAI-Com
187
 
188
  You can download the latest release of Koharu from the [releases page](https://github.com/mayocream/koharu/releases/latest).
189
 
190
- We provide pre-built binaries for Windows, macOS, and Linux. For the normal install flow, see [Install Koharu](https://koharu.rs/how-to/install-koharu/). If something goes wrong, see [Troubleshooting](https://koharu.rs/how-to/troubleshooting/).
191
 
192
  ## Development
193
 
@@ -216,13 +216,13 @@ If you want more direct control over the Tauri build:
216
  bun tauri build --release --no-bundle
217
  ```
218
 
219
- The built binaries will be located in `target/release`.
220
 
221
  For platform-specific build notes, see [Build From Source](https://koharu.rs/how-to/build-from-source/). For the local development workflow, see [Contributing](https://koharu.rs/how-to/contributing/).
222
 
223
  ## Sponsorship
224
 
225
- If you find Koharu useful, consider sponsoring the project to support its development.
226
 
227
  - [GitHub Sponsors](https://github.com/sponsors/mayocream)
228
  - [Patreon](https://www.patreon.com/mayocream)
 
20
 
21
  ## Features
22
 
23
+ - Automatic detection of text regions, speech bubbles, and cleanup masks
24
+ - OCR for manga dialogue, captions, and other page text
25
+ - Inpainting to remove source lettering from the page
26
+ - Translation with local or remote LLM backends
27
+ - Vertical CJK layout and text rendering
28
+ - Layered PSD export with editable text
29
  - Local HTTP API and MCP server for automation
30
 
31
  If you just want to get started, see [Install Koharu](https://koharu.rs/how-to/install-koharu/) and [Translate Your First Page](https://koharu.rs/tutorials/translate-your-first-page/).
 
40
 
41
  ### Export
42
 
43
+ Koharu can export the current page either as a rendered image or as a layered Photoshop PSD. PSD export keeps helper layers and writes translated text as editable text layers, which makes manual cleanup much easier when the automatic pass gets you most of the way there.
44
 
45
  For export behavior, PSD contents, and file naming, see [Export Pages and Manage Projects](https://koharu.rs/how-to/export-and-manage-projects/).
46
 
47
  ### MCP Server
48
 
49
+ Koharu includes a built-in MCP server for agent workflows. By default it listens on a random local port, but you can pin it with `--port`.
50
 
51
  ```bash
52
  # macOS / Linux
 
61
 
62
  ### Headless Mode
63
 
64
+ Koharu can also run without opening the desktop window.
65
 
66
  ```bash
67
  # macOS / Linux
 
70
  koharu.exe --port 4000 --headless
71
  ```
72
 
73
+ You can then open the Web UI at `http://localhost:4000`.
74
 
75
  For runtime modes, ports, and local endpoints, see [Run GUI, Headless, and MCP Modes](https://koharu.rs/how-to/run-gui-headless-and-mcp/).
76
 
77
  ## GPU acceleration
78
 
79
+ Koharu supports CUDA, Metal, and Vulkan. CPU fallback is always available when the accelerated path is unavailable or not worth the setup cost on your system.
80
 
81
  ### CUDA (NVIDIA GPUs on Windows)
82
 
83
+ On Windows, Koharu ships with CUDA support so it can use NVIDIA GPUs for the full local pipeline.
84
 
85
  Koharu bundles CUDA Toolkit 13.1. The required DLLs are extracted to the application data directory on first run.
86
 
 
95
 
96
  ### Metal (Apple Silicon on macOS)
97
 
98
+ Koharu supports Metal on Apple Silicon Macs. No extra runtime setup is required beyond a normal app install.
99
 
100
  ### Vulkan (Windows and Linux)
101
 
102
+ Koharu also supports Vulkan on Windows and Linux. This backend is currently used primarily for OCR and local LLM inference.
103
 
104
+ Detection and inpainting still depend on CUDA or Metal, so Vulkan is useful but not a full replacement for the main accelerated path. AMD and Intel GPUs can still benefit from it, but the best all-around experience is still NVIDIA on Windows or Apple Silicon on macOS.
105
 
106
  ### CPU fallback
107
 
 
118
 
119
  ## ML Models
120
 
121
+ Koharu uses a staged stack of vision and language models instead of trying to solve the entire page with a single network.
122
 
123
  ### Computer Vision Models
124
 
125
+ Koharu uses multiple pretrained models, each tuned for a specific part of the page pipeline:
126
 
127
  - [comic-text-bubble-detector](https://huggingface.co/ogkalu/comic-text-and-bubble-detector) for joint text block and speech bubble detection
128
  - [comic-text-detector](https://huggingface.co/mayocream/comic-text-detector) for text segmentation masks
 
137
  - [Manga OCR](https://huggingface.co/mayocream/manga-ocr) and [MIT 48px OCR](https://huggingface.co/mayocream/mit48px-ocr) as alternative OCR engines
138
  - [lama-manga](https://huggingface.co/mayocream/lama-manga) as an alternative inpainter
139
 
140
+ Koharu downloads the required models automatically on first use.
141
 
142
+ Some models are consumed directly from upstream Hugging Face repos, while Rust-friendly `safetensors` conversions are hosted on [Hugging Face](https://huggingface.co/mayocream) when Koharu needs a converted bundle.
143
 
144
  For a closer look at the pipeline, see [Models and Providers](https://koharu.rs/explanation/models-and-providers/) and the [Technical Deep Dive](https://koharu.rs/explanation/technical-deep-dive/).
145
 
146
  ### Large Language Models
147
 
148
+ Koharu supports both local and remote LLM backends. When possible, it also tries to preselect sensible defaults based on your system locale.
149
 
150
  #### Local LLMs
151
 
152
+ Koharu supports quantized GGUF models through [llama.cpp](https://github.com/ggml-org/llama.cpp). These models run on your machine and are downloaded on demand when you select them in Settings. Suggested models:
153
 
154
  For translating to English:
155
 
 
165
 
166
  - [hunyuan-7b-mt-v1.0](https://huggingface.co/Mungert/Hunyuan-MT-7B-GGUF): around 6.3 GB, with decent multilingual translation quality
167
 
168
+ LLMs are downloaded on demand when you pick a model in Settings. If you are constrained by memory, start with a smaller model. If you have the VRAM or RAM budget, the 7B and 8B models generally produce better translations.
169
 
170
  #### Remote LLMs
171
 
 
177
  - DeepSeek
178
  - OpenAI Compatible, including LM Studio, OpenRouter, or any endpoint that exposes the OpenAI-style `/v1/models` and `/v1/chat/completions` APIs
179
 
180
+ Remote providers are configured in **Settings > API Keys**. OpenAI-compatible providers also need a custom base URL. API keys are optional for local servers such as LM Studio, but are usually required for hosted services such as OpenRouter.
181
 
182
+ Use a remote provider if you do not want to download local models, if you want to reduce local VRAM or RAM use, or if you already have a hosted model endpoint. Keep in mind that the OCR text selected for translation is sent to the provider you configured.
183
 
184
  For LM Studio, OpenRouter, and other OpenAI-style endpoints, see [Use OpenAI-Compatible APIs](https://koharu.rs/how-to/use-openai-compatible-api/). For provider configuration, see [Settings Reference](https://koharu.rs/reference/settings/).
185
 
 
187
 
188
  You can download the latest release of Koharu from the [releases page](https://github.com/mayocream/koharu/releases/latest).
189
 
190
+ We provide prebuilt binaries for Windows, macOS, and Linux. For the standard install flow, see [Install Koharu](https://koharu.rs/how-to/install-koharu/). If something goes wrong, see [Troubleshooting](https://koharu.rs/how-to/troubleshooting/).
191
 
192
  ## Development
193
 
 
216
  bun tauri build --release --no-bundle
217
  ```
218
 
219
+ The built binaries are written to `target/release`.
220
 
221
  For platform-specific build notes, see [Build From Source](https://koharu.rs/how-to/build-from-source/). For the local development workflow, see [Contributing](https://koharu.rs/how-to/contributing/).
222
 
223
  ## Sponsorship
224
 
225
+ If Koharu is useful in your workflow, consider sponsoring the project.
226
 
227
  - [GitHub Sponsors](https://github.com/sponsors/mayocream)
228
  - [Patreon](https://www.patreon.com/mayocream)
assets/Koharu_Halo.png DELETED

Git LFS Details

  • SHA256: 8e07c095ee8e80b8c9c25d39693c3afb2ea91b5e98f96e750f48074467579834
  • Pointer size: 131 Bytes
  • Size of remote file: 128 kB
assets/Koharu_Icon.png DELETED

Git LFS Details

  • SHA256: 35868875403430b9ad12821d9d452be342c079b21019c7e9ecb17454e7bc92eb
  • Pointer size: 130 Bytes
  • Size of remote file: 79.7 kB
assets/koharu-screenshot-en.png DELETED

Git LFS Details

  • SHA256: c75068d9336d0974f821748b0a7254fecde205e6f8afb830263f3fab4a3dcbd8
  • Pointer size: 132 Bytes
  • Size of remote file: 2.22 MB
assets/koharu-screenshot-ja.png DELETED

Git LFS Details

  • SHA256: 601326f20fe90797c7adaea729d0285c018832523354d5be37fc19b3ff385575
  • Pointer size: 132 Bytes
  • Size of remote file: 2.22 MB
assets/koharu-screenshot-zh-CN.png DELETED

Git LFS Details

  • SHA256: 71eee83c8b223e2e1010d73f9a80178bfe11e95b92b28699675dce5c2ba7664d
  • Pointer size: 132 Bytes
  • Size of remote file: 2.24 MB
docs/en-US/explanation/acceleration-and-runtime.md CHANGED
@@ -4,16 +4,16 @@ title: Acceleration and Runtime
4
 
5
  # Acceleration and Runtime
6
 
7
- Koharu supports multiple runtime paths so it can run well on a wide range of hardware.
8
 
9
  ## CUDA on NVIDIA GPUs
10
 
11
- CUDA is the main GPU acceleration path on systems with supported NVIDIA hardware.
12
 
13
  - Koharu supports NVIDIA GPUs with compute capability 7.5 or higher
14
  - Koharu bundles CUDA toolkit 13.1
15
 
16
- On first run, the required dynamic libraries are extracted to the application data directory.
17
 
18
  !!! note
19
 
@@ -21,13 +21,13 @@ On first run, the required dynamic libraries are extracted to the application da
21
 
22
  ## Metal on Apple Silicon
23
 
24
- On macOS, Koharu supports Metal acceleration for Apple Silicon devices such as M1 and M2 systems.
25
 
26
  ## Vulkan on Windows and Linux
27
 
28
- Vulkan is supported on Windows and Linux for OCR and LLM inference as an alternative GPU acceleration path when CUDA or Metal are not available.
29
 
30
- AMD and Intel GPUs can use Vulkan for acceleration, but detection and inpainting models still rely on CUDA or Metal.
31
 
32
  ## CPU fallback
33
 
@@ -43,10 +43,10 @@ koharu.exe --cpu
43
 
44
  ## Why fallback matters
45
 
46
- Fallback behavior makes Koharu usable on more machines, but it changes the experience:
47
 
48
  - GPU inference is much faster when supported
49
  - CPU mode is more compatible but can be substantially slower
50
  - Smaller local LLMs are often the best choice on CPU-only systems
51
 
52
- For exact model choices, see [Models and Providers](models-and-providers.md).
 
4
 
5
  # Acceleration and Runtime
6
 
7
+ Koharu supports multiple runtime backends so the same pipeline can run across a wide range of hardware.
8
 
9
  ## CUDA on NVIDIA GPUs
10
 
11
+ CUDA is the primary GPU backend on systems with supported NVIDIA hardware.
12
 
13
  - Koharu supports NVIDIA GPUs with compute capability 7.5 or higher
14
  - Koharu bundles CUDA toolkit 13.1
15
 
16
+ On first run, Koharu extracts the required dynamic libraries into the application data directory.
17
 
18
  !!! note
19
 
 
21
 
22
  ## Metal on Apple Silicon
23
 
24
+ On macOS, Koharu supports Metal acceleration on Apple Silicon systems such as the M1 and M2 families.
25
 
26
  ## Vulkan on Windows and Linux
27
 
28
+ On Windows and Linux, Vulkan is available as an alternative GPU path for OCR and LLM inference when CUDA or Metal are not available.
29
 
30
+ AMD and Intel GPUs can benefit from Vulkan, but detection and inpainting still depend on CUDA or Metal.
31
 
32
  ## CPU fallback
33
 
 
43
 
44
  ## Why fallback matters
45
 
46
+ Fallback behavior makes Koharu usable on more machines, but it changes the performance profile:
47
 
48
  - GPU inference is much faster when supported
49
  - CPU mode is more compatible but can be substantially slower
50
  - Smaller local LLMs are often the best choice on CPU-only systems
51
 
52
+ For model selection guidance, see [Models and Providers](models-and-providers.md).
docs/en-US/explanation/how-koharu-works.md CHANGED
@@ -4,7 +4,7 @@ title: How Koharu Works
4
 
5
  # How Koharu Works
6
 
7
- Koharu is built around a page pipeline for manga translation. The user-facing workflow is simple, but the implementation intentionally separates joint detection, segmentation, OCR, inpainting, translation, and rendering into different stages.
8
 
9
  ## The pipeline at a glance
10
 
@@ -37,7 +37,7 @@ The important implementation detail is that `Detect` is already a multi-model st
37
  - `comic-text-detector-seg` produces a per-pixel text probability map that becomes the cleanup mask.
38
  - `YuzuMarker.FontDetection` estimates font and color hints for later rendering.
39
 
40
- That split is why Koharu can use one model to decide where text belongs on the page and another to decide which exact pixels should be removed.
41
 
42
  ## What each stage produces
43
 
@@ -51,20 +51,20 @@ That split is why Koharu can use one model to decide where text belongs on the p
51
 
52
  ## Why the stages are separate
53
 
54
- Manga pages are harder than plain document OCR:
55
 
56
  - speech bubbles are irregular and often curved
57
  - Japanese text may be vertical while captions or SFX may be horizontal
58
  - text can overlap artwork, screentones, speed lines, and panel borders
59
  - reading order is part of the page structure, not just the raw pixels
60
 
61
- Because of that, one model is usually not enough. Koharu first finds text blocks and bubble regions, then runs OCR on cropped regions, then uses a segmentation mask for cleanup, and only then asks an LLM to translate the text.
62
 
63
  ## The implementation shape
64
 
65
- In source terms, the engine registry and pipeline execution live in `koharu-app/src/engine.rs`, while the default engine selection lives in `koharu-app/src/config.rs`.
66
 
67
- Some implementation details that matter:
68
 
69
  - the default detect engine is `comic-text-bubble-detector`, which writes `TextBlock` values and bubble regions in one pass
70
  - `comic-text-detector-seg` runs after text blocks exist and stores the final cleanup mask as `doc.segment`
@@ -89,10 +89,10 @@ By default, Koharu runs:
89
  - vision models locally
90
  - local LLMs locally
91
 
92
- If you configure a remote LLM provider, Koharu sends only the text selected for translation to that provider.
93
 
94
  ## Want the deep technical version?
95
 
96
- See [Technical Deep Dive](technical-deep-dive.md) for model types, segmentation mask theory, AOT inpainting, and background references to official model cards. See [Text Rendering and Vertical CJK Layout](text-rendering-and-vertical-cjk-layout.md) for the renderer internals, vertical writing-mode behavior, and current layout limits.
97
 
98
 
 
4
 
5
  # How Koharu Works
6
 
7
+ Koharu is built around a staged page pipeline for manga translation. The editor presents that pipeline as a simple workflow, but the implementation keeps detection, segmentation, OCR, inpainting, translation, and rendering separate because each stage produces different data and fails in different ways.
8
 
9
  ## The pipeline at a glance
10
 
 
37
  - `comic-text-detector-seg` produces a per-pixel text probability map that becomes the cleanup mask.
38
  - `YuzuMarker.FontDetection` estimates font and color hints for later rendering.
39
 
40
+ That split lets Koharu use one model to reason about page structure and another to decide which exact pixels should be removed.
41
 
42
  ## What each stage produces
43
 
 
51
 
52
  ## Why the stages are separate
53
 
54
+ Manga pages are much harder than ordinary document OCR:
55
 
56
  - speech bubbles are irregular and often curved
57
  - Japanese text may be vertical while captions or SFX may be horizontal
58
  - text can overlap artwork, screentones, speed lines, and panel borders
59
  - reading order is part of the page structure, not just the raw pixels
60
 
61
+ Because of that, a single model is usually not enough. Koharu first finds text blocks and bubble regions, then runs OCR on cropped regions, then uses a segmentation mask for cleanup, and only after that asks an LLM to translate the text.
62
 
63
  ## The implementation shape
64
 
65
+ In the source tree, the engine registry and pipeline execution live in `koharu-app/src/engine.rs`, while default engine selection lives in `koharu-app/src/config.rs`.
66
 
67
+ Some implementation details matter:
68
 
69
  - the default detect engine is `comic-text-bubble-detector`, which writes `TextBlock` values and bubble regions in one pass
70
  - `comic-text-detector-seg` runs after text blocks exist and stores the final cleanup mask as `doc.segment`
 
89
  - vision models locally
90
  - local LLMs locally
91
 
92
+ If you configure a remote LLM provider, Koharu sends only the OCR text selected for translation to that provider.
93
 
94
  ## Want the deep technical version?
95
 
96
+ See [Technical Deep Dive](technical-deep-dive.md) for model types, segmentation-mask behavior, AOT inpainting, and upstream model references. See [Text Rendering and Vertical CJK Layout](text-rendering-and-vertical-cjk-layout.md) for renderer internals, vertical writing-mode behavior, and current layout limits.
97
 
98
 
docs/en-US/explanation/index.md CHANGED
@@ -4,7 +4,7 @@ title: Explanation
4
 
5
  # Explanation
6
 
7
- Explanation pages describe how Koharu is put together and why it behaves the way it does.
8
 
9
  ## Topics
10
 
 
4
 
5
  # Explanation
6
 
7
+ These pages describe how Koharu is built and why the runtime behaves the way it does.
8
 
9
  ## Topics
10
 
docs/en-US/explanation/models-and-providers.md CHANGED
@@ -6,11 +6,11 @@ title: Models and Providers
6
 
7
  Koharu uses both vision models and language models. The vision stack prepares the page; the language stack handles translation.
8
 
9
- If you want the architecture-level explanation of how these pieces fit together, read [Technical Deep Dive](technical-deep-dive.md) after this page.
10
 
11
  ## Vision models
12
 
13
- Koharu automatically downloads the required vision models when you use them for the first time.
14
 
15
  The current default stack includes:
16
 
@@ -20,7 +20,7 @@ The current default stack includes:
20
  - [aot-inpainting](https://huggingface.co/mayocream/aot-inpainting) for default inpainting
21
  - [YuzuMarker.FontDetection](https://huggingface.co/fffonion/yuzumarker-font-detection) for font and color detection
22
 
23
- Some models are used directly from upstream Hugging Face repos, while converted safetensors weights are hosted on [Hugging Face](https://huggingface.co/mayocream) when Koharu needs a Rust-friendly bundle.
24
 
25
  ### What each vision model is
26
 
@@ -32,7 +32,7 @@ Some models are used directly from upstream Hugging Face repos, while converted
32
  | `aot-inpainting` | inpainting network | reconstructs masked image regions after text removal |
33
  | `YuzuMarker.FontDetection` | classifier / regressor | estimates font and style hints for rendering |
34
 
35
- The important design choice is that Koharu does not use a single model for every page task. Detection, segmentation, OCR, and inpainting all need different output shapes:
36
 
37
  - joint detection wants text blocks and bubble regions
38
  - segmentation wants per-pixel masks
@@ -52,7 +52,7 @@ You can swap individual stages in **Settings > Engines**. Built-in alternatives
52
 
53
  Koharu supports local GGUF models through [llama.cpp](https://github.com/ggml-org/llama.cpp). These models run on your machine and are downloaded on demand when you select them in the LLM picker.
54
 
55
- In practice, the local models are usually quantized decoder-only transformers. GGUF is the file format; `llama.cpp` is the inference runtime.
56
 
57
  ### Suggested local models for English output
58
 
@@ -70,7 +70,7 @@ In practice, the local models are usually quantized decoder-only transformers. G
70
 
71
  ## Remote providers
72
 
73
- Koharu can translate through remote or self-hosted APIs instead of downloading a local model.
74
 
75
  Supported providers include:
76
 
@@ -104,7 +104,7 @@ Use remote providers when you want:
104
 
105
  ## Background reading
106
 
107
- For theory and diagrams behind the model categories on this page, see:
108
 
109
  - [Technical Deep Dive](technical-deep-dive.md)
110
  - [Fourier transform on Wikipedia](https://en.wikipedia.org/wiki/Fourier_transform)
 
6
 
7
  Koharu uses both vision models and language models. The vision stack prepares the page; the language stack handles translation.
8
 
9
+ If you want the architecture-level view of how these pieces fit together, read [Technical Deep Dive](technical-deep-dive.md) after this page.
10
 
11
  ## Vision models
12
 
13
+ Koharu downloads required vision models automatically the first time you use them.
14
 
15
  The current default stack includes:
16
 
 
20
  - [aot-inpainting](https://huggingface.co/mayocream/aot-inpainting) for default inpainting
21
  - [YuzuMarker.FontDetection](https://huggingface.co/fffonion/yuzumarker-font-detection) for font and color detection
22
 
23
+ Some models are used directly from upstream Hugging Face repos, while converted `safetensors` weights are hosted on [Hugging Face](https://huggingface.co/mayocream) when Koharu needs a Rust-friendly bundle.
24
 
25
  ### What each vision model is
26
 
 
32
  | `aot-inpainting` | inpainting network | reconstructs masked image regions after text removal |
33
  | `YuzuMarker.FontDetection` | classifier / regressor | estimates font and style hints for rendering |
34
 
35
+ The important design choice is that Koharu does not use one model for every page task. Detection, segmentation, OCR, and inpainting all need different output shapes:
36
 
37
  - joint detection wants text blocks and bubble regions
38
  - segmentation wants per-pixel masks
 
52
 
53
  Koharu supports local GGUF models through [llama.cpp](https://github.com/ggml-org/llama.cpp). These models run on your machine and are downloaded on demand when you select them in the LLM picker.
54
 
55
+ In practice, the local models are usually quantized decoder-only transformers. GGUF is the model format; `llama.cpp` is the inference runtime.
56
 
57
  ### Suggested local models for English output
58
 
 
70
 
71
  ## Remote providers
72
 
73
+ Koharu can also translate through remote or self-hosted APIs instead of downloading a local model.
74
 
75
  Supported providers include:
76
 
 
104
 
105
  ## Background reading
106
 
107
+ For background theory behind the model categories on this page, see:
108
 
109
  - [Technical Deep Dive](technical-deep-dive.md)
110
  - [Fourier transform on Wikipedia](https://en.wikipedia.org/wiki/Fourier_transform)
docs/en-US/explanation/technical-deep-dive.md CHANGED
@@ -4,7 +4,7 @@ title: Technical Deep Dive
4
 
5
  # Technical Deep Dive
6
 
7
- This page explains the technical side of Koharu's manga pipeline: what each model does, how the stages fit together, and why text and bubble detection, segmentation masks, OCR, inpainting, and translation are handled separately.
8
 
9
  ## The page pipeline in implementation terms
10
 
@@ -26,13 +26,13 @@ flowchart TD
26
  K --> L[Rendered page / PSD]
27
  ```
28
 
29
- At the code level, the public pipeline steps are `Detect -> OCR -> Inpaint -> LLM Generate -> Render`, but the detect stage is already doing three distinct jobs:
30
 
31
  - text and bubble detection
32
  - text foreground segmentation
33
  - font and color estimation
34
 
35
- That design is deliberate. A manga translation tool needs both page structure and pixel precision.
36
 
37
  ## Model types at a glance
38
 
@@ -45,7 +45,7 @@ That design is deliberate. A manga translation tool needs both page structure an
45
  | Font hints | [YuzuMarker.FontDetection](https://huggingface.co/fffonion/yuzumarker-font-detection) | image classifier / regressor | estimate font family, colors, and stroke hints |
46
  | Translation | local GGUF model via [llama.cpp](https://github.com/ggml-org/llama.cpp) or remote API | decoder-only LLM in most local setups | translate OCR text into the target language |
47
 
48
- Optional built-in alternatives remain available. The main ones are [PP-DocLayoutV3](https://huggingface.co/PaddlePaddle/PP-DocLayoutV3_safetensors) as an alternative detector and layout-analysis engine, [speech-bubble-segmentation](https://huggingface.co/mayocream/speech-bubble-segmentation) as a dedicated bubble detector, and [lama-manga](https://huggingface.co/mayocream/lama-manga) as an alternative inpainter.
49
 
50
  ## Why text and bubble detection matters on manga pages
51
 
@@ -57,14 +57,14 @@ Detection is not just "find boxes around text". On manga pages it has to answer
57
  - which boxes should be deduplicated before OCR
58
  - which regions should become editable `TextBlock` records
59
 
60
- This matters because manga is visually dense:
61
 
62
  - speech bubbles are often curved or skewed
63
  - text may sit on top of screentones and action lines
64
  - vertical Japanese and horizontal Latin text can coexist on the same page
65
  - the region that should be read is not always the same shape as the pixels that should be erased
66
 
67
- Koharu uses the detector output to create `TextBlock` records first, then uses those blocks to drive OCR and later rendering. Bubble regions are kept as separate geometry so the UI and later tooling can still reason about the speech-balloon area.
68
 
69
  In the current implementation, the default detect stage:
70
 
@@ -73,11 +73,11 @@ In the current implementation, the default detect stage:
73
  - converts bubble detections into `BubbleRegion` values
74
  - sorts text blocks into manga reading order before OCR
75
 
76
- If you prefer a document-layout-style detector, `PP-DocLayoutV3` is still available as an alternative engine. It is just no longer the default.
77
 
78
  ## What a segmentation mask is
79
 
80
- A segmentation mask is an image-sized map where each pixel says whether it belongs to a target class. In Koharu's case, the target class is effectively "text foreground that should later be removed during cleanup".
81
 
82
  This is different from a bounding box:
83
 
@@ -102,22 +102,22 @@ In Koharu, the segmentation path is intentionally separate from layout:
102
  - the resulting binary mask becomes `doc.segment`
103
  - `aot-inpainting` then uses `doc.segment` as the erase and fill mask for inpainting
104
 
105
- The cleanup step still matters because raw segmentation probabilities are usually soft and noisy. Koharu thresholds the prediction and dilates the final binary mask so the cleanup covers text edges and outlines instead of leaving halos behind.
106
 
107
  ## How the vision models work in theory
108
 
109
  ### Joint detection: text blocks and bubble regions in one pass
110
 
111
- [ogkalu/comic-text-and-bubble-detector](https://huggingface.co/ogkalu/comic-text-and-bubble-detector) is the default detector because it directly predicts the two region types the rest of the pipeline cares about most:
112
 
113
  - text-like regions that should become `TextBlock`s
114
  - speech-bubble regions that should stay available to the editor and downstream tooling
115
 
116
- Koharu's Candle port maps those detections into document data structures and then sorts the text blocks into manga reading order before OCR. Conceptually, this is closer to page object detection than to OCR itself.
117
 
118
  ### Segmentation: dense per-pixel text prediction
119
 
120
- Koharu's `comic-text-detector` path is a segmentation-first design. The Rust port loads:
121
 
122
  - a YOLOv5-style backbone
123
  - a U-Net decoder for mask prediction
@@ -128,16 +128,16 @@ The default page pipeline uses the segmentation-only path because Koharu already
128
  - one model that is good at page-level region detection
129
  - one model that is good at pixel-level text foreground
130
 
131
- This is a better fit for cleanup than relying on boxes alone.
132
 
133
  ### OCR: multimodal decoding from image crops to text tokens
134
 
135
- [PaddleOCR-VL](https://huggingface.co/docs/transformers/en/model_doc/paddleocr_vl) is a compact vision-language model. The official architecture description says it combines:
136
 
137
  - a NaViT-style dynamic-resolution visual encoder
138
  - the ERNIE-4.5-0.3B language model
139
 
140
- In theory, OCR here works like a multimodal sequence generation problem:
141
 
142
  1. the image crop is encoded into visual tokens
143
  2. a text prompt such as `OCR:` conditions the task
@@ -150,13 +150,13 @@ Koharu's implementation follows that pattern closely:
150
  - it prompts with `OCR:`
151
  - it greedily decodes text for each crop
152
 
153
- So OCR in Koharu is not a classic CTC-only recognizer. It is a small document-oriented VLM being used in a tightly scoped OCR task.
154
 
155
  ### Inpainting: why the default is now AOT
156
 
157
  The default inpainter is the AOT model from [manga-image-translator](https://github.com/zyddnys/manga-image-translator), exposed in Koharu as `aot-inpainting`. It is a masked-image inpainting network built around gated convolutions and repeated context-mixing blocks with multiple dilation rates.
158
 
159
- The important intuition is:
160
 
161
  - text removal needs more than a rectangular crop fill
162
  - the model needs both local edge detail and wider context from the bubble or background
@@ -181,7 +181,7 @@ The theory is standard modern LLM inference:
181
  - run masked self-attention over the growing token sequence
182
  - predict the next token repeatedly until the output is complete
183
 
184
- The practical trade-off is also standard:
185
 
186
  - larger models usually translate better
187
  - smaller quantized models use less VRAM and RAM
@@ -191,7 +191,7 @@ Koharu keeps the image understanding steps local even when you choose a remote t
191
 
192
  ## Koharu-specific implementation notes
193
 
194
- Some details that are easy to miss if you only read the high-level docs:
195
 
196
  - the default detect stage is `comic-text-bubble-detector`, not `PP-DocLayoutV3`
197
  - `comic-text-detector-seg` still loads the segmentation-only `comic-text-detector` path for `doc.segment`
@@ -218,7 +218,7 @@ Some details that are easy to miss if you only read the high-level docs:
218
 
219
  ### Background theory and Wikipedia diagrams
220
 
221
- These pages are useful when you want the general theory and the overview diagrams before diving into model cards:
222
 
223
  - [Fourier transform](https://en.wikipedia.org/wiki/Fourier_transform)
224
  - [Image segmentation](https://en.wikipedia.org/wiki/Image_segmentation)
@@ -227,4 +227,4 @@ These pages are useful when you want the general theory and the overview diagram
227
  - [Object detection](https://en.wikipedia.org/wiki/Object_detection)
228
  - [Inpainting](https://en.wikipedia.org/wiki/Inpainting)
229
 
230
- Those Wikipedia links are background references. For Koharu-specific behavior and the actual model architecture choices, prefer the official model cards and the source tree.
 
4
 
5
  # Technical Deep Dive
6
 
7
+ This page covers the technical structure of Koharu's manga pipeline: what each model does, how the stages fit together, and why text and bubble detection, segmentation masks, OCR, inpainting, and translation are handled separately.
8
 
9
  ## The page pipeline in implementation terms
10
 
 
26
  K --> L[Rendered page / PSD]
27
  ```
28
 
29
+ At the code level, the public pipeline is `Detect -> OCR -> Inpaint -> LLM Generate -> Render`, but the detect stage is already doing three distinct jobs:
30
 
31
  - text and bubble detection
32
  - text foreground segmentation
33
  - font and color estimation
34
 
35
+ That design is deliberate. A manga translation tool needs both page structure and pixel-level precision.
36
 
37
  ## Model types at a glance
38
 
 
45
  | Font hints | [YuzuMarker.FontDetection](https://huggingface.co/fffonion/yuzumarker-font-detection) | image classifier / regressor | estimate font family, colors, and stroke hints |
46
  | Translation | local GGUF model via [llama.cpp](https://github.com/ggml-org/llama.cpp) or remote API | decoder-only LLM in most local setups | translate OCR text into the target language |
47
 
48
+ Optional built-in alternatives are still available. The main ones are [PP-DocLayoutV3](https://huggingface.co/PaddlePaddle/PP-DocLayoutV3_safetensors) as an alternative detector and layout-analysis engine, [speech-bubble-segmentation](https://huggingface.co/mayocream/speech-bubble-segmentation) as a dedicated bubble detector, and [lama-manga](https://huggingface.co/mayocream/lama-manga) as an alternative inpainter.
49
 
50
  ## Why text and bubble detection matters on manga pages
51
 
 
57
  - which boxes should be deduplicated before OCR
58
  - which regions should become editable `TextBlock` records
59
 
60
+ This matters because manga pages are visually dense:
61
 
62
  - speech bubbles are often curved or skewed
63
  - text may sit on top of screentones and action lines
64
  - vertical Japanese and horizontal Latin text can coexist on the same page
65
  - the region that should be read is not always the same shape as the pixels that should be erased
66
 
67
+ Koharu first converts detector output into `TextBlock` records, then uses those blocks to drive OCR and later rendering. Bubble regions are kept as separate geometry so the UI and downstream tooling can still reason about the speech-balloon area.
68
 
69
  In the current implementation, the default detect stage:
70
 
 
73
  - converts bubble detections into `BubbleRegion` values
74
  - sorts text blocks into manga reading order before OCR
75
 
76
+ If you prefer a document-layout-style detector, `PP-DocLayoutV3` is still available as an alternative engine. It is simply no longer the default.
77
 
78
  ## What a segmentation mask is
79
 
80
+ A segmentation mask is an image-sized map in which each pixel indicates whether it belongs to a target class. In Koharu's case, that class is effectively "text foreground that should later be removed during cleanup".
81
 
82
  This is different from a bounding box:
83
 
 
102
  - the resulting binary mask becomes `doc.segment`
103
  - `aot-inpainting` then uses `doc.segment` as the erase and fill mask for inpainting
104
 
105
+ The cleanup step still matters because raw segmentation probabilities are usually soft and noisy. Koharu thresholds the prediction and dilates the final binary mask so cleanup covers text edges and outlines instead of leaving halos behind.
106
 
107
  ## How the vision models work in theory
108
 
109
  ### Joint detection: text blocks and bubble regions in one pass
110
 
111
+ [ogkalu/comic-text-and-bubble-detector](https://huggingface.co/ogkalu/comic-text-and-bubble-detector) is the default detector because it predicts the two region types the rest of the pipeline cares about most:
112
 
113
  - text-like regions that should become `TextBlock`s
114
  - speech-bubble regions that should stay available to the editor and downstream tooling
115
 
116
+ Koharu's Candle port maps those detections into document data structures and then sorts the text blocks into manga reading order before OCR. Conceptually, this is closer to page-level object detection than to OCR itself.
117
 
118
  ### Segmentation: dense per-pixel text prediction
119
 
120
+ Koharu's `comic-text-detector` path is segmentation-first. The Rust port loads:
121
 
122
  - a YOLOv5-style backbone
123
  - a U-Net decoder for mask prediction
 
128
  - one model that is good at page-level region detection
129
  - one model that is good at pixel-level text foreground
130
 
131
+ That is a much better fit for cleanup than relying on boxes alone.
132
 
133
  ### OCR: multimodal decoding from image crops to text tokens
134
 
135
+ [PaddleOCR-VL](https://huggingface.co/docs/transformers/en/model_doc/paddleocr_vl) is a compact vision-language model. The published architecture combines:
136
 
137
  - a NaViT-style dynamic-resolution visual encoder
138
  - the ERNIE-4.5-0.3B language model
139
 
140
+ In Koharu, OCR is treated as a multimodal sequence-generation problem:
141
 
142
  1. the image crop is encoded into visual tokens
143
  2. a text prompt such as `OCR:` conditions the task
 
150
  - it prompts with `OCR:`
151
  - it greedily decodes text for each crop
152
 
153
+ So OCR in Koharu is not a classic CTC-only recognizer. It is a compact document-oriented VLM used for a tightly scoped OCR task.
154
 
155
  ### Inpainting: why the default is now AOT
156
 
157
  The default inpainter is the AOT model from [manga-image-translator](https://github.com/zyddnys/manga-image-translator), exposed in Koharu as `aot-inpainting`. It is a masked-image inpainting network built around gated convolutions and repeated context-mixing blocks with multiple dilation rates.
158
 
159
+ The practical intuition is:
160
 
161
  - text removal needs more than a rectangular crop fill
162
  - the model needs both local edge detail and wider context from the bubble or background
 
181
  - run masked self-attention over the growing token sequence
182
  - predict the next token repeatedly until the output is complete
183
 
184
+ The practical trade-off is also familiar:
185
 
186
  - larger models usually translate better
187
  - smaller quantized models use less VRAM and RAM
 
191
 
192
  ## Koharu-specific implementation notes
193
 
194
+ Some details are easy to miss if you only read the high-level docs:
195
 
196
  - the default detect stage is `comic-text-bubble-detector`, not `PP-DocLayoutV3`
197
  - `comic-text-detector-seg` still loads the segmentation-only `comic-text-detector` path for `doc.segment`
 
218
 
219
  ### Background theory and Wikipedia diagrams
220
 
221
+ These pages are useful if you want the general theory and overview diagrams before diving into model cards:
222
 
223
  - [Fourier transform](https://en.wikipedia.org/wiki/Fourier_transform)
224
  - [Image segmentation](https://en.wikipedia.org/wiki/Image_segmentation)
 
227
  - [Object detection](https://en.wikipedia.org/wiki/Object_detection)
228
  - [Inpainting](https://en.wikipedia.org/wiki/Inpainting)
229
 
230
+ Those Wikipedia links are background references. For Koharu-specific behavior and actual model choices, prefer the official model cards and the source tree.
docs/en-US/explanation/text-rendering-and-vertical-cjk-layout.md CHANGED
@@ -5,11 +5,11 @@ description: How Koharu's text renderer works, why text rendering is difficult,
5
 
6
  # Text Rendering and Vertical CJK Layout
7
 
8
- Text rendering is one of the hardest parts of a manga translator. Detection, OCR, and inpainting decide what should happen to the page, but the renderer decides whether the result still looks like a manga page instead of a debug overlay.
9
 
10
- A good outside reference here is Aria Desires's [Text Rendering Hates You](https://faultlore.com/blah/text-hates-you/). Its main point applies directly to Koharu: text rendering is not a clean linear problem, and there is no universally perfect answer. Layout, shaping, font fallback, rasterization, and composition all push on each other.
11
 
12
- Koharu does not try to be a full desktop publishing engine. It tries to be very good at the specific kinds of text layout manga pages need most, especially vertical CJK bubble text.
13
 
14
  ## Why this problem is hard
15
 
@@ -23,7 +23,7 @@ flowchart LR
23
  D --> E[Composition]
24
  ```
25
 
26
- That picture is useful, but in practice the stages do not stay independent:
27
 
28
  - you cannot know the final line breaks until you know shaped advances
29
  - you cannot shape reliably without knowing the writing direction and OpenType features
@@ -31,7 +31,7 @@ That picture is useful, but in practice the stages do not stay independent:
31
  - you cannot just draw code points one by one because real text is shaped into glyph runs
32
  - you cannot assume that a bubble's box is the same thing as the renderer's true ink bounds
33
 
34
- Vertical manga text makes this harder again:
35
 
36
  - columns flow top-to-bottom, but the columns themselves flow right-to-left
37
  - punctuation often needs vertical alternates or recentering
@@ -40,7 +40,7 @@ Vertical manga text makes this harder again:
40
 
41
  ## What Koharu actually does
42
 
43
- At the implementation level, the renderer lives in the `koharu-renderer` crate and the main orchestration happens in `koharu-app/src/renderer.rs`, `src/layout.rs`, `src/shape.rs`, `src/segment.rs`, and `src/renderer.rs`.
44
 
45
  The pipeline for one translated `TextBlock` is roughly:
46
 
@@ -72,14 +72,14 @@ Koharu does not blindly force all CJK text into vertical mode. The current heuri
72
  - if the translation contains CJK text and the block is taller than it is wide, use `VerticalRl`
73
  - otherwise, keep the block horizontal
74
 
75
- That means vertical layout is tied to both:
76
 
77
  - script detection
78
  - the geometry of the detected or user-adjusted text box
79
 
80
  This is simple on purpose. It matches a large share of manga bubble text, and it avoids turning every mixed-script caption into vertical text just because it contains one Japanese character.
81
 
82
- It is also a heuristic, not a universal writing-mode engine. That matters for edge cases and is one of the current limits of the renderer.
83
 
84
  ## How vertical CJK is implemented
85
 
@@ -96,7 +96,7 @@ When Koharu shapes vertical text, it enables the OpenType features:
96
  - `vert`
97
  - `vrt2`
98
 
99
- These are the standard vertical alternates used by fonts that actually support vertical writing. This is one of the biggest reasons the renderer can produce convincing vertical CJK layout instead of looking like rotated horizontal text.
100
 
101
  If the font has proper vertical glyph substitutions, Koharu can use them. If the font does not, the result degrades to whatever the font provides.
102
 
@@ -127,7 +127,7 @@ This covers cases such as:
127
  - brackets and corner marks
128
  - middle dots and similar marks
129
 
130
- This is not a cosmetic extra. It is one of the reasons the current vertical path looks much more deliberate than a generic text renderer.
131
 
132
  ### 5. Emphasis punctuation is normalized
133
 
@@ -145,7 +145,7 @@ This is important because:
145
  - vertical punctuation and alternate glyph forms can have surprising extents
146
  - outline and bitmap glyphs need to land in the same final surface reliably
147
 
148
- In practice, this bounds pass is one of the pieces that makes the renderer feel stable instead of constantly shaving off the top, bottom, or right edge of the text.
149
 
150
  ## Why the output is good on manga bubbles
151
 
@@ -163,7 +163,7 @@ That combination is why the renderer can produce vertical CJK text that looks in
163
 
164
  ## How perfect is it?
165
 
166
- It is strong for the common manga cases. It is not a perfect Japanese typesetting engine.
167
 
168
  That distinction matters.
169
 
@@ -176,7 +176,7 @@ Koharu is best understood as:
176
 
177
  ## Current limits
178
 
179
- The codebase is fairly honest about where the renderer is still incomplete.
180
 
181
  ### Writing mode is heuristic
182
 
@@ -222,12 +222,12 @@ Koharu instead pushes vertical handling back into the shaping and layout stages.
222
 
223
  ## External reference worth reading
224
 
225
- [Text Rendering Hates You](https://faultlore.com/blah/text-hates-you/) is useful because it explains the renderer problem in a language-agnostic way. The specific stack in Koharu is different from a browser engine, but the same core lessons show up here:
226
 
227
  - shaping is not optional
228
  - fallback fonts are unavoidable
229
  - layout and shaping depend on each other
230
  - "perfect" text rendering is mostly a story people tell before they implement it
231
 
232
- If you want the short version: Koharu's renderer is careful precisely because text rendering really does hate you.
233
 
 
5
 
6
  # Text Rendering and Vertical CJK Layout
7
 
8
+ Text rendering is one of the hardest parts of a manga translator. Detection, OCR, and inpainting decide what should happen to the page, but the renderer decides whether the result still reads like a finished manga page instead of a debug overlay.
9
 
10
+ A useful outside reference is Aria Desires's [Text Rendering Hates You](https://faultlore.com/blah/text-hates-you/). The core point applies directly to Koharu: text rendering is not a clean linear problem, and there is no universally correct answer. Layout, shaping, font fallback, rasterization, and composition all affect one another.
11
 
12
+ Koharu does not try to be a full desktop publishing engine. It aims to be very good at the text layout patterns manga pages need most, especially vertical CJK bubble text.
13
 
14
  ## Why this problem is hard
15
 
 
23
  D --> E[Composition]
24
  ```
25
 
26
+ That breakdown is useful, but in practice the stages do not stay independent:
27
 
28
  - you cannot know the final line breaks until you know shaped advances
29
  - you cannot shape reliably without knowing the writing direction and OpenType features
 
31
  - you cannot just draw code points one by one because real text is shaped into glyph runs
32
  - you cannot assume that a bubble's box is the same thing as the renderer's true ink bounds
33
 
34
+ Vertical manga text makes the problem harder again:
35
 
36
  - columns flow top-to-bottom, but the columns themselves flow right-to-left
37
  - punctuation often needs vertical alternates or recentering
 
40
 
41
  ## What Koharu actually does
42
 
43
+ At the implementation level, the renderer lives in the `koharu-renderer` crate, and the main orchestration happens in `koharu-app/src/renderer.rs`, `src/layout.rs`, `src/shape.rs`, `src/segment.rs`, and `src/renderer.rs`.
44
 
45
  The pipeline for one translated `TextBlock` is roughly:
46
 
 
72
  - if the translation contains CJK text and the block is taller than it is wide, use `VerticalRl`
73
  - otherwise, keep the block horizontal
74
 
75
+ That means vertical layout depends on both:
76
 
77
  - script detection
78
  - the geometry of the detected or user-adjusted text box
79
 
80
  This is simple on purpose. It matches a large share of manga bubble text, and it avoids turning every mixed-script caption into vertical text just because it contains one Japanese character.
81
 
82
+ It is still a heuristic, not a general writing-mode engine. That matters for edge cases and is one of the current limits of the renderer.
83
 
84
  ## How vertical CJK is implemented
85
 
 
96
  - `vert`
97
  - `vrt2`
98
 
99
+ These are the standard vertical alternates exposed by fonts that actually support vertical writing. This is one of the main reasons the renderer can produce convincing vertical CJK layout instead of looking like rotated horizontal text.
100
 
101
  If the font has proper vertical glyph substitutions, Koharu can use them. If the font does not, the result degrades to whatever the font provides.
102
 
 
127
  - brackets and corner marks
128
  - middle dots and similar marks
129
 
130
+ This is not cosmetic. It is one of the reasons the current vertical path looks more intentional than a generic text renderer.
131
 
132
  ### 5. Emphasis punctuation is normalized
133
 
 
145
  - vertical punctuation and alternate glyph forms can have surprising extents
146
  - outline and bitmap glyphs need to land in the same final surface reliably
147
 
148
+ In practice, this bounds pass is one of the reasons the renderer feels stable instead of constantly clipping the top, bottom, or right edge of the text.
149
 
150
  ## Why the output is good on manga bubbles
151
 
 
163
 
164
  ## How perfect is it?
165
 
166
+ It is strong for common manga cases. It is not a full Japanese typesetting engine.
167
 
168
  That distinction matters.
169
 
 
176
 
177
  ## Current limits
178
 
179
+ The codebase is fairly clear about where the renderer is still incomplete.
180
 
181
  ### Writing mode is heuristic
182
 
 
222
 
223
  ## External reference worth reading
224
 
225
+ [Text Rendering Hates You](https://faultlore.com/blah/text-hates-you/) is useful because it explains the renderer problem in a language-agnostic way. Koharu's stack is different from a browser engine, but the same core lessons show up here:
226
 
227
  - shaping is not optional
228
  - fallback fonts are unavoidable
229
  - layout and shaping depend on each other
230
  - "perfect" text rendering is mostly a story people tell before they implement it
231
 
232
+ If you want the short version: Koharu's renderer is careful because text rendering is a coupled systems problem, not a final paint step.
233
 
docs/en-US/how-to/build-from-source.md CHANGED
@@ -4,7 +4,7 @@ title: Build From Source
4
 
5
  # Build From Source
6
 
7
- If you want to compile Koharu locally instead of using a prebuilt release, start with the repository's Bun wrapper. It matches the normal developer workflow and handles platform-specific setup that a direct Tauri call does not.
8
 
9
  ## What the build includes
10
 
@@ -46,7 +46,7 @@ bun install
46
  bun run build
47
  ```
48
 
49
- This is the normal source-build path for most users. It runs the repository's Bun helper, which then launches Tauri with the project's expected build flow.
50
 
51
  On Windows, that wrapper also tries to discover `nvcc` and `cl.exe` automatically before starting the build.
52
 
@@ -57,7 +57,7 @@ The main binaries are written to `target/release`:
57
 
58
  ## Development build
59
 
60
- If you are actively working on the app instead of producing a release-style binary, use:
61
 
62
  ```bash
63
  bun run dev
@@ -79,7 +79,7 @@ Unlike `bun run build`, this path does not go through the repository's Windows h
79
 
80
  ## Direct Rust builds
81
 
82
- If you only want to build the Rust crate directly and intentionally bypass the Bun and Tauri wrapper, use `bun cargo` rather than calling `cargo` yourself.
83
 
84
  Examples:
85
 
@@ -91,7 +91,7 @@ bun cargo build --release -p koharu --features=cuda
91
  bun cargo build --release -p koharu --features=metal
92
  ```
93
 
94
- This is useful for lower-level Rust work, but `bun run build` remains the better choice for a normal desktop app build because it preserves the full Tauri packaging flow.
95
 
96
  ## What happens at runtime after the build
97
 
 
4
 
5
  # Build From Source
6
 
7
+ If you want to compile Koharu locally instead of using a prebuilt release, start with the repository's Bun wrapper. It matches the project's build flow and handles platform-specific setup that a direct Tauri invocation does not.
8
 
9
  ## What the build includes
10
 
 
46
  bun run build
47
  ```
48
 
49
+ This is the standard source-build path for most users. It runs the repository's Bun helper and then launches Tauri with the build flow the project expects.
50
 
51
  On Windows, that wrapper also tries to discover `nvcc` and `cl.exe` automatically before starting the build.
52
 
 
57
 
58
  ## Development build
59
 
60
+ If you are actively working on the app rather than producing a release-style binary, use:
61
 
62
  ```bash
63
  bun run dev
 
79
 
80
  ## Direct Rust builds
81
 
82
+ If you only want to build the Rust crate directly and intentionally bypass the Bun and Tauri wrapper, use `bun cargo` rather than invoking `cargo` yourself.
83
 
84
  Examples:
85
 
 
91
  bun cargo build --release -p koharu --features=metal
92
  ```
93
 
94
+ This is useful for lower-level Rust work, but `bun run build` remains the better choice for a normal desktop build because it preserves the full Tauri packaging flow.
95
 
96
  ## What happens at runtime after the build
97
 
docs/en-US/how-to/configure-mcp-clients.md CHANGED
@@ -4,7 +4,7 @@ title: Configure MCP Clients
4
 
5
  # Configure MCP Clients
6
 
7
- Koharu exposes a built-in MCP server over local Streamable HTTP. This page shows how to connect MCP clients to it, with detailed setup for Antigravity, Claude Desktop, and Claude Code.
8
 
9
  ## What Koharu exposes over MCP
10
 
@@ -16,7 +16,7 @@ Koharu's MCP server is the same local runtime used by the desktop app and headle
16
  - LLM model listing, loading, unloading, and translation
17
  - text-block editing and export
18
 
19
- That means an MCP client can drive the same manga workflow that Koharu's GUI uses.
20
 
21
  ## 1. Start Koharu on a stable port
22
 
@@ -108,7 +108,7 @@ If that works, move on to page actions such as:
108
 
109
  ## Claude Desktop
110
 
111
- Claude Desktop's current local MCP config is command-based. Because Koharu exposes a local HTTP MCP endpoint rather than a packaged desktop extension, the practical config-file path is to use a small bridge process that connects Claude Desktop to `http://127.0.0.1:9999/mcp`.
112
 
113
  This guide uses `mcp-remote` for that bridge.
114
 
@@ -188,7 +188,7 @@ Then move to actual page work:
188
 
189
  ## Claude Code
190
 
191
- If by "Claude" you mean Claude Code, the safest setup for Koharu's local `http://127.0.0.1` MCP endpoint is also to use the same stdio bridge pattern.
192
 
193
  ### Add it to your user config
194
 
 
4
 
5
  # Configure MCP Clients
6
 
7
+ Koharu exposes a built-in MCP server over local Streamable HTTP. This page shows how to connect MCP clients to it, with concrete setup for Antigravity, Claude Desktop, and Claude Code.
8
 
9
  ## What Koharu exposes over MCP
10
 
 
16
  - LLM model listing, loading, unloading, and translation
17
  - text-block editing and export
18
 
19
+ That means an MCP client can drive the same manga workflow as Koharu's GUI.
20
 
21
  ## 1. Start Koharu on a stable port
22
 
 
108
 
109
  ## Claude Desktop
110
 
111
+ Claude Desktop's current local MCP config is command-based. Because Koharu exposes a local HTTP MCP endpoint rather than a packaged desktop extension, the practical approach is to use a small bridge process that connects Claude Desktop to `http://127.0.0.1:9999/mcp`.
112
 
113
  This guide uses `mcp-remote` for that bridge.
114
 
 
188
 
189
  ## Claude Code
190
 
191
+ If by "Claude" you mean Claude Code, the safest setup for Koharu's local `http://127.0.0.1` MCP endpoint is to use the same stdio bridge pattern.
192
 
193
  ### Add it to your user config
194
 
docs/en-US/how-to/contributing.md CHANGED
@@ -4,9 +4,9 @@ title: Contributing
4
 
5
  # Contributing
6
 
7
- Koharu accepts contributions to the Rust workspace, the Tauri app shell, the Next.js UI, the ML pipeline, MCP integrations, tests, and documentation.
8
 
9
- This guide focuses on the current repository workflow so you can make changes that match CI and are easy to review.
10
 
11
  ## Before you start
12
 
@@ -40,7 +40,7 @@ If you are not sure where a change belongs:
40
 
41
  ## Set up the repository
42
 
43
- Install JS dependencies first:
44
 
45
  ```bash
46
  bun install
@@ -58,7 +58,7 @@ For active development, use:
58
  bun run dev
59
  ```
60
 
61
- The dev command runs the Tauri app in dev mode and keeps the local server on a fixed port for UI development and e2e tests.
62
 
63
  ## Use the repo's preferred local commands
64
 
@@ -113,7 +113,7 @@ If you changed docs:
113
  - `zensical build -f docs/zensical.ja-JP.toml`
114
  - `zensical build -f docs/zensical.zh-CN.toml`
115
 
116
- You do not always need to run every command in this list for every PR, but you should run enough to cover the code paths you touched.
117
 
118
  ## E2E tests
119
 
 
4
 
5
  # Contributing
6
 
7
+ Koharu accepts contributions across the Rust workspace, the Tauri app shell, the Next.js UI, the ML pipeline, MCP integrations, tests, and documentation.
8
 
9
+ This guide focuses on the repository workflow that matches CI and keeps changes easy to review.
10
 
11
  ## Before you start
12
 
 
40
 
41
  ## Set up the repository
42
 
43
+ Install JavaScript dependencies first:
44
 
45
  ```bash
46
  bun install
 
58
  bun run dev
59
  ```
60
 
61
+ The dev command runs the Tauri app in development mode and keeps the local server on a fixed port for UI work and e2e tests.
62
 
63
  ## Use the repo's preferred local commands
64
 
 
113
  - `zensical build -f docs/zensical.ja-JP.toml`
114
  - `zensical build -f docs/zensical.zh-CN.toml`
115
 
116
+ You do not need to run every command in this list for every PR, but you should cover the code paths you touched.
117
 
118
  ## E2E tests
119
 
docs/en-US/how-to/export-and-manage-projects.md CHANGED
@@ -4,7 +4,7 @@ title: Export Pages and Manage Projects
4
 
5
  # Export Pages and Manage Projects
6
 
7
- Koharu's workflow is page-based. You import image pages, run the pipeline, review text blocks, and then export either flattened output or a layered handoff file for manual finishing.
8
 
9
  ## Supported page inputs
10
 
@@ -50,7 +50,7 @@ When exported, Koharu uses an `_inpainted` filename suffix.
50
 
51
  Koharu can also export a layered Photoshop PSD.
52
 
53
- PSD export is the handoff format for users who want to keep working in Photoshop or a PSD-compatible editor after the ML pipeline is done.
54
 
55
  In the current implementation, PSD export uses editable text layers by default and can include:
56
 
@@ -99,7 +99,7 @@ This is the main way to manage a chapter or batch job inside the app today.
99
 
100
  ## Recommended workflow
101
 
102
- If you care about polish, a good pattern is:
103
 
104
  1. run detection, OCR, translation, and render in Koharu
105
  2. export a rendered image for quick review
 
4
 
5
  # Export Pages and Manage Projects
6
 
7
+ Koharu's workflow is page-based. You import one or more page images, run the pipeline, review text blocks, and then export either flattened output or a layered handoff file for manual finishing.
8
 
9
  ## Supported page inputs
10
 
 
50
 
51
  Koharu can also export a layered Photoshop PSD.
52
 
53
+ PSD export is the handoff format for users who want to keep working in Photoshop or a PSD-compatible editor after the ML pipeline has done its first pass.
54
 
55
  In the current implementation, PSD export uses editable text layers by default and can include:
56
 
 
99
 
100
  ## Recommended workflow
101
 
102
+ If you care about polish, a practical pattern is:
103
 
104
  1. run detection, OCR, translation, and render in Koharu
105
  2. export a rendered image for quick review
docs/en-US/how-to/index.md CHANGED
@@ -4,7 +4,7 @@ title: How-To Guides
4
 
5
  # How-To Guides
6
 
7
- How-to guides focus on specific jobs you may want to complete with Koharu.
8
 
9
  ## Common tasks
10
 
@@ -14,5 +14,5 @@ How-to guides focus on specific jobs you may want to complete with Koharu.
14
  - [Configure MCP Clients](configure-mcp-clients.md): connect Antigravity, Claude Desktop, or Claude Code to Koharu's local MCP endpoint
15
  - [Use OpenAI-Compatible APIs](use-openai-compatible-api.md): connect LM Studio, OpenRouter, and other OpenAI-style chat-completions endpoints
16
  - [Export Pages and Manage Projects](export-and-manage-projects.md): rendered images, PSD handoff, and page-set management
17
- - [Build From Source](build-from-source.md): local developer build flow with Bun, Tauri, and platform features
18
  - [Troubleshooting](troubleshooting.md): common startup, download, GPU, pipeline, and connectivity failures
 
4
 
5
  # How-To Guides
6
 
7
+ How-to guides focus on concrete tasks you may want to complete with Koharu.
8
 
9
  ## Common tasks
10
 
 
14
  - [Configure MCP Clients](configure-mcp-clients.md): connect Antigravity, Claude Desktop, or Claude Code to Koharu's local MCP endpoint
15
  - [Use OpenAI-Compatible APIs](use-openai-compatible-api.md): connect LM Studio, OpenRouter, and other OpenAI-style chat-completions endpoints
16
  - [Export Pages and Manage Projects](export-and-manage-projects.md): rendered images, PSD handoff, and page-set management
17
+ - [Build From Source](build-from-source.md): local build flow with Bun, Tauri, and platform features
18
  - [Troubleshooting](troubleshooting.md): common startup, download, GPU, pipeline, and connectivity failures
docs/en-US/how-to/install-koharu.md CHANGED
@@ -18,7 +18,7 @@ If your platform is not covered by a release build, use [Build From Source](buil
18
 
19
  ## What gets installed locally
20
 
21
- Koharu is a local-first app. In practice, the desktop binary is only part of the installation footprint. The first real run also creates a per-user local data directory for:
22
 
23
  - runtime libraries used by llama.cpp and GPU backends
24
  - downloaded vision and OCR models
@@ -34,7 +34,7 @@ On first run, Koharu may:
34
  - download the default vision and OCR models used by detection, segmentation, OCR, inpainting, and font estimation
35
  - wait to download local translation LLMs until you actually select them in Settings
36
 
37
- This is normal and can take time depending on your connection and hardware.
38
 
39
  If you want to prefetch those runtime dependencies ahead of time, run Koharu once with `--download`. That path initializes the runtime packages and default vision stack, then exits without opening the GUI.
40
 
@@ -53,7 +53,7 @@ Some practical details matter:
53
  - Vulkan is mainly the fallback GPU path for OCR and local LLM inference
54
  - if Koharu cannot verify that your NVIDIA driver supports CUDA 13.1, it falls back to CPU
55
 
56
- For CUDA-capable systems, Koharu bundles and initializes the runtime pieces it needs instead of requiring you to wire every library path by hand.
57
 
58
  !!! note
59
 
 
18
 
19
  ## What gets installed locally
20
 
21
+ Koharu is a local-first application. In practice, the desktop binary is only part of the install footprint. The first real run also creates a per-user local data directory for:
22
 
23
  - runtime libraries used by llama.cpp and GPU backends
24
  - downloaded vision and OCR models
 
34
  - download the default vision and OCR models used by detection, segmentation, OCR, inpainting, and font estimation
35
  - wait to download local translation LLMs until you actually select them in Settings
36
 
37
+ This is normal and can take a while depending on your connection and hardware.
38
 
39
  If you want to prefetch those runtime dependencies ahead of time, run Koharu once with `--download`. That path initializes the runtime packages and default vision stack, then exits without opening the GUI.
40
 
 
53
  - Vulkan is mainly the fallback GPU path for OCR and local LLM inference
54
  - if Koharu cannot verify that your NVIDIA driver supports CUDA 13.1, it falls back to CPU
55
 
56
+ On CUDA-capable systems, Koharu bundles and initializes the runtime pieces it needs instead of requiring you to configure every library path manually.
57
 
58
  !!! note
59
 
docs/en-US/how-to/run-gui-headless-and-mcp.md CHANGED
@@ -28,7 +28,7 @@ That is why desktop editing, headless automation, and MCP tooling stay aligned.
28
 
29
  Launch Koharu normally from your installed application.
30
 
31
- Even in desktop mode, Koharu still starts a local HTTP server internally. The embedded window talks to that local server rather than calling the pipeline directly.
32
 
33
  This is the default mode and is the best choice for most users.
34
 
@@ -72,13 +72,13 @@ When Koharu is running on a fixed port, the main endpoints are:
72
 
73
  Replace `9999` with the port you chose.
74
 
75
- Because Koharu binds to loopback, these endpoints are local by default. If you want remote access from another machine, you need to expose that port yourself through your own network setup.
76
 
77
  For endpoint-level details, see [HTTP API Reference](../reference/http-api.md).
78
 
79
  ## Connect to the MCP server
80
 
81
- Koharu includes a built-in MCP server using the same loaded documents, models, and page pipeline as the rest of the app.
82
 
83
  Point your MCP client or agent at:
84
 
@@ -144,7 +144,7 @@ On Windows, debug and headless runs also influence how Koharu attaches to or cre
144
 
145
  ## Running without keyring
146
 
147
- By default Koharu stores API keys in the system keyring. In container or CI environments where there is no persistent keyring, you can pass `--no-keyring` to skip it and supply API keys through environment variables instead.
148
 
149
  The variable name for each provider follows the pattern `KOHARU_<PROVIDER>_API_KEY`:
150
 
 
28
 
29
  Launch Koharu normally from your installed application.
30
 
31
+ Even in desktop mode, Koharu still starts a local HTTP server internally. The embedded window talks to that local server instead of calling the pipeline directly.
32
 
33
  This is the default mode and is the best choice for most users.
34
 
 
72
 
73
  Replace `9999` with the port you chose.
74
 
75
+ Because Koharu binds to loopback, these endpoints are local by default. If you want access from another machine, you need to expose that port yourself through your own network setup.
76
 
77
  For endpoint-level details, see [HTTP API Reference](../reference/http-api.md).
78
 
79
  ## Connect to the MCP server
80
 
81
+ Koharu includes a built-in MCP server that uses the same loaded documents, models, and page pipeline as the rest of the app.
82
 
83
  Point your MCP client or agent at:
84
 
 
144
 
145
  ## Running without keyring
146
 
147
+ By default, Koharu stores API keys in the system keyring. In container or CI environments where there is no persistent keyring, you can pass `--no-keyring` to skip it and supply API keys through environment variables instead.
148
 
149
  The variable name for each provider follows the pattern `KOHARU_<PROVIDER>_API_KEY`:
150
 
docs/en-US/how-to/troubleshooting.md CHANGED
@@ -4,7 +4,7 @@ title: Troubleshooting
4
 
5
  # Troubleshooting
6
 
7
- This page covers the most common Koharu problems that follow from the current implementation: first-run downloads, runtime initialization, GPU fallback, headless and MCP access, pipeline-stage ordering, and source-build setup.
8
 
9
  ## Before you start
10
 
@@ -47,7 +47,7 @@ koharu.exe --cpu
47
  koharu.exe --debug
48
  ```
49
 
50
- If `--cpu` works and the normal launch does not, the problem is usually in the GPU path rather than the general app startup path.
51
 
52
  ## Model or runtime downloads fail
53
 
@@ -70,7 +70,7 @@ What to check:
70
  - whether retrying `--download` succeeds
71
  - whether another process or security tool is locking files in the local runtime directory
72
 
73
- If downloads keep failing, test on a different network first. That quickly distinguishes a machine-local problem from an upstream reachability issue.
74
 
75
  ## Koharu falls back to CPU even though you have an NVIDIA GPU
76
 
@@ -93,7 +93,7 @@ If the driver is old or the CUDA check fails, Koharu deliberately prefers CPU ov
93
 
94
  ## OCR, inpainting, or export says something is missing
95
 
96
- Some errors are just pipeline ordering problems.
97
 
98
  Common examples from the current API and MCP layer:
99
 
@@ -131,7 +131,7 @@ Try this:
131
  3. fix obvious bad blocks before running the rest of the pipeline
132
  4. rerun later stages after the structural fixes
133
 
134
- If the structure is wrong, translation quality usually gets worse downstream because OCR and rendering both depend on the block geometry.
135
 
136
  ## Headless mode starts, but you cannot open the Web UI
137
 
 
4
 
5
  # Troubleshooting
6
 
7
+ This page covers the most common Koharu problems in the current implementation: first-run downloads, runtime initialization, GPU fallback, headless and MCP access, pipeline-stage ordering, and source-build setup.
8
 
9
  ## Before you start
10
 
 
47
  koharu.exe --debug
48
  ```
49
 
50
+ If `--cpu` works and the normal launch does not, the problem is usually in the GPU path rather than general app startup.
51
 
52
  ## Model or runtime downloads fail
53
 
 
70
  - whether retrying `--download` succeeds
71
  - whether another process or security tool is locking files in the local runtime directory
72
 
73
+ If downloads keep failing, test on a different network first. That is the fastest way to separate a machine-local problem from an upstream reachability issue.
74
 
75
  ## Koharu falls back to CPU even though you have an NVIDIA GPU
76
 
 
93
 
94
  ## OCR, inpainting, or export says something is missing
95
 
96
+ Some errors are simply pipeline ordering problems.
97
 
98
  Common examples from the current API and MCP layer:
99
 
 
131
  3. fix obvious bad blocks before running the rest of the pipeline
132
  4. rerun later stages after the structural fixes
133
 
134
+ If the structure is wrong, translation quality usually gets worse downstream because OCR and rendering both depend on block geometry.
135
 
136
  ## Headless mode starts, but you cannot open the Web UI
137
 
docs/en-US/how-to/use-openai-compatible-api.md CHANGED
@@ -6,7 +6,7 @@ title: Use OpenAI-Compatible APIs
6
 
7
  Koharu can translate through APIs that follow the OpenAI Chat Completions shape. That includes local servers such as LM Studio and hosted routers such as OpenRouter.
8
 
9
- This page is specifically about the current OpenAI-compatible path in Koharu. It is different from Koharu's built-in OpenAI, Gemini, Claude, and DeepSeek provider presets.
10
 
11
  ## What Koharu expects from a compatible endpoint
12
 
@@ -25,7 +25,7 @@ Some implementation details matter:
25
  - a compatible model only appears in Koharu's LLM picker after both `Base URL` and `Model name` are filled in
26
  - each configured preset shows up as its own selectable source in the LLM picker
27
 
28
- That means OpenAI-compatible here really means OpenAI API-compatible, not just "can be used with OpenAI tools in general."
29
 
30
  ## Where to configure it in Koharu
31
 
@@ -113,7 +113,7 @@ If the server only implements `Responses` or some custom schema, Koharu's curren
113
 
114
  ## How model selection works in practice
115
 
116
- Koharu does not treat these endpoints as one generic remote bucket. Instead, each configured preset becomes its own LLM entry source.
117
 
118
  For example:
119
 
 
6
 
7
  Koharu can translate through APIs that follow the OpenAI Chat Completions shape. That includes local servers such as LM Studio and hosted routers such as OpenRouter.
8
 
9
+ This page covers Koharu's current OpenAI-compatible integration. It is separate from Koharu's built-in OpenAI, Gemini, Claude, and DeepSeek provider presets.
10
 
11
  ## What Koharu expects from a compatible endpoint
12
 
 
25
  - a compatible model only appears in Koharu's LLM picker after both `Base URL` and `Model name` are filled in
26
  - each configured preset shows up as its own selectable source in the LLM picker
27
 
28
+ So "OpenAI-compatible" here means OpenAI API-compatible, not just "works with OpenAI-adjacent tooling."
29
 
30
  ## Where to configure it in Koharu
31
 
 
113
 
114
  ## How model selection works in practice
115
 
116
+ Koharu does not treat these endpoints as one generic remote bucket. Each configured preset becomes its own LLM entry source.
117
 
118
  For example:
119
 
docs/en-US/index.md CHANGED
@@ -469,19 +469,19 @@ hide:
469
  <div class="kh-shell">
470
  <div class="kh-announce-wrap">
471
  <div class="kh-announce">
472
- <span>Introducing:</span>
473
- <span class="kh-announce__token">llama.cpp-based model inference</span>
474
  <span class="kh-announce__copy">
475
- Runs GGUF models locally with CUDA, Vulkan, or Metal acceleration.
476
  </span>
477
  </div>
478
  </div>
479
 
480
  <div class="kh-hero__copy">
481
- <h1>Translate manga locally, privately, seamlessly.</h1>
482
  <p class="kh-hero__lede">
483
- Koharu is a SOTA manga translation desktop app in Rust for OCR, cleanup,
484
- translation, review, and export on Windows, macOS, and Linux.
485
  </p>
486
  <div class="kh-hero__model-row">
487
  <div class="kh-hero__model-label">Local models include</div>
@@ -497,7 +497,7 @@ hide:
497
  Download for Windows&nbsp;&nbsp;<span class="kh-download-button__version">0.42.1</span>
498
  </a>
499
  <div class="kh-download-hero__subtext">
500
- Koharu is free and open source.
501
  </div>
502
  </div>
503
  </div>
@@ -516,12 +516,11 @@ hide:
516
  <div class="kh-shell">
517
  <div class="kh-section__header">
518
  <div class="kh-kicker">No-GUI Deployment</div>
519
- <h2>Run Koharu without the desktop window when you want a local Web UI or scripted page pipelines.</h2>
520
  <p>
521
- The desktop app is the main experience, but the same runtime can also run
522
- headless. Use it for browser-based access on another machine, repeatable batch
523
- translation, or local automation that still depends on Koharu's page-aware
524
- pipeline.
525
  </p>
526
  </div>
527
 
@@ -529,8 +528,8 @@ hide:
529
  <div class="kh-command-card">
530
  <div class="kh-command-card__title">Headless mode</div>
531
  <div class="kh-command-card__copy">
532
- Start Koharu without the desktop window and keep the same translation runtime
533
- available through a browser session on a fixed local port.
534
  </div>
535
  <pre><code># macOS / Linux
536
  koharu --port 4000 --headless
@@ -541,8 +540,8 @@ koharu.exe --port 4000 --headless</code></pre>
541
  <div class="kh-command-card">
542
  <div class="kh-command-card__title">What headless is for</div>
543
  <div class="kh-command-card__copy">
544
- Use it when you need the existing desktop workflow in a form that is easier
545
- to script, schedule, or expose to other local tools.
546
  </div>
547
  <div class="kh-chip-list">
548
  <span class="kh-chip">Local Web UI</span>
@@ -559,11 +558,11 @@ koharu.exe --port 4000 --headless</code></pre>
559
  <div class="kh-shell">
560
  <div class="kh-section__header">
561
  <div class="kh-kicker">MCP Integration</div>
562
- <h2>Let agents drive Koharu while the models and page data stay local.</h2>
563
  <p>
564
- Koharu includes MCP support so desktop editing, headless mode, and agent
565
- workflows can all talk to the same local translation runtime instead of
566
- splitting work across different stacks.
567
  </p>
568
  </div>
569
 
@@ -571,9 +570,8 @@ koharu.exe --port 4000 --headless</code></pre>
571
  <div class="kh-mcp-card">
572
  <h3>One runtime, multiple entry points</h3>
573
  <p>
574
- The same page pipeline can power the desktop UI, the headless Web UI, and
575
- MCP tools, so automation does not drift away from the way Koharu behaves in
576
- normal editing sessions.
577
  </p>
578
  </div>
579
  <div class="kh-mcp-card">
@@ -592,11 +590,11 @@ koharu.exe --port 4000 --headless</code></pre>
592
  <div class="kh-dev__lead">
593
  <img src="assets/Koharu_Halo.png" alt="Koharu" />
594
  <div class="kh-kicker">Developer Friendly</div>
595
- <h2>Build locally and integrate the same desktop runtime into your own tooling.</h2>
596
  <p>
597
- Koharu is practical to work on and practical to embed: build from source with
598
- Bun and Rust, use stable runtime flags, and reuse headless mode or MCP when you
599
- need local automation around the app.
600
  </p>
601
  </div>
602
 
@@ -605,8 +603,8 @@ koharu.exe --port 4000 --headless</code></pre>
605
  <div class="kh-resource-card">
606
  <div class="kh-resource-card__eyebrow">Build</div>
607
  <div class="kh-resource-card__copy">
608
- Build the desktop app from source with the same Bun and Rust toolchain used
609
- by the project.
610
  </div>
611
  <pre><code>bun install
612
  bun run build</code></pre>
@@ -614,8 +612,8 @@ bun run build</code></pre>
614
  <div class="kh-resource-card">
615
  <div class="kh-resource-card__eyebrow">Runtime flags</div>
616
  <div class="kh-resource-card__copy">
617
- The desktop binary exposes a small set of useful flags for local deployment
618
- and automation without introducing a separate backend service.
619
  </div>
620
  <div class="kh-chip-list">
621
  <span class="kh-chip">--headless</span>
 
469
  <div class="kh-shell">
470
  <div class="kh-announce-wrap">
471
  <div class="kh-announce">
472
+ <span>Now available:</span>
473
+ <span class="kh-announce__token">llama.cpp local inference</span>
474
  <span class="kh-announce__copy">
475
+ Run GGUF models locally with CUDA, Vulkan, or Metal acceleration.
476
  </span>
477
  </div>
478
  </div>
479
 
480
  <div class="kh-hero__copy">
481
+ <h1>Translate manga locally, privately, and with a real production pipeline.</h1>
482
  <p class="kh-hero__lede">
483
+ Koharu is a Rust desktop application for manga translation. It handles OCR,
484
+ cleanup, translation, review, and export on Windows, macOS, and Linux.
485
  </p>
486
  <div class="kh-hero__model-row">
487
  <div class="kh-hero__model-label">Local models include</div>
 
497
  Download for Windows&nbsp;&nbsp;<span class="kh-download-button__version">0.42.1</span>
498
  </a>
499
  <div class="kh-download-hero__subtext">
500
+ Free and open source.
501
  </div>
502
  </div>
503
  </div>
 
516
  <div class="kh-shell">
517
  <div class="kh-section__header">
518
  <div class="kh-kicker">No-GUI Deployment</div>
519
+ <h2>Run Koharu without the desktop window when you need a local Web UI or a scriptable translation runtime.</h2>
520
  <p>
521
+ The desktop app is the primary interface, but the same runtime can also run
522
+ headless. Use it for browser-based access, repeatable batch work, or local
523
+ automation that still depends on Koharu's page-aware pipeline.
 
524
  </p>
525
  </div>
526
 
 
528
  <div class="kh-command-card">
529
  <div class="kh-command-card__title">Headless mode</div>
530
  <div class="kh-command-card__copy">
531
+ Start Koharu without the desktop window and keep the same translation
532
+ runtime available through a browser session on a fixed local port.
533
  </div>
534
  <pre><code># macOS / Linux
535
  koharu --port 4000 --headless
 
540
  <div class="kh-command-card">
541
  <div class="kh-command-card__title">What headless is for</div>
542
  <div class="kh-command-card__copy">
543
+ Use it when you need the desktop workflow in a form that is easier to
544
+ script, schedule, or expose to other local tools.
545
  </div>
546
  <div class="kh-chip-list">
547
  <span class="kh-chip">Local Web UI</span>
 
558
  <div class="kh-shell">
559
  <div class="kh-section__header">
560
  <div class="kh-kicker">MCP Integration</div>
561
+ <h2>Let agents drive Koharu while models and page data stay on the local machine.</h2>
562
  <p>
563
+ Koharu includes MCP support so the desktop UI, headless mode, and agent
564
+ workflows all talk to the same local translation runtime instead of drifting
565
+ into separate stacks.
566
  </p>
567
  </div>
568
 
 
570
  <div class="kh-mcp-card">
571
  <h3>One runtime, multiple entry points</h3>
572
  <p>
573
+ The same page pipeline powers the desktop UI, the headless Web UI, and MCP
574
+ tools, so automation stays aligned with normal editing sessions.
 
575
  </p>
576
  </div>
577
  <div class="kh-mcp-card">
 
590
  <div class="kh-dev__lead">
591
  <img src="assets/Koharu_Halo.png" alt="Koharu" />
592
  <div class="kh-kicker">Developer Friendly</div>
593
+ <h2>Build from source and reuse the same runtime in your own tooling.</h2>
594
  <p>
595
+ Koharu is designed to be practical to build and practical to integrate. Use
596
+ Bun and Rust for local builds, stable runtime flags for deployment, and
597
+ headless mode or MCP when you need automation around the app.
598
  </p>
599
  </div>
600
 
 
603
  <div class="kh-resource-card">
604
  <div class="kh-resource-card__eyebrow">Build</div>
605
  <div class="kh-resource-card__copy">
606
+ Build the desktop app from source with the same Bun and Rust toolchain
607
+ used by the project.
608
  </div>
609
  <pre><code>bun install
610
  bun run build</code></pre>
 
612
  <div class="kh-resource-card">
613
  <div class="kh-resource-card__eyebrow">Runtime flags</div>
614
  <div class="kh-resource-card__copy">
615
+ The desktop binary exposes a small set of runtime flags for local
616
+ deployment and automation without introducing a separate backend service.
617
  </div>
618
  <div class="kh-chip-list">
619
  <span class="kh-chip">--headless</span>
docs/en-US/reference/cli.md CHANGED
@@ -4,7 +4,7 @@ title: CLI Reference
4
 
5
  # CLI Reference
6
 
7
- This page covers the command-line options exposed by Koharu's desktop binary.
8
 
9
  Koharu uses the same binary for:
10
 
@@ -36,7 +36,7 @@ koharu.exe [OPTIONS]
36
 
37
  ## Behavior notes
38
 
39
- Some flags change more than just startup appearance:
40
 
41
  - without `--port`, Koharu chooses a random local port
42
  - with `--headless`, Koharu skips the Tauri window but still serves the Web UI and API
@@ -88,8 +88,8 @@ Start with explicit debug logging:
88
  koharu --debug
89
  ```
90
 
91
- Use without keyring
92
 
93
  ```bash
94
  KOHARU_OPENAI_API_KEY=[key] koharu --no-keyring
95
- ```
 
4
 
5
  # CLI Reference
6
 
7
+ This page documents the command-line options exposed by Koharu's desktop binary.
8
 
9
  Koharu uses the same binary for:
10
 
 
36
 
37
  ## Behavior notes
38
 
39
+ Some flags affect more than startup appearance:
40
 
41
  - without `--port`, Koharu chooses a random local port
42
  - with `--headless`, Koharu skips the Tauri window but still serves the Web UI and API
 
88
  koharu --debug
89
  ```
90
 
91
+ Use without keyring:
92
 
93
  ```bash
94
  KOHARU_OPENAI_API_KEY=[key] koharu --no-keyring
95
+ ```
docs/en-US/reference/http-api.md CHANGED
@@ -10,11 +10,11 @@ Koharu exposes a local HTTP API under:
10
  http://127.0.0.1:<PORT>/api/v1
11
  ```
12
 
13
- This is the same API used by the desktop UI and headless Web UI.
14
 
15
  ## Runtime model
16
 
17
- Important behavior from the current implementation:
18
 
19
  - the API is served by the same process as the GUI or headless runtime
20
  - the server binds to `127.0.0.1` by default
@@ -23,7 +23,7 @@ Important behavior from the current implementation:
23
 
24
  ## Common response shapes
25
 
26
- Frequently used types include:
27
 
28
  - `MetaInfo`: app version and ML device
29
  - `DocumentSummary`: document id, name, size, revision, layer availability, and text-block count
 
10
  http://127.0.0.1:<PORT>/api/v1
11
  ```
12
 
13
+ This is the same API used by the desktop UI and the headless Web UI.
14
 
15
  ## Runtime model
16
 
17
+ Important current behavior:
18
 
19
  - the API is served by the same process as the GUI or headless runtime
20
  - the server binds to `127.0.0.1` by default
 
23
 
24
  ## Common response shapes
25
 
26
+ Frequently used response types include:
27
 
28
  - `MetaInfo`: app version and ML device
29
  - `DocumentSummary`: document id, name, size, revision, layer availability, and text-block count
docs/en-US/reference/index.md CHANGED
@@ -4,7 +4,7 @@ title: Reference
4
 
5
  # Reference
6
 
7
- Reference pages collect factual details you may want to look up quickly.
8
 
9
  ## Available references
10
 
 
4
 
5
  # Reference
6
 
7
+ Reference pages collect factual details you may want to look up quickly while working with Koharu.
8
 
9
  ## Available references
10
 
docs/en-US/reference/keyboard-shortcuts.md CHANGED
@@ -4,7 +4,7 @@ title: Keyboard Shortcuts
4
 
5
  # Keyboard Shortcuts
6
 
7
- These are the default controls documented for the editor.
8
 
9
  | Shortcut | Action |
10
  | --- | --- |
 
4
 
5
  # Keyboard Shortcuts
6
 
7
+ These are the default editor controls currently documented in the app.
8
 
9
  | Shortcut | Action |
10
  | --- | --- |
docs/en-US/reference/mcp-tools.md CHANGED
@@ -73,7 +73,7 @@ Valid `view_text_block` layers:
73
  | `render` | draw translated text back onto the page | `index`, optional `text_block_index`, `shader_effect`, `font_family` |
74
  | `process` | start detect -> OCR -> inpaint -> translate -> render | optional `document_id`, `llm_target`, `language`, `shader_effect`, `font_family` |
75
 
76
- `process` is the coarse-grained convenience tool. If you need more control or easier debugging, use the stage tools separately.
77
 
78
  ## LLM tools
79
 
 
73
  | `render` | draw translated text back onto the page | `index`, optional `text_block_index`, `shader_effect`, `font_family` |
74
  | `process` | start detect -> OCR -> inpaint -> translate -> render | optional `document_id`, `llm_target`, `language`, `shader_effect`, `font_family` |
75
 
76
+ `process` is the coarse-grained convenience tool. If you need finer control or easier debugging, use the stage tools separately.
77
 
78
  ## LLM tools
79
 
docs/en-US/reference/settings.md CHANGED
@@ -14,7 +14,7 @@ Theme options:
14
  - `Dark`
15
  - `System`
16
 
17
- The app uses the selected theme immediately through the frontend theme provider.
18
 
19
  ## Language
20
 
 
14
  - `Dark`
15
  - `System`
16
 
17
+ The app applies the selected theme immediately through the frontend theme provider.
18
 
19
  ## Language
20
 
docs/en-US/tutorials/index.md CHANGED
@@ -4,7 +4,7 @@ title: Tutorials
4
 
5
  # Tutorials
6
 
7
- Tutorials walk through complete tasks from start to finish.
8
 
9
  ## Available tutorials
10
 
 
4
 
5
  # Tutorials
6
 
7
+ Tutorials walk through complete tasks from start to finish, using the same workflow you would follow in the app.
8
 
9
  ## Available tutorials
10
 
docs/en-US/tutorials/translate-your-first-page.md CHANGED
@@ -4,7 +4,7 @@ title: Translate Your First Page
4
 
5
  # Translate Your First Page
6
 
7
- This tutorial walks through the normal Koharu workflow for a single manga page: import, detect, recognize, translate, review, and export.
8
 
9
  ## Before you begin
10
 
@@ -107,7 +107,7 @@ The usual fixes are:
107
  - switch to a stronger translation model
108
  - export PSD and finish the page with manual lettering cleanup
109
 
110
- Koharu works best when you treat the pipeline as a fast first pass, then use manual review where the page needs it.
111
 
112
  ## Next steps
113
 
 
4
 
5
  # Translate Your First Page
6
 
7
+ This tutorial walks through the standard Koharu workflow for a single manga page: import, detect, recognize, translate, review, and export.
8
 
9
  ## Before you begin
10
 
 
107
  - switch to a stronger translation model
108
  - export PSD and finish the page with manual lettering cleanup
109
 
110
+ Koharu works best when you treat the pipeline as a fast first pass and then apply manual review where the page needs it.
111
 
112
  ## Next steps
113