comfyui-dynamic-selector Introduction
comfyui-dynamic-selector is a collection of ComfyUI utility nodes that helps you choose, organize, and repeat parts of an image-generation workflow. Instead of rebuilding a graph whenever you want to try another image, prompt, model, or setting, you can connect several options and control which one flows through the graph.
The extension is useful when you want to:
- Switch between connected inputs without rewiring your workflow.
- Give inputs readable names, such as character or scene names.
- Keep related assets together and choose an item from a group.
- Add variety by making a random choice, with optional weights to make some options more likely.
- Run the same downstream workflow across a series of prompts or numerical settings.
These nodes route and organize data; they do not generate images by themselves. Your existing ComfyUI nodes continue to perform the generation.
How comfyui-dynamic-selector Works
Think of a selector as a junction in your workflow. Several paths enter it, but only the chosen path leaves through its output. For example, you might connect three images to input_0, input_1, and input_2, then choose which image goes to the next node. Dynamic Type Selector evaluates only the selected branch, so unselected branches do not need to run.
The input_N labels are numbered from zero: input_0 is the first slot, input_1 is the second, and so on. Index outputs use those same numbers. A slot can remain empty until you connect something to it.
There are several ways to make a choice:
- By number: Select an
input_Nindex. - By name: Give each Dynamic Dictionary input a key, then select that key.
- By condition: Use a boolean toggle to choose between two configured options.
- At random: Let the node pick an eligible input each run; optionally provide weights to influence the odds.
Groups add a second level of choice. A Dynamic Group bundles related items into one GROUP connection. A Dynamic Group Selector then chooses both the group and an item inside it—like choosing an asset folder first, then a particular asset in that folder.
Iterators work differently from selectors. They produce a list of values, and ComfyUI runs connected downstream nodes once per value. For example, a Float Iterator connected to a sampler’s CFG input lets you compare several CFG settings in one queued run.
comfyui-dynamic-selector Features
Dynamic Type Selector
Use Dynamic Type Selector as a flexible switch for connected data such as images, latents, models, or strings.
- Right-click the node to add or remove
input_Nslots. The context menu also supports batch changes, up to 99 inputs. - Connect an input to establish the node’s data type. The output follows the connected type; when no inputs are connected, it returns to an unrestricted (“any”) type.
- Set
selectto the zero-based index you want to pass through. Theindexoutput reports the index chosen for that run. - Enable
use_bool_itemto choose between the indices initem_trueanditem_false. While this is enabled,selectis ignored. - Enable
random_selectionto choose among connected inputs at run time. Without a Weighted Randomizer, each eligible input has an equal chance. Manual selection controls are disabled while random selection is on.
For example, connect three candidate images and change select from 0 to 2 to send the third image downstream without moving any links.
Adding inputs from the context menu
Dynamic Dictionary
Dynamic Dictionary is a switch whose branches have names. Each numbered input has a matching editable key field (key_0, key_1, and so on). You could name branches portrait, landscape, and detail rather than remembering their numbers.
- Choose a key with
selection, or enableuse_bool_itemand configureitem_trueanditem_falsefor conditional key selection. OUTPUTpasses through the chosen input’s value.KEYoutputs its resolved name as text, which you can use elsewhere in the workflow.- A blank key falls back to
key_N, whereNis its input number. - If multiple branches have the same key, the first matching branch is selected. Unique names make the result easier to predict.
random_selectionchooses among connected input indices. You can connect a Weighted Randomizer to bias those choices; manual key-selection controls are disabled in random mode.type_strictchecks for mismatched ComfyUI data types and raises an error when connected values do not match. If input0is already connected when you turn on strict typing, mismatched items are disconnected immediately.
Like Dynamic Type Selector, it supports context-menu and batch changes to its inputs, up to 99 slots.
Be careful when mixing types: The output type can change with the selected input. If it no longer matches the type expected by a downstream node, ComfyUI may disconnect that link.
Dynamic Dictionary with named image choices
Dynamic Group and Dynamic Group Selector
Dynamic Group packs multiple inputs of the same type into one GROUP output. Add or remove its input slots through the context menu. This is helpful when you want to keep related images, models, or other assets together.
Dynamic Group Selector opens that collection for selection:
- Choose a connected group using
select_group. - Choose the item inside that group using
index. - Pass the item onward through
OUTPUT.
The node’s group_index output reports the chosen group’s input_N index, while its index output reports the chosen item’s position within that group.
Enable Type Strict if all connected groups must contain the same data type. A mismatch raises an error and stops execution. Leave it off when your workflow needs more flexibility.
With random_selection on, the node randomly chooses a connected group, then randomly chooses an item within that group. A Weighted Randomizer can influence the group choice, but the choice of item inside that group remains uniform. The manual group and item controls are disabled in random mode.
Grouping assets and selecting an item
Dynamic Combo
Dynamic Combo turns a text list into a searchable dropdown. Enter options in choice_list, select a splitting method, and choose an item from the resulting choice menu. The dropdown updates as you edit the list.
You can separate items by newlines, commas, semicolons, pipes (|), a custom delimiter, or a regular expression. The node outputs the selected string, its zero-based position in the parsed list, and the cleaned-up full list.
For example, enter a list of art directions and send the selected string into a prompt field. You can also use random_selection to pick an item each run. While random mode is on, the manual choice dropdown is disabled.
A Weighted Randomizer can bias Dynamic Combo by list position: index 0 means the first item after splitting. Its weight widgets do not automatically adjust when the list changes. Add enough weights yourself for the options you want to configure, and check them again if you edit choice_list or split_mode. Extra weights are ignored; an eligible item with no corresponding weight uses weight 1.
Weighted Randomizer
Weighted Randomizer supplies integer weights that influence random choices. Connect its weighted_randomizer output to a Dynamic Type Selector, Dynamic Dictionary, Dynamic Group Selector, or Dynamic Combo with random_selection enabled.
Its input_0, input_1, and other weight widgets correspond to branch or list indices. A larger weight makes an eligible option more likely to be chosen. Add or remove weights from the context menu or with the batch dialog.
In ComfyUI Settings → Wakaura → Weighted Randomizer, Sync weight count with linked selector can match the number of weight widgets to the maximum input count across linked Dynamic Type Selector and Dynamic Group Selector nodes. Manual weight add/remove menus are hidden while sync is on. This setting does not sync weights to Dynamic Combo’s parsed list.
You can also open the randomizer example workflow to inspect the connections.
Float, Int, and String Iterators
Iterators let you repeat downstream work across a list of values:
| Node | What you provide | Example use |
|---|---|---|
| Float Iterator | Start, Stop, and Increment decimal values | Compare several CFG values in a sampler or test model-patcher settings. |
| Int Iterator | Start, Stop, and Increment whole numbers | Step through a range of integer settings. |
| String Iterator | A list of text items | Compare prompts or other text variations. |
Float Iterator checks that the increment moves toward the stop value, preventing an endless sequence. It also uses decimal rounding to reduce small floating-point precision errors. String Iterator supports the same splitting methods as Dynamic Combo—newlines, commas, semicolons, pipes, a custom delimiter, or regex—and has Allow Empty Items for cases where empty entries should be passed through.
Float Iterator connected to KSampler
Float Iterator testing FreeU_V2 settings
String Iterator comparing prompts
Settings that affect your workflow
Find these controls in ComfyUI Settings → Wakaura:
| Section | Setting | Effect |
|---|---|---|
| Dynamic Selector | Dynamic socket growth | Automatically grow or compact input_N sockets as links are connected or disconnected. Turn it off to manage slots through the context menu only. |
| Dynamic Selector | Auto-collapse empty inputs | When socket growth is enabled, trim trailing empty slots and keep indices compact. Recheck indices if your workflow relies on specific slot numbers. |
| Iterator | Iterator loop cooldown (seconds) | Pause between list steps on supported heavy downstream nodes. 0 disables the pause. |
| Iterator | Extra cooldown nodes | Use Search & add nodes… to include additional heavy node types in cooldown behavior. |
| Weighted Randomizer | Sync weight count with linked selector | Keep weight-widget counts aligned with linked type/group selector inputs. |
Cooldown applies to supported heavy operations, such as core samplers, common VAE encode/decode nodes, and certain upscale nodes. It does not pace lightweight preparation steps. For long iterator runs, a modest pause—for example, 2–10 seconds—may help manage thermals or VRAM pressure, though it will make those runs take longer.
What's New with comfyui-dynamic-selector
The provided documentation identifies these pack updates:
| Version | Changes | Why it matters |
|---|---|---|
| 1.3.00 | Added Weighted Randomizer, random_selection, and the extension settings API. | You can introduce repeatable workflow structure with different choices on each run, and bias how often eligible options are selected. |
| 1.4.00 | Added iterator loop cooldown and selector index / group_index outputs. | You can pace heavy operations during iterator runs and send the chosen indices to other parts of a workflow. |
Troubleshooting comfyui-dynamic-selector
My output link disconnected after I changed inputs
- Check the data type of the newly connected or selected branch—for example, image versus latent.
- Check what type the downstream node expects.
- Connect matching types to the selector, or route different types to appropriate downstream nodes.
- For Dynamic Dictionary or Dynamic Group Selector, enable strict typing if you want mismatches to produce an explicit error rather than allowing mixed-type choices.
The selector’s output type follows connected data. A link can disconnect when that type no longer matches the next node.
A manual selection control is greyed out
- Check whether
random_selectionis enabled. Turn it off to choose manually. - On Dynamic Type Selector or Dynamic Dictionary, check
use_bool_item. When it is enabled, the main selection control is ignored in favor of the configured true/false options.
Random choices or weights do not match my options
- Confirm that the choices you expect are connected. Selector random mode chooses among connected branches.
- Match each weight to the correct zero-based
input_Nor parsed-list index. - For Dynamic Combo, recheck the weight count and positions after editing
choice_listorsplit_mode; its options do not auto-sync to Weighted Randomizer. - For linked Dynamic Type Selector or Dynamic Group Selector nodes, check whether Sync weight count with linked selector is enabled in Settings if you expect the widget count to adjust automatically.
Dynamic Dictionary selects the wrong named item
Check for duplicate keys. If several items have the same name, the first matching one is used. Rename the keys so each branch has a unique, recognizable name. A blank key resolves to key_N.
Type Strict stops my workflow
A connected value or group has a different ComfyUI data type from the others. Review the connected branches, replace the mismatched data, or turn off strict typing if your workflow intentionally mixes types. On Dynamic Dictionary, enabling type_strict with input 0 connected can immediately disconnect mismatched items.
An iterator example workflow reports a missing Text Format node
The example iterator workflows use ComfyUI’s newer native Text Format node. Update ComfyUI, or replace that node with an alternative that makes the connections you need. The author reports testing these examples with ComfyUI 0.24.1.
Frequently asked questions
Do I need a separate model for this extension?
No extension-specific model is described. These nodes organize and route the data already available in your ComfyUI workflow; you still use your usual generation models and nodes.
Does random selection weight every item inside a Dynamic Group?
No. Weighted Randomizer can bias which group is chosen. The item inside the selected group is chosen uniformly.
Will cooldown slow every node in my iterator workflow?
No. It pauses between iterator list steps on supported heavy downstream nodes, not on every lightweight step. A cooldown value of 0 turns it off.
How many dynamic selector inputs can I add?
Dynamic Type Selector and Dynamic Dictionary support up to 99 inputs.
Learn More about comfyui-dynamic-selector
The example workflows are a practical place to start: open one in ComfyUI, follow its connections, and replace the sample inputs with your own assets or prompts.
| Resource | What it demonstrates |
|---|---|
example_workflow.json | Basic Dynamic Type Selector use |
example_workflow_gs.json | Dynamic Group and Group Selector |
example_workflow_iterator.json | Float and string iterators |
example_workflow_randomizer.json | Random selection with Weighted Randomizer |
QwenImage2.1_FacialExpressions in the workflows folder | Using a String Iterator to create 27 facial expressions in one run |
For another visual reference, see the updated String Iterator screenshot.
