ComfyUI Node

Max

Max (MaxNode) — ComfyUI-LogicUtils

By aria1th·Created 3 years ago·Updated 7 months ago· 123
Max
  • input1
  • input2
  • *

Max takes two values and returns the larger one. Sounds trivial, and the operation is, but its most useful trick is as a floor guard: if you feed a computed value and a minimum into Max, the output can never drop below that minimum. That's the pattern that makes it worth having in a graph where numbers are calculated rather than typed.

Here's the scenario. Something upstream computes a step count, or a dimension, or a strength, by dividing or subtracting, and under certain inputs it could come out at zero or negative, which would break whatever consumes it. Wire that value and a safe minimum into Max, and you've clamped the low end. The result is "whatever the computation gave, but never less than this." It's the cheapest insurance you can add against a downstream node getting a value it can't handle, and it's exactly the kind of guard the divide-by-zero and empty-input footguns in this pack invite.

Max ships in ComfyUI-LogicUtils, the utility collection from aria1th, the handle behind AngelBottomless who trained Illustrious XL. It's a personal toolkit, thinly documented, so the node is bare-bones and you learn it by using it.

Inputs and outputs

Two required inputs, input1 and input2, both typed * (wildcard, so they take numbers of any kind). The single output is *, and it's whichever of the two inputs is larger. Nothing else to set. There's no third "which one to prefer on a tie" option because on a tie they're equal anyway.

To use it as a floor, put your computed value on one input and your minimum on the other. To just find the bigger of two real values, wire both and read the output. Same node, two framings.

Installing it

  • ComfyUI Manager: Custom Nodes Manager, search "ComfyUI-LogicUtils," install, restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/aria1th/ComfyUI-LogicUtils, then restart.

No models, no meaningful dependencies. The pack's optional auto-installer is gated behind COMFYUI_LOGICUTILS_AUTO_INSTALL=1 (force off with COMFYUI_LOGICUTILS_SKIP_INSTALL=1), and comparing two numbers needs none of it.

Notes

The usual wildcard caveat applies: because the inputs are typed *, ComfyUI won't police what you connect, so keep it to numbers unless you've deliberately tested other types. Comparing an image to a string is not going to end well.

Output type follows the winning input, so if you're clamping and the result feeds an integer field, a Round afterward keeps things clean. Otherwise Max is one of those quietly indispensable little nodes: it does almost nothing on its own, and it saves you from a whole category of "the value went to zero and everything broke" bugs when your numbers are computed on the fly.

CategoryMath

Inputs (2)

NameTypeDefaultDescription
input1*
input2*

Outputs (1)

NameTypeDescription
**