Nodes/ComfyUI Web Viewer/WebSocket Server @ vrch.ai
ComfyUI Node

WebSocket Server @ vrch.ai

The quiet engine behind ComfyUI Web Viewer's real-time browser streaming

By VrchStudio·Created 2 years ago·Updated 18 days ago· 356
WebSocket Server @ vrch.ai
    • SERVER
    server172.17.0.2
    port8001
    debugfalse

    Every one of those vrch.ai demo workflows - the live-portrait puppet, the gamepad-driven avatar, the audio-reactive visuals - has this node buried in the graph doing the actual plumbing. WebSocket Server @ vrch.ai doesn't generate a single pixel. That's exactly why it's the one you can't leave out: it's the hub that lets any browser tab stream frames out of ComfyUI in real time, and the whole Web Viewer node family is useless without it.

    What it actually does

    The VrchStudio/comfyui-web-viewer pack splits into viewer nodes (things that display), sender and loader nodes (things that move data), and this - the server. Run it once and it starts a WebSocket server inside ComfyUI on the port you give it (default 8001). That server keeps separate connection paths per data type - /image, /json, /latent, /audio, /video, /text, /midi - so one running server backs every WebSocket node in the pack, and multiple browser clients can connect to it at the same time.

    Two details are easy to miss. First, only one server can live on a given ip:port; if one is already running there, the node just attaches to it instead of erroring. Second, the connections stay alive even when your workflow isn't running, so your browser keeps showing the last frame while you tweak the graph and re-run. The node shows its state on the canvas - grey "Stopped" or green "Running" - and the HOST:PORT label under it is click-to-copy, which you'll want because every sibling node asks you for that address.

    The inputs and outputs that matter

    Only three inputs exist, and a beginner only really touches two of them:

    • server - an enum of 127.0.0.1, 0.0.0.0, or your machine's resolved default IP. The baked-in default is 172.17.0.2, which is just whatever the author's dev box resolved to (looks like a Docker bridge address). On your machine, 127.0.0.1 is right for local-only viewing; use 0.0.0.0 when you want to reach the viewer from your phone or another device on the LAN.
    • port - TCP port, default 8001. Leave it unless it's taken.
    • debug - turn this on and the console fills with per-connection logs; it's your first move when a browser won't connect.

    The single output, SERVER (a STRING), is the host:port address you wire into the server fields of the other Web Viewer nodes so they all point at the same hub. That's the one wire this node needs - even though ComfyUI marks it as an output node, meaning it executes fine on its own.

    How to install it

    This is the easiest part of the whole pack, because there are no model downloads. In ComfyUI Manager, search "ComfyUI Web Viewer" and install. Or by hand:

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

    Windows portable installs run the pip step with python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\comfyui-web-viewer\requirements.txt. Then restart ComfyUI. The optional Music2Emotion submodule in the README is only for the AUDIO Music to Emotion Detector node - you don't need it for anything here.

    Common issues

    Almost every failure with this node is browser-side, not node-side, and the README has the fixes:

    • CORS errors ("origin 'https://vrch.ai' has been blocked by CORS policy") happen when the viewer page is served from a different origin than ComfyUI. Launch ComfyUI with python main.py --enable-cors-header.
    • Chrome shows nothing when you view from another device over plain HTTP. Chrome treats non-localhost HTTP as insecure; add the ComfyUI server's IP under chrome://flags/#unsafely-treat-insecure-origin-as-secure (Firefox and friends usually just work over http-to-http).
    • Nothing connects at all. Remember the node must actually execute before the server starts - hit Run once with it in the graph, then check the green "Running" indicator. If it's grey, your browser never had a server to talk to.
    • For HTTPS on a remote box, the pack ships a dev-only self-signed cert so you can run python main.py --tls-keyfile ./custom_nodes/comfyui-web-viewer/https/key.pem --tls-certfile ./custom_nodes/comfyui-web-viewer/https/cert.pem --port 8189 --listen.

    It's not the node that wins you likes on the show-off post. But it's the dependency every real-time workflow in this pack shares - and in the ComfyUI custom-node world, that kind of quiet utility is exactly what's worth installing.

    Categoryvrch.ai/viewer/websocket

    Inputs (3)

    NameTypeDefaultDescription
    serverCOMBO172.17.0.23 options: 127.0.0.1, 0.0.0.0, 172.17.0.2
    portINT80011–65535
    debugBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    SERVERSTRING