Need some help to convert binary previews into images when using websocket example
Open
User Support
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 155
Description
I want to see the Ksampler preview when using the websocket, and I modified the example in https://github.com/comfyanonymous/ComfyUI/blob/master/script_examples/websockets_api_example.py.
The modification begins from line 32.
```
while True:
out = ws.recv()
if isinstance(out, str):
message = json.loads(out)
print(message)
else:
print(out)
image_file = BytesIO(out)
image.show()
```
I do get something binary, but I cannot convert it into an image. It seems that it is not a binary image.
What should I do to get the preview images?
thank you for your help.
Contributor guide
Assessment
This issue has not been assessed yet.