min
The ceiling you clamp to when things get too big
- value1
- value2
- *
min takes two numbers and returns the smaller. And like its sibling max, the boring description hides the actual job: this is the node that says "never let this value go above X." Every time a computed number in your workflow threatens to overshoot - a resolution that must fit in memory, a step count with a hard cap, a weight that can't exceed 1.0 - min is the two-widget guardrail.
From the Basic data handling pack, it's as simple as a node can be, and it's one of the few I'd call genuinely load-bearing once you build any automation at all.
How it works
Python's built-in min() under the hood. Two required inputs, both accepting FLOAT or INT (defaults 0):
value1value2
The output is the smaller of the two, returned as a * wildcard type - ComfyUI lets you wire it into FLOAT or INT sockets alike. That flexibility matters more than it sounds: your inputs might be floats from arithmetic while your target socket wants an integer, and this node lets you defer that decision.
The pattern: clamping from above
min(value, cap) is a hard upper bound. Concrete uses:
- Resolution / latent size caps - when a width formula can overshoot your VRAM budget, clamp it.
- Step and CFG ceilings - keep a workflow variable inside what the sampler can handle.
- Any "at most" constraint - that's literally all
mindoes, and it does it readably.
For a full clamp (bounded on both sides), chain it with max from the same pack: min(max(value, lo), hi). The order matters - clamp the bottom first, then the top - and both halves are right there in the menu.
One thing to notice
Since the output is a wildcard, a float input gives you a float result even if both values happen to be whole. If the next node genuinely needs an INT type (step counts, indices), run the result through floor or an explicit cast rather than assuming the wiring will coerce it. ComfyUI is usually forgiving here, but "usually" is how 2am errors happen.
Installing it
The whole Basic data handling pack is dependency-free - no models, no pip requirements, which honestly makes it a breath of fresh air next to the packs that need three conflicting versions of the same library. Install via ComfyUI Manager (search "Basic data handling") and restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
Restart, and min is under Basic/maths.
Bottom line
min and max together are the cheapest, most readable clamping system in ComfyUI, and they never need a conditional. If you've been writing if value > cap style logic with control-flow nodes just to bound a number, stop - this is the tool, and it's free.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| value1 | FLOAT,INT | 0 | — |
| value2 | FLOAT,INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |