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

IMAGE Switch OSC Control @ vrch.ai

A phone's radio buttons choose which image is live

By VrchStudio·Created 2 years ago·Updated 19 days ago· 356
IMAGE Switch OSC Control @ vrch.ai
  • image0
  • image1
  • image2
  • image3
  • IMAGE
server_ip172.17.0.2
port8000
path/radio1
debugfalse

You've got four image streams rendering - maybe four prompts, four styles, four camera angles - and you want to flip between them live, the way a video switcher flips sources. The IMAGE Switch OSC Control node does exactly that: it listens for OSC messages and routes one of up to four input images to a single output, and you change which one with a radio-button-style OSC control on your phone or tablet.

What it is

The mechanism is OSC in, image router out. It listens on server_ip:port at path (default /radio1, and a radio group in TouchOSC is exactly the kind of control that path implies). Each OSC value that comes in selects one of the four optional inputs - image0, image1, image2, image3 - and that image passes through as IMAGE. You feed the four streams in, and whatever the OSC message says is what comes out. debug prints the incoming values so you can see which selection is arriving.

Setup follows the same script as the pack's other OSC nodes, and the same default-address trap: server_ip defaults to 172.17.0.2, a Docker address from the dev environment. Set it to the IP of the device running your OSC sender (or 127.0.0.1 if it's on the same machine), keep port at 8000 unless your app uses something else, and make sure path matches your control's OSC address rather than a placeholder. The pack ships a ready-made TouchOSC panel (comfyui_osc_control.tosc) that has a radio group wired for exactly this sort of thing - grab that, tweak the path, and you're switching images in minutes.

How to install

Install is the pack-standard story:

cd ComfyUI/custom_nodes
git clone https://github.com/VrchStudio/comfyui-web-viewer
cd comfyui-web-viewer
pip install -r requirements.txt

restart ComfyUI. Manager users search "ComfyUI Web Viewer". Windows portable: python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\comfyui-web-viewer\requirements.txt. No models or heavy deps.

Common issues

The practical pattern: generate several variations of a subject in parallel branches of the graph, wire each to one of the four image inputs, then mix them live into a Web Viewer node. It turns a static "pick the best of four" decision into a live performance move. Two honest notes. First, the node only has four inputs - if you're switching more sources, chain multiple switches or use a different approach. Second, if nothing switches, it's the usual OSC checklist: OSC is connectionless UDP, so there's no "connected" state - flip debug, watch the console, confirm the value is arriving, then confirm it maps to the input index you expect. Radio values in TouchOSC start at 1, and this node's inputs are zero-indexed, which has tripped up more than one person on their first try.

Categoryvrch.ai/control/osc

Inputs (8)

NameTypeDefaultDescription
server_ipSTRING172.17.0.2
portINT80000–65535
pathSTRING/radio1
debugBOOLEANfalse
image0optIMAGE
image1optIMAGE
image2optIMAGE
image3optIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE