Skip to content

Mayonnaisu/simple-comic-translator

Repository files navigation

Simple Comic Translator

Simple Comic Translator πŸ’©

Translate comic and manga/hwa/hua in batch.

Test App

STATUS

Warning

  • Under construction πŸ› οΈ
  • Unstable ⚠️
  • Not thoroughly tested yet ⁉️

DIRECTORY

NOTICE

Update & redownload config.json and prompt.yaml to get the latest features. For more info, see CHANGELOG.

All PowerShell scripts (.ps1) are only tested on Windows and may not be compatible with PowerShell Core run directly on other OSes.

For advanced users, use this guide.

ABOUT

Full Name

THAT TIME I GOT REINCARNATED AS A SCRIPT KIDDIE FOR THE SAKE OF CREATING THIS NOT-SO-SIMPLE COMIC TRANSLATOR WITH THE HELP OF MY UNRELIABLE SYSTEM (GEMINI) πŸ˜‚

Me: "System, how to extract text from image with PaddleOCR?"
System: "To extract text from image with PaddleOCR- Oops, something went wrong with this response."
Me: "...."

**A few moments later**

Me: "Alright, translate this OCR results to English."
System: "503 UNAVAILABLE. {'error': {'code': 503, 'message': 'The model is overloaded. Please try again later.', 'status': 'UNAVAILABLE'}}"
Me: "WTF!"

Shorter Names

SCT
Read:
-> "S-C-T"
-> "ess-see-tee"
-> "Shitty" πŸ’©

Tasteless T-Rex Meme

Background

This is just a shitty simple app for translating comics in batch with Gemini. It can translate comic images in a folder recursively and save them to the corresponding output folder/subfolders with its limitations. Don't use this janky app! Instead, use these:

However, if you insist on using my app, then proceed to the next section. You've been warned! Just don't expect much cuz it's intended to be "simpler" than those better alternatives or other programs not mentioned here (go search them on your own).

WORKFLOW

Go to here.

DEMO

Go to here.

DOWNLOAD

  1. Click on the green button on the top.
  2. Select "Download ZIP".
  3. Right click on the downloaded .zip file.
  4. Select "Extract Here" with WinRAR or 7-Zip.

INSTALLATION

Important

The installer only supports Windows 10 & 11.

  1. Open PowerShell as Administrator.
  2. Change PowerShell execution policy by entering the command below:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
  1. Enter y or yes.
  2. Close the PowerShell.
  3. Right click on installer.ps1.
  4. Select "Run with PowerShell".
  5. Select "Yes" if UAC prompt pops up.
  6. Wait until you get ${{\color{lightgreen}{\textsf{INSTALLATION COMPLETED!}}}}$ message.

Tip

If you get a warning when opening the installer, uncheck the option, then Open. If you don't do this, the script won't be able to run properly.

View image

Warning for Script

CONFIGURATION

Required

  1. Open .env file with text/code editor (Notepad, VS Code, etc).
  2. Paste your Gemini API key between the quotation marks.
  3. Save.

Optional

  1. Open config.json with text/code editor.
  2. Change the settings as you see fit.
  3. Save.

For more info, see config options.

USAGE

  1. Right click on launcher.ps1.
  2. Select "Run with PowerShell".
  3. Select a folder containing your manga/hwa/hua.

UPDATE

Warning

This updater will replace the old files with the newer ones, so make sure to back up the files you want to keep first. For more info, see here.

Exclusions:

  • config.json
  • prompt.yaml
  • filters/*
  1. Right click on updater.ps1 > Run with PowerShell.
  2. Wait until you get ${{\color{lightgreen}{\textsf{UPDATE COMPLETED!}}}}$ message.

LIMITATIONS

  1. It can't automatically detect the input language and only supports one language in each process. As a result, you need to manually specify the language in config.json.
  2. Some texts, especially non-plain/styled texts, may not be recognized properly if at all.
  3. Some unwanted texts may also be detected and recognized, making the result riddled with unnecessary texts and white rectangles.
  4. Gemini itself is prone to throwing "model overloaded" error & returning None or incomplete response and response with messed-up format. When those happen, just retry it manually or increase max_retries in config.json for more automatic retries.

EXTRA INFO

How to Get Gemini API Key

  1. Visit https://aistudio.google.com/app/apikey.
  2. Accept the Terms and Conditions.
  3. Click "Create API key".
  4. Name your key.
  5. Choose project > Create project.
  6. Select the newly created project.
  7. Click "Create key".
  8. Click the code in the "Key" column.
  9. Click "Copy key".

Tip

Gemini API Free Tier has rate limits, see: https://ai.google.dev/gemini-api/docs/rate-limits.

To check your quota:

  1. Visit https://aistudio.google.com/app/usage
  2. Make sure you are on the right account & project.
  3. Click "Open in Cloud Console" on the bottom.
  4. Scroll down > Click "Quotas & System Limits".
  5. Scroll down > You will see your model quota usage on the top result. If you don't see it, use Filter to search it.

For example:

View image

Gemini Free Tier Quota

FAQ

Go to here.

Releases

No releases published

Packages

No packages published