Clamp Float
Keep a number where it belongs
- value
Sometimes the most useful node in a graph is the boring one. ClampFloat takes a float and squeezes it into a range: below the min becomes the min, above the max becomes the max, anything in between passes through. That's the entire job. No model loading, no vision, no downloads. You wire it into a chain of values and it quietly prevents a number from going somewhere it shouldn't.
Where you'll actually feel it: when a math node, a seed-derived value, or a LoRA-weight slider produces something out of bounds and the node downstream is strict about its range. Strength values, CFG scales, denoise values, any 0..1-or-bust parameter. ClampFloat is the safety net between "a computed value" and "a value a node will accept."
How it works
Three inputs:
value- the number to clamp.min- floor. Default0.max- ceiling. Default1.
One output, value (a FLOAT). Two nice details from the source: it handles min > max by swapping them instead of erroring - so a mis-wired range still does something sane - and it uses the same clamp on both ends. It also takes any float precision, so you can clamp a 0.8733… whatever into [0, 1] without rounding it.
Honestly, that's the whole feature list. The power is compositional: ClampFloat upstream of a picker or a switch means the value downstream is guaranteed in range, which makes the rest of the graph easier to reason about.
Where it fits
This one lives in the Utils category of the pack, alongside the resolution pickers and gates. It's the kind of node that looks trivial and then shows up in every workflow once you know it exists - the graph-version of defensive programming. Use it wherever a value crosses a boundary between nodes with different ideas about what's valid.
Installing it
Part of Mickmumpitz-Nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/mickmumpitz/ComfyUI-Mickmumpitz-Nodes.git
or ComfyUI Manager → search "Mickmumpitz" → install → restart. No dependencies beyond what the pack already needs (numpy, Pillow, opencv-python), and nothing to download.
Troubleshooting
- Value doesn't change - it's in range. That's success, not a bug.
- Clamping wrong direction - double-check
minandmax; the swap-when-inverted behavior means a flipped pair still works, just with your intent inverted. - Need it on an INT instead - this is float-only. Pipe the output through whatever converts to int, or reach for a different node.
- "This is trivial, why does it exist?" - fair. But next time a sampler rejects a 1.3 denoise, you'll remember it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| value | FLOAT | 0.00-1000000000–1000000000 | — |
| min | FLOAT | 0.00-1000000000–1000000000 | — |
| max | FLOAT | 1.00-1000000000–1000000000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | FLOAT | — |