ComfyUI Node

Model Switch

The A/B Test Switch

By r-vage·Created about a year ago·Updated 5 months ago· 23
Model Switch
  • input1
  • input2
  • model
Input1

Comparing two checkpoints is the most tedious routine in ComfyUI: render with model A, rewire the whole graph to model B, render again, compare. Model Switch kills the rewiring. It's a 2-input, 1-output pass-through for the MODEL type - plug two loaded models in, flip a single integer, and the workflow uses whichever one you point it at. Same run, same seed, different model. It's the smallest thing that makes A/B testing actually pleasant.

How it works

The interface is two optional MODEL inputs and a selector:

  • Input (integer, default 1, range 1–2) - the switch. 1 sends input1 through, 2 sends input2.
  • input1 / input2 (optional, MODEL type, both forceInput) - the two models you're choosing between, usually from two Load Checkpoint nodes.

The output, model, goes straight into whatever consumes a model - a KSampler, a LoRA stacker, an IPAdapter model input. Under the hood it's literally if Input == 1: return input1 else: return input2. That's the whole mechanism, and that simplicity is the point: a switch that can't do anything except choose between two things is a switch you can trust.

The trick that makes it useful

The README's switch advice applies here directly: connect the node that's always on to slot 1. If you're switching between a bypassable option and a default model, the always-enabled model goes in input1 - because if input1 is always valid, the switch always has something sane to send, and you can bypass slot 2's loader freely without the graph collapsing. That's the pattern for building an "options menu" that stays robust when other branches get muted or bypassed.

It's also worth knowing this is a static switch - it's meant to be set by you between runs, not to react to data mid-graph. If you want something that picks a model based on a condition, you'd be better served by a conditional-routing node; this one just needs an integer and doesn't care where it came from.

Installing it

Part of ComfyUI-RvTools_v2 - Manager → search "ComfyUI-RvTools_v2", or:

cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI-RvTools_v2
# restart ComfyUI

No model files, no extra dependencies.

Gotchas

Two things to keep straight. First, the switch passes through whatever it's given - if you bypass the loader feeding input1 and have the selector on 1, the output is None and the KSampler will throw. That's why the always-on-source-goes-first rule matters. Second, model switching like this doesn't unload the other model from VRAM; both checkpoints stay resident, so running two big SDXL checkpoints through this will happily eat your VRAM. If that's a problem, look at the pack's Any Multi-Switch for the multi-option case, and remember the pack-level caveat: RvTools_v2 is unmaintained, superseded by ComfyUI_Eclipse.

Category🫦 RvTools II/ Switches

Inputs (3)

NameTypeDefaultDescription
InputINT11–2
input1optMODEL
input2optMODEL

Outputs (1)

NameTypeDescription
modelMODEL