WebSocket Bridge Plan
A WebSocket handoff as a JSON contract — plan first, connect later
- websocket_plan_json
- manifest_line
- summary_json
MKRWebSocketBridgePlan describes a WebSocket handoff as a JSON contract. Like every other ...Plan node in this pack's addon lane, it does not connect to anything - no socket is opened, no message is sent. What it builds is a websocket_plan_json that something else - a browser page, a DCC addon, a custom server - uses as the spec for an actual WebSocket link, carrying the payload you specify over the channel you name.
The idea: ComfyUI keeps state in the graph, but live tools speak WebSocket. A browser dashboard that wants your progress, a TouchDesigner component that wants frames, a remote client that wants control signals - all of them can receive over a WebSocket, but none of them know what you'll send until someone defines it. This node is that definition, as data instead of as a handshake you have to code by hand.
The inputs that matter
url- the WebSocket endpoint, defaultws://127.0.0.1:8188/mkrshift. Notice the port: 8188 is ComfyUI's own server port, so the intended default is a/mkrshiftchannel on your own ComfyUI instance. For a real remote target, point it at the actual host.channel- the message channel, defaultframe. A label the receiving side uses to route the payload - "these messages are frames," "these are controls," whatever your addon expects.payload_json- the message body, as JSON text. This is what gets sent when the plan is executed. It can be a static JSON blob, or you can wire a computed JSON string into it.
Outputs: websocket_plan_json (the plan, schema mkrshift_websocket_plan_v1, protocol websocket), a comma-joined manifest_line for logging, and summary_json with warnings - including whether your payload_json actually parsed.
Install
Part of MKRShift Nodes - install the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes
or ComfyUI Manager → search MKRShift_Nodes → restart. No pip dependencies, no ffmpeg - pure JSON in, JSON out.
Where people get burned
The recurring trap across this pack's plan nodes applies here hardest: people run it, see a URL, and assume it connected. It didn't - check summary_json for a has_path-style confirmation if you're unsure, but the tell is in the name: this is a plan. To actually move a frame over WebSocket you pair the plan with an addon or script that opens the socket and uses the contract. Second: malformed payload_json doesn't crash the node - it emits a warning in summary_json and builds the plan with an empty payload, so if your receiver keeps getting empty messages, the parse failure is upstream of the plan. And the default URL only makes sense if your consumer is actually listening on ComfyUI's own port - for anything else, set url to the real endpoint.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| url | STRING | ws://127.0.0.1:8188/mkrshift | — |
| channel | STRING | frame | — |
| payload_json | STRING | {} | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| websocket_plan_json | STRING | — |
| manifest_line | STRING | — |
| summary_json | STRING | — |