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

SWITCH OSC Control @ vrch.ai

Eight OSC toggles, one node, zero mouse

By VrchStudio·Created 2 years ago·Updated 18 days ago· 356
SWITCH OSC Control @ vrch.ai
    • SWITCH_1
    • SWITCH_2
    • SWITCH_3
    • SWITCH_4
    • SWITCH_5
    • SWITCH_6
    • SWITCH_7
    • SWITCH_8
    server_ip172.17.0.2
    port8000
    path1/toggle1
    path2/toggle2
    path3/toggle3
    path4/toggle4
    path5/toggle5
    path6/toggle6
    path7/toggle7
    path8/toggle8
    debugfalse

    SWITCH OSC Control is the pack's answer to "I need eight on/off buttons in front of me." It watches eight separate OSC paths and turns each into a boolean output, so a tablet full of toggle buttons becomes eight switches in your graph. This is the node that makes live control of anything conditional feel natural - flip a button on the tablet, and a whole branch of your workflow turns on or off.

    How it works

    You give it a server_ip and port (8000 default) plus eight paths - path1 through path8, defaulting to /toggle1/toggle8. Your OSC client sends 1 to a path for ON and 0 for OFF, and the matching output flips. The outputs are literally SWITCH_1 through SWITCH_8, all booleans. One message, one switch, zero state to manage on your side.

    The crucial detail is that these are value-based, not edge-triggered: you send 0 or 1 to set the state, and the node reflects whatever the last message said. That means TouchOSC toggle buttons work perfectly - each press sends the opposite value - but it also means a momentary button that sends 1 on press and nothing on release won't behave the way you expect. Set your client to send both states.

    A sane beginner setup: load the pack's bundled TouchOSC panel (comfyui_osc_control.tosc), which already speaks /toggle1-style paths on port 8000. Point it at your machine and the switches come alive without any path renaming.

    Wiring it

    Eight booleans give you a lot of routing for very little effort:

    • Feed them into Trigger Toggle nodes if you want them to latch into a state that survives a message disappearing.
    • Wire them into conditionals or TEXT Concat OSC Control to build a prompt out of active tags.
    • Use them to bypass a whole segment of the graph - mute the upscaler, drop the LoRA, switch between two branches.

    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 arrives with the pack. First install is slow because the requirements also bundle the optional Music2Emotion stack; that's unrelated, let it finish.

    Gotchas

    Same network trap as every OSC node here: the default server_ip of 172.17.0.2 is a Docker-bridge address that means nothing on a normal desktop. Set it to 127.0.0.1 or your LAN IP. And don't skip sending 0 - a switch that never receives an OFF will stay ON forever, which is exactly the kind of thing you discover mid-set. Enable debug while testing and watch the console confirm each path is landing before you trust it live.

    Categoryvrch.ai/control/osc

    Inputs (11)

    NameTypeDefaultDescription
    server_ipSTRING172.17.0.2
    portINT80000–65535
    path1STRING/toggle1
    path2STRING/toggle2
    path3STRING/toggle3
    path4STRING/toggle4
    path5STRING/toggle5
    path6STRING/toggle6
    path7STRING/toggle7
    path8STRING/toggle8
    debugBOOLEANfalse

    Outputs (8)

    NameTypeDescription
    SWITCH_1BOOLEAN
    SWITCH_2BOOLEAN
    SWITCH_3BOOLEAN
    SWITCH_4BOOLEAN
    SWITCH_5BOOLEAN
    SWITCH_6BOOLEAN
    SWITCH_7BOOLEAN
    SWITCH_8BOOLEAN