Nodes/PromptMasterLD/🎛 Group Switch - LD
ComfyUI Node

🎛 Group Switch - LD

Let the Canvas Do the Switching

By Lora-Daddy·Created 6 days ago·Updated 2 days ago· 5
🎛 Group Switch - LD
    • active_mode
    modeauto
    mappingt2v = FL2VA, I2V, VIDEO i2v = FL2VA, I2V, VIDEO ref = REF2VA, REF, VIDEO ext = REF2VA, EXTEND multishot = FL2VA, CHAIN multishot_mp3 = REF2VA, CHAIN music = MUSIC image = IMAGE
    applytrue
    studio_mode

    The old way was invisible, and that was the problem

    A big H3 canvas isn't one graph - it's several rails living on the same canvas: a text-to-video rail, an image-to-video rail, a reference rail, a multishot chain, a music path. When you want the multishot rail instead of the single-shot one, someone has to switch it. The classic solution was a switch node that silently picked a model or a sampler mid-wire. And when one of those broke, you had nothing to look at: the wires looked identical in every mode, and the only way to find out what actually ran was to read the node's source. Lazy, opaque, and the opposite of debuggable.

    Group Switch - LD (🎛 Group Switch - LD under LD / PromptMaster / Video rail, part of Lora-Daddy's PromptMasterLD pack) does the opposite. Instead of routing values through invisible logic, it drives ComfyUI's own group bypass - the same greyed-out mechanism you toggle by hand when you right-click a group. The answer to "what's switched on" is literally the canvas in front of you: greyed groups are off, full-colour groups are running. If something's off, you can see it and turn it back on yourself.

    How it works

    You own a plain-text mapping, one line per mode:

    multishot = FL2VA, CHAIN
    music     = MUSIC
    image     = IMAGE
    

    Group names match from the start and ignore case, so VIDEO catches a group called VIDEO - H3 (bypass when not making video). Groups named on the active line get switched on; every other group mentioned anywhere in the mapping box gets bypassed; groups you never mention are left exactly as you set them, so notes, previews and anything you're hand-managing survive untouched.

    The mechanism runs in the browser, because group bypass is canvas state - a backend node can't flip it for you. The node's run() mostly hands back which mode is active, so you can wire active_mode onward if you want it.

    Inputs worth knowing

    • mode - the dropdown: auto, the eight modes (t2v, i2v, ref, ext, multishot, multishot_mp3, music, image), and off. off is the one to use while you're rearranging the canvas - it parks the whole thing without deleting your mapping.
    • mapping - the multiline mode→groups table above.
    • apply - off disables the switch without wiping your mapping.
    • studio_mode (optional, STRING) - wire H3 Studio's mode output here and, with mode set to auto, the controller follows whichever tab that Studio panel is on. That turns the thing deciding your routing into a cable you can see rather than something listening in the background. Leave it unwired and the dropdown drives by hand.

    Output is a single active_mode STRING telling you which line was applied.

    How to install

    GroupSwitchLD ships with PromptMasterLD, so the install is the pack install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Lora-Daddy/PromptMasterLD
    cd PromptMasterLD
    pip install -r requirements.txt
    

    Restart ComfyUI, or grab it via ComfyUI Manager by searching "PromptMasterLD".

    Where people get burned

    Two gotchas, both about the mapping semantics. First: only groups on the active line get switched on, and every other group mentioned anywhere in the box gets bypassed - so if you name VIDEO on the t2v line, VIDEO is bypassed the moment you switch to a mode whose line doesn't name it. If you have a group you always want on, don't put it in the mapping at all; unnamed groups are left alone. Second, since the real work happens in the browser, this is a node for interactive use - running a workflow headless or through the API without the canvas attached isn't where its party trick lives.

    CategoryLD/PromptMaster/Video rail

    Inputs (4)

    NameTypeDefaultDescription
    modeCOMBOautoWhich line of the mapping to apply. auto = follow the Studio panel's active tab. multishot_mp3 = MV tab (REF2VA + CHAIN). off = touch nothing, leave every group as it is (use while you rearrange the canvas).
    mappingSTRINGt2v = FL2VA, I2V, VIDEO i2v = FL2VA, I2V, VIDEO ref = REF2VA, REF, VIDEO ext = REF2VA, EXTEND multishot = FL2VA, CHAIN multishot_mp3 = REF2VA, CHAIN music = MUSIC image = IMAGE One line per mode: <mode> = <group>, <group> MULTISHOT always keeps CHAIN (the multi sampler). Bare MS stays on FL2VA. multishot_mp3 is REF2VA+CHAIN: the MV song, and MS with staged stills/voice clones, so Picture N / Audio N exist. Group names match from the START and ignore case, so VIDEO matches 'VIDEO — H3 (...)'. Groups named on the active line are switched ON, every other group MENTIONED ANYWHERE in this box is bypassed, and groups you never mention are left exactly as you set them.
    applyBOOLEANtrueOff parks the whole thing without deleting your mapping.
    studio_modeoptSTRINGWire H3 Studio's `mode` pin here. With this connected and `mode` set to auto, the controller follows whichever tab that panel is on — and the thing deciding what is switched on is a cable you can see rather than something listening in the background. Leave it unwired to drive the groups by hand from the `mode` dropdown.

    Outputs (1)

    NameTypeDescription
    active_modeSTRING