mirror of
https://github.com/ArdeniusAI/ComfyUI-cpu
synced 2026-11-19 01:00:36 +03:00
Added to the websockets_api_example.py to show how to decode latent previews from the binary stream (#5016)
* Update websockets_api_example.py * even more simplfied
This commit is contained in:
1 parent
7a415f47a9
commit
13ecf10a92
1 file changed
+3
@@ -38,6 +38,9 @@ def get_images(ws, prompt):
|
||||
if data['node'] is None and data['prompt_id'] == prompt_id:
|
||||
break #Execution is done
|
||||
else:
|
||||
# If you want to be able to decode the binary stream for latent previews, here is how you can do it:
|
||||
# bytesIO = BytesIO(out[8:])
|
||||
# preview_image = Image.open(bytesIO) # This is your preview in PIL image format, store it in a global
|
||||
continue #previews are binary data
|
||||
|
||||
history = get_history(prompt_id)[prompt_id]
|
||||
|
||||
Reference in new issue
Block a user