Nodes/ComfyUi-MpiNodes/Mpi Has Options
ComfyUI Node

Mpi Has Options

Turn a prompt-list pick into a workflow decision

By MadPonyInteractive·Created 11 months ago·Updated 5 days ago· 3
Mpi Has Options
    • boolean
    options_check
    selected_options

    The whole point of a prompt list is that the list decides what gets generated, not you. But that creates a coordination problem: if the list randomly picks "night time," the rest of the workflow might need to react - different lighting nodes, a different seed, a different upscale path. MpiHasOptions is the bridge. It looks at what the list actually selected and answers one question: did it pick any of these options? A boolean out, a workflow branch in.

    How it works

    Two inputs, both strings. selected_options is the output from a MpiPromptList (the node's selected_options output, a comma-separated string of what got picked). options_check is the list of options you care about, also comma-separated - your "is this relevant?" filter.

    The check is case-insensitive and does a contains-match: if any of the selected options appears in your check list, the boolean output is true. So with options_check set to night, rain, snow and the list having picked Night time, you get true - and you can route that into an MpiIfElse to switch behavior. Nothing picked matches, you get false and the workflow takes the default path.

    The inputs that matter

    • options_check - the options to watch for, comma-separated.
    • selected_options - wired from the prompt list's selected_options output.

    One output: boolean.

    Where you'd actually use it

    The classic pattern is a prompt list that varies scene or mood, and a workflow that needs to branch on the outcome. "If the pick contains portrait, use the portrait framing; else use the wide framing." That's MpiHasOptionsMpiIfElse, with the framing nodes on either side. Because MpiIfElse is lazy, the branch you don't take doesn't compute - so a conditional prompt list costs you nothing when the option doesn't fire. The pack even pairs it with MpiPromptOverride when you want the branch to also change what gets generated, not just how.

    It also works for whitelist/blacklist sanity: if you have options that must never coexist, checking the selection before generation beats discovering the conflict in the output.

    Where people get burned

    The matching is per-option against your check list - it's "does the selection contain any of these terms," not "is the selection exactly equal." A check for night will also fire on midnight. If you need whole-word, plural-aware matching, the pack's MpiTextContains is the stricter tool; MpiHasOptions is deliberately loose because option names are usually short and distinctive. Also remember selected_options comes from the list's output - if you type a stale selection in by hand, you're testing a guess, not the actual pick.

    Install

    From the MadPonyInteractive/ComfyUi-MpiNodes pack. ComfyUI Manager → search ComfyUi-MpiNodes (publisher mad-pony-interactive), install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes
    

    then restart. Zero dependencies, no model files - it's string matching. The pack is AGPL-3.0 (≤ 1.2.6 MIT) and is the node library behind the author's Cubric Vision app.

    The verdict

    If you use the pack's prompt lists without branching on the result, this node is invisible - which is fine. The moment you want a generated prompt to actually drive the rest of the workflow, it's the hinge. One boolean, one MpiIfElse, and your prompt list stops being a text generator and becomes a workflow router.

    CategoryMpiNodes/Logic

    Inputs (2)

    NameTypeDefaultDescription
    options_checkSTRINGThe options to check if present in selected_options output from a 'Prompt List' (separated by commas)
    selected_optionsSTRING

    Outputs (1)

    NameTypeDescription
    booleanBOOLEAN