Skip to content

Commit

Permalink
Don't display JPEG images from websocket (used for ksampler preview) #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Acly committed Oct 28, 2024
1 parent 2354d4b commit 0d9e938
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ai_diffusion/comfy_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0d9e938

Please sign in to comment.