Nodes/Dream Project Animation Nodes/β­† Big Text Switch
ComfyUI Node

β­† Big Text Switch

Pick between up to ten strings on the fly

By alt-key-projectΒ·Created 3 years agoΒ·Updated 2 years agoΒ· 114
β­† Big Text Switch
    • selected
    β—„select0β–Ί
    β—„on_missingβ–Ύβ–Ί
    β—„input_0β­†β–Ί
    β—„input_1β­†β–Ί
    β—„input_2β­†β–Ί
    β—„input_3β­†β–Ί
    β—„input_4β­†β–Ί
    β—„input_5β­†β–Ί
    β—„input_6β­†β–Ί
    β—„input_7β­†β–Ί
    β—„input_8β­†β–Ί
    β—„input_9β­†β–Ί

    Animation graphs are full of "this frame use prompt A, that frame use prompt B" moments, and manually rewiring is not an option mid-render. Big Text Switch [Dream] is the pack's answer for text: up to ten STRING inputs, one select value picks which one comes out. The same pattern repeats across the pack as Big Float/Int/Image/Latent/Palette switches - once you learn one, you've learned all six.

    How it works

    You plug strings into input_0 through input_9 (all optional - only connect the ones you use), set select to an index 0–9, and the node outputs that input as selected. The clever part is on_missing: because not every input is connected, the node needs to know what to do if you select an empty slot. Set it to previous and it walks backward to the nearest connected input; set it to next and it walks forward. So select doesn't have to match a connected slot exactly - the node finds the closest real value. Text inputs also have a special sentinel placeholder (β­†) so an unconnected-but-selected slot is reliably treated as "empty" rather than a blank string.

    The inputs that matter

    • select - INT, 0–9. The slot you want. This is the input you'll drive with a frame counter or Boolean To Int to swap prompts mid-animation.
    • on_missing - previous or next. What to do when the chosen slot is empty.
    • input_0 … input_9 - the candidate strings. Up to ten, connect as many as you need.

    Where it fits

    Wire several Text Input [Dream] (or prompt-builder) outputs into it, drive select from a frame counter, and different parts of your animation get different prompts without touching the graph. It's also handy for toggling between a positive prompt and a test prompt by just changing one number. Note these Big switches evaluate all their inputs eagerly - the pack has (commented-out) Lazy switch variants that only run the selected branch, but as shipped, everything upstream of the switch runs.

    Installing it

    Ships with Dream Project Animation Nodes - ComfyUI Manager (search Dream Project Animation) or clone https://github.com/alt-key-project/comfyui-dream-project into custom_nodes, pip install -r requirements.txt, restart. No model downloads.

    Common issues

    The main thing people trip on is select exceeding what's connected and then wondering why they get a weird value - that's the sentinel placeholder for unconnected text slots, which the on_missing logic is there to handle. Keep on_missing set deliberately. And because inputs are eager, if one of your ten branches is expensive (like an image pipeline), the switch won't save you compute - use it for cheap values like strings and numbers.

    Category✨ Dream/πŸ›  utils/β­† switches

    Inputs (12)

    NameTypeDefaultDescription
    selectINT00–9β€”
    on_missingCOMBO2 options: previous, next
    input_0optSTRINGβ­†β€”
    input_1optSTRINGβ­†β€”
    input_2optSTRINGβ­†β€”
    input_3optSTRINGβ­†β€”
    input_4optSTRINGβ­†β€”
    input_5optSTRINGβ­†β€”
    input_6optSTRINGβ­†β€”
    input_7optSTRINGβ­†β€”
    input_8optSTRINGβ­†β€”
    input_9optSTRINGβ­†β€”

    Outputs (1)

    NameTypeDescription
    selectedSTRINGβ€”