Model Index Switch
Twenty-six model slots, and only the one you pick loads
- index
- input_a
- input_b
- input_c
- input_d
- input_e
- input_f
- input_g
- input_h
- input_i
- input_j
- input_k
- input_l
- input_m
- input_n
- input_o
- input_p
- input_q
- input_r
- input_s
- input_t
- input_u
- input_v
- input_w
- input_x
- input_y
- input_z
- output
- resolved_index
- count
Model Index Switch passes one of up to twenty-six loaded models onward, chosen by a number. Wire a dozen checkpoints into slots input_a through input_l, drive index from a widget or a value, and the graph uses whichever one the number points at. It's the "pick a model with a counter" node, and it's built for the lazy-loading workflow trick that makes it actually practical: only the chosen input gets evaluated, so a node with twelve checkpoints wired in only ever loads one.
It's part of WAS Node Suite's logic/switch family (WAS Suite/Logic/Switch), alongside the two-way Model Switch and the suite's typed switches - part of v3's push to give ComfyUI real control flow over model-loading.
How it works
An index and a row of optional sockets. The sockets take anything a loader answers - MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL, and the rest of the loader types - and the first connection fixes the type, so you can't accidentally mix a VAE and a diffusion model across slots. index counts from 0, negatives count from the end (-1 = last slot), and decimals truncate. Two details make the index predictable:
- Unconnected slots aren't counted. With only slots A, B, and C wired, index 0 is slot A. You don't have to fill the alphabet to use the node.
out_of_rangedecides what an index past the end does:wrapcycles back around,clampholds at the last slot,errorstops the prompt. When a counter from a loop drives the index,wrapis usually what you want so the run never dies on an off-by-one.
The important claim in the tooltip deserves emphasis: only the chosen input is evaluated. In ComfyUI's lazy execution model, a loader sitting on an unselected branch never runs, so those eleven other checkpoints are just menu entries - they consume no VRAM until the index points at them. That's the difference between a "model switcher" you'd actually use and a graph that OOMs on load.
What comes out
output - the selected input, typed to whatever was connected, ready for a sampler or anything downstream. Plus two helpful wires: resolved_index (the slot actually read, after wrap or clamp) and count (how many slots are connected, so the index runs 0..count-1). If you're driving the index from a counter, wiring count into a compare is how you stop the loop before it walks off the end.
Installing it
Standard WAS Node Suite v3 install:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git
or ComfyUI Manager → "WAS Node Suite v3", restart. ComfyUI 0.14.0+, Python 3.10+, no pip installs.
Where people get burned
The classic mistake is assuming the node is a model loader - it isn't. You still need a loader per checkpoint; this node just picks which loaded result passes through. Second, wiring slots out of order then expecting index 0 to be input A: index 0 is the first slot actually connected, so if you wire B first, B becomes slot 0. And the lazy-loading only works when the unselected loaders genuinely sit unconnected from anything else - if a loader feeds both this node and somewhere else, it loads regardless, and the "only one model" promise quietly dies. Use dedicated loaders per branch and you're fine.
Inputs (28)
| Name | Type | Default | Description |
|---|---|---|---|
| index | INT,NUMBER,FLOAT | 0-99999999–99999999 | Slot to pass on, from 0. Negative counts from the end: -1 = last. A decimal is truncated: 2.7 = 2. |
| out_of_range | COMBO | wrap | Index outside 0..count-1. With 3 slots and index 4: `wrap` = slot 1, `clamp` = slot 2, `error` stops the prompt. |
| input_aopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_bopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_copt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_dopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_eopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_fopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_gopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_hopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_iopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_jopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_kopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_lopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_mopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_nopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_oopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_popt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_qopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_ropt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_sopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_topt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_uopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_vopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_wopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_xopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_yopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. | |
| input_zopt | COMFY_MATCHTYPE_V3 | One candidate for the index. Takes MODEL, VAE, CLIP, CLIP_VISION, CONTROL_NET, UPSCALE_MODEL, STYLE_MODEL and the other loader types. The first connection fixes the type; an unconnected slot is not counted, so index 0 is the first slot actually wired. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| output | COMFY_MATCHTYPE_V3 | The selected input, typed to whatever was connected. |
| resolved_index | INT | Slot actually read, from 0, after wrap or clamp. |
| count | INT | Connected slots. The index runs 0..count-1. |