Dynamic Type Selector
The type-safe switch node that won't let you wire a LoRA into a model slot
- input_0
- OUTPUT
Every ComfyUI user eventually hits the same wall: you want one node to decide between two things - LoRA A or LoRA B, model X or model Y, this image or that image - and the only tool in the base install is a primitive switch that can't carry a MODEL or IMAGE through it. The DynamicTypeSelector from the wakaura-asaho/comfyui-dynamic-selector pack is the fix: a switch that handles any data type, including models, latents, images, conditioning, strings, whatever. And unlike the loose "route anything anywhere" nodes the community keeps fighting over, this one will refuse a connection that doesn't match the type it's already locked to.
How it works
You get a stack of inputs named input_0, input_1, input_2 and so on, plus an integer select widget. Set select to 2 and the node outputs whatever is connected to input_2. That's the whole core idea - a zero-based index picker.
The clever part is type discipline. When nothing is connected, every input and the output show as wildcard (*). The moment you connect your first branch - say a MODEL - the node locks itself to that type: the output becomes MODEL, all empty inputs snap to MODEL, and any future connection that isn't a MODEL gets rejected. Wire in a second LoRA where the node expects models and the connection simply refuses to happen, which is exactly the failure you want, early, instead of a confusing graph error at execution time. The same JS also gives you the right-click "Add Input" / "Remove Input" / "Batch Add/Remove Inputs" menu, up to a hard cap of 99 inputs.
There's also a boolean mode. Turn use_bool_item on and the select widget greys out; instead bool_item decides between item_true and item_false, each of which holds an input index. In plain terms: flip one boolean and the node routes one of two preselected branches. Handy for an A/B toggle in the middle of a workflow.
One genuinely nice backend detail: the node uses lazy evaluation. It fingerprints on select, so only the branch you actually picked gets executed - the unselected inputs aren't run at all. In a workflow where each branch is a full model load, that's the difference between a fast toggle and a machine-gun reload.
The inputs that matter
select- zero-based index of whichinput_Nto pass through. This is the one you'll touch 95% of the time.use_bool_item/bool_item/item_true/item_false- the two-branch toggle mode described above.input_0,input_1, … - the branches. Add more via the right-click menu.
Output is a single OUTPUT of whatever type the node is locked to, wired straight into whatever normally takes that type.
Installing it
This pack is one of the few with zero model downloads and zero heavy Python deps - its only dependency is a recent ComfyUI frontend. Easiest path: ComfyUI Manager → "Install via Git URL" → paste https://github.com/wakaura-asaho/comfyui-dynamic-selector → restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/wakaura-asaho/comfyui-dynamic-selector
# restart ComfyUI
Gotchas
The big one: this is written against the new V3 node API (comfyui-frontend-package >= 1.37.11, ComfyUI base >= 0.12.3). If the node shows up missing after install, or loads but its inputs misbehave, you're almost certainly on an older ComfyUI - update it first before you blame the pack. The whole pack is also flagged experimental by the author, and it's brand new with essentially zero community footprint yet, so treat it as early-adopter territory: read the source if something surprises you, and check the repo for updates. When a branch is missing, the node raises a clean "selected input must be connected" error at validation time, which beats a silent wrong-output every time.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| select | INT | 00–99 | Output the item based on the zero-based index selection. |
| input_0 | * | — | |
| use_bool_item | BOOLEAN | false | Use a true or false branch to select items. |
| bool_item | BOOLEAN | false | Set to true to use the item_true as the output; false to use the item_false. |
| item_true | INT | 00–99 | When set the bool_item to true, this item will be used as the output. |
| item_false | INT | 00–99 | When set the bool_item to false, this item will be used as the output. |
| random_selection | BOOLEAN | false | Randomly select an item from the inputs. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| OUTPUT | * | — |