We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! Can you provide code example for decoding image?
The text was updated successfully, but these errors were encountered:
I'm using python code like this:
async for msg in websocket: if isinstance(msg, bytes): s = struct.calcsize(">II") data = memoryview(msg) if len(data) > s: event, format = struct.unpack_from(">II", data) if event == 1 and format == 2: # 1=PREVIEW_IMAGE, 2=PNG, see ComfyUI server.py return Image.png_from_bytes(data[s:])
where Image.png_from_bytes does QImage.fromData(data, "PNG") because I use Qt anyway, but you can use similar method with eg. PIL.Image.open
Image.png_from_bytes
QImage.fromData(data, "PNG")
PIL.Image.open
Sorry, something went wrong.
Thank you!
No branches or pull requests
Hi! Can you provide code example for decoding image?
The text was updated successfully, but these errors were encountered: