mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-08-02 23:14:49 +08:00
Preview sampled images with TAESD
This commit is contained in:
6
main.py
6
main.py
@@ -26,6 +26,7 @@ import yaml
|
||||
import execution
|
||||
import folder_paths
|
||||
import server
|
||||
from server import BinaryEventTypes
|
||||
from nodes import init_custom_nodes
|
||||
|
||||
|
||||
@@ -40,8 +41,11 @@ async def run(server, address='', port=8188, verbose=True, call_on_start=None):
|
||||
await asyncio.gather(server.start(address, port, verbose, call_on_start), server.publish_loop())
|
||||
|
||||
def hijack_progress(server):
|
||||
def hook(value, total):
|
||||
def hook(value, total, preview_bytes_jpeg):
|
||||
server.send_sync("progress", { "value": value, "max": total}, server.client_id)
|
||||
if preview_bytes_jpeg is not None:
|
||||
server.send_sync(BinaryEventTypes.PREVIEW_IMAGE, preview_bytes_jpeg, server.client_id)
|
||||
pass
|
||||
comfy.utils.set_progress_bar_global_hook(hook)
|
||||
|
||||
def cleanup_temp():
|
||||
|
Reference in New Issue
Block a user