ComfyUI Node

OSC Send

Fire a real OSC message over UDP — the node that makes the plan live

By criskb·Created 7 months ago·Updated 5 months ago· 0
OSC Send
    • sent_payload_json
    • bytes_sent
    • summary_json
    osc_plan_json{}
    payload_json{}

    MKROSCSend is where OSC actually happens in this pack. The plan node designs the message; this one sends it. Feed it an osc_plan_json from MKROSCMessagePlan and it opens a UDP socket, builds a proper OSC packet (address + type tag string + arguments, all packed to the OSC spec), and fires it at the host and port in the plan. Then it tells you how many bytes went out.

    It's a tiny node, and it's honestly refreshing in a pack this size: no dependencies, no callback, no queue. The runtime builds the packet with Python's standard library - check the pack source and you'll see a hand-rolled _osc_arg encoder and a plain socket.sendto. That means no python-osc to install, and it also means this is exactly as real as OSC gets: the receiving app will see a genuine message, not a file or a fake.

    Where you'd use it: any time ComfyUI should nudge live software. Send /mkrshift/frame to TouchDesigner when a render finishes, poke Resolume to advance a clip, flash a parameter in QLab, tell an LED rig to change state. Because the pack's network lane is built around plans + transport, you can also attach an endpoint plan so the message is triggered from outside - but the simple version is just: plan in, send, done.

    The inputs

    • osc_plan_json - the plan from MKROSCMessagePlan (address, host, port, payload). Wire it straight in.
    • payload_json (optional) - override the payload at send time. Handy when the plan carries the routing but you want to vary the data per execution without rebuilding the plan.

    The outputs

    • sent_payload_json - the payload as actually sent. If you overrode it, this reflects that.
    • bytes_sent (INT) - bytes that went out the socket. Zero or an exception means nothing left the machine.
    • summary_json - host, port, address, bytes, the OSC type tags the packet used, and warnings.

    Installing

    Same pack, same drill:

    cd ComfyUI/custom_nodes
    git clone https://github.com/criskb/MKRShift_Nodes
    

    restart, or ComfyUI Manager → "MKRShift". Nothing extra to install - this node is dependency-free by design.

    Gotchas

    The whole failure surface is networking, and UDP makes it sneaky. UDP is fire-and-forget: sendto succeeding does not mean anything received it, and there's no handshake to tell you otherwise. So if your receiver isn't reacting, check, in order: (1) is the receiver listening on the exact port in the plan, (2) is host right - 127.0.0.1 only works if both ends are on the same machine, (3) is the address /something the receiver actually filters on. Firewall blocking UDP is a classic. Also worth knowing: this sends a packet every time the graph executes. In a live loop that's a packet per run, which is what you want - just don't put it in a place that runs 60 times a second unless that's genuinely your intent. And empty {} payloads produce a packet with no arguments plus a warning; most receivers will shrug at it.

    CategoryMKRShift Nodes/Addons/Network

    Inputs (2)

    NameTypeDefaultDescription
    osc_plan_jsonSTRING{}
    payload_jsonoptSTRING{}

    Outputs (3)

    NameTypeDescription
    sent_payload_jsonSTRING
    bytes_sentINT
    summary_jsonSTRING