Nodes/ComfyUI-JakeUpgrade/Int Unary Condition JK๐Ÿ‰
ComfyUI Node

Int Unary Condition JK๐Ÿ‰

Ask an integer a yes/no question

By jakechaiยทCreated 2 years agoยทUpdated 3 months agoยท 146
Int Unary Condition JK๐Ÿ‰
    • BOOLEAN
    โ—„opโ–พโ–บ
    โ—„a0โ–บ

    CM_IntUnaryCondition turns a single integer into a BOOLEAN verdict. One op dropdown, one INT input (a), six questions to ask it: IsZero, IsNonZero, IsPositive, IsNegative, IsEven, IsOdd. The output is the boolean that feeds the rest of your graph.

    What it's for

    Condition nodes are the connective tissue between math and control flow in ComfyUI. You compute a number, ask it a question, and the answer drives a switch, a gate, or a toggle. Concrete patterns:

    • IsEven / IsOdd on a seed or frame counter โ†’ alternate between two paths every other frame. This is the poor-man's scheduler and it's shockingly common in animation loops.
    • IsPositive on a delta โ†’ "did the value increase?" before you branch.
    • IsZero on a count โ†’ "did that detector find nothing?" before you skip a detail pass.
    • IsNonZero โ†’ the same intent as converting to bool, but explicit and readable.

    Because these return proper BOOLEANs, they chain straight into the pack's Bool And/OR gates or into any node with a boolean input - no conversion step.

    Installing it

    Ships with ComfyUI-JakeUpgrade:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jakechai/ComfyUI-JakeUpgrade
    cd ComfyUI-JakeUpgrade
    # Windows standalone: install.bat
    # or: python_embeded\python.exe -s -m pip install -r requirements.txt
    pip install -r requirements.txt   # non-Windows
    

    Or ComfyUI Manager, search "JakeUpgrade", install, restart.

    Gotchas

    • IsEven/IsOdd only make sense for whole numbers - which is fine, this node only takes ints anyway. If your upstream is a float, convert first or use the float condition twin.
    • IsPositive excludes zero. Zero is neither positive nor negative; ask IsZero separately if the zero case matters to your branch.
    • Manager's JakeUpgrade / IPAdapter_plus conflict warning is a false positive from the pack's replacement/ folder.
    • ComfyUI-MultiGPU causes CUDA errors with recent ComfyUI; the README says disable it.
    Category๐Ÿ‰ JK/โœ–๏ธ Math/๐ŸŽก Int

    Inputs (2)

    NameTypeDefaultDescription
    opCOMBOSelect unary condition to check
    aINT0Input integer value to check

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEANโ€”