Image Color Range
Restore the contrast your footage lost to a limited range
- image
- image
Ever decoded a video frame in ComfyUI and gotten a flat, washed, gray-looking image even though the video itself looked fine? That's the classic limited-range problem: the pixels only use the 16–235 range (TV/studio levels) out of 0–255, so on a full-range monitor everything sits in the middle of the histogram. "Image Color Range" is the node that fixes exactly that.
What it is
NNImageColorRange expands or remaps an image's color range. The README's description is honest and to the point: "Useful for restoring contrast from limited-range images." You give it the min and max values your image actually occupies, and it stretches that band back out to the full 0–1 range.
How it works
The math is a linear rescale, applied per channel. With min and max set, the node treats those values (divided by 255) as the current black and white points, then maps:
output = (pixel - min) / (max - min)
So if your footage occupies 16–235 (the classic studio video range), you set min to 16 and max to 235 and everything below 16 becomes pure black, everything above 235 becomes pure white, and the middle stretches out to fill the whole 0–1 range. The result is the contrast you were missing, done in one pass.
Two details worth knowing:
- It's linear, not a curve. It won't sculpt shadows or highlights - it just puts the existing data on the full range, which is correct for a range problem and wrong for a "this image is genuinely low contrast" problem. If your source already uses the full range and just looks flat, this node is not the fix (that's a contrast node like
NNImageAdjustContrast). - Default is no-op. With
minat 0 andmaxat 255 (the defaults), the node passes the image through untouched. You only get work when you move the sliders - which makes it safe to leave parked in a workflow.
The inputs
image- the washed-out tensor.min- the current black point, 0–127. For 16–235 video, 16.max- the current white point, 128–255. For 16–235 video, 235.
One image output, same batch shape as the input. Because it operates per-channel with the same values, it fixes the range without introducing a color cast - which is the failure mode of guessing this by hand with contrast sliders.
Where you'll hit it
This is a niche but very real fix. The most common trigger is video frames (LTXV, Wan, or any video model pipeline where frames get decoded and re-encoded) and images that took a round trip through a video codec. If you load frames and they look gray and low-contrast but the actual video plays fine, this node is the answer before you reach for anything generative. It's also the honest alternative to "fix the washed image with img2img" - this is deterministic, instant, and can't hallucinate details while it's at it.
Installing
Ships in bandifiu/ComfyUI-NN-custom-nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/bandifiu/ComfyUI-NN-custom-nodes
Restart ComfyUI (or Manager → "NN-custom-nodes"). Deps are torch, numpy, pillow - nothing heavy, no models. The pack is GPL-3.0 and uses the newer V3 backend node API, so no NODE_CLASS_MAPPINGS in the source.
One trap to avoid: if your source is actually full-range and you set min/max anyway, you'll crush your blacks and clip your highlights - the exact opposite of the problem. Check your input histogram first, or start from the 16/235 presets that most limited-range footage actually uses, and adjust from there.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| min | INT | 00–127 | — |
| max | INT | 255128–255 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |