ComfyUI Node

Int Operations

The pocket calculator for your graph — add or subtract two ints mid-workflow

By baicai99·Created 2 years ago·Updated about a year ago· 15
Int Operations
    • result
    num10
    num20
    operation

    Int Operations does exactly two things: adds two integers or subtracts one from another. Feed it num1 and num2, pick "add" or "subtract" from the dropdown, and it hands you the result as an INT. No models, no torch tricks, nothing clever - and for once "nothing clever" is the right engineering call. Half of graph-building in ComfyUI is feeding integer offsets to nodes that want them, and doing that arithmetic by hand between workflow edits is how you end up with frame ranges that are off by one.

    The mechanism is a three-line if operation == "add" branch. The one subtle detail: this node is flagged as an output node, so the result shows up in ComfyUI's sidebar as a visible value. You can literally watch your addition update as you drag the inputs, which is more than most utility nodes give you for free.

    Where it actually earns its keep: computing frame offsets on the fly. Want frames 16 through "16 plus however many you decide later"? Wire num1 into a shared offset, num2 into the amount, and changing one number ripples through the graph. That was the author's original use - and the pack README is refreshingly honest that the IntOperations-based approach for selecting frames got so cumbersome that he built Frame Selector to replace it. So this node is, fairly openly, the legacy tool of the pack: still useful for ad-hoc arithmetic, but if you're using it to compute a frame range, the pack's own author would tell you to use Frame Selector instead and save yourself the wiring.

    The inputs are just num1, num2, and operation - there's nothing to get wrong except expecting more than add/subtract. No multiply, no divide, no clamp, no negation. The dropdown has exactly two options. If you need richer math you'll outgrow this node fast - rgthree's Power Puter or a generic expression node will do more - but for a single +5 or −16 in a workflow, this is the least-friction thing that works.

    Install is shared with the whole pack: ComfyUI Manager → search "ComfyUI-FrameSkipping", or clone the repo into custom_nodes and restart. It ships with no dependencies beyond ComfyUI's own Python - there's no requirements.txt in the repo - so there's no reason not to have it if the pack is already installed. You'll find it under the "baicai" menu.

    Categorybaicai/Operations

    Inputs (3)

    NameTypeDefaultDescription
    num1INT0
    num2INT0
    operationCOMBO2 options: add, subtract

    Outputs (1)

    NameTypeDescription
    resultINT