ComfyUI Node Runs on cloud

ImpactMinMax

The smaller or larger of two values, as an int

By ltdrdata·Created 3 years ago·Updated 4 months ago· 3,242
ImpactMinMax
  • a
  • b
  • INT
modetrue

Filed under ImpactPack/Logic/_for_test in the pack itself and absent from the README's own node list - this is one of the pack's least-documented corners. It's genuinely useful when you need it, but go in knowing you're on your own for the fine print more than usual.

What it does

It compares two values and outputs whichever is smaller or larger, depending on a toggle. Simple in concept - the kind of thing you reach for inside a loop-driven workflow when you need to clamp a counter, pick the larger of two computed sizes, or keep a running maximum across iterations without hand-rolling comparison logic out of ImpactCompare and a conditional branch every time.

The one thing worth being upfront about: neither the README nor this pack's own documentation says which state of the mode toggle gives you the minimum and which gives you the maximum. There's no bullet, no tooltip text captured anywhere to check against. If you're relying on this node for something that matters, wire in two known values, flip mode, and confirm which way it goes before trusting it in a real pipeline - don't assume from the name alone.

The inputs and output

  • mode (BOOLEAN, default true) - picks min or max. Which is which isn't documented; verify it yourself with test values.
  • a, b - both wildcard-typed (*), so you can feed numbers or anything else that has a sensible ordering. Numbers are the realistic case.

Output is a single INT. Worth flagging: the output type is a hard INT regardless of what you feed in, so if a and b are floats, expect them to get cast down - a comparison between 3.7 and 3.2 will still correctly pick 3.7 as the max, but what comes out the other side is truncated to an integer, not the original float. If you need the fractional part preserved, this isn't the node for that.

Installing it

No separate install - it's part of the pack. Via ComfyUI Manager: search ComfyUI Impact Pack, Install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack
cd ComfyUI-Impact-Pack
pip install -r requirements.txt

(portable: python_embeded\python.exe -m pip install -r requirements.txt), restart. No models needed.

Common issues

Beyond the undocumented mode direction already flagged above, watch the wildcard typing - it'll happily let you wire in things that don't have a meaningful ordering, and you'll get a nonsensical or erroring comparison rather than a clean type error at connection time. Keep a and b restricted to actual numbers unless you know exactly what comparison you're asking for.

And the honest bottom line: this lives in the pack's own _for_test category for a reason. Treat it as a working but lightly-maintained utility rather than a polished, thoroughly-documented node - test it against known values before you build something you depend on around it.

CategoryImpactPack/Logic/_for_test

Inputs (3)

NameTypeDefaultDescription
modeBOOLEANtrue
a*
b*

Outputs (1)

NameTypeDescription
INTINT