Ⓜ️ Multiplexer
Mithril Multiplexer routes by name, not by order
- item_1
- item_2
- item_3
- item_4
- item_5
- output
ComfyUI has no shortage of switch nodes. rgthree's Context Switch, the stock Switch, a dozen "pick any" utilities - you've probably tripped over half of them already. The Mithril Multiplexer is another take on the same problem, and its angle is worth knowing: it selects by label, not by position, and it refuses to run if your items aren't the same type.
That label-based selection is the genuinely nice part. Instead of "take input 2" (which breaks the moment you reorder things), it's "give me the item named portrait_lora." Reorder the inputs, add one in the middle - the selection keeps working, because you're addressing items by name. If you've ever reordered a workflow and silently started sampling from the wrong checkpoint, you'll feel the difference immediately.
How it works
The Multiplexer has a select input and up to five item_1…item_5 inputs. Each item must be fed by a Mithril Multiplexer Input node (right-click any item slot and pick "Add Multiplexer Input" to spawn one wired up automatically). At runtime it builds a map of label → data from those wrapped inputs, checks that every connected item holds the same underlying data type, then returns the data whose label matches select.
The type check happens twice - once at validation time, which turns the node red before you even queue if you've mixed types, and again at runtime. That's a small but real quality-of-life touch: the node fails loudly with a clear "Type Mismatch" message instead of letting a mismatched value sneak downstream and explode three nodes later.
The inputs that matter
select- the one you'll actually touch. It's aSTRINGmarkedforceInput, which means you can't type the label into a widget; you have to connect a string from another node. That's deliberate - it keeps the selection data-driven so an API call or a Text Constant can steer it. A Text Constant holding your label is the canonical way to drive this.item_1…item_5- only acceptMITHRIL_MULTIPLEXER_INPUTwires. All five are optional; connect as many as you need.output- the selected item's data, typed*, so it plugs into whatever the items were.
Where people get burned
- The label has to match exactly. If
selectsaysportraitand the input's label isportraitwith a trailing space, you get aSelected label 'portrait' not founderror listing the available labels. The error message is genuinely helpful - read it. - Five items, that's the cap. There's no sixth slot, no "+" button. If you're multiplexing more than five options, you'll be chaining multiplexers or looking at a different pack.
- Same type or nothing. Connect a string and an image and the node goes red. That's the feature, not a bug.
Install
Part of MithrilNodes: ComfyUI Manager → Install Custom Nodes → search Mithril ("Mithril-Nodes for ComfyUI"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/MithrilMan/ComfyUI-MithrilNodes
Restart after. No requirements.txt, no model downloads. One caveat: the pack is early (0.1.0, essentially a single commit, zero community footprint on reddit as of this writing) and its README is a placeholder that describes features that don't exist yet. The code itself is small, readable, and does what it says - but treat it as a fresh project, not a battle-tested one.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| select | STRING | — | |
| item_1opt | MITHRIL_MULTIPLEXER_INPUT | — | |
| item_2opt | MITHRIL_MULTIPLEXER_INPUT | — | |
| item_3opt | MITHRIL_MULTIPLEXER_INPUT | — | |
| item_4opt | MITHRIL_MULTIPLEXER_INPUT | — | |
| item_5opt | MITHRIL_MULTIPLEXER_INPUT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | — |