From 0d9e9382c7b024f198a22c12e5ef4f7d760d61a6 Mon Sep 17 00:00:00 2001 From: Acly Date: Mon, 28 Oct 2024 14:09:52 +0100 Subject: [PATCH] Don't display JPEG images from websocket (used for ksampler preview) #1330 --- ai_diffusion/comfy_client.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ai_diffusion/comfy_client.py b/ai_diffusion/comfy_client.py index 0516618dc..14a8956d1 100644 --- a/ai_diffusion/comfy_client.py +++ b/ai_diffusion/comfy_client.py @@ -721,9 +721,7 @@ def _extract_message_png_image(data: memoryview): if len(data) > s: event, format = struct.unpack_from(">II", data) # ComfyUI server.py: BinaryEventTypes.PREVIEW_IMAGE=1 - if event == 1: - if not (format == 1 or format == 2): # JPEG=1, PNG=2 - log.warning(f"Websocket binary data has unknwon image format '{format}'") + if event == 1 and format == 2: # format: JPEG=1, PNG=2 return Image.from_bytes(data[s:]) return None