Nodes/ComfyUI-RvTools_v2/Integer Multi-Switch
ComfyUI Node

Integer Multi-Switch

First non-None wins, for numbers

By r-vage·Created about a year ago·Updated 5 months ago· 23
Integer Multi-Switch
    • int
    input1
    input2
    input3
    input4
    input5

    The sibling of String Multi-Switch, done for integers. Feed it up to five INT inputs and it returns the first one that isn't None, in order. Same logic, same "which slot wins depends on what's connected, not on a widget" behavior - the only difference is the data type riding through.

    How it works

    A five-way if input1 is not None: return input1; elif ... chain, falling back to None when every input is empty. Bypass an upstream node and its integer contribution vanishes, so the switch rolls down to the next connected source. That makes it a natural fit for the author's options-menu pattern: several bypassable branches feeding one numeric slot, with the always-on default parked in the last position.

    The inputs that matter

    • input1 through input5 - wire-only INT inputs (forced input, so no widget to type in).
    • Output int - the winning value, ready for a seed, width, height, steps, or batch-size port.

    The ordering rule from the README applies as much here as for strings: put the source that's always enabled on the last input, because a never-None source in slot 1 makes every later slot irrelevant.

    When you'd actually use it

    A seed bank, basically. Drop a few different seed sources (a random seed node you can bypass, a fixed-seed node, a per-project seed from a settings group) into inputs 1–3, and the active one flows through without you touching a switch widget. The same pattern works for steps or a resolution value when you're toggling between "fast preview" and "final render" branches by muting whole groups.

    Installing

    cd ComfyUI/custom_nodes
    git clone https://github.com/r-vage/ComfyUI-RvTools_v2
    

    Restart ComfyUI or use ComfyUI Manager (search "ComfyUI-RvTools_v2"). No models, no heavy dependencies.

    Gotchas

    Same pair of caveats as its string twin: 0 is a perfectly valid integer, so "first non-None" means a zero still wins over anything in later slots - that's correct behavior, just remember it when you're debugging a batch size that keeps coming out as 0. And this pack is deprecated in favor of ComfyUI_Eclipse, which inherits the multi-switches. Old workflows referencing the deleted v1 RvTools repo's node names will error out and ComfyUI Manager can't install those - the v2 names (what you see here) are the ones that still work.

    Category🫦 RvTools II/ Multi-Switches

    Inputs (5)

    NameTypeDefaultDescription
    input1optINT
    input2optINT
    input3optINT
    input4optINT
    input5optINT

    Outputs (1)

    NameTypeDescription
    intINT