Number Remap
Move a number from one scale to another without thinking
- remapped
Somewhere in almost every ComfyUI workflow there's a value on the wrong scale: a strength stuck at 0–1 that needs to be a 0–100 percentage, a 512–1024 width that needs to be a 0–1 factor, a raw number that needs normalizing. Number Remap is the node that translates between scales linearly. It's "map a value from one range to another" - the formula behind normalized_value * (to_max - to_min) + to_min, minus the homework.
It's part of DebugPadawan's ComfyUI Essentials, a pure-Python utility pack. Zero models, zero GPU - this is arithmetic in a wrapper.
How it works
Five required inputs, all FLOATs:
value- the number you're translating (default 0.5)from_minandfrom_max- the rangevaluecurrently lives in (defaults 0 and 1)to_minandto_max- the range you want it in (defaults 0 and 100)
One output: remapped (FLOAT).
The math: first it normalizes the value to 0–1 by subtracting from_min and dividing by the span ((value - from_min) / (from_max - from_min)), then it stretches that 0–1 onto the target range (to_min + normalized * (to_max - to_min)). Because it's linear, 0.5 in a 0–1 range becomes 50 in a 0–100 range - the README's example.
The obvious use cases
- 0–1 to 0–255 for color work, or the reverse.
- Normalizing a value for a model. Many sampling parameters want 0–1; if you're computing a CFG or weight in arbitrary units, remap it into the range the consumer expects.
- Percent to fraction and back - it's the two-way street: remap from 0–100 to 0–1 as easily as the other direction.
- Cleaning up after math. Pair it with
Number Clamp(same pack) to both rescale and pin the result to a valid window.
Installing it
The whole pack installs in one shot. ComfyUI Manager, searching for "DebugPadawans-ComfyUI-Essentials," or:
cd ComfyUI/custom_nodes
git clone https://github.com/DebugPadawan/DebugPadawans-ComfyUI-Essentials
Then restart ComfyUI. Requirements are numpy, torch, and opencv-python - all already present in stock ComfyUI - and there are no model files to fetch. Search carefully: "DebugPadawan's ComfyUI Essentials" is a different, smaller pack than cubiq's "ComfyUI Essentials," which is in maintenance mode.
Gotchas
- If
from_minequalsfrom_max, the node raises aValueError- you can't normalize over a zero-width range. That's the main way this node fails, and it fails loudly rather than silently, which is honestly polite. - It extrapolates, it doesn't clamp. A
valueof 1.5 in a 0–1 source range happily remaps to 150 in a 0–100 target. If you need to pin outliers, chain aNumber Clampafter it. - Linear only. This won't do easing curves or log scales; for those you're into custom-node territory.
- It always outputs FLOAT, so a node demanding INT needs a conversion step (the pack has one).
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| value | FLOAT | 0.50 | — |
| from_min | FLOAT | 0.00 | — |
| from_max | FLOAT | 1.00 | — |
| to_min | FLOAT | 0.00 | — |
| to_max | FLOAT | 100.00 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| remapped | FLOAT | — |