Context Switch (rgthree)
Context Switch (rgthree)
- CONTEXT
- MODEL
- CLIP
- VAE
- POSITIVE
- NEGATIVE
- LATENT
- IMAGE
- SEED
Context Switch is how you branch a whole workflow with a single mute. It takes several Context streams - those bundled wires that carry your model, clip, vae, conditioning, latent and the rest all at once - and passes along the first one that isn't empty. Turn the earlier ones off and the next live context takes over. It's the node that makes "generate a cheap preview, then optionally run the expensive upscale" a one-click toggle instead of a rewiring job.
Why this exists and why it's better than a selector
Lots of node packs ship a switch with a dropdown: "output number 2." Those work, but they quietly do too much work - every input still executes, and the picked one gets kept while the rest are computed and discarded. On a workflow with an upscaler or a second sampler behind those inputs, that's real GPU time thrown away every run.
Context Switch does it differently: it chooses the first non-null context and lets you make the others null by muting. A muted branch produces nothing, so Context Switch skips it, and - this is the payoff - nothing on that branch actually runs. rgthree calls this out explicitly in the pack docs as the thing other switches get wrong. If you care about not burning cycles on paths you didn't take, this is the switch you want.
The part everyone gets wrong: muting runs backward
The confusion is universal, so let's kill it. ComfyUI doesn't flow forward. When you queue, it starts at the output nodes and walks backward, only pulling in nodes needed to feed them. So you don't stop a branch by muting its front - you make its output disappear.
Concretely, from rgthree's own worked example: feed your Upscale Out context into the first slot of a Context Switch and the pre-upscale context into the second. Mute the Upscale Out context node (select it, Ctrl+M) and its output goes to None; the switch falls through to the second slot; the entire upscaler never executes. Unmute it and the upscale path comes back. To make this a dashboard, wire those context nodes into a Fast Muter and you get one-click toggles for the whole fork.
Inputs and outputs
The inputs are dynamic - you connect several Context wires and the node grows slots as needed, so there's no fixed named-input list. Feed them in order of preference: slot one wins if it's live, otherwise slot two, and so on.
The output is the important part, and it's generous. You get a CONTEXT wire (RGTHREE_CONTEXT) to carry the chosen bundle onward, plus every field pre-exploded for convenience: MODEL, CLIP, VAE, POSITIVE, NEGATIVE, LATENT, IMAGE, and SEED. So you can keep passing the bundle down one tidy wire, or pull individual pieces straight off the switch into a KSampler or VAE Decode without a separate unpack node.
Installing it
Context Switch is part of rgthree-comfy. Install via ComfyUI Manager (search rgthree's ComfyUI Nodes) or clone the repo:
cd ComfyUI/custom_nodes
git clone https://github.com/rgthree/rgthree-comfy.git
Restart ComfyUI. Nothing else to fetch - no models, no Python packages. The pack is entirely graph and UI code, so install really is just clone-and-restart.
Common issues
The recurring trap is muting the wrong end and getting an error instead of a clean skip. Mute toward the output side of the branch you want gone, not its input side, so the path stops being pulled in. The rgthree pack's whole advanced section is really just teaching this one reflex.
A close second is the one that quietly picks the wrong branch: mute, don't bypass. They feel interchangeable but they're opposites here. A muted node outputs None, which is exactly the empty context the switch skips over. A bypassed node passes its input straight through to its output - so it hands the switch a real, non-null context, and the switch dutifully picks it. rgthree tells people this directly when they hit it: mute those nodes, don't bypass them. If your Context Switch keeps selecting a branch you thought you'd turned off, this is almost always the reason.
Also note Context Switch only makes sense with rgthree's Context (or Context Big) nodes upstream - the RGTHREE_CONTEXT type is what it switches between. If you're trying to branch a single value like an image or a latent, use Any Switch instead; it's the same idea for one type.
And the pack-wide one: if the node looks broken or won't behave, check that ComfyUI's Nodes 2.0 frontend is off. The Vue rewrite broke several rgthree nodes and the standing fix is to stay on the legacy canvas.
Inputs (0)
No inputs
Outputs (9)
| Name | Type | Description |
|---|---|---|
| CONTEXT | RGTHREE_CONTEXT | — |
| MODEL | MODEL | — |
| CLIP | CLIP | — |
| VAE | VAE | — |
| POSITIVE | CONDITIONING | — |
| NEGATIVE | CONDITIONING | — |
| LATENT | LATENT | — |
| IMAGE | IMAGE | — |
| SEED | INT | — |