Number Remap Range
Normalize any number into the range you actually need
- pre_multiply
- clamp_min
- clamp_max
- output_number
- float_string
- bool
Every workflow eventually needs the same conversion: you have a number living in one range, and a node that only understands another. Your cursor is at 0.73 of a slider, but the LoRA strength wants 0.4–1.2. Your seed produced a value in 0–1, but the CFG node wants 4–12. Number Remap Range is the linear mapping node that does exactly that one job, with optional clamping so the output never leaves your target range. It's the kind of thing you can hand-roll with three math nodes - and then you've got three math nodes clogging your graph instead of one.
It lives in the pack's DRMBT nodes category alongside Number ++, and it shares that node's DNA: an any_typ-tolerant design, a formatted string output, and a boolean you can use to drive a switch. It's also an output node, so the result shows up in the UI for a quick sanity check.
How it works
The mapping is the standard linear remap you remember from school:
output = (number - from_min) / (from_max - from_min) * (to_max - to_min) + to_min
Fraction of the way through the source range, scaled to the target range. The optional pre_multiply (default 1) scales the input before the mapping, and clamp_min / clamp_max - optional, both off by default - clamp the result so it stays inside your target. That last part is worth calling out: without clamping, a number outside the source range will happily extrapolate past the target range, which is sometimes exactly what you want (overshoot) and sometimes a bug you didn't notice. When in doubt, wire a clamp.
Like Number ++, the optional numeric inputs are any_typ - int, float, or a string that parses as a number all work, which saves you converter nodes when values arrive as text.
The inputs and outputs that matter
- number - the value to remap.
- from_range_min / from_range_max - the range your input currently lives in (defaults 0 and 1).
- to_range_min / to_range_max - the range you want it in (defaults 0 and 1).
- pre_multiply - optional scale applied before mapping (default 1).
- clamp_min / clamp_max - optional hard limits on the output.
Outputs: output_number (FLOAT) is the one you'll wire into whatever needs it; float_string (STRING) is the formatted text for filenames/prompts; bool (BOOLEAN) is true when the result is positive, useful for conditional routing.
Installing
Number Remap Range ships in the drmbt/comfyui-dreambait-nodes pack. Install via ComfyUI Manager (search comfyui-dreambait-nodes) or:
cd ComfyUI/custom_nodes
git clone https://github.com/drmbt/comfyui-dreambait-nodes
# restart ComfyUI
No models, no extra dependencies - pure math.
Where people get tripped up
The most common mistake is feeding it the wrong from range. The node can't infer where your number currently sits - you have to tell it, and if you lie, the mapping silently produces garbage. Second: if from_range_min == from_range_max, you get a divide-by-zero, which is on you, not the node. And the unclamped extrapolation mentioned above - it's the quiet one that bites in animations where a value drifts past its nominal range. Honestly, this node is so simple that the only real question is why ComfyUI core doesn't ship it. If you've got a control signal in the wrong units, this is a five-second fix.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| number | FLOAT | 0.000 | Main number parameter |
| from_range_min | FLOAT | 0.000 | — |
| from_range_max | FLOAT | 1.000 | — |
| to_range_min | FLOAT | 0.000 | — |
| to_range_max | FLOAT | 1.000 | — |
| pre_multiplyopt | * | 1 | multiply by an optional number |
| clamp_minopt | * | optional_clamp | |
| clamp_maxopt | * | multiply by an optional number |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| output_number | FLOAT | — |
| float_string | STRING | — |
| bool | BOOLEAN | — |