lehuyqq/Manga-Translator-Extension

Browser extension for translating manga pages in-browser using your own LLM provider, with page scanning, auto-translate, outside-text detection, and a local FastAPI backend.

33

stars

20

commits

Python

primary language

Jun 6, 2026

updated

Browse cluster: Manga OCR and Translation

README

MangaTranslator Extension

Translate manga pages directly in your browser with the LLM provider you configure, a local FastAPI backend, batch page scanner, auto-translate mode, multilingual UI, and optional Flux inpainting.

Tiếng Việt · 中文

Manifest V3 TypeScript FastAPI Windows portable Release

Showcase · Features · Download · Quick Start · Configuration · Optional Flux · Development

MangaTranslator Extension banner

Overview

MangaTranslator Extension is a portable browser-extension stack for translating manga and comic pages. The browser extension scans images on the current page, sends them to a local backend, and replaces or previews the translated result. The backend runs locally, so the browser does not need to send manga images through a third-party extension server.

The extension uses the LLM, API key, model, and Base URL that you provide. You can connect it to Google, OpenAI, Anthropic, OpenRouter, DeepSeek, xAI, Z.ai, Moonshot AI, or any OpenAI-compatible endpoint, then keep the translation workflow inside the browser.

The default package is intentionally lighter: it includes the normal backend runtime and non-Flux models, while Flux Klein 4B is optional and can be installed later with setup.bat.

Showcase

MangaTranslator Extension is built for people who want to keep reading, not copy text into separate tools. Open a chapter, scan the page, choose the images you want, and let your own LLM translate the dialogue back into the manga image.

Popup controlsPage scanner
MangaTranslator Extension popupMangaTranslator Extension page scanner
Configure source/target languages, outside-text detection, backend status, and one-click auto translation.Scan a chapter, preview detected pages, select only what you need, and translate pages in batch.

Translation Result

Original pageTranslated page
Original Japanese manga pageTranslated manga page rendered back into the image
  • Bring your own LLM: use the provider, API key, model, and endpoint you trust.
  • Read faster with auto-translate: pages are translated as you scroll, including lookahead pages.
  • Keep the manga feel: original text is cleaned and translated text is rendered back into the image.
  • Translate more than bubbles: SFX, narration, captions, and other outside-bubble text can be handled too.
  • Stay lightweight by default: Flux Klein 4B is optional, so normal users do not need to download a workstation-sized package.

Features

AreaWhat it does
Bring-your-own LLMUses the LLM provider, API key, model, and Base URL configured by the user.
Page scannerFinds manga/comic images on the active page and lets you choose which pages to translate.
Auto-translateWatches the current reading page and translates images as you scroll.
Bubble translationDetects speech bubbles, removes original text, translates, and renders text back into the image.
Outside-bubble textHandles SFX/narration outside speech bubbles with lightweight cleanup by default.
Optional FluxLets advanced users download Flux Klein 4B for heavier inpainting without shipping it in the default release.
Provider supportGoogle, OpenAI, Anthropic, xAI, DeepSeek, Z.ai, Moonshot AI, OpenRouter, and OpenAI-compatible endpoints.
Model pickerFetches available OpenAI-compatible models from your configured Base URL.
UI languagesEnglish by default, plus Vietnamese, Chinese, Japanese, and Korean.
Translation languagesMain source/target options include Japanese, Korean, English, and Vietnamese.
Portable backendUses start-backend.bat, backend/main.py, and optional bundled backend/runtime/python.exe.

Download

Latest release:

https://github.com/lehuyqq/Manga-Translator-Extension/releases/latest

Recommended release assets:

AssetPurpose
manga-translator-extension-dist-*.zipBuilt browser extension. Load the extracted dist/ folder in Chrome/Edge.
manga-translator-models-no-flux-*.zipBackend model files without Flux. Extract into the project root so it restores backend/models/.
manga-translator-runtime-*.tar.gz.part01, part02, ...Split backend Python runtime. Recombine before extracting.

Recombine split runtime parts on Windows PowerShell:

Get-Content .\manga-translator-runtime-v1.0.1.tar.gz.part* -Encoding Byte -ReadCount 0 |
  Set-Content .\manga-translator-runtime-v1.0.1.tar.gz -Encoding Byte

tar -xzf .\manga-translator-runtime-v1.0.1.tar.gz

Extract models:

Expand-Archive .\manga-translator-models-no-flux-v1.0.1.zip -DestinationPath .

Quick Start

  1. Download the source or clone the repository.
git clone https://github.com/lehuyqq/Manga-Translator-Extension.git
cd Manga-Translator-Extension
  1. Download release assets and restore backend/runtime/ and backend/models/.

  2. Start the backend.

.\start-backend.bat

The backend should listen on:

http://localhost:7677
  1. Load the browser extension.
cd extension
npm install
npm run build

Then open Chrome or Edge:

chrome://extensions/

Enable Developer mode, choose Load unpacked, and select extension/dist/.

Configuration

Open the extension popup and use the three tabs:

TabOptions
TranslateSource language, target language, outside-bubble text toggle.
LLM ConfigProvider, Base URL, model, API key, temperature, Top P, Top K, full-page context, special instructions.
ConfigExtension UI language and backend URL.

Default backend URL:

http://localhost:7677

Provider keys can be entered in the popup or exposed through environment variables:

GOOGLE_API_KEY
OPENAI_API_KEY
ANTHROPIC_API_KEY

Optional Flux

Flux is not bundled in the normal release because it adds several GB. The default outside-bubble mode uses lightweight cleanup and does not require Flux.

To install Flux Klein 4B on demand:

.\setup.bat

Choose:

2. Download optional Flux Klein 4B model

The script downloads to:

backend/models/flux/

Use Flux only when you explicitly configure outside-text inpainting to a Flux mode such as flux_klein_4b. For most users, the default auto behavior is lighter and faster.

Usage Workflow

  1. Start the backend with start-backend.bat.
  2. Open a manga/comic chapter in Chrome or Edge.
  3. Click the MangaTranslator extension icon.
  4. Choose source and target language.
  5. Click Scan & Translate Page to choose images manually, or Auto-translate to translate as you scroll.
  6. Review translated images on the page.

Tip: On manga sites that use lazy-load and prevent the extension from scanning the whole chapter at once, scan and translate the next 4-5 pages first, then turn on Auto-MT for the smoothest reading experience.

Project Layout

manga-translator-extension/
  backend/                         FastAPI backend and MangaTranslator integration
  backend/main.py                  Backend entry point
  backend/core/                    Detection, cleanup, translation, rendering
  backend/models/                  Model files restored from release assets
  backend/pipeline/                Wrapper around the core pipeline
  extension/                       Manifest V3 browser extension
  extension/src/background/        Service worker and backend requests
  extension/src/content-script/    Page scanner and auto-translate overlay
  extension/src/popup/             Popup UI
  extension/src/shared/            Types, constants, i18n
  docs/                            API docs and localized READMEs
  setup.bat                        Optional setup helper, including Flux download
  start-backend.bat                Backend launcher

Development

Build the extension:

cd extension
npm install
npm run build

Compile-check backend files:

cd ..\backend
python -m py_compile pipeline\wrapper.py

Check backend health:

Invoke-RestMethod http://localhost:7677/health

Release Packaging

Do not commit generated runtime, models, caches, or extension build output. They are intentionally ignored:

backend/runtime/
backend/models/
extension/dist/
extension/node_modules/
release-assets/

Use GitHub Releases for runtime/model archives. GitHub blocks files over 100 MB in normal Git history, and large runtime archives should be split so each release asset stays below GitHub's release asset limit.

FAQ

Q: How good is the translation quality?

A: Translation quality depends on the LLM model you use. Stronger models usually produce more natural wording, better context handling, and fewer mistranslations.

Q: Some pages have text outside speech bubbles and the result shows white/black boxes. What should I do?

A: Use the optional Flux Klein 4B model to improve inpainting quality for text outside bubbles, SFX, narration, and messy backgrounds.

Q: Why does the popup show Backend Offline?

A: Start .\start-backend.bat, wait until the backend is ready, then confirm that http://localhost:7677/health opens successfully. Also check that the Backend URL in the Config tab matches your local server.

Q: Why are some manga images not detected?

A: Wait for the reader page to finish lazy-loading, then run Scan & Translate Page again. If the site loads pages only while scrolling, scroll through the chapter once or use Auto-collect in the scanner.

Troubleshooting

ProblemFix
Backend offline in popupStart .\start-backend.bat and confirm http://localhost:7677/health.
Extension cannot connectCheck the backend URL in the Config tab.
No images foundLet the manga page finish loading, then run Scan & Translate Page again.
Model/provider errorCheck API key, Base URL, model name, and provider selection.
Flux download failsRe-run setup.bat, check disk space and internet connection.
Release runtime has .part01 filesRecombine parts first, then extract the .tar.gz.

Security

Never commit API keys, private backend URLs, generated caches, model artifacts, node_modules, dist, or a full Python runtime. Keep secrets in the extension popup or environment variables.

License

This portable build includes code derived from MangaTranslator. Keep upstream license requirements with any redistribution.

Contributors

lehuyqq

20 commits

lehuyqq/Manga-Translator-Extension

Browser extension for translating manga pages in-browser using your own LLM provider, with page scanning, auto-translate, outside-text detection, and a local FastAPI backend.

33

stars

20

commits

Python

primary language

Jun 6, 2026

updated

Browse cluster: Manga OCR and Translation

README

MangaTranslator Extension

Translate manga pages directly in your browser with the LLM provider you configure, a local FastAPI backend, batch page scanner, auto-translate mode, multilingual UI, and optional Flux inpainting.

Tiếng Việt · 中文

Manifest V3 TypeScript FastAPI Windows portable Release

Showcase · Features · Download · Quick Start · Configuration · Optional Flux · Development

MangaTranslator Extension banner

Overview

MangaTranslator Extension is a portable browser-extension stack for translating manga and comic pages. The browser extension scans images on the current page, sends them to a local backend, and replaces or previews the translated result. The backend runs locally, so the browser does not need to send manga images through a third-party extension server.

The extension uses the LLM, API key, model, and Base URL that you provide. You can connect it to Google, OpenAI, Anthropic, OpenRouter, DeepSeek, xAI, Z.ai, Moonshot AI, or any OpenAI-compatible endpoint, then keep the translation workflow inside the browser.

The default package is intentionally lighter: it includes the normal backend runtime and non-Flux models, while Flux Klein 4B is optional and can be installed later with setup.bat.

Showcase

MangaTranslator Extension is built for people who want to keep reading, not copy text into separate tools. Open a chapter, scan the page, choose the images you want, and let your own LLM translate the dialogue back into the manga image.

Popup controlsPage scanner
MangaTranslator Extension popupMangaTranslator Extension page scanner
Configure source/target languages, outside-text detection, backend status, and one-click auto translation.Scan a chapter, preview detected pages, select only what you need, and translate pages in batch.

Translation Result

Original pageTranslated page
Original Japanese manga pageTranslated manga page rendered back into the image
  • Bring your own LLM: use the provider, API key, model, and endpoint you trust.
  • Read faster with auto-translate: pages are translated as you scroll, including lookahead pages.
  • Keep the manga feel: original text is cleaned and translated text is rendered back into the image.
  • Translate more than bubbles: SFX, narration, captions, and other outside-bubble text can be handled too.
  • Stay lightweight by default: Flux Klein 4B is optional, so normal users do not need to download a workstation-sized package.

Features

AreaWhat it does
Bring-your-own LLMUses the LLM provider, API key, model, and Base URL configured by the user.
Page scannerFinds manga/comic images on the active page and lets you choose which pages to translate.
Auto-translateWatches the current reading page and translates images as you scroll.
Bubble translationDetects speech bubbles, removes original text, translates, and renders text back into the image.
Outside-bubble textHandles SFX/narration outside speech bubbles with lightweight cleanup by default.
Optional FluxLets advanced users download Flux Klein 4B for heavier inpainting without shipping it in the default release.
Provider supportGoogle, OpenAI, Anthropic, xAI, DeepSeek, Z.ai, Moonshot AI, OpenRouter, and OpenAI-compatible endpoints.
Model pickerFetches available OpenAI-compatible models from your configured Base URL.
UI languagesEnglish by default, plus Vietnamese, Chinese, Japanese, and Korean.
Translation languagesMain source/target options include Japanese, Korean, English, and Vietnamese.
Portable backendUses start-backend.bat, backend/main.py, and optional bundled backend/runtime/python.exe.

Download

Latest release:

https://github.com/lehuyqq/Manga-Translator-Extension/releases/latest

Recommended release assets:

AssetPurpose
manga-translator-extension-dist-*.zipBuilt browser extension. Load the extracted dist/ folder in Chrome/Edge.
manga-translator-models-no-flux-*.zipBackend model files without Flux. Extract into the project root so it restores backend/models/.
manga-translator-runtime-*.tar.gz.part01, part02, ...Split backend Python runtime. Recombine before extracting.

Recombine split runtime parts on Windows PowerShell:

Get-Content .\manga-translator-runtime-v1.0.1.tar.gz.part* -Encoding Byte -ReadCount 0 |
  Set-Content .\manga-translator-runtime-v1.0.1.tar.gz -Encoding Byte

tar -xzf .\manga-translator-runtime-v1.0.1.tar.gz

Extract models:

Expand-Archive .\manga-translator-models-no-flux-v1.0.1.zip -DestinationPath .

Quick Start

  1. Download the source or clone the repository.
git clone https://github.com/lehuyqq/Manga-Translator-Extension.git
cd Manga-Translator-Extension
  1. Download release assets and restore backend/runtime/ and backend/models/.

  2. Start the backend.

.\start-backend.bat

The backend should listen on:

http://localhost:7677
  1. Load the browser extension.
cd extension
npm install
npm run build

Then open Chrome or Edge:

chrome://extensions/

Enable Developer mode, choose Load unpacked, and select extension/dist/.

Configuration

Open the extension popup and use the three tabs:

TabOptions
TranslateSource language, target language, outside-bubble text toggle.
LLM ConfigProvider, Base URL, model, API key, temperature, Top P, Top K, full-page context, special instructions.
ConfigExtension UI language and backend URL.

Default backend URL:

http://localhost:7677

Provider keys can be entered in the popup or exposed through environment variables:

GOOGLE_API_KEY
OPENAI_API_KEY
ANTHROPIC_API_KEY

Optional Flux

Flux is not bundled in the normal release because it adds several GB. The default outside-bubble mode uses lightweight cleanup and does not require Flux.

To install Flux Klein 4B on demand:

.\setup.bat

Choose:

2. Download optional Flux Klein 4B model

The script downloads to:

backend/models/flux/

Use Flux only when you explicitly configure outside-text inpainting to a Flux mode such as flux_klein_4b. For most users, the default auto behavior is lighter and faster.

Usage Workflow

  1. Start the backend with start-backend.bat.
  2. Open a manga/comic chapter in Chrome or Edge.
  3. Click the MangaTranslator extension icon.
  4. Choose source and target language.
  5. Click Scan & Translate Page to choose images manually, or Auto-translate to translate as you scroll.
  6. Review translated images on the page.

Tip: On manga sites that use lazy-load and prevent the extension from scanning the whole chapter at once, scan and translate the next 4-5 pages first, then turn on Auto-MT for the smoothest reading experience.

Project Layout

manga-translator-extension/
  backend/                         FastAPI backend and MangaTranslator integration
  backend/main.py                  Backend entry point
  backend/core/                    Detection, cleanup, translation, rendering
  backend/models/                  Model files restored from release assets
  backend/pipeline/                Wrapper around the core pipeline
  extension/                       Manifest V3 browser extension
  extension/src/background/        Service worker and backend requests
  extension/src/content-script/    Page scanner and auto-translate overlay
  extension/src/popup/             Popup UI
  extension/src/shared/            Types, constants, i18n
  docs/                            API docs and localized READMEs
  setup.bat                        Optional setup helper, including Flux download
  start-backend.bat                Backend launcher

Development

Build the extension:

cd extension
npm install
npm run build

Compile-check backend files:

cd ..\backend
python -m py_compile pipeline\wrapper.py

Check backend health:

Invoke-RestMethod http://localhost:7677/health

Release Packaging

Do not commit generated runtime, models, caches, or extension build output. They are intentionally ignored:

backend/runtime/
backend/models/
extension/dist/
extension/node_modules/
release-assets/

Use GitHub Releases for runtime/model archives. GitHub blocks files over 100 MB in normal Git history, and large runtime archives should be split so each release asset stays below GitHub's release asset limit.

FAQ

Q: How good is the translation quality?

A: Translation quality depends on the LLM model you use. Stronger models usually produce more natural wording, better context handling, and fewer mistranslations.

Q: Some pages have text outside speech bubbles and the result shows white/black boxes. What should I do?

A: Use the optional Flux Klein 4B model to improve inpainting quality for text outside bubbles, SFX, narration, and messy backgrounds.

Q: Why does the popup show Backend Offline?

A: Start .\start-backend.bat, wait until the backend is ready, then confirm that http://localhost:7677/health opens successfully. Also check that the Backend URL in the Config tab matches your local server.

Q: Why are some manga images not detected?

A: Wait for the reader page to finish lazy-loading, then run Scan & Translate Page again. If the site loads pages only while scrolling, scroll through the chapter once or use Auto-collect in the scanner.

Troubleshooting

ProblemFix
Backend offline in popupStart .\start-backend.bat and confirm http://localhost:7677/health.
Extension cannot connectCheck the backend URL in the Config tab.
No images foundLet the manga page finish loading, then run Scan & Translate Page again.
Model/provider errorCheck API key, Base URL, model name, and provider selection.
Flux download failsRe-run setup.bat, check disk space and internet connection.
Release runtime has .part01 filesRecombine parts first, then extract the .tar.gz.

Security

Never commit API keys, private backend URLs, generated caches, model artifacts, node_modules, dist, or a full Python runtime. Keep secrets in the extension popup or environment variables.

License

This portable build includes code derived from MangaTranslator. Keep upstream license requirements with any redistribution.

Contributors

lehuyqq

20 commits

Languages

Python

83.0%

TypeScript

14.6%

HTML

1.6%