LimitNumber Input ♾️Mixlab
LimitNumber — A Safety Clamp for Numbers Already in Your Graph
- number
- number
Don't confuse LimitNumber with IntNumber, even though they live in the same Mixlab/Input category and both have min/max fields - they solve different problems. IntNumber is a standalone input widget, a value you set by hand. LimitNumber is a clamp: it sits mid-graph and forces a number that's already flowing through your workflow to stay inside bounds you set, regardless of what produced it.
That distinction matters because the situations where you'd want each are different. You reach for IntNumber when you're the one typing the value in. You reach for LimitNumber when something upstream - a math node, a random generator, someone else's output you don't fully control - might occasionally hand you a number outside what the next node can actually accept, and you'd rather clamp it quietly than have the workflow error out mid-run.
The node itself is deliberately unopinionated about what kind of number it's clamping: number, the required input, is typed as the wildcard *, so it'll happily take an INT or a FLOAT from whatever's upstream. min_value and max_value set the floor and ceiling - defaults are 0 and 1, but both are adjustable, with min_value allowed down to a very large negative number and max_value up to a correspondingly large positive one. The output, number, is the same wildcard type as the input and just reflects the clamped value back out. Feed it a number inside the bounds and it passes through untouched; feed it something outside and it gets pinned to whichever edge it crossed.
One real limitation worth knowing before you rely on it: min_value and max_value are both typed as INT in the node's schema. If you're clamping a FLOAT value, your bounds are still whole numbers - you can't set a ceiling of, say, 2.5. For most uses (batch counts, step counts, anything integer-shaped) that's a non-issue. If you were hoping to use this as a fine-grained float clamp, it won't do fractional bounds, and there's no workaround inside the node itself - you'd need a separate math node to handle the fractional case.
Installing it is the same as every node in this pack. Through ComfyUI Manager: search "comfyui-mixlab-nodes," install, restart - the easiest route for most people. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/shadowcz007/comfyui-mixlab-nodes.git
cd comfyui-mixlab-nodes
install.bat
or pip3 install -r requirements.txt in a venv, or the embedded-python pip invocation on a portable Windows build (../../../python_embeded/python.exe -s -m pip install -r requirements.txt). Restart ComfyUI once it finishes.
Keep in mind this pulls in the entire Mixlab pack, not just this one clamp node - 3D tools, TTS, VQA, layer compositing, and a long list of other categories come along whether you use them or not. That's the tradeoff with a kitchen-sink pack like this one: convenient if you end up wanting more than one of its nodes, unnecessary weight if you genuinely only wanted LimitNumber. Since this node has no models to download and no external dependency of its own, there's nothing else to troubleshoot beyond making sure the pack loaded at all - if LimitNumber doesn't show up in the node search after install, that's a pack-wide install problem, not something specific to this node, and the fix is the same as for any missing custom node: check the ComfyUI startup console for an import error from comfyui-mixlab-nodes and re-run the requirements install if you see one.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| number | * | — | |
| min_value | INT | 00–18446744073709550000 | — |
| max_value | INT | 11–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| number | * | — |