LC Int Compare
The bigger-of-two node your dynamic resolutions keep needing
- value
Somewhere in your workflow you will need the answer to "which of these two numbers is bigger?" - a resolution floor, a minimum step count, the longer of two dimensions feeding a latent. ComfyUI core doesn't hand you a node for that out of the box. LC Int Compare is the two-second fix: feed it two integers, pick largest or smallest, get one integer back. It's plumbing, and it's the right kind of plumbing: tiny, typed, and hard to misuse.
How it works
Two integer inputs, a and b, both clamped to a huge ±2^32-ish range, plus a mode dropdown with two choices - largest (default) or smallest. It compares and returns whichever you asked for. That's the entire mechanism, and it's deliberately dumb. Both inputs are forceInput, so they show as sockets rather than widgets, which means you're meant to wire values in from other nodes rather than typing them. The single output is value (INT).
The real utility is what you chain around it. It's the "clamp a value to a floor or ceiling" primitive: largest(computed, minimum) guarantees you never generate below a resolution you care about, smallest(computed, max) keeps a batch count or a latent dimension from running away. It's the same family of value-nodes-as-graph-logic that the plumbing layer is built on - a math decision expressed as a node instead of a Python script.
The few things to know
aandbare interchangeable - it's a pure comparison, order doesn't matter.modeis a dropdown, not a wire. Convert it to an input if you want a toggle elsewhere in the graph to flip between "use the bigger" and "use the smaller."- Output feeds anything that takes an INT - resolution nodes, batch counts,
LC Sampler Configurestep values, whatever.
Install
Part of ComfyUI LC123 Nodes (MIT, 89 nodes). ComfyUI Manager → search "ComfyUI LC123 Nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes
Restart after. No extra pip packages, no models to download. On cloud hosts like RunningHub, the platform installs the pack on request.
When it isn't enough
Two values is all it does. If you need the largest of five, stack two of these, or reach for something list-oriented - but honestly, most real workflows resolve down to "is the incoming number under my floor?" and that's exactly the two-input case. If you're comparing floats instead of ints, this same pack has LC Float Compare with the identical shape. Don't overthink it; wire it and move on.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| a | INT | 0-4294967295–4294967295 | First integer. |
| b | INT | 0-4294967295–4294967295 | Second integer. |
| mode | COMBO | largest | Return the larger or smaller of a and b. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | INT | — |