ComfyUI Node

Multi Min/Max

Min and max across up to eight inputs, done right

By drmbt·Created 2 years ago·Updated 7 months ago· 6
Multi Min/Max
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • *
modetrue

Multi Min/Max does one thing and does it cleanly: it finds the minimum or maximum among a pile of inputs. a and b are required, and you can keep wiring c through h up to a total of eight. Flip the mode toggle to max (default) or min, and the single output hands back whichever value wins. That's the whole node - and it's the right shape, because a min/max node is a boring utility you want to never think about.

Where it comes from and why it matters

It's an explicit fork of the Impact Pack's MinMax node, extended from two inputs to eight. If you've used Impact Pack (the ltdrdata node pack that basically owns FaceDetailer and a lot of the ecosystem's wildcard/upscale plumbing), you already know this node's personality - it's the same ergonomics, just more inputs. The KB's impact-pack panel calls that pack "load-bearing infrastructure," and this node borrows its no-nonsense spirit.

The details that make it worth using over a hand-rolled chain:

  • Type preservation. Because the inputs are typed * (ANY), the output is the same type as whatever won. Give it a c that's a FLOAT and it returns a FLOAT; give it a string and it returns the max string lexicographically. You don't get a surprise int cast in the middle of a workflow.
  • Any comparable type. Numbers, strings, even tuples - anything Python can compare works, because the source is just max(inputs) / min(inputs) after filtering out unconnected inputs.
  • Min-compatible defaults. a and b are required, but ch are optional; unconnected inputs are simply dropped from the comparison, so you can wire two today and seven later without rewiring.

When you'll actually reach for it

The classic case: you have several alternative values for the same setting - a clamp, a budget, a resolution cap - from different branches of a workflow, and you want the largest (or smallest) one to win. One common pattern is resolution clamping: feed it several dimension candidates and cap the result so your sampler doesn't try to generate at a size your GPU can't handle. Another is scheduling: pick the max of several step-count suggestions so nothing under-delivers. Because the output keeps its type, the result plugs straight into an INT or FLOAT socket with no conversion node.

Honestly, for two inputs a plain Switch does the job, but as soon as you're comparing three or more values this is the node. And since it inherits from Impact Pack lineage, the behavior is predictable in exactly the way you want a math utility to be.

Install

It's in drmbt/comfyui-dreambait-nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/drmbt/comfyui-dreambait-nodes

then restart ComfyUI (or ComfyUI Manager, search "comfyui-dreambait-nodes"). Caveat as always with this pack: installing brings the whole bundle's dependency list, heavy ML deps included, even though this node is a dozen lines of pure Python. If you already run the pack for Load Media or MiniCPM-V, it's free value.

CategoryMath

Inputs (9)

NameTypeDefaultDescription
modeBOOLEANtrue
a*
b*
copt*
dopt*
eopt*
fopt*
gopt*
hopt*

Outputs (1)

NameTypeDescription
**