Manga translator with character memory — tracks who's who across pages for more consistent translations. Fully local via Ollama.
8
stars
39
commits
Python
primary language
Jul 5, 2026
updated
A manga translator that remembers characters across pages.
Most automatic manga translators handle each speech bubble in isolation, so they re-translate the same character with a different name, get the wrong grammatical gender, or miss tone shifts. Kotoba builds up a character archive as it processes a chapter — recording each speaker's appearance, gender, and behavior — then uses that context plus per-page scene analysis to translate bubbles more consistently.
Everything runs locally on your machine via Ollama. No cloud API keys.
Pepper&Carrot — Chinese → English
| Original (Chinese) | Kotoba → English |
|---|---|
![]() | ![]() |
Pepper&Carrot by David Revoy, CC-BY 4.0. Chinese localization by the Pepper&Carrot community.
愛さずにはいられない (I Can't Help But Love You) — Japanese → English
| Original (Japanese) | Kotoba → English |
|---|---|
![]() | ![]() |
![]() | ![]() |
愛さずにはいられない by よしまさこ. From the Manga109 dataset, used under the Manga109 research license for non-commercial purposes. © よしまさこ / 集英社.
| Kotoba | Most other tools | |
|---|---|---|
| Tracks characters across pages | ✅ | ❌ |
| Scene-aware translation (knows what's happening on the page) | ✅ | ❌ |
| Portable Python — no system install needed | ✅ (Windows) | Usually a pip install chore |
| Fully local, no cloud APIs | ✅ | Mixed |
| Web UI with drag-and-drop + editor + i18n | ✅ EN/RU | Some |
Page image
│
├─► Bubble detection (RT-DETRv2)
├─► OCR per bubble (GLM-OCR via transformers)
├─► Page analysis (vision LLM — characters + scene)
├─► Speaker attribution (vision LLM — who said what)
├─► Batch translation (text LLM — uses speaker, gender, scene)
├─► Original text removal (anime-big-lama inpainting)
└─► Translated text render (PIL — auto font size, smart wrapping)
__ A Fast mode toggle skips the page-analysis and attribution stages — useful for quick drafts when context isn't critical (saves ~30-60 seconds per page).
ollama pull gemma4:26b # or any vision-capable model: llava, gemma3:27b, qwen2.5-vl, etc.
The OCR model (GLM-OCR) downloads automatically from HuggingFace on first run — no Ollama pull needed.run.bat.python_embed/ subfolder. Your system Python is not touched.Subsequent launches are instant.
chmod +x run.sh
./run.sh
Downloads a python-build-standalone distribution into python_embed/ on first run.
If you'd rather use your system Python:
python3.11 -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu128
pip install -r requirements.txt
python setup.py
PyTorch is installed separately so you can pick the right build. cu128 supports modern NVIDIA cards including RTX 50xx (Blackwell); for older CUDA use the matching index (e.g. cu121), or drop the --index-url line entirely for a CPU-only build.
Once the web UI is open:
gemma3:27b or gemma4:26b; avoid abliterated builds — they often have broken vision/template tags)Anime Ace, CC Wild Words, etc.); Kotoba auto-picks the best bold font installed on your systemcharacters.json).User preferences (language, model, font, debug toggles) are stored in your browser's localStorage. Job data (uploaded pages, translations, per-bubble overrides) live in web_data/ next to the project.
The character archive is characters.json in the project root. You can edit or delete it freely. Deleting it starts a fresh archive.
Model weights cache to ~/.cache/huggingface/hub/ (anime-big-lama, RT-DETRv2, GLM-OCR, comic-text-detector) — Ollama models live wherever you configured Ollama to store them.
Kotoba never sends your images, text, or anything else off your machine. The only network requests are:
localhost:11434 (Ollama).You can air-gap the machine after the initial setup and it will still work.
Each page's vision-LLM call gets the archive of every character seen so far as part of the prompt. For each new visible character the model decides: "is this someone I've seen before?" If yes, it reuses the existing ID; if no, it adds a new entry with a description.
The next page sees the updated archive. Over a chapter this becomes detailed enough that:
Same applies to scene context: a short summary of each page accumulates over the chapter, so dialogue on page 15 can reference "the bald hero seen earlier in the alley".
huihui_ai/gemma-4-abliterated, etc.) often have broken vision or template tags and return empty responses unpredictably. Use the regular gemma3:27b or gemma4:26b instead.Issues and PRs welcome. Please describe your platform (OS, GPU) and include a server log when reporting bugs — most issues turn out to be either Ollama model quirks or font/path issues.
MIT — see LICENSE.
Kotoba stands on the shoulders of several excellent open-source projects:
Pepper&Carrot — The first example is from the webcomic Pepper&Carrot by David Revoy, used under the Creative Commons Attribution 4.0 International License (CC-BY 4.0). The Chinese localization is by the Pepper&Carrot community. Pepper&Carrot is a free-libre webcomic — please support its author at https://www.peppercarrot.com/.
愛さずにはいられない — The second and third examples are pages from 愛さずにはいられない (I Can't Help But Love You) by よしまさこ, © よしまさこ / 集英社. These pages are from the Manga109 dataset (Manga109s_released_2023_12_07) and are used here for non-commercial research and demonstration purposes only, under the Manga109 research license.
39 commits
Python
53.1%
HTML
43.8%
Shell
1.5%
Batchfile
1.5%
Manga translator with character memory — tracks who's who across pages for more consistent translations. Fully local via Ollama.
8
stars
39
commits
Python
primary language
Jul 5, 2026
updated
A manga translator that remembers characters across pages.
Most automatic manga translators handle each speech bubble in isolation, so they re-translate the same character with a different name, get the wrong grammatical gender, or miss tone shifts. Kotoba builds up a character archive as it processes a chapter — recording each speaker's appearance, gender, and behavior — then uses that context plus per-page scene analysis to translate bubbles more consistently.
Everything runs locally on your machine via Ollama. No cloud API keys.
Pepper&Carrot — Chinese → English
| Original (Chinese) | Kotoba → English |
|---|---|
![]() | ![]() |
Pepper&Carrot by David Revoy, CC-BY 4.0. Chinese localization by the Pepper&Carrot community.
愛さずにはいられない (I Can't Help But Love You) — Japanese → English
| Original (Japanese) | Kotoba → English |
|---|---|
![]() | ![]() |
![]() | ![]() |
愛さずにはいられない by よしまさこ. From the Manga109 dataset, used under the Manga109 research license for non-commercial purposes. © よしまさこ / 集英社.
| Kotoba | Most other tools | |
|---|---|---|
| Tracks characters across pages | ✅ | ❌ |
| Scene-aware translation (knows what's happening on the page) | ✅ | ❌ |
| Portable Python — no system install needed | ✅ (Windows) | Usually a pip install chore |
| Fully local, no cloud APIs | ✅ | Mixed |
| Web UI with drag-and-drop + editor + i18n | ✅ EN/RU | Some |
Page image
│
├─► Bubble detection (RT-DETRv2)
├─► OCR per bubble (GLM-OCR via transformers)
├─► Page analysis (vision LLM — characters + scene)
├─► Speaker attribution (vision LLM — who said what)
├─► Batch translation (text LLM — uses speaker, gender, scene)
├─► Original text removal (anime-big-lama inpainting)
└─► Translated text render (PIL — auto font size, smart wrapping)
__ A Fast mode toggle skips the page-analysis and attribution stages — useful for quick drafts when context isn't critical (saves ~30-60 seconds per page).
ollama pull gemma4:26b # or any vision-capable model: llava, gemma3:27b, qwen2.5-vl, etc.
The OCR model (GLM-OCR) downloads automatically from HuggingFace on first run — no Ollama pull needed.run.bat.python_embed/ subfolder. Your system Python is not touched.Subsequent launches are instant.
chmod +x run.sh
./run.sh
Downloads a python-build-standalone distribution into python_embed/ on first run.
If you'd rather use your system Python:
python3.11 -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu128
pip install -r requirements.txt
python setup.py
PyTorch is installed separately so you can pick the right build. cu128 supports modern NVIDIA cards including RTX 50xx (Blackwell); for older CUDA use the matching index (e.g. cu121), or drop the --index-url line entirely for a CPU-only build.
Once the web UI is open:
gemma3:27b or gemma4:26b; avoid abliterated builds — they often have broken vision/template tags)Anime Ace, CC Wild Words, etc.); Kotoba auto-picks the best bold font installed on your systemcharacters.json).User preferences (language, model, font, debug toggles) are stored in your browser's localStorage. Job data (uploaded pages, translations, per-bubble overrides) live in web_data/ next to the project.
The character archive is characters.json in the project root. You can edit or delete it freely. Deleting it starts a fresh archive.
Model weights cache to ~/.cache/huggingface/hub/ (anime-big-lama, RT-DETRv2, GLM-OCR, comic-text-detector) — Ollama models live wherever you configured Ollama to store them.
Kotoba never sends your images, text, or anything else off your machine. The only network requests are:
localhost:11434 (Ollama).You can air-gap the machine after the initial setup and it will still work.
Each page's vision-LLM call gets the archive of every character seen so far as part of the prompt. For each new visible character the model decides: "is this someone I've seen before?" If yes, it reuses the existing ID; if no, it adds a new entry with a description.
The next page sees the updated archive. Over a chapter this becomes detailed enough that:
Same applies to scene context: a short summary of each page accumulates over the chapter, so dialogue on page 15 can reference "the bald hero seen earlier in the alley".
huihui_ai/gemma-4-abliterated, etc.) often have broken vision or template tags and return empty responses unpredictably. Use the regular gemma3:27b or gemma4:26b instead.Issues and PRs welcome. Please describe your platform (OS, GPU) and include a server log when reporting bugs — most issues turn out to be either Ollama model quirks or font/path issues.
MIT — see LICENSE.
Kotoba stands on the shoulders of several excellent open-source projects:
Pepper&Carrot — The first example is from the webcomic Pepper&Carrot by David Revoy, used under the Creative Commons Attribution 4.0 International License (CC-BY 4.0). The Chinese localization is by the Pepper&Carrot community. Pepper&Carrot is a free-libre webcomic — please support its author at https://www.peppercarrot.com/.
愛さずにはいられない — The second and third examples are pages from 愛さずにはいられない (I Can't Help But Love You) by よしまさこ, © よしまさこ / 集英社. These pages are from the Manga109 dataset (Manga109s_released_2023_12_07) and are used here for non-commercial research and demonstration purposes only, under the Manga109 research license.
39 commits
Python
53.1%
HTML
43.8%
Shell
1.5%
Batchfile
1.5%