Nodes/ComfyUI Web Viewer/TEXT Concat OSC Control @ vrch.ai
ComfyUI Node

TEXT Concat OSC Control @ vrch.ai

Build a prompt by flipping tags on a tablet

By VrchStudio·Created 2 years ago·Updated 18 days ago· 356
TEXT Concat OSC Control @ vrch.ai
    • TEXT_OUTPUT
    text1
    text2
    text3
    text4
    text5
    text6
    text7
    text8
    server_ip172.17.0.2
    port8000
    path1/toggle1
    path2/toggle2
    path3/toggle3
    path4/toggle4
    path5/toggle5
    path6/toggle6
    path7/toggle7
    path8/toggle8
    separator,
    debugfalse

    TEXT Concat OSC Control is the node that turns a tablet into a prompt editor. You store up to eight text chunks, each one tied to its own OSC toggle, and the node glues together whatever chunks are currently switched ON. Flip "neon," "portrait," and "cinematic" and you get neon, portrait, cinematic out the other side. This is the classic live-tagging rig - it's the reason you can stand in front of a crowd and compose a prompt from a phone instead of typing it into ComfyUI.

    How it works

    Each of the eight text inputs - text1 through text8 - has a matching path, path1 through path8, defaulting to /toggle1/toggle8. Send 1 to a path and that chunk joins the output; send 0 and it drops out. The active chunks are joined with whatever separator you set (default is a comma) and emitted as a single TEXT_OUTPUT string. Empty text boxes contribute nothing, so you can leave slots spare for later.

    Two details make this genuinely useful rather than just a concat with extra steps:

    • It's value-based, not edge-triggered - your controller sends 0 or 1, and the node reflects the latest state. TouchOSC toggle buttons (or the pack's bundled comfyui_osc_control.tosc panel, which speaks these exact paths on port 8000) are the intended driver.
    • Order is fixed by slot number, so the output reads predictably: text1 always comes first, text8 always last, regardless of the order you flip things. Keep your structure - subject, style, lighting, quality - in slot order and the assembled prompt stays grammatical.

    Wiring it

    The output is a STRING, so it feeds a CLIP Text Encode, a text router, or another concat node downstream. The combo that gets the most mileage: run this node's output into TEXT Key Control's... no - more practically, pair it with the pack's TEXT Switch OSC Control if you want a fixed preset (radio-style) plus live tags (toggle-style) in the same prompt. Preset picks the base, this node adds the garnish.

    Installing it

    Standard pack install:

    1. ComfyUI Manager → search ComfyUI Web Viewer → install.
    2. Manual:
      cd ComfyUI/custom_nodes
      git clone https://github.com/VrchStudio/comfyui-web-viewer
      pip install -r requirements.txt
      
      Windows portable: python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\comfyui-web-viewer\requirements.txt.
    3. Restart ComfyUI.

    The python-osc dependency rides along in the pack's requirements. First install is slow because that file also bundles the optional Music2Emotion stack (librosa, pytorch_lightning, numba) - nothing to do with this node, just let it finish.

    Gotchas

    The usual OSC suspects apply: the default server_ip of 172.17.0.2 is a Docker-bridge leftover and means nothing on a normal desktop - set it to 127.0.0.1 or your LAN IP. And remember the value rule: a toggle that never receives 0 stays stuck ON, so your output can quietly keep a tag you thought you turned off. Flip debug on while you're setting up and watch the console confirm each path is landing before you go live with it.

    Categoryvrch.ai/control/osc

    Inputs (20)

    NameTypeDefaultDescription
    text1STRING
    text2STRING
    text3STRING
    text4STRING
    text5STRING
    text6STRING
    text7STRING
    text8STRING
    server_ipSTRING172.17.0.2
    portINT80000–65535
    path1STRING/toggle1
    path2STRING/toggle2
    path3STRING/toggle3
    path4STRING/toggle4
    path5STRING/toggle5
    path6STRING/toggle6
    path7STRING/toggle7
    path8STRING/toggle8
    separatorSTRING,
    debugBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    TEXT_OUTPUTSTRING