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:
+9
-1
@@ -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}"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user