Nodes/comfyui_AcademiaSD/Academia SD Fast Switch ยท Counter ๐Ÿ”ข
ComfyUI Node

Academia SD Fast Switch ยท Counter ๐Ÿ”ข

The Academia SD Fast Switch ยท Counter

By AcademiaSDยทCreated about a year agoยทUpdated 5 days agoยท 100
Academia SD Fast Switch ยท Counter ๐Ÿ”ข
    • value
    โ—„switch_data{}โ–บ

    The switch is a group bypasser with a number instead of a name. Instead of picking side A or side B, you pick how many: OFF, 1, 2, 3 - level N turns on the groups assigned to levels 1 through N, bypasses the rest, and leaves everything you never assigned alone. One drag replaces a lap around your graph re-enabling six groups by hand.

    The obvious use is references: one group per image or per character, and the slider decides how many are in play. That's the thing you redo every time you test whether a third reference helps or hurts. It's the sibling of Fast Switch ยท Toggle (A/B sides) in the same pack, and it does the job rgthree's Fast Groups Muter/Bypasser does - only with a number instead of a checkbox per group.

    How it works

    Almost all of this happens in the browser, not in Python. Flipping each group to BYPASS or MUTE is graph manipulation, so it lives in the node's JavaScript - the same approach rgthree took. The Python side does three small things: hold the state in a widget so it saves with the workflow, hand the number out as an INT, and print which level the queue launched at.

    The one input, and the one output

    info_schema for this node is genuinely this short, so don't go looking for more:

    • switch_data (STRING, required) - the tooltip says it plainly: "Serialized state of the switch. Managed by the node UI." You never type here. Levels, step count and mode all get squashed into this string and travel with the workflow file.
    • value (INT, output) - the number the slider currently sits on. Wire it into anything that wants an integer: a filename prefix, a Primitive, a prompt weight. A convenience, not the point of the node.

    Everything else is UI. Open the panel and each group in the graph gets a level: โ€“, 1, 2, 3โ€ฆ The โ€“ is the important one - this counter never touches that group - so it can arm the references you care about without you declaring your entire workflow to it. Two counters on one canvas don't fight, because each only owns the groups you handed it.

    The time-saver is the filter box: type Ref, press ๐Ÿ”ข, and every visible group gets numbered 1, 2, 3โ€ฆ in order. Step count goes up to 32, from the โš™ menu.

    Cumulative or exact

    • Cumulative (default) - value 3 turns on levels 1, 2 and 3. The "how many references are live" case, and what you want most of the time: 1-, 2- and 3-reference setups end up one drag apart.
    • Exact - value 3 turns on only level 3. A picker rather than a count: one option among several, mutually exclusive.

    The lever behaves better than it sounds. Drag and it snaps to steps, click the track to jump, wheel for ยฑ1, click the label to go OFF and back to the last value. At 0 the left label reads OFF in red; from 1 up it turns ON in green with the count beside it (3/8). Both words are renameable, and an option applies the active level when the workflow loads, so a saved graph opens in the state you left it.

    Install

    Nothing exotic - the pack ships no requirements file, and everything it imports (torch, numpy, PIL, safetensors) already comes with ComfyUI.

    ComfyUI Manager: search comfyui_AcademiaSD, install, restart. It's on the Comfy Registry under publisher academia-sd, so updates come through Manager like anything else.

    By hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AcademiaSD/comfyui_AcademiaSD
    # restart ComfyUI
    

    No model downloads for this node - the pack is a grab bag of UX nodes from the Spanish-language ComfyUI channel @Academia_SD.

    Where people get burned

    The node is a frontend widget wearing a Python node's clothes, so if the level list comes up empty or the slider won't move, the JS didn't load - hard-refresh the tab (Ctrl+Shift+R) after installing or updating.

    Second: Bypass and Mute are not the same thing, which is why the pack gives you the choice. If switching a level off leaves you with a downstream error instead of a quietly skipped branch, the off side is set to the wrong one.

    Third, the honest limit of every group switcher: turning a level off skips the nodes, it doesn't unload anything. A branch holding a model in VRAM keeps holding it.

    When to reach for something else

    Two flavours rather than a variable count? Use the Toggle in the same pack. Want the graph to choose by itself? rgthree's Any Switch takes the first non-empty input and needs no hand on the lever. And if your branches aren't grouped, group switches have nothing to grab.

    CategoryAcademiaSD/Switch

    Inputs (1)

    NameTypeDefaultDescription
    switch_dataSTRING{}Serialized state of the switch. Managed by the node UI.

    Outputs (1)

    NameTypeDescription
    valueINTโ€”