Nodes/ComfyUI LC123 Nodes/LC Float Compare
ComfyUI Node

LC Float Compare

Keep the bigger (or smaller) of two numbers

By lonecatone23·Created 2 months ago·Updated 3 days ago· 18
LC Float Compare
    • value
    a0.00
    b0.00
    modelargest

    Sometimes a workflow needs to be a tiny program, and tiny programs need to pick the larger or smaller of two numbers. LC Float Compare (LCFloatCompare) is the LC123 pack's node for exactly that: two floats in, one float out - the largest or smallest, depending on a mode switch. It's about as close to a no-nonsense utility as ComfyUI gets.

    It lives in the LC123/utils category, the same drawer as the pack's boolean helpers, seed jumping, and combo selectors - the "make the graph behave like logic" shelf. And per the comfyui-node-plumbing docs, this is the kind of plumbing node that turns a pipeline into something with actual decisions in it.

    The inputs

    Three, and the first two are worth a note:

    • a, b (FLOAT) - the two values. Both have forceInput, which means they're meant to be wired from other nodes rather than typed. They still accept typed numbers, but the design intent is "compare two computed values."
    • mode - largest (default) or smallest.

    Output: value (FLOAT), the winner. The comparison is a simple max/min - no tolerance, no clamping, just the larger or smaller.

    Why you'd reach for it

    It's the building block for guardrails and choices:

    • Clamping a CFG or denoise - take your slider value and 8.0, output the smallest, and you've built a hard ceiling without a script.
    • Max-of-two for resolutions - pick the larger of two computed widths so a branch never produces a too-small latent.
    • Falling back sensibly - compare a node's output to a floor and keep the larger, so downstream never sees a degenerate 0.

    Real talk: it's a very small node, and its niche sibling LC Int Compare handles the integer version in the same file. You reach for this when a float is genuinely computed and you want the graph to choose for you rather than hardcoding.

    Install

    Part of ComfyUI_LC123_nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes
    

    or ComfyUI Manager, then restart. No dependencies, no models - it's max(a, b) in a hat.

    Where people get burned

    The forceInput quirk is the one that gets people: because the inputs are forced to wire-in, typing values and expecting them to stick in a saved workflow can behave differently than a normal float widget - if your typed numbers seem to be ignored, wire a Primitive or value node in instead. Also, there's no equality branch - if a and b are equal, you just get that value back, which is fine until you expected a three-way result. This is a quiet niche pack with no community lore to consult, so the source in lc_compare.py (a dozen lines) is the real documentation.

    CategoryLC123/utils

    Inputs (3)

    NameTypeDefaultDescription
    aFLOAT0.00-1000000000–1000000000First float.
    bFLOAT0.00-1000000000–1000000000Second float.
    modeCOMBOlargestReturn the larger or smaller of a and b.

    Outputs (1)

    NameTypeDescription
    valueFLOAT