Nodes/Shima/Shima Int Switch
ComfyUI Node

Shima Int Switch

The A/B picker you'll actually wire

By KDB-USJP·Created 6 months ago·Updated 6 months ago· 2
Shima Int Switch
    • choice
    Input1
    int1
    int2

    Sometimes you don't need a fancy routing graph, you need to flip between two numbers. Shima Int Switch is the ComfyUI equivalent of a two-position toggle: feed it two integers, point the switch at one, and it hands that one downstream. It's the kind of node that looks trivial until you want to A/B a couple of seeds or batch sizes without rewiring anything.

    How it works

    The mechanism is exactly what you'd hope: an Input widget holds a 1 or a 2, and the node returns int1 when Input is 1, int2 when Input is 2. Straight pass-through, no logic beyond the pick. The output is a single choice INT.

    The detail that matters is in the two inputs, int1 and int2: they're marked forceInput, which means they're wire-only sockets with no widget value behind them. You must connect something to both. The node has no fallback, so a dangling input comes through as None - which then breaks whatever's waiting for an integer downstream.

    When you'd use it

    The natural pairing is with a couple of primitive integer nodes (Shima ships its own Shima.Int, or use ComfyUI's core Int). Wire seed A into int1, seed B into int2, and you've got a manual seed flipper without touching the sampler's widget. Same trick works for width, height, batch size, or any other integer that's awkward to swap by hand.

    You can also drive it with a seed from Shima.Commons on one side and a fixed value on the other, so one position tracks your project seed and the other is a hard override. That's a genuinely useful pattern in a Shima workflow, where Commons is meant to be the single source of truth - this is the escape hatch.

    Where it's not useful: as a general switch. It only handles INTs. If you want to route images, models, or strings, you're in the wrong node - Shima has Shima.ChoiceSwitch (a prettier multi-mode toggle) and Shima.TheNothing (an any-type relay) for that.

    Installing it

    This is one of the utility nodes in the Shima pack. Install via ComfyUI Manager (search Shima) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/KDB-USJP/shima_wf.git Shima
    

    Restart ComfyUI. The pack auto-installs a couple of Python deps and its companion repos (ComfyUI-Impact-Pack, cg-use-everywhere) on first load.

    Common issues

    • None output. You left int1 or int2 unconnected. Both inputs are wire-only; connect both before you queue, or the downstream node will choke.
    • Switch "does nothing." You changed Input between runs but the downstream value didn't move - check that the node actually re-ran. If nothing feeding it changed, ComfyUI's cache may skip it; tweak the value you're switching on as well.
    • Expecting it to be a seed "control_after_generate" widget. It isn't. Input stays where you left it until you change it, which is exactly what you want for a manual toggle.

    It's a humble node, and that's fine. Sometimes the most useful tool in the box is the one that picks a number and stays out of your way.

    CategoryShima/Utilities

    Inputs (3)

    NameTypeDefaultDescription
    InputINT11–2
    int1optINT
    int2optINT

    Outputs (1)

    NameTypeDescription
    choiceINT