Nodes/Orion4D_MetaNode/πŸ“ Text Road
ComfyUI Node

πŸ“ Text Road

A text mixer with per-input on/off, prefix, suffix β€” and zero fiddly regex

By orion4dΒ·Created 5 months agoΒ·Updated 5 months agoΒ· 5
πŸ“ Text Road
    • text_out
    β—„separator\nβ–Ί
    β—„config_json[]β–Ί

    Assembling a prompt from parts is one of those jobs ComfyUI makes oddly painful. You want "subject, then style, then camera, then lighting", with the ability to switch a part on and off and glue everything together with a separator. Text Road is that, done as a single node: plug in as many text inputs as you need, give each one a label, a prefix, a suffix, and an on/off toggle, and it concatenates the active ones into one output string.

    The "Road" name comes from this pack's Dynamic Road router - Text Road is the text-only version of the same idea, and the two share the same dynamic-port trick. Connect a wire to a txt_N input and another slot materializes. Everything else is handled by small per-slot controls managed in JavaScript, so the Python class stays tiny.

    How it works

    Behind the scenes the frontend keeps a config_json string - an array of {enabled, prefix, suffix} entries, one per slot. On each run the node parses that config, walks the txt_N inputs, and for every enabled slot builds prefix + value + suffix, then joins the results with your separator. It's a dumb, predictable concatenation, which is exactly what you want from a glue node.

    Two practical details. The separator resolves escape sequences, so typing \n gives you a real newline and \t gives a tab - no literal backslash-n appearing in your output. And disabled slots are skipped entirely, so toggling a segment off is like it was never there.

    Inputs and outputs

    • Inputs:
      • separator (STRING, default \n) - the join string; \n and \t are interpreted.
      • config_json (STRING, default []) - managed by the UI; you don't hand-edit this.
      • txt_1, txt_2, … - dynamic string ports, one per connected source.
    • Output: text_out (STRING) - the concatenation of all enabled, non-empty slots.

    When you'd reach for it

    Any time a prompt is modular. Feed it the positive prompt fragments you're testing (subject here, style there), and use the toggles to A/B whole sections without deleting them. Or build a structured positive prompt as: quality line, subject, style block, camera block - each with a suffix that adds its own comma or keywords. It also plays well with this pack's Load Text File if you keep fragments as files. The payoff is the same one the prompt-engineering playbook keeps circling back to: build prompts from reusable blocks instead of retyping the whole thing for every variation.

    Troubleshooting

    • A slot vanished from the output? Its enabled toggle is off, or its input is empty - both are silent skips by design.
    • \n appearing literally in the output? Check the separator field is literally the two characters backslash-n, not a newline you pasted in weirdly.
    • Order follows slot number. The concatenation goes txt_1 β†’ txt_2 β†’ … in port order, so keep your fragments in the order you want them read.

    Installing it

    It comes with the whole pack - Orion4D_MetaNode:

    cd ComfyUI/custom_nodes
    git clone https://github.com/orion4d/Orion4D_MetaNode
    

    Or install via ComfyUI Manager (search "Orion4D_MetaNode") and restart. It lives under Orion4D_MetaNode β†’ UI Widgets β†’ Dynamic Widgets. No extra dependencies. One honest note: this is a young, single-developer pack, so Text Road is a handy utility rather than a community standard - but the toggle-per-input idea is genuinely nice once you've used it.

    CategoryOrion4D_MetaNode/UI Widgets/Dynamic Widgets

    Inputs (2)

    NameTypeDefaultDescription
    separatorSTRING\nβ€”
    config_jsonSTRING[]β€”

    Outputs (1)

    NameTypeDescription
    text_outSTRINGβ€”