Load Image (16 bit)
Your 16-bit PNGs are being read as 8-bit. This node stops that.
- IMAGE
- MASK
Here's the trap: you generated a perfectly smooth sky, saved it as a 16-bit PNG with the Save Image (16 bit) node, reload it the normal way, and all that extra precision silently disappears. ComfyUI's stock Load Image reads a 16-bit PNG as if it were 8-bit, so the 65,536 levels you carefully preserved collapse back to 256 - and the banding you saved it to avoid comes straight back.
Load Image (16 bit) is the matching read side of that story. It uses pypng to pull the full 16 bits out of the file, so a smooth gradient loaded here stays smooth.
How it works
The node reads the PNG's raw rows as uint16, divides by 65,535 to get floats in [0, 1], and hands you a normal IMAGE tensor. Nothing about your downstream graph changes - you just get more of the actual file. It's a subclass of the core Load Image, so the input widget is the same dropdown of files in your input/ folder.
The inputs and outputs that matter
image- pick the file from the dropdown (only files listed there, same as stock).- Outputs: IMAGE and MASK. If your PNG has an alpha channel, the alpha becomes the mask output - handy for 16-bit transparency or cutout work. No alpha, no mask, and it outputs an empty one.
One honest limitation: PNG only. If you select anything else, it prints a warning ("Only PNG files can be loaded in 16 bit color") and silently falls back to the standard 8-bit loader. Also note it's smart about container depth: a file that's technically 16-bit but only ever used values up to 255 (an 8-bit image stuffed in a 16-bit wrapper) is scaled correctly instead of getting crushed.
Installing
This is part of the ColorMod pack, and needs the pypng dependency:
cd ComfyUI/custom_nodes
git clone https://github.com/city96/ComfyUI_ColorMod
cd ComfyUI_ColorMod
pip install -r requirements.txt
Restart ComfyUI afterwards (or use ComfyUI Manager and search "ComfyUI_ColorMod"). If the node doesn't show up at all, pypng isn't installed - that's the entire failure mode for the 16-bit family.
When it's actually worth it
The people who care about this are mostly doing depth maps or gradient-heavy work - the classic complaint is banding showing up as lines in a rendered mesh or a posterized sky. If you're doing 16-bit load → edit → 16-bit save entirely inside ComfyUI, the pipeline holds precision end to end. Just remember the same caveat that applies to the whole 16-bit family: the moment your image passes through a VAE encode/decode, the precision is gone no matter how you loaded it. This node preserves the input; it can't preserve what a bf16 VAE already destroyed.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | 1 options: example.png |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |