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

TEXT Switch OSC Control @ vrch.ai

Radio buttons for your prompts

By VrchStudio·Created 2 years ago·Updated 19 days ago· 356
TEXT Switch OSC Control @ vrch.ai
    • TEXT_OUTPUT
    text1
    text2
    text3
    text4
    text5
    text6
    text7
    text8
    server_ip172.17.0.2
    port8000
    path/radio1
    debugfalse

    TEXT Switch OSC Control is what you want when you have a set of mutually exclusive choices and a finger. It holds up to eight text options, listens to a single OSC path, and whichever index your controller sends is the text you get out. It's the radio-button version of the pack's TEXT Key Control - instead of cycling with a key, you tap one of eight buttons and the selection jumps straight to it. No cycling through the whole list to get back to option one.

    How it works

    Set up text1 through text8 with your options - full prompts, style tags, system messages, whatever strings you're switching between. Then point the node at your OSC server with server_ip and port (8000 by default) and give it a single path (default /radio1). Your OSC client sends an integer index - 0 through 7 - to that path, and the node outputs the corresponding text as TEXT_OUTPUT.

    One behavior worth knowing: if it receives an out-of-range index, it keeps the previous output rather than blanking out. That's defensive by design - a stray 9 from a misconfigured controller won't nuke your current selection mid-run. It does mean "garbage in, silence out," so if the node ever looks frozen, check what indices the client is actually sending.

    This pairs naturally with TouchOSC's radio-button control, and the pack's bundled panel (comfyui_osc_control.tosc) is built to speak these paths on port 8000.

    Where it fits

    The pattern is: a tablet with eight buttons, each one a different look. Press "neon," you get the neon prompt; press "ink," you get the ink prompt. Because it's a single index rather than a toggle, it's the cleanest way to pick one of N presets - the node is stateless between messages, so there's no drift, no latched state, nothing to reset. Wire TEXT_OUTPUT into a CLIP Text Encode or a prompt builder and combine it with the pack's TEXT Concat OSC Control if you want a fixed preset plus live-added tags.

    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 comes with the pack's requirements. First install is slow because that file also bundles the optional Music2Emotion stack; it doesn't touch this node, just let it finish.

    Gotchas

    The default server_ip of 172.17.0.2 is the author's Docker-bridge address - on a normal install, set it to 127.0.0.1 or your LAN IP or nothing will arrive. And mind the zero-based indexing: your OSC client sends 0 for the first text box, not 1. Get that backwards and every selection is off by one, which feels like the node is broken when it's just doing what you told it. Enable debug and the console will show you exactly what indices are landing.

    Categoryvrch.ai/control/osc

    Inputs (12)

    NameTypeDefaultDescription
    text1STRING
    text2STRING
    text3STRING
    text4STRING
    text5STRING
    text6STRING
    text7STRING
    text8STRING
    server_ipSTRING172.17.0.2
    portINT80000–65535
    pathSTRING/radio1
    debugBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    TEXT_OUTPUTSTRING