Fast single-pass colorization of black-and-white manga pages, small enough to run in the browser (WebGPU). Line art, screentones and text stay pixel-exact: the network only predicts color, the page keeps its own lightness. Optional color hints and a series cover keep characters' colors consistent across pages.
Code, training and export: github.com/PianoNic/ColorUNet-Manga
Series cover as the color reference → black-and-white page → output. Tonikaku Kawaii (Fly Me to the Moon) ch. 305.5 © Kenjiro Hata / Shogakukan, a series not in the training data.
| File | What |
|---|---|
model.safetensors, config.json |
PyTorch weights (61.0M: 33.0M colorizer + 28.0M cover encoder) |
onnx/colorizer-fp16.onnx, onnx/colorizer-fp32.onnx |
Browser graph without a cover: model + Lab merge in one pass |
onnx/ref-encoder-fp16.onnx, onnx/colorizer-ref-fp16.onnx, onnx/null-tokens.bin |
Cover encoder (once per series) and the colorizer that takes its tokens |
onnx/meta.json |
Input/output names, shapes and sizes for the ONNX files |
git clone https://github.com/PianoNic/ColorUNet-Manga && cd ColorUNet-Manga/training
pip install torch torchvision timm safetensors opencv-python-headless numpy
hf download PianoNic/ColorUNet-Manga-61M --local-dir weights
python scripts/infer.py page.png --weights weights/model.safetensors --ref cover.jpg --sbs
Input: the page at a long side of 768 px (padded to a multiple of 32). Output: Lab a/b color, upsampled edge-aware onto the full-resolution page, whose own L channel is kept.
Staged fine-tuning of a ConvNeXt-Tiny U-Net (encoder initialised from timm/convnext_tiny.fb_in1k):
Held-out Lab a/b L1 on the stage-3 pages: 3.67 (no hints).
Training data notice: stages 2 and 3 used copyrighted manga pages, which are not redistributed and not part of this repository. Whether training on them is permitted depends on your jurisdiction; check before commercial use. Sources and licences: DATASETS.md.
MIT. Encoder initialisation: timm convnext_tiny.fb_in1k (Apache-2.0).
@misc{colorunetmanga2026,
title = {ColorUNet-Manga: Fast Single-Pass Manga Colorization},
author = {PianoNic},
year = {2026},
url = {https://huggingface.co/PianoNic/ColorUNet-Manga-61M}
}
model.safetensors 233 MiBonnx/colorizer-fp32.onnx 126 MiBonnx/colorizer-fp16.onnx 63 MiBonnx/colorizer-ref-fp16.onnx 63 MiBonnx/ref-encoder-fp16.onnx 54 MiBonnx/null-tokens.bin 64 KiBtimm/convnext_tiny.fb_in1k