Latent Switch x9 🦬
One dropdown, nine latent inputs — pick which one flows through
- latent_0
- latent_1
- latent_2
- latent_3
- latent_4
- latent_5
- latent_6
- latent_7
- latent_8
- LATENT
Sometimes you have nine latent sources and one sampler, and you want a single switch to choose between them. That's exactly what Latent Switch x9 is: a 9-input latent router. Pick an index, it forwards that latent to its output. The README also frames it as an Empty Latent Selector - wire nine empty latents of different resolutions into it and use the switch to pick dimensions on the fly.
It's part of Sokes Nodes 🦬, and it's the classic "why doesn't ComfyUI ship this" utility - a question the custom-node ecosystem answers a hundred times a day.
How it works
One control, one output:
- latent_select - an integer 0–8 that picks which input to forward.
- latent_0 … latent_8 - the nine LATENT inputs.
latent_0is required; the rest are optional.
The node looks up the selected index and passes that latent straight through - no resizing, no resampling, it's a pure router. If the chosen slot isn't connected, it quietly falls back to latent_0 and prints a note to the console.
The two ways people use it
- Switch between real latents. Got an img2img latent, a text-to-image empty latent, and an inpaint latent all feeding one sampler? Route them into slots, flip the switch per run.
- Resolution presets. This is the README's intended use: create empty latents at different dimensions (say 512×512, 768×768, 1024×1024), connect each to a slot, and use
latent_selectto choose the output resolution from one widget instead of editing an Empty Latent node's dimensions each time. Handy for batch experimentation.
Install
Standard Sokes Nodes 🦬 install:
cd ComfyUI/custom_nodes
git clone https://github.com/m-sokes/ComfyUI-Sokes-Nodes.git
pip install -r requirements.txt
Or via ComfyUI Manager → search "ComfyUI Sokes Nodes" → Install, then restart. No models, no special dependencies.
Gotchas
The fallback behavior is the one thing to remember: selecting an unconnected slot doesn't error - it silently uses latent_0. If you think you're getting latent_5 but it's not wired up, you're getting latent_0, and the only clue is a console line. If outputs look wrong, check both the index and that the slot actually has a wire.
Also note that latent_0 is mandatory, so this node never sits completely empty. It's a small node that mostly disappears into your graph - which is the correct outcome for a switch. When you need it, it's the difference between a tangled bundle of reroutes and one clean dropdown.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| latent_select | INT | 00–8 | — |
| latent_0 | LATENT | — | |
| latent_1opt | LATENT | — | |
| latent_2opt | LATENT | — | |
| latent_3opt | LATENT | — | |
| latent_4opt | LATENT | — | |
| latent_5opt | LATENT | — | |
| latent_6opt | LATENT | — | |
| latent_7opt | LATENT | — | |
| latent_8opt | LATENT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |