ComfyUI Node

Maximum

The biggest of 2 to 10 numbers, in one node

By silveroxides·Created 7 months ago·Updated 3 months ago· 3
Maximum
  • values
  • MATCHTYPE

Maximum is one of those nodes you don't think you need until you need it three times in one afternoon. It takes between two and ten numbers and returns the largest one. That's it. But "that's it" is doing real work: ComfyUI core has no basic max, so without this you're building a comparison chain with primitive nodes, which is fiddly, ugly, and a pain to read back later.

The classic use is range-guarding. Resolution values, CFG, denoise strength, batch sizes - all the numbers that flow between nodes in a big workflow sometimes come out of a calculation smaller than you'd ever want. A quick max(value, floor) keeps a computed value from collapsing to something unusable. It's also the natural companion to MathMin: clamp a number to a minimum with Max, to a maximum with Min, and to a band with both.

How it works

The mechanism is about as honest as it gets. values is an autogrowing list - two to ten numeric inputs, added with the plus button on the node. On execution the node runs Python's built-in max() over all of them and returns the winner. No magic, no state, nothing cached. Both ints and floats are accepted (the inputs use a type template that allows either), and the output type matches what you put in.

It's also deterministic, which matters more than it sounds: feed it the same inputs and you get the same output every run, so it's safe to use in the middle of a graph without worrying about cache-invalidating side effects.

The inputs that matter

  • values (2–10): the numbers to compare. Drag wires from any int or float output, or type values in.

Output is the maximum as a MATCHTYPE number.

One thing to note: because inputs are added with the plus button, people occasionally wire only one value in and get confused when nothing happens. The node requires at least two. If you only have one number, you don't need this node.

Install

This is part of the ComfyUI-LogicMath pack. Install through ComfyUI Manager (search "ComfyUI-LogicMath", Install, restart) or clone it manually:

cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-LogicMath

No pip dependencies, no model files. One catch: the pack targets ComfyUI's newer extension API, so if the nodes don't appear, update ComfyUI before you start hunting for other causes.

Common issues

  • Only one value accepted / no output - the node needs two or more inputs by design.
  • Max returns the wrong "type" - if you feed a float and an int, the result type follows what Python's max() returns; mixed input gives you whatever it gives you, which is fine for wiring into a number input.

If your graph already has a Max somewhere in a LoRA or size utility, this node won't replace a widget you love. But for an ad-hoc "don't let this number get below X," it's the shortest path that stays readable when you come back to the workflow in three months.

Categoryutils/math

Inputs (1)

NameTypeDefaultDescription
valuesCOMFY_AUTOGROW_V3

Outputs (1)

NameTypeDescription
MATCHTYPECOMFY_MATCHTYPE_V3