π§ Swap Brain - LD
Rgthree-style group switching, but every rule is a dropdown
- active_mode
Big ComfyUI graphs with several modes share one problem: when the panel says "now do image-to-video", a whole rail of nodes has to wake up and another has to go quiet. Group-switch nodes solve that by bypassing groups in bulk. Swap Brain - LD is PromptMasterLD's version, and its whole argument is about how you write the rules. Where a Group Switch keeps its rules in a text box with a private syntax nobody can edit without being taught the format, Swap Brain turns every rule into a dropdown - and each dropdown is filled with the real group titles off your canvas. Nothing to spell, nothing to punctuate, and a group you renamed shows up under its new name.
How it works
The layout is honest about what your graph actually has: one axis is the route, the other is the rail. Routes are the pack's modes - t2v, i2v, ref, multishot, ext, music, image - and for each one you get three dropdowns: which MODELS rail loads, which SAMPLER renders it, and an EXTRA rail for route-specific bits. Two groups are on for every route (normally the shared loaders and the panel's own group), so always_on_1 and always_on_2 set those once instead of repeating them on all seven rows.
The mode dropdown picks which row applies: auto follows the panel wired into studio_mode (including its multishot tick), a named mode forces that row, and off touches nothing - which is what you want while rearranging the canvas. apply off parks the whole thing without losing your choices.
Two implementation details are worth knowing because they explain the odd bits you'll see. First, the actual switching happens in the browser - group bypass is canvas state, not something a backend execution can set - so the node's real job is holding your choices in the saved workflow and passing the resolved mode onward. Second, that's why the dropdowns are empty until your graph loads: the server has never seen your group titles, and the node ships a VALIDATE_INPUTS that accepts any value so your real group names don't trip ComfyUI's "Value not in list" check. Any group you never name is left exactly as you set it, so the node can be adopted on a canvas it doesn't fully understand.
Inputs and outputs that matter
mode-auto/t2v/i2v/ref/multishot/ext/music/image/off. Start here.studio_mode- a STRING input; wire H3 Studio'smodepin (directly or through an Unpack) andautomode follows it. The thing deciding becomes a cable you can see.always_on_1/always_on_2- the two groups that never switch off.- The per-route
*_models,*_sampler,*_extradropdowns, filled with your group names.
One output: active_mode (STRING), the resolved route, for anything downstream that wants to know which mode actually ran.
Gotchas
The pack ships a clear warning about one specific wiring: multishot must NOT get the clip picker in its EXTRA rail, or the chain sampler thinks it's continuing a clip when it isn't - the ext route uses ext_extra for exactly that. If a route renders the wrong sampler, nine times out of ten it's a group you named in the wrong dropdown, which is at least easy to see now that the names are real. Install is the usual pack story:
cd ComfyUI/custom_nodes
git clone https://github.com/Lora-Daddy/PromptMasterLD
# restart ComfyUI
If you've never used a group switcher, Swap Brain is honestly a gentler place to start than the text-syntax originals - the cost is that it only makes sense on a canvas that's already organized into groups, so tidy the graph first and the node will feel obvious.
Inputs (26)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | auto | Which row to apply. auto = follow the panel wired to `studio_mode`, including its multishot tick. off = touch nothing, leave every group as it is (use while you rearrange the canvas). |
| apply | BOOLEAN | true | Off parks the whole thing without losing your choices. |
| always_on_1 | COMBO | β none β | On for EVERY route. Normally the shared loaders β clip, VAEs, the Pack In. |
| always_on_2 | COMBO | β none β | On for EVERY route. Normally the panel's own group. |
| t2v_models | COMBO | β none β | T2V: which MODEL rail loads. |
| t2v_sampler | COMBO | β none β | T2V: which sampler renders it. |
| t2v_extra | COMBO | β none β | T2V: anything else this route needs. Usually none β EXT uses it for the clip picker, which multishot must NOT have or the chain sampler thinks it is continuing a clip. |
| i2v_models | COMBO | β none β | I2V: which MODEL rail loads. |
| i2v_sampler | COMBO | β none β | I2V: which sampler renders it. |
| i2v_extra | COMBO | β none β | I2V: anything else this route needs. Usually none β EXT uses it for the clip picker, which multishot must NOT have or the chain sampler thinks it is continuing a clip. |
| ref_models | COMBO | β none β | REF: which MODEL rail loads. |
| ref_sampler | COMBO | β none β | REF: which sampler renders it. |
| ref_extra | COMBO | β none β | REF: anything else this route needs. Usually none β EXT uses it for the clip picker, which multishot must NOT have or the chain sampler thinks it is continuing a clip. |
| multishot_models | COMBO | β none β | MULTISHOT: which MODEL rail loads. |
| multishot_sampler | COMBO | β none β | MULTISHOT: which sampler renders it. |
| multishot_extra | COMBO | β none β | MULTISHOT: anything else this route needs. Usually none β EXT uses it for the clip picker, which multishot must NOT have or the chain sampler thinks it is continuing a clip. |
| ext_models | COMBO | β none β | EXT: which MODEL rail loads. |
| ext_sampler | COMBO | β none β | EXT: which sampler renders it. |
| ext_extra | COMBO | β none β | EXT: anything else this route needs. Usually none β EXT uses it for the clip picker, which multishot must NOT have or the chain sampler thinks it is continuing a clip. |
| music_models | COMBO | β none β | MUSIC: which MODEL rail loads. |
| music_sampler | COMBO | β none β | MUSIC: which sampler renders it. |
| music_extra | COMBO | β none β | MUSIC: anything else this route needs. Usually none β EXT uses it for the clip picker, which multishot must NOT have or the chain sampler thinks it is continuing a clip. |
| image_models | COMBO | β none β | IMAGE: which MODEL rail loads. |
| image_sampler | COMBO | β none β | IMAGE: which sampler renders it. |
| image_extra | COMBO | β none β | IMAGE: anything else this route needs. Usually none β EXT uses it for the clip picker, which multishot must NOT have or the chain sampler thinks it is continuing a clip. |
| studio_modeopt | STRING | Wire H3 Studio's `mode` pin here β directly, or through an Unpack. With this connected and `mode` on auto, the rails follow whichever tab that panel is on, and the thing deciding is a cable you can see. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| active_mode | STRING | β |