From 5e6f23b14b73d34c3216cd69698bb94ad62dd013 Mon Sep 17 00:00:00 2001 From: "Eric W. Burns" Date: Sat, 30 Aug 2025 14:19:12 -0400 Subject: [PATCH] custom nodes for waiting, which can be used to gate sections of your workflow until other sections are complete --- nodes.py | 70 ++++++++++++++++++++++++++++++++++++++++++++++++-- pyproject.toml | 2 +- 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/nodes.py b/nodes.py index 4cd4120..b5f8c68 100644 --- a/nodes.py +++ b/nodes.py @@ -370,6 +370,66 @@ class EbuDecodeNewLines: decoded = encoded_text.replace(new_line_encoding, "\n") return (decoded,) +class EbuStringWaitForImage: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "input_string": ("STRING", {"multiline": True}), + "wait_for_image": ("IMAGE",), + } + } + + RETURN_TYPES = ("STRING",) + RETURN_NAMES = ("output_string",) + FUNCTION = "passthrough" + CATEGORY = "Utility" + + def passthrough(self, input_string, wait_for_image): + if wait_for_image is None or len(wait_for_image) == 0: + raise ValueError("Image not loaded. Cannot proceed.") + return (input_string,) + +class EbuImageWaitForImage: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "input_image": ("IMAGE",), + "wait_for_image": ("IMAGE",), + } + } + + RETURN_TYPES = ("IMAGE",) + RETURN_NAMES = ("output_image",) + FUNCTION = "passthrough" + CATEGORY = "Utility" + + def passthrough(self, input_image, wait_for_image): + if wait_for_image is None or len(wait_for_image) == 0: + raise ValueError("Image not loaded. Cannot proceed.") + return (input_image,) + +class EbuModelWaitForImage: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "input_model": ("MODEL",), + "wait_for_image": ("IMAGE",), + } + } + + RETURN_TYPES = ("MODEL",) + RETURN_NAMES = ("output_model",) + FUNCTION = "passthrough" + CATEGORY = "Utility" + + def passthrough(self, input_model, wait_for_image): + if wait_for_image is None or len(wait_for_image) == 0: + raise ValueError("Image not loaded. Cannot proceed.") + return (input_model,) + NODE_CLASS_MAPPINGS = { "EbuGetImageAspectRatio": EbuGetImageAspectRatio, "EbuScalingResolution": EbuScalingResolution, @@ -379,7 +439,10 @@ NODE_CLASS_MAPPINGS = { "EbuReadFromFile": EbuReadFromFile, "EbuFileListCache": EbuFileListCache, "EbuEncodeNewLines": EbuEncodeNewLines, - "EbuDecodeNewLines": EbuDecodeNewLines + "EbuDecodeNewLines": EbuDecodeNewLines, + "EbuStringWaitForImage": EbuStringWaitForImage, + "EbuImageWaitForImage": EbuImageWaitForImage, + "EbuModelWaitForImage": EbuModelWaitForImage, } NODE_DISPLAY_NAME_MAPPINGS = { @@ -391,6 +454,9 @@ NODE_DISPLAY_NAME_MAPPINGS = { "EbuReadFromFile": "EBU Read From File", "EbuFileListCache": "EBU File List Cache", "EbuEncodeNewLines": "EBU Encode New Lines", - "EbuDecodeNewLines": "EBU Decode New Lines" + "EbuDecodeNewLines": "EBU Decode New Lines", + "EbuStringWaitForImage": "EBU String Wait For Image", + "EbuImageWaitForImage": "EBU Image Wait For Image", + "EbuModelWaitForImage": "EBU Model Wait For Image", } diff --git a/pyproject.toml b/pyproject.toml index f464949..1c1af28 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "ComfyUI_EBU_Workflow" description = "This ComfyUI extension provides a suite of custom nodes for assisting with your workflow with a focus on resolution, upscaling, and file naming" -version = "1.0.3" +version = "1.0.4" authors = [ {name = "burnsbert"} ]