diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b643ce..492299a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ # nightly +# v1.0.6 +- Add `Simple Auto Bypass` node - Fix "always run" mode for `Simple Lora Loader` # v1.0.5 - Add node `Simple Load Images From Dir` to batch images diff --git a/nodes/nodes.py b/nodes/nodes.py index 317bee8..8d796ca 100644 --- a/nodes/nodes.py +++ b/nodes/nodes.py @@ -879,6 +879,29 @@ class SimpleLoadImagesFromDir: ################################ +class AutoBypassNode: + @classmethod + def INPUT_TYPES(cls): + return { + "required": {}, + "optional": { + "input1": (anytype, { "default": None, "tooltip": "Bypassed input" }), + "input2": (anytype, { "default": None, "tooltip": "Input from disable group" }), + }, + } + + RETURN_TYPES = (anytype,) + RETURN_NAMES = ("output",) + FUNCTION = "switch" + CATEGORY = "📚 SimpleButcher" + DESCRIPTION = "input1 bypassed to output if input2 is None (connected to disable group)" + + def switch(self, input1=None, input2=None): + output = input2 if input2 is not None else input1 + return (output,) + +################################ + NODE_CLASS_MAPPINGS = { "Simple Load Line From Text File": SimpleLoadLineFromTextFile, "Simple Extract Lora From Text": SimpleExtractLoraFromText, @@ -886,6 +909,7 @@ NODE_CLASS_MAPPINGS = { "Simple Image Saver (as Forge)": SimpleImageSaver, "Simple Load Image With Metadata": SimpleLoadImageWithMetadataString, "Simple Load Images from Dir": SimpleLoadImagesFromDir, + "Simple Auto Bypass": AutoBypassNode, } NODE_DISPLAY_NAME_MAPPINGS = { @@ -895,5 +919,6 @@ NODE_DISPLAY_NAME_MAPPINGS = { "Simple Image Saver (as Forge)": "Simple Image Saver (as Forge) 📚", "Simple Load Image With Metadata": "Simple Load Image With Metadata 📚", "Simple Load Images From Dir": "Simple Load Images From Dir 📚", + "Simple Auto Bypass": "Simple Auto Bypass 📚", }