Nodes/ComfyUI-Desert-Pixel-Nodes/DP Random Mode Switch
ComfyUI Node

DP Random Mode Switch

Route the picked random-generator text through

By DesertPixelAi·Created 2 years ago·Updated about a year ago· 25
DP Random Mode Switch
    • string
    • random_token_limit
    random_mode
    random_token_limit72
    Crazy_Random_Prompt
    Random_Psychedelic_Punk
    Random_Superhero
    Random_Vehicle
    Random_Letter_Style
    All_Mixed

    This is the half of the controller/switch pair that actually does something with your text. DP Random Mode Controller picks which of six random-generator modes is active; this node is where you wire in the actual outputs of those six generators, and it passes through only the one that matches whatever mode was picked. It's a named multiplexer - six possible inputs, one selected output.

    How it works

    You wire each of this pack's random-generator outputs into the matching optional input: your DP Random Superhero Prompt Generator output goes into Random_Superhero, your DP Random Vehicle Generator output goes into Random_Vehicle, and so on for Crazy_Random_Prompt, Random_Psychedelic_Punk, Random_Letter_Style, and All_Mixed. Then random_mode (fed either manually or from a DP Random Mode Controller upstream) decides which of those six wired inputs actually gets passed through as the final string output.

    This is the pattern to reach for when you want to swap between several different randomized prompt sources without rewiring your graph every time - set up all six generators once, wire them all into this node, and switch between them with a single dropdown (or drive that dropdown from a controller node upstream if you want it configurable from one central spot).

    Inputs and outputs

    Required:

    • random_mode - six-way choice matching the generators: Crazy Random Prompt, Random Psychedelic Punk, Random Superhero, Random Vehicle, Random Letter Style, All Mixed.
    • random_token_limit (0-512, default 72) - a token budget that passes through to the output alongside the routed string.

    Optional, one multiline STRING input per mode: Crazy_Random_Prompt, Random_Psychedelic_Punk, Random_Superhero, Random_Vehicle, Random_Letter_Style, All_Mixed - wire in whichever generator outputs you're using; you don't need all six connected if you're only using some of the modes.

    Two outputs: string (the routed text from whichever input matched the picked mode) and random_token_limit (INT passthrough).

    Installing it

    ComfyUI Manager: search ComfyUI-Desert-Pixel-Nodes, install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes
    

    Restart ComfyUI - no models, pure routing logic.

    Where people get tripped up

    The most common mistake: picking a mode you never actually wired an input for. Since all six inputs are optional, it's easy to build a graph with only two or three generators connected, then flip random_mode to one you forgot to wire - the string output will come back empty (or whatever the node's fallback for an unconnected input is) rather than throwing an obvious error, which can be confusing when everything upstream looks fine.

    The second: not connecting a DP Random Mode Controller upstream and forgetting that means you're setting random_mode by hand on this node directly. That's completely valid - the controller is a convenience for driving multiple things from one setting, not a requirement - but if you expected changing a controller elsewhere in your graph to affect this node's output and it isn't wired in, that's why nothing's changing.

    CategoryDP/text

    Inputs (8)

    NameTypeDefaultDescription
    random_modeCOMBO6 options: Crazy Random Prompt, Random Psychedelic Punk, Random Superhero, Random Vehicle, Random Letter Style, All Mixed
    random_token_limitINT720–512
    Crazy_Random_PromptoptSTRING
    Random_Psychedelic_PunkoptSTRING
    Random_SuperherooptSTRING
    Random_VehicleoptSTRING
    Random_Letter_StyleoptSTRING
    All_MixedoptSTRING

    Outputs (2)

    NameTypeDescription
    stringSTRING
    random_token_limitINT