Nodes/RES4LYF/Sigmas InvLerp
ComfyUI Node Runs on cloud

Sigmas InvLerp

Turn raw sigma values into a 0-1 position within a range

By ClownsharkBatwing·Created 2 years ago·Updated 21 days ago· 1,222
Sigmas InvLerp
  • sigmas
  • SIGMAS
min_value0.00
max_value1.00

If you've ever used InverseLerp in a game engine or a shader, this is the exact same idea applied to a sigma schedule. Where a regular lerp takes a 0-1 position and gives you back a value in some range, inverse lerp does the opposite: it takes a value and tells you where in a given range it falls, as a 0-1 fraction. Sigmas InvLerp runs that per element of your schedule.

How it works

For each value in sigmas, the node computes (value - min_value) / (max_value - min_value). A value equal to min_value maps to 0; a value equal to max_value maps to 1; anything in between lands proportionally, and anything outside the range lands below 0 or above 1. It's the mirror image of Sigmas Lerp, which blends two schedules by a 0-1 factor - this node produces the 0-1 factor from raw values instead.

The inputs and outputs that matter

  • sigmas (SIGMAS, required) - the schedule to remap.
  • min_value (default 0, range -10000 to 10000) - the value that should map to 0.
  • max_value (default 1, range -10000 to 10000) - the value that should map to 1.

Output is a single SIGMAS list, containing (usually) 0-1 normalized values rather than actual noise-level magnitudes.

Why you'd reach for this

This is a genuinely useful utility node, more so than most of RES4LYF's sigma-math corner - the normalized output is exactly the kind of thing you want as an input elsewhere: feeding it into Sigmas If's condition_sigmas as a clean 0-1 progress signal, using it to drive a modulate-style operation in another node, or just checking where in a schedule's actual range a given step sits. Note carefully, though: the output of this node is no longer a valid sigma schedule in the "noise level a sampler expects" sense - it's a 0-1 progress curve. Don't wire it straight into a sampler's sigmas input expecting it to work as noise levels; it won't.

How to install it

  • ComfyUI Manager - search "RES4LYF", install, restart.
  • Manual - activate your venv, cd ComfyUI/custom_nodes && git clone https://github.com/ClownsharkBatwing/RES4LYF, cd RES4LYF, pip install -r requirements.txt (portable builds: use the embedded pip.exe). Restart.

Common issues & troubleshooting

Set min_value/max_value to your schedule's actual range, not the defaults. Out of the box, min_value = 0 and max_value = 1 will produce nonsense on a typical sigma schedule that peaks well above 1 - every value near the top of your schedule will map far above 1 instead of landing in a clean 0-1 range. Check your scheduler's actual peak sigma (or just run Sigmas Split-Value/a preview to look at the raw numbers) and set the range to match before relying on this node's output being properly normalized.

Feeding the output directly into a sampler produces garbage. The whole point of this node is to strip away the magnitude information that makes a schedule a schedule - its output is a position indicator, not a set of noise levels. It belongs feeding into other logic nodes, not straight into a sampler's sigmas input.

Values outside [min_value, max_value] in the input produce results outside [0, 1] in the output, which isn't a bug - it's the same behavior as a standard inverse-lerp. If you need the result strictly clamped to 0-1, add a clamp step afterward.

CategoryRES4LYF/sigmas

Inputs (3)

NameTypeDefaultDescription
sigmasSIGMAS
min_valueFLOAT0.00-10000–10000
max_valueFLOAT1.00-10000–10000

Outputs (1)

NameTypeDescription
SIGMASSIGMAS