ComfyUI Node

Group Switch

Every group on your canvas, on one panel of switches

By Mistress-Lukutar·Created 2 months ago·Updated 2 days ago· 2
Group Switch
    • states
    ◄disable_methodbypass►
    ◄change_group_colortrue►
    ◄sort_order►
    ◄group_states{}►

    Groups are the closest thing ComfyUI has to structure: you box off the upscaler, the refiner, the detailer, and the graph becomes a diagram instead of a noodle heap. Then you want to run it without the refiner, and the only options are right-click the group header → Bypass Group Nodes, or muting six nodes by hand.

    Group Switch turns that into a panel: one boolean row per group on your canvas, all in one node.

    What it is

    A utility node with no input sockets. Drop it top-left, outside every group, where its own panel can't switch it off, and it grows a row per group it can see. Check a row and that group is live; uncheck it and it's off.

    Rows track the canvas, not a saved list. Rename a group and the row renames. Add one and a row appears. Reorder the groups and the rows follow your sort_order.

    Worth saying plainly: this is not rgthree's Fast Groups Muter/Bypasser, the incumbent. That one is a searchable dashboard you pin to the screen edge; this is a serialized node inside the graph with color feedback. Want a HUD? rgthree has more miles on it. Want switch state to travel inside the workflow JSON? This is that shape.

    How the switching happens

    The Python class is thin - it validates the four parameters and republishes current states as one dictionary. All panel behaviour lives in the frontend extension, which uses the same mechanism as ComfyUI's native group menu:

    • bypass sets every node in the group to bypass mode, so links pass straight through. Use it for a segment you want to skip over - an upscale pass, a face fix - where the image should keep flowing.
    • disable sets them to never / mute, removing them from the prompt. Use it when downstream doesn't need that output.

    It's native node mode underneath, so a bypassed group reloads as a bypassed group and nobody needs your pack installed to read the workflow.

    Before switching a group off the extension captures each node's current mode and restores it on re-enable - a node you'd muted by hand stays muted. With change_group_color on, the off frame tints purple for bypass and grey for disable, and the original color is stored in a node property, so it survives a reload.

    The four fields

    disable_method is the one real decision. Start on bypass unless you have a reason not to.

    change_group_color - leave it on for feedback; switch it off if your group colors already mean something.

    sort_order - comma-separated title prefixes, e.g. inp,im,det, case-insensitive. A group whose title starts with a token takes that token's position; several may share a token and keep their relative order; unlisted groups fall to the end. Short tokens are the point - you never type a full title.

    group_states - hidden JSON, {"group title": true/false}, kept in sync by the extension. You touch it only when driving the node from an API workflow without the frontend; invalid JSON gets rejected, not guessed at.

    The single output is states, type GROUP_STATES - an ordered {group title: enabled} dict. Wire it into anything accepting * (Set Variable, say) or leave it unconnected. Don't expect it to drive anything: it's telemetry, not a control surface. Duplicate titles come out as Title, Title (2).

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/Mistress-Lukutar/ComfyUI-LukutarNodes
    

    Or Manager → Install via git URL, then restart. Dependencies are just opencv-python>=4.8 (there for the pack's image nodes, not this one), no models, no downloads. The node appears under Lukutar/Groups.

    Reload the browser tab after installing, not just the server. Without the web assets, Group Switch still loads and validates but is an empty shell with a JSON field - every row is drawn by JavaScript.

    Things that look like bugs

    No rows. Almost always frontend assets: check the browser console, restart ComfyUI, hard-reload the tab.

    A group isn't listed. Only the root canvas is mirrored. Groups inside subgraphs don't exist to this node.

    Rows aren't checked the way you left them. By design - row values aren't persisted at all, they're re-derived from the live group node modes, which ComfyUI saves natively. A group muted at save shows unchecked on reload, because it genuinely still is muted.

    A group you switched off via the native menu behaves oddly. The row reflects it, but parameter changes don't re-apply it; the panel only owns groups it switched itself.

    One risk that isn't this pack's fault: anything reaching into the canvas and rewriting node modes is what a frontend rewrite breaks first. The Nodes 2.0 rollout in late 2025 broke third-party group dashboards - rgthree's Fast Groups Bypasser rendered with stacked fields and its author declined to port it. So after a big ComfyUI update, sanity-check a toggle before trusting it inside a long run. And the pack itself is new, with nothing in the community record yet.

    CategoryLukutar/Groups

    Inputs (4)

    NameTypeDefaultDescription
    disable_methodCOMBObypassHow an unchecked group is switched off: bypass (nodes pass inputs through) or disable (nodes are muted)
    change_group_colorBOOLEANtrueRecolor a switched-off group's frame: purple for bypass, grey for disable; restored when the group is switched back on
    sort_orderSTRINGComma-separated title prefixes for the row order, e.g. inp,im,det: a group whose title starts with a token takes the token's position (case-insensitive); unlisted groups keep their order at the end
    group_statesSTRING{}Current states as JSON, managed automatically by the web extension: {"group title": true/false}

    Outputs (1)

    NameTypeDescription
    statesGROUP_STATES—