Nodes/MKRShift_Nodes/WebSocket Bridge Plan
ComfyUI Node

WebSocket Bridge Plan

A WebSocket handoff as a JSON contract — plan first, connect later

By criskb·Created 7 months ago·Updated 5 months ago· 0
WebSocket Bridge Plan
    • websocket_plan_json
    • manifest_line
    • summary_json
    urlws://127.0.0.1:8188/mkrshift
    channelframe
    payload_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, default ws://127.0.0.1:8188/mkrshift. Notice the port: 8188 is ComfyUI's own server port, so the intended default is a /mkrshift channel on your own ComfyUI instance. For a real remote target, point it at the actual host.
    • channel - the message channel, default frame. 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.

    CategoryMKRShift Nodes/Addons/Network

    Inputs (3)

    NameTypeDefaultDescription
    urlSTRINGws://127.0.0.1:8188/mkrshift
    channelSTRINGframe
    payload_jsonSTRING{}

    Outputs (3)

    NameTypeDescription
    websocket_plan_jsonSTRING
    manifest_lineSTRING
    summary_jsonSTRING