Skip to content

Latest commit

 

History

History
71 lines (54 loc) · 3.28 KB

File metadata and controls

71 lines (54 loc) · 3.28 KB

Info

MangaJaNaiConverterGui is a convenient GUI windows tool, but in the backend it operates by running some python scripts in CLI.

This README is for those interested in running only the CLI on a linux systems or WSL.

Setup

Setup virtual environment and download dependencies

Navigate to root fo the project and execute these commands. This script will create a new python virtual environment, switch to it and download all required dependencies:

python -m venv venv_mangajanai
source venv_mangajanai/bin/activate
pip install MangaJaNaiConverterGui/backend/src/

By default, it uses pytorch for CUDA 12.1 compute platform. If you wish to change it, install proper version based on instruction from their official website.

Download models

Scripts expect all MangaJaNai models to be available in order to select the best one for each processed file. When running it as CLI on linux, put them in MangaJaNaiConverterGui/backend/models folder.

You can extract them from the release .exe file of the version you wish to use.

Usage

You can use this tool in two ways. As a simple CLI or as advanced json-controlled utility.

Simple CLI

Execution

Script should be run from MangaJaNaiConverterGui/backend/src/ directory. Example usage:

# Show detailed help
python run_upscale.py -h

# Upscale single file with factor 4
python run_upscale.py -f "/my/dir/myFile.jpg" -u 4

# Upscale whole directory into a custom output directory
python run_upscale.py -d "/my/input/dir/" -o "/my/output/dir/"

Advanced Utility

Script uses a settings file generated by the GUI to control its behavior. You need to build it manually to use the CLI. The default settings can be found in MangaJaNaiConverterGui/appstate2.json. Just copy it and modify only what you need. It's a long file, but you only need to worry about a few root keys and first workflow Upscale Manga (Default)

Important Root Keys

  • SelectedDeviceIndex - Controls which GPU should run upscaling jobs. If default doesn't work for you, check your devices by running device_list.py
  • UseCPU - true/false
  • UseFp16 - true/false

Important Workflows Keys

  • SelectedTabIndex - Choose if you want to upscale a single file or a whole folder
    • 0 - file
    • 1 - folder
  • InputFilePath - absolute file path. Used when SelectedTabIndex = 0
  • InputFolderPath - absolute folder path. Used when SelectedTabIndex = 1
  • OutputFilename - Name of generated filenames. Keep %filename% to leave the same name
  • OutputFolderPath - absolute folder path.
  • OverwriteExistingFiles - true/false
  • UpscaleImages - true/false - needs to be true for upscale to work
  • WebpSelected/AvifSelected/PngSelected/JpegSelected - true/false. Only one should be true. Selects output filetype.
  • UpscaleScaleFactor - 1/2/3/4 - How much you want to upscale which controls which models will be used
  • There are a bunch of other options if you want to dig deeper into it, but setting these should be enough for basic usage

Execution

In MangaJaNaiConverterGui/backend/src/ directory run:

python run_upscale.py --settings "/path/to/your/file/appstate2.json"