Nodes/VLM_nodes/VLA Policy — OpenPI WebSocket
ComfyUI Node Runs on cloud

VLA Policy — OpenPI WebSocket

Talk to the official openpi server over WebSocket, from inside ComfyUI

By gokayfem·Created 3 years ago·Updated 9 days ago· 583
VLA Policy — OpenPI WebSocket
  • observation
  • actions
  • inference_report
endpointws://127.0.0.1:8000
observation_layoutFlat keys (DROID / LIBERO)
state_keyobservation/state
prompt_keyprompt
timeout_seconds120
allow_remotefalse

openpi is the open-source framework behind the π0 and π0.5 robot policies, and it ships its own MessagePack-over-WebSocket server protocol. VLA Policy - OpenPI WebSocket is the pack's native client for that exact protocol - not a generic wrapper, but a client that speaks openpi's message format so you can drop a VLA_OBSERVATION straight into an openpi server that's running in its own environment and get the action chunk back.

The inputs assume you know what you're pointing at. observation comes from the Observation Builder. endpoint defaults to ws://127.0.0.1:8000 - that's the openpi server's default WebSocket port, and since this is the native protocol the pack requires the real openpi server, not a stand-in. observation_layout is the interesting one: openpi's DROID/LIBERO policies expect flat keys (the default), while ALOHA-style bimanual policies use nested images - picking wrong means the server can't find your frames. state_key (default observation/state) and prompt_key (default prompt) let you match the exact key names your openpi checkpoint was trained with, because those aren't universal.

Auth is the same pattern as every policy node here: OPENPI_API_KEY lives in the server environment, never in the workflow. allow_remote defaults to false - remote connections need explicit opt-in, and given that a WebSocket policy server is a live robot-policy endpoint, the pack's caution is justified.

Outputs are the familiar pair: actions (VLA_ACTIONS) and inference_report (JSON string with the server's response and timing). Wire actions into the safety gate - openpi models output raw chunks, and raw chunks deserve a gate before they go anywhere near a controller.

Installing it

This client needs the lightweight robotics extra on top of the main pack:

cd ComfyUI/custom_nodes
git clone https://github.com/gokayfem/ComfyUI_VLM_nodes
python -m pip install -r ComfyUI/custom_nodes/ComfyUI_VLM_nodes/requirements.txt
python -m pip install -r ComfyUI/custom_nodes/ComfyUI_VLM_nodes/requirements-robotics-client.txt

That extra brings in msgpack and websockets - small, and it keeps the heavy openpi stack out of ComfyUI's Python. The openpi server itself runs in its own environment (the pack's examples walk through the setup). ComfyUI Manager also works for the main install.

Common issues

  • Handshake/format errors → you're not actually talking to an openpi server, or the layout is wrong. Confirm the endpoint really is an openpi MessagePack WebSocket server, then double-check observation_layout for your policy family.
  • "Unknown key"state_key / prompt_key don't match the checkpoint's names. Look at what your openpi config calls them and mirror it.
  • Auth failuresOPENPI_API_KEY mismatch between the ComfyUI environment and the openpi server. Same token, both sides, restart after setting.
  • Chunk looks fine but the robot is confused → openpi observations are exacting; an extra or missing camera key from the Observation Builder will pass validation here and fail semantically. Check observation_summary upstream.

This is the node to reach for when your pipeline is explicitly openpi-based (π0/π0.5). If you're running any policy through the pack's own sidecar instead, the Universal HTTP node is the simpler fit - the WebSocket client is the specialist tool.

CategoryVLM Nodes/Robotics/Policies

Inputs (7)

NameTypeDefaultDescription
observationVLA_OBSERVATION
endpointSTRINGws://127.0.0.1:8000
observation_layoutCOMBOFlat keys (DROID / LIBERO)2 options: Flat keys (DROID / LIBERO), Nested images (ALOHA)
state_keySTRINGobservation/state
prompt_keySTRINGprompt
timeout_secondsFLOAT1200.1–600
allow_remoteBOOLEANfalse

Outputs (2)

NameTypeDescription
actionsVLA_ACTIONS
inference_reportSTRING