Nodes/JPS Custom Nodes for ComfyUI/Integer Switch (JPS)
ComfyUI Node

Integer Switch (JPS)

A 5-to-1 switch for plain numbers

By JPS-GER·Created 3 years ago·Updated 2 years ago· 100
Integer Switch (JPS)
    • int_out
    select
    int_1
    int_2
    int_3
    int_4
    int_5

    The plainest node in the pack, and one of the more useful ones: five optional integer inputs, one selector, one output. Whichever numbered input select points at is what comes out. It's the same "5 to 1" pattern JPS built across the whole switch family - Image, VAE, IPA, and this one for raw numbers - and the point of all of them is the same: stop deleting and rewiring nodes every time you want to try a different value, and instead flip one number.

    How it works

    select is a plain integer, and it's 1-indexed against the five optional inputs - set it to 2 and you get whatever's wired into int_2, set it to 5 and you get int_5. You don't have to wire all five; leave the branches you're not using empty and just make sure select is pointed at one that's actually connected.

    Where this earns its keep

    Anywhere you'd otherwise maintain several near-identical subgraphs that differ by one number - step count, batch size, a resolution value, a seed offset - wire each candidate value into one of the five inputs and drive select from a single control point. It's also the node you reach for when you want to programmatically pick a value: wire something computed (a counter, a random-int node, an output from earlier in the graph) into select instead of setting it by hand, and the switch becomes a genuine branch rather than a static toggle.

    It's worth knowing this alongside the _source outputs on this pack's ControlNet Settings/Pipe nodes (OpenPose, CannyEdge, MiDaS) - those output a plain integer specifically because it's meant to drive a switch like this one (or its Image Switch sibling), letting a single settings menu pick which reference image or value a whole downstream chain uses.

    Unlike the pack's other switches, this one carries no model or image data at all - it's the lightest-weight member of the family, and a reasonable one to reach for even outside a strictly JPS-built workflow. Any time you need a single number to depend on which of a handful of upstream branches is currently "active," this does that job without you writing a conditional or a custom expression node for it.

    Installing it

    Comes with the rest of the pack. ComfyUI Manager: search JPS Custom Nodes for ComfyUI, install, restart. By hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/JPS-GER/ComfyUI_JPS-Nodes.git
    

    Restart ComfyUI afterward, and remove any older copy of the pack first - the README specifically warns against installing over a previous version. No models, no Python dependencies beyond ComfyUI itself; this is pure graph logic.

    Where people get tripped up

    If int_out isn't giving you what you expect, the almost-always cause is select pointing at a branch that isn't actually wired - an unconnected optional input doesn't error, it just gives you nothing useful, and it's an easy thing to miss in a busy graph. Beyond that there's not much to trip over: this is about as simple as a node gets, which is exactly the point.

    CategoryJPS Nodes/Switches

    Inputs (6)

    NameTypeDefaultDescription
    selectINT
    int_1optINT
    int_2optINT
    int_3optINT
    int_4optINT
    int_5optINT

    Outputs (1)

    NameTypeDescription
    int_outINT