Nodes/ComfyUI Sokes Nodes 🦬/Latent Switch x9 🦬
ComfyUI Node

Latent Switch x9 🦬

One dropdown, nine latent inputs — pick which one flows through

By m-sokes·Created 3 years ago·Updated 15 days ago· 4
Latent Switch x9 🦬
  • latent_0
  • latent_1
  • latent_2
  • latent_3
  • latent_4
  • latent_5
  • latent_6
  • latent_7
  • latent_8
  • LATENT
â—„latent_select0â–º

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_0 is 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

  1. 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.
  2. 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_select to 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.

CategorySokes 🦬

Inputs (10)

NameTypeDefaultDescription
latent_selectINT00–8—
latent_0LATENT—
latent_1optLATENT—
latent_2optLATENT—
latent_3optLATENT—
latent_4optLATENT—
latent_5optLATENT—
latent_6optLATENT—
latent_7optLATENT—
latent_8optLATENT—

Outputs (1)

NameTypeDescription
LATENTLATENT—