img2img / txt2img Switch
The Switch node that remembers which side is img2img
- img2img_latent
- txt2img_latent
- latent
Let's be honest about this one up front: the img2img / txt2img Switch is a re-labeled version of the generic Switch node that ships with ComfyUI. Mechanically it does nothing new. What it does do is stop you from wiring a graph backwards at 1am, which is a real thing that happens.
The core Switch node takes two inputs and a boolean and passes one through. It works fine, but the two input sockets are just called "on" and "off" - there's no visual cue for which side is which. This node renames the inputs to img2img_latent and txt2img_latent and swaps the plain checkbox for a colored pill toggle with the two pipeline names written on it. That's the whole product, and for a workflow that can run either way it genuinely earns its place.
Where it fits
You build one graph that does txt2img and img2img from the same KSampler. In txt2img mode the sampler's latent comes from an Empty Latent node; in img2img mode it comes from a VAE Encode. Normally you'd duplicate the sampler or fumble with a generic switch. Here you feed both latent sources in, flip the pill, and the sampler keeps working.
The actual wiring is dead simple. The mode boolean (defaults to true, meaning txt2img) picks which latent passes through to the single latent output. Only the output matters - it feeds the latent input of your KSampler. The JS replaces the boring checkbox with the toggle, and it syncs correctly when you load a saved workflow.
One behavior worth knowing: if the side you toggled to isn't connected, the node silently passes whichever latent is connected instead of throwing an error. That's a friendly fallback, but it means a forgotten wire won't announce itself - you'll just get the wrong pipeline's image. If the graph "does nothing" when you flip the switch, check your connections first.
The honest limits
It switches LATENT only. It can't switch between two checkpoints, two samplers, or two conditioning stacks. For those you still want a proper conditional-routing setup (or a bookmark-style muter), not this. It's a single-purpose utility: one node, one decision point, one latent in or out. Don't reach for it expecting more.
Also note the pack README documents three of the pack's five nodes and never mentions this one. It ships, it's registered, it works - it just isn't the author's showpiece.
Installing it
It comes from the Danchi93/ComfyUI-Multi-Lora pack. The easiest route is ComfyUI Manager: search for ComfyUI-Multi-Lora and hit install. By hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Danchi93/ComfyUI-Multi-Lora
Then restart ComfyUI. There's no requirements.txt and no model download - the pack is pure Python + a JS frontend, so this is about as painless as custom nodes get. One gotcha: the README's own clone URL says ComfyUI-Workflow-Tools, an older name for the same project. Use the real repo name above. And if you'd rather have the UI in Chinese, each .js file has a LANG constant at the top you can flip from "en" to "zh".
If the node shows up in your node list, you're done. If it doesn't, restart again and confirm the folder name under custom_nodes matches the repo exactly - that's the standard "custom node installed but not loading" culprit.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | BOOLEAN | true | — |
| img2img_latentopt | LATENT | — | |
| txt2img_latentopt | LATENT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |