Nodes/ComfyUI-JakeUpgrade/Int Input Switch JK๐Ÿ‰
ComfyUI Node

Int Input Switch JK๐Ÿ‰

One checkbox, two integer paths โ€” A/B your steps, seeds, and counts without rewiring

By jakechaiยทCreated 2 years agoยทUpdated 3 months agoยท 147
Int Input Switch JK๐Ÿ‰
    • int_output
    • boolean
    โ—„boolean_valuefalseโ–บ
    โ—„int_false0โ–บ
    โ—„int_true0โ–บ

    When you're tuning a workflow, half the job is swapping one number for another - steps 30 vs 40, seed 12345 vs 67890, one frame count vs another. Int Input Switch JK๐Ÿ‰ lets you put both values in the graph and flip between them with a single boolean. No more editing constants and re-running to compare.

    It's part of the switch family Jake built into JakeUpgrade so his workflows stay toggleable: every CR * Input Switch JK node follows the same shape, and this is the integer flavor. If you've seen his img2mesh or Wan workflows, you've seen these switches sprinkled through the graph - that's the house style, and it's a genuinely nice way to keep A/B options in a workflow you share.

    How it works

    The mechanism is exactly as simple as it looks:

    if int_true is not None and boolean_value:
        return (int_true, boolean_value)
    else:
        return (int_false, boolean_value)
    
    • boolean_value - the condition. True picks the "true" value, False picks the "false" value.
    • int_false - required, default 0. The value returned when the condition is False.
    • int_true - optional, default 0. The value returned when the condition is True. Leave it unplugged and the node just passes int_false through regardless.

    Two outputs: int_output (the chosen INT) and boolean (a pass-through of the condition, so you can keep branching downstream without re-deriving it).

    One subtlety worth knowing: the source checks int_true is not None and the boolean. The INT type can't be "None" from the UI anyway (it always has a default), so in practice the boolean is the whole story - but it means an unconnected int_true behaves as a safe pass-through rather than erroring.

    Where you'd actually use it

    The two-number pattern is everywhere in generative workflows. Sample counts ("draft 20 steps / final 40 steps" on a master toggle), seed alternation, batch sizes, resize targets. In JakeUpgrade's image-gen workflows, switches like this gate the difference between the draft and refinement paths - the same graph, just flipped. You can also feed the boolean output into another switch to make compound conditions, which is how his big workflows layer these things without turning into spaghetti.

    Install

    Ships with ComfyUI-JakeUpgrade: ComfyUI Manager โ†’ search ComfyUI-JakeUpgrade, or

    cd ComfyUI/custom_nodes
    git clone https://github.com/jakechai/ComfyUI-JakeUpgrade
    cd ComfyUI-JakeUpgrade && pip install -r requirements.txt
    

    No models, no config. It lives in the ๐Ÿ‰ JK/๐Ÿ”€ Switch menu. The int range is the full 64-bit span with step 1, so there's no practical limit on what you route through it. If the whole Switch menu is missing, check the pack's config.ini - ENABLED_MODULES can exclude the switch module, though the default is to load everything.

    Category๐Ÿ‰ JK/๐Ÿ”€ Switch

    Inputs (3)

    NameTypeDefaultDescription
    boolean_valueBOOLEANfalseCondition to select between inputs (True=int_true, False=int_false)
    int_falseINT0-18446744073709550000โ€“18446744073709550000Integer value to return when condition is False
    int_trueoptINT0-18446744073709550000โ€“18446744073709550000Integer value to return when condition is True (optional)

    Outputs (2)

    NameTypeDescription
    int_outputINTโ€”
    booleanBOOLEANโ€”