Weighted Randomizer
Rig the dice on your ComfyUI random picks
- W_RANDOMIZER
It draws nothing, samples nothing, and that's the point
Drop Weighted Randomizer on the canvas and it looks like a node that failed to load. One input, one custom-typed output, no model, no image, no prompt, and nothing happens when you queue. That's correct - it only makes sense as half of a pair.
The other half lives in the same pack: Dynamic Type Selector, Dynamic Group Selector, and Dynamic Combo each have a random_selection toggle that picks one of their inputs (or one line of a list) fresh each queue run - uniformly by default. Wire this node into the selector's weighted_randomizer input and the odds stop being uniform.
Why you'd want this
"Variety without rewiring" is the real goal. Queue twenty images overnight: seventeen in the look you trust, three experiments on a new LoRA branch. Or eight characters in a list, one of whom should show up four times as often as the rest.
You've met the idea if you've used wildcards - Impact Pack's __wildcard__, the old {brown|blonde|black} syntax - variety you don't hand-edit between runs. Same itch, bigger scale: a wildcard swaps a word, while a random-selection selector swaps which branch runs at all - a different checkpoint, a different LoRA stack, a different subgraph feeding one output, with ComfyUI's lazy execution meaning the losing branches never run.
How the weighting actually works
The mechanism is dumb in a good way. Every weight widget is named input_0, input_1, … mirroring the selector's socket names. On execute the node walks them, sorts by number, and returns the values as one flat list of integers. The selector reads that list positionally: with random_selection on it builds a pool of its connected inputs and calls random.choices with weight list[i] for input index i. Three consequences:
- A weight of 0 drops that index from the pool entirely - a soft mute for a branch you're not in the mood for, without unplugging anything.
- A missing weight counts as 1, so a randomizer with only
input_0filled in isn't suppressing the other branches, just ignoring them; the pick stays uniform. Extra weights are ignored too. - All-zero excludes nothing. If every eligible index is 0, the code falls through to a plain uniform
random.choice.
One trap follows from that positional read: keep your slots matched to the selector's sockets. Indices match by number, but the list is packed, so a gap doesn't mean "skip that branch" - it means the numbers stop lining up with what you think they weight. On Dynamic Combo, the README admits the weights never track your parsed list: index 0 is the first item after splitting, and you recheck by hand after editing choice_list or split_mode.
The input and output that matter
input_0(INT, default 1, min 0, max 99) - the first weight slot, and the only input the schema declares. Every other weight is a dynamically added widget that behaves identically.weighted_randomizer(typeW_RANDOMIZER) - the output, wired into theweighted_randomizerinput on Dynamic Type Selector, Dynamic Group Selector, or Dynamic Combo. Nothing else in ComfyUI consumes this type, so don't expect rgthree's switch nodes to care about it.
More slots come from the right-click menu: Add Weight, Remove Weight, or Batch Add/Remove Weights. Cap is 99, and you can't remove the last one. The setting that changes how you use it is Settings → Wakaura → Weighted Randomizer → "Sync weight count with linked selector", which sizes the weight slots to the highest input count of the Dynamic Type/Group Selectors it's wired to - and hides those manual menu items while it's on.
Install
No models, no extra pip packages - the only declared dependency is the ComfyUI frontend package.
cd ComfyUI/custom_nodes
git clone https://github.com/wakaura-asaho/comfyui-dynamic-selector.git
# restart ComfyUI
The README's own preferred route is ComfyUI Manager → Install via Git URL → paste the repo URL → restart.
Where it goes wrong
Nothing random happens. Usually random_selection is off on the consumer; weights only apply to the random path. On Dynamic Type Selector use_bool_item overrides it too, so a randomizer wired into a boolean-switched node is quietly ignored.
None of the nodes appear in the menu. The pack uses ComfyUI's newer V3 node API (from comfy_api.latest import ComfyExtension, io). On an older ComfyUI that import fails and the whole pack vanishes - every node, not just this one. It asks for ComfyUI ≥ 0.12.3 and frontend ≥ 1.37.11. Update rather than debug.
It's random but not weighted the way you set it. Check ordering first: weights attach by index, so a value in input_1 does nothing if the branch you care about is on input_4.
Same seed, different branch every queue. By design - the selectors report themselves always-dirty (float("NaN") from fingerprint_inputs), so the roll happens every run instead of being cached.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| input_0opt | INT | 10–99 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| W_RANDOMIZER | W_RANDOMIZER | — |