Standalone inference script for the Manga Light Colorizer model.
The following gallery uses the same source images as the manga-colorization-v2 project to facilitate direct comparison between models.
Comparison between input (left) and colorized output (right):
| Input (BW) | Colorized Output |
|---|---|
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
# Install dependencies
pip install -r requirements.txt
# Single image
python inference.py --input input/bw1.jpg
# All images in a folder
python inference.py --input input/
# Custom output folder
python inference.py --input input/ --output_dir output/
# Custom inference resolution
python inference.py --input input/ --infer-size 1024
| Argument | Required | Default | Description |
|---|---|---|---|
--input | Yes | - | Input grayscale image or folder |
--onnx-model | No | models/v6_generator.onnx | Generator ONNX model path |
--sam-onnx | No | models/v6_sam_encoder.onnx | SAM 2.1 encoder ONNX path |
--output_dir | No | ./output/ | Output folder for colorized images |
--infer-size | No | 768 | Inference resolution (square) |
--ort-device | No | cpu | ONNX Runtime device (cpu or cuda) |
The model was trained at 512×512 pixels. Inference currently runs at 768×768 pixels by default.
More the inference resolution differs from 512×512, the less faithful the colors will be.
For best results, use the training resolution:
# Best color accuracy, but lower resolution — matches training resolution python inference.py --input input/ --infer-size 512 # Default (good quality) python inference.py --input input/ # Higher resolution (may reduce color accuracy) python inference.py --input input/ --infer-size 1024
Input (grayscale) → Resize to infer-size → SAM 2.1 (zeros) → Generator ONNX → Resize to original
See requirements.txt for full list.
Licensed under CC BY-NC-SA 4.0 (Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International).
You may:
Under the following terms:
See: https://creativecommons.org/licenses/by-nc-sa/4.0/
Licensed under GNU General Public License v3 (GPL-3.0).
You may use, modify, and distribute this code under the terms of the GPL-3.0 license.
8 commits
Standalone inference script for the Manga Light Colorizer model.
The following gallery uses the same source images as the manga-colorization-v2 project to facilitate direct comparison between models.
Comparison between input (left) and colorized output (right):
| Input (BW) | Colorized Output |
|---|---|
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
# Install dependencies
pip install -r requirements.txt
# Single image
python inference.py --input input/bw1.jpg
# All images in a folder
python inference.py --input input/
# Custom output folder
python inference.py --input input/ --output_dir output/
# Custom inference resolution
python inference.py --input input/ --infer-size 1024
| Argument | Required | Default | Description |
|---|---|---|---|
--input | Yes | - | Input grayscale image or folder |
--onnx-model | No | models/v6_generator.onnx | Generator ONNX model path |
--sam-onnx | No | models/v6_sam_encoder.onnx | SAM 2.1 encoder ONNX path |
--output_dir | No | ./output/ | Output folder for colorized images |
--infer-size | No | 768 | Inference resolution (square) |
--ort-device | No | cpu | ONNX Runtime device (cpu or cuda) |
The model was trained at 512×512 pixels. Inference currently runs at 768×768 pixels by default.
More the inference resolution differs from 512×512, the less faithful the colors will be.
For best results, use the training resolution:
# Best color accuracy, but lower resolution — matches training resolution python inference.py --input input/ --infer-size 512 # Default (good quality) python inference.py --input input/ # Higher resolution (may reduce color accuracy) python inference.py --input input/ --infer-size 1024
Input (grayscale) → Resize to infer-size → SAM 2.1 (zeros) → Generator ONNX → Resize to original
See requirements.txt for full list.
Licensed under CC BY-NC-SA 4.0 (Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International).
You may:
Under the following terms:
See: https://creativecommons.org/licenses/by-nc-sa/4.0/
Licensed under GNU General Public License v3 (GPL-3.0).
You may use, modify, and distribute this code under the terms of the GPL-3.0 license.
8 commits