Manga Translator
Batch manga page translator (JPβEN first) with free/local models.
Stack: Python FastAPI worker + Next.js UI. Phase 1 ships detect β OCR β translate β overlay preview. Phase 2 adds inpaint + typeset for finished visual pages.
Separate from Dinamus/ml-danbooru-onnx-repo (image tagging / folder routing).
Pipeline
- Detect text regions (heuristic contours; CTD optional later)
- OCR source text (
manga-ocrwhenMANGA_TRANSLATOR_REAL_MODELS=1, else stub) - Translate JPβEN (
opus-mt-ja-enwhen real models, else stub) - Overlay preview (Phase 1) β Inpaint + typeset (Phase 2)
- Export side-by-side PNG + zip / CBZ
Quick start (Phase 1 stubs β no GPU/model download)
Backend
cd backend
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e ".[dev]"
pytest
uvicorn manga_translator.api.app:app --reload --port 8000
CLI:
manga-translator translate-batch .\path\to\pages
Web UI
cd web
npm install
$env:NEXT_PUBLIC_API_BASE="http://127.0.0.1:8000"
npm run dev
Open http://localhost:3000 β upload pages, poll job progress, preview side-by-side, download zip.
Optional real models (Windows note)
Torch installs into the long project .venv path can fail with WinError 206. Prefer a short venv:
python -m venv C:\mtvenv
C:\mtvenv\Scripts\python -m pip install -e ".[ml]"
C:\mtvenv\Scripts\python -m pip install -e .
$env:MANGA_TRANSLATOR_REAL_MODELS="1"
$env:MANGA_TRANSLATOR_OCR_BACKEND="manga_ocr"
$env:MANGA_TRANSLATOR_TRANSLATE_BACKEND="opus_mt"
C:\mtvenv\Scripts\python -m uvicorn manga_translator.api.app:app --port 8010
Checklist: docs/CHECKLIST-p1-ui-local-models.md
Layout
backend/ Python package, FastAPI, CLI, tests
web/ Next.js job UI
data/jobs/ Runtime job store (gitignored)
docs/superpowers/ Design spec + implementation plan
License
MIT β compose Apache/MIT model weights; do not embed GPL engines (manga-image-translator / BallonsTranslator) as libraries.