Nodes/comfyui-selector/Selector In (LATENT)...
ComfyUI Node

Selector In (LATENT)...

Per-model latents, without loading eight copies of anything

By exdysa·Created 2 years ago·Updated about a year ago· 6
Selector In (LATENT)...
  • latent1
  • latent2
  • latent3
  • latent4
  • latent5
  • latent6
  • latent7
  • latent8
  • LATENT
model_type1

SelInLatent ("Selector In (LATENT)") routes LATENT objects by model type: eight latent inputs, one model_type integer, one LATENT output. It's the Selector In family's heavyweight, and the lazy-loading detail matters more here than in any of the other variants, because latents are the biggest things you'll be passing around a graph. A naive eight-port router would materialize all eight; this one only realizes the port you actually selected.

When does a per-model latent actually matter? A few honest cases. If different model families in your workflow build their latents differently - one branch VAE-encodes an image, another uses an Empty Latent with a particular noise setup - you can pre-wire all the branches and switch between them by number instead of rewiring. If you're doing batch experiments where the latent pipeline (not just the settings) changes per family, this keeps the sampler's input lane clean. It's also useful when you want the same latent concept (say, a fixed-size base) prepared differently per model, because some families want specific starting noise or sizes.

How it works

The mechanism is the pack standard: model_type (1–8) selects latent<number>, and the winner emerges on the single LATENT output, ready for a KSampler or SamplerCustom. What's different is that the ports are marked lazy, and the node explicitly tells ComfyUI which port to evaluate (check_lazy_status), so the other seven branches don't compute. If a branch behind an unselected port has an expensive VAE Encode or a big latent operation feeding it, that cost simply doesn't happen until you select it.

Inputs & outputs that matter

  • model_type (INT, required) - the selector, normally fed by RecourseCkpt's MODEL_TYPE broadcast.
  • latent1latent8 (LATENT, optional) - your candidate latent objects from VAE Encode, Empty Latent, or latent-manipulation nodes.
  • LATENT output - the winner, wired into the sampler's latent input.

Installing it

The pack standard, which means boring and painless. ComfyUI Manager → search comfyui-selector → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/exdysa/comfyui-selector

Restart and it's under Selector_Recourse/In. No requirements.txt, no model files, no network access.

Gotchas

  • Selected-but-empty port → None output → downstream doesn't run. The lazy logic only helps if the selected port is actually connected.
  • Lazy evaluation means the first run after switching model types can be slower, since the newly selected branch has to actually compute then. Steady-state runs only touch one branch.
  • Latents are model-agnostic tensors at the end of the day - for most simple workflows a Reroute handles your single latent fine. This node earns its place only when you genuinely maintain multiple latent pipelines and switch between them.
  • Single-author pack (GPL-3.0), quiet since early 2025. The lazy-loading is the reason to trust it with big objects; it's a small pack, but that detail is done right.
CategorySelector_Recourse/In

Inputs (9)

NameTypeDefaultDescription
model_typeINT11–8
latent1optLATENT
latent2optLATENT
latent3optLATENT
latent4optLATENT
latent5optLATENT
latent6optLATENT
latent7optLATENT
latent8optLATENT

Outputs (1)

NameTypeDescription
LATENTLATENT