M Int Min
The cheap way to put a floor under a value
- min
Sometimes you don't want to clamp a value to a range, you just want to guarantee it never exceeds a limit. That's min(a, b): the smaller of two numbers, no threshold logic, no modes. M Int Min returns exactly that, as an INT named min.
The one-line mechanism - return a if a < b else b - is trivial, but the uses aren't:
- Capping a computed value. "Steps, but never more than 50" is
min(steps, 50). Same shape for batch size ("as many as the formula says, capped at 8"), and it's the lower-bound half of what M Int Clamp does in one direction. - Lower of two sources. When you have two independent paths producing a value and you want the conservative one,
minpicks it. - Flooring with intent. Combined with M Int Max, you can build a two-node clamp:
mincaps the top,maxlifts the bottom. More explicit than a single clamp node when you want the two halves visible and independently tweakable.
Inputs a and b are signed 32-bit INT, both defaulting to 0. Output is the smaller value as a plain INT, ready to feed any integer socket or further math. It composes with the pack's arithmetic nodes the way you'd expect - min after a multiply is the standard "scale, then cap" idiom.
It ships in ComfyUiNodes (repo Madlumi/ComfyUiNodes, author "Madanie"), a small personal pack of integer math, string helpers, and workflow-glue nodes. Install via ComfyUI Manager - search "ComfyUiNodes" - or:
cd ComfyUI/custom_nodes
git clone https://github.com/Madlumi/ComfyUiNodes
Restart ComfyUI after that. No pip requirements or model downloads. Find it under Add Node → mnodes → int.
Honest note: min and max are the kind of node you don't need until you do - but the first time a computed batch size overflows your VRAM, you'll want one in your graph.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| a | INT | 0-2147483648–2147483647 | — |
| b | INT | 0-2147483648–2147483647 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| min | INT | — |