Umi Bypass Model Switch
Two Model Loaders, One Wire, Switched by the Prompt
- base_model
- reference_model
- model
Umi Bypass Model Switch picks between two models using the same signal the Umi Bypass node uses: the JSON boolean list the Wildcard Processor emits from bypass_phrases. One output, model. If the phrase you're watching for shows up in the rolled prompt, you get reference_model; if it doesn't, you get base_model.
The use case is the one that makes half of the editing workflows in ComfyUI annoying: you want a single graph that mostly does text-to-image, but occasionally - when the roll picks a character edit, a reference shot, a restyle - should load a different model entirely. Normally that's two graphs and a decision you make by hand. This turns the decision into a phrase in the prompt.
The inputs
Required: matched_list and match_index.
matched_list- wire the processor'sbypass_matcheshere. It's parsed as JSON. If the list is empty, unparseable, or the index is out of range, the node treats it as not matched and returns the base model - a safe, boring default that keeps your graph running.match_index- which phrase in the list to read. It's 0-based against the order you typed the phrases intobypass_phrases. One phrase means index 0. Two phrases means 0 and 1, and if you later prepend a third, every index shifts.
Optional: base_model and reference_model, both MODEL.
The lazy-input detail that makes it actually useful
Both model inputs are declared lazy. Rather than pulling both branches into the node, the switch asks for exactly one - reference_model when the match is true, base_model when it isn't - and only if that socket is empty. So the losing branch isn't evaluated for that run, which is the difference between "a switch between two loaded models" and "a switch that makes you load both models with the VRAM of both".
That's the same lazy-evaluation pattern as rgthree-style switches, and it's the reason a switch like this can exist at all on a single-GPU machine. Keep the other loader out of the rest of the graph, though - if something else also consumes the base model, it'll be evaluated regardless and you've paid for both.
Wiring it
[Umi AI Wildcard Processor] bypass_phrases: "portrait mode"
↓ bypass_matches
[Umi Bypass Model Switch] match_index = 0
← base_model (your normal checkpoint)
← reference_model (the edit/reference checkpoint)
↓ model
sampler / model patch chain
Where people get burned
Confusing it with Umi Bypass. The names are close and the inputs are similar, but they do different jobs. Umi Bypass gates a stream - it either stops downstream execution or doesn't. Umi Bypass Model Switch never blocks anything; it just hands you one of two models. If you want a branch to be skipped, that's the other node.
A phrase that matches more than you think. Matching is whole-word and case-insensitive, so simple will not match simplicity - good - but it will match simple inside simple background, simple lighting in the rolled prompt, which is usually fine and occasionally not what you meant. Pick a phrase that only appears when you want it.
Index drift. Since match_index is positional, editing the phrase list in the processor silently re-points the switch. If you add a phrase, check the index on every bypass node downstream of it.
One phrase, one decision. There's no "else if" here. For three models you'd chain two switches; at that point a plain routing node with an explicit index is probably cleaner.
Install
Core node, no separate install. ComfyUI Manager (search the pack title, or install via git URL) or:
cd ComfyUI/custom_nodes
git clone https://github.com/Tinuva88/Comfy-UmiAI
cd Comfy-UmiAI && pip install -r requirements.txt
Core needs pyyaml. Restart ComfyUI and it appears under UmiAI, next to the other bypass node.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| matched_list | STRING | — | |
| match_index | INT | 00–1024 | — |
| base_modelopt | MODEL | — | |
| reference_modelopt | MODEL | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |