diff --git a/comfy_extras/nodes_images.py b/comfy_extras/nodes_images.py index 392aea32c..4bd82d1c9 100644 --- a/comfy_extras/nodes_images.py +++ b/comfy_extras/nodes_images.py @@ -22,6 +22,9 @@ from server import PromptServer MAX_RESOLUTION = nodes.MAX_RESOLUTION class ImageCrop: + ALLOW_LIVE_PREVIEW = True + WANT_LIVE_PREVIEW = True + @classmethod def INPUT_TYPES(s): return {"required": { "image": ("IMAGE",), diff --git a/nodes.py b/nodes.py index f023ae3b6..0bcfffc7d 100644 --- a/nodes.py +++ b/nodes.py @@ -1614,6 +1614,8 @@ class SaveImage: return { "ui": { "images": results } } class PreviewImage(SaveImage): + WANT_LIVE_PREVIEW = True + def __init__(self): self.output_dir = folder_paths.get_temp_directory() self.type = "temp" diff --git a/server.py b/server.py index 0fd2e49e3..699742c6a 100644 --- a/server.py +++ b/server.py @@ -666,6 +666,12 @@ class PromptServer(): if hasattr(obj_class, 'API_NODE'): info['api_node'] = obj_class.API_NODE + + if getattr(obj_class, "WANT_LIVE_PREVIEW", False): + info['want_live_preview'] = True + if getattr(obj_class, "ALLOW_LIVE_PREVIEW", False): + info['allow_live_preview'] = True + return info @routes.get("/object_info")