Mpi Prompt Chain Selector
Pick one list out of a chain, deterministically
- prompt_chain
- prompt_list
- selected_list
- seed
A "chain" in the ComfyUi-MpiNodes prompt system is a bundle of lists that travel together down one PROMPT_LST wire - usually because they share a theme or a chain of related options. Mpi Prompt Chain Selector looks at that bundle and hands back exactly one list from it, chosen by seed. Think of it as a seed-driven index into the chain.
How it works
The mechanism is almost offensively simple in the source: it seeds Python's random with your seed and calls random.choice on the chain. Same seed, same pick, always. That determinism is the entire reason the node exists - you could guess-and-check the selection manually, but then you couldn't reproduce it, and reproduction is how you debug a prompt system.
prompt_chain- the PROMPT_LST chain, from a MpiPromptListJoin or a series of chained lists.seed- which list wins.
Three outputs: prompt_list (the chosen single list, ready for a Processor), selected_list (a STRING of that list's title - handy for display, logging, or gating), and seed (passed through for coordination).
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes
Restart, or ComfyUI Manager → search ComfyUi-MpiNodes. No dependencies, pure Python, AGPL-3.0 from v1.2.7 (MIT through 1.2.6).
The honest take
This is a niche node, and it's fine that it is. Its natural habitat: you've built a chain of several lists that represent stages of a single concept - say five different "clothing eras" for a character - and you want exactly one era per run, chosen by the same seed that drives everything else. The selected_list title output is the sleeper feature: because it tells you which list won, you can wire it to a display node or use it to drive other choices in the workflow. One thing to keep straight: this selects a whole list, not an option within it. If you want a coin flip between two specific lists, that's MpiPromptListSelector; if you want one item picked out of a single list, that's the MpiPromptList's own specific_item or a _pickers_ token. Different tools, all from the same drawer.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt_chain | PROMPT_LST | Selects and outputs only 1 list from a chain | |
| seed | INT | 00–18446744073709550000 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| prompt_list | PROMPT_LST | — |
| selected_list | STRING | — |
| seed | INT | — |