Nodes/KJNodes for ComfyUI/Remap Image Range
ComfyUI Node Runs on cloud

Remap Image Range

Stretch or compress pixel values into a new range

By kijai·Created 3 years ago·Updated a day ago· 2,908
Remap Image Range
  • image
  • IMAGE
min0.00
max1.00
clamptrue

This one does exactly what the name says, and that's the whole appeal: Remap Image Range takes an image and linearly maps its pixel values into whatever min/max range you specify, instead of the standard 0–1. It's a one-node fix for a class of problem that otherwise sends people digging through math-node chains.

Why you'd want this

ComfyUI images are normally floats in the 0–1 range. Most of the time you never think about it, because every node in a normal pipeline expects and produces that range. But you'll hit edges where that assumption breaks: you're doing something with a latent-adjacent visualization that expects -1 to 1, you're feeding a downstream tool (a mask blend, a compositing trick, a hand-rolled color grade) that wants headroom above 1.0 or below 0 to punch contrast, or you've got an image that's technically valid but visually crushed and want to stretch its actual value range back out to use the full 0–1 span. Remap Image Range is the node you reach for in all of those cases instead of chaining together subtract/multiply/divide math nodes by hand.

How it works

It's a straight linear remap: whatever the image's current value range is, it gets rescaled so it lands between your min and max. Set clamp on and anything that would fall outside min/max after the remap gets clipped to the boundary instead of wrapping or going negative-weird; turn it off if you deliberately want values to spill past the range for a downstream node that can handle it.

The inputs and outputs that matter

  • image (IMAGE) in, remapped IMAGE out - drop it wherever in your graph you need the range changed.
  • min (default 0, range -10 to 1) - the floor of the output range.
  • max (default 1, range 0 to 10) - the ceiling of the output range.
  • clamp (default true) - hard-clips anything outside [min, max] after remapping. Leave it on unless you specifically need values outside the range to survive.

Between min and max you can build the standard 0–1→-1–1 remap, push the range wider for contrast tricks, or compress it narrower if you're deliberately flattening an image's dynamic range for a downstream effect.

Installing it

Comes with the pack, no separate steps:

  • ComfyUI Manager - search KJNodes for ComfyUI, install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, then pip install -r ComfyUI-KJNodes/requirements.txt, restart.

No models, no heavy dependencies - it's pure tensor math, so it's genuinely free to add to any workflow.

Common issues & troubleshooting

Output looks broken/inverted after using it. Double-check you actually wanted clamp on. With it off, values outside your [min, max] window aren't clipped - they just pass through unbounded, and if a downstream node (like a straight Save Image) assumes 0–1 input, values above 1 or below 0 will look wrong when it tries to display them, even though the math is correct.

Nothing visibly changes. If your min/max happen to match the image's existing effective range (0 and 1, the defaults), you'll get back what you put in - this node doesn't auto-detect anything, it just applies the numbers you gave it. Set min/max to something that actually differs from 0–1 to see an effect.

Trying to use this as a tone-mapping or exposure tool. It's a linear remap, not a curve - it won't recover blown highlights or lift shadows selectively the way a proper tone curve would. For that kind of nonlinear correction you want a dedicated color/levels node; this one is for range conversion, not creative grading.

CategoryKJNodes/image

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
minFLOAT0.00-10–1
maxFLOAT1.000–10
clampBOOLEANtrue

Outputs (1)

NameTypeDescription
IMAGEIMAGE