ComfyUI Node

Model Fallback

The first-non-null switch for your model slot

By duckcomfy·Created about a year ago·Updated 10 months ago· 0
Model Fallback
  • primary
  • fallback
  • MODEL

Model Fallback is a switch with no selector. It takes two model inputs, looks at them, and hands you whichever one is actually there. There's no dropdown to flip, no boolean to set - the graph decides by what's connected. It's the MODEL-typed cousin of the "first non-null" fallback pattern that rgthree's Any Switch made famous, and it exists because conditional model loading is a real workflow shape.

The mechanism is one line: fallback if primary is None else primary. If primary is connected and isn't None, you get primary. If primary is missing or produced nothing, you get fallback. Both inputs are optional, so it also works as a plain passthrough when you only bother to wire one.

When you'd actually reach for it

The clean use case is a gated or branched workflow where a model slot can legitimately come up empty. Say you've got a conditional that decides between loading a LoRA'd model or the raw base, or a switch node that returns None for the branch that didn't run. Feed both outcomes here and the downstream sampler always gets a model, no matter which branch fired. It's the model-level version of letting the graph sort itself out instead of you babysitting a selector.

Where it won't help: it only tests for None, not for "wrong." If your primary model loads fine but is too heavy for your VRAM, or is a base you didn't want, Model Fallback will cheerfully pass it through. There's no quality check, no "if this model is big, use that one" logic. It's a null test, full stop. And if neither input is connected, it outputs None - which most samplers will then choke on, so keep at least one path wired.

Inputs and outputs

  • primary (MODEL, optional) - the first choice.
  • fallback (MODEL, optional) - used when primary is None.
  • MODEL - the survivor, wired into your KSampler or any node that wants a model.

How to install it

It's part of the duckcomfy personal nodes pack, a personal utility collection that author duckcomfy re-implements from scratch to keep his workflows lean. Via ComfyUI Manager, search "duckcomfy personal nodes"; or:

cd ComfyUI/custom_nodes
git clone https://github.com/duckcomfy/duckcomfy_personal_nodes

Restart after cloning. No models to download, no Python dependencies - the pack's pyproject.toml is deliberately empty on the dependency front, which is the whole point of the author's "plundered and reimplemented, fewer things to go wrong" approach. If you already run a logic-heavy pack like rgthree or Impact, you might already have a fallback node that covers this slot - check before adding yet another switch to your graph.

Categoryduckcomfy

Inputs (2)

NameTypeDefaultDescription
primaryoptMODEL
fallbackoptMODEL

Outputs (1)

NameTypeDescription
MODELMODEL