fix(nilor-nodes): prevent ComfyUI websocket 1009 disconnects by allowing large frames

- Accept large preview frames from ComfyUI without dropping the socket.
- Binary preview frames are still ignored by the consumer; this change stops the
  connection from closing with code 1009 (message too big).
- Impact: keeps workers from getting stuck "busy" and allows long video job
  queues to finish reliably.

Notes:
- To reduce bandwidth instead of disabling client handling, start ComfyUI with
  --preview-method none or a smaller --preview-size.
This commit is contained in:
Sebastian Monroy
2025-10-16 11:40:36 +01:00
parent a093a51291
commit bfba7b0265
+9 -1
View File
@@ -117,7 +117,15 @@ class WorkerConsumer:
while True:
try:
ws_url = f"{COMFYUI_WS_URL}?clientId={urllib.parse.quote(self.worker_client_id)}"
async with websockets.connect(ws_url) as websocket:
# Allow large preview frames from ComfyUI without dropping the connection (1009: message too big)
async with websockets.connect(
ws_url,
max_size=None, # disable message size limit
read_limit=64 * 1024 * 1024, # buffer up to 64 MiB per frame
max_queue=4, # small queue to avoid memory spikes
ping_interval=20,
ping_timeout=20,
) as websocket:
logger.debug(
f"ℹ️\u2009 Nilor-Nodes (worker_consumer): Connected to ComfyUI websocket at {ws_url}"
)