From cbf771ff03356c8a70335386d18668ea6ad75afd Mon Sep 17 00:00:00 2001 From: Rhys Yang Date: Tue, 27 Feb 2024 03:10:02 +0800 Subject: [PATCH] Fix the issue where the `Prompt Saver` node cannot consume filename from another `Prompt Saver` node #62 --- nodes.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nodes.py b/nodes.py index ff1c544..d1ef15e 100644 --- a/nodes.py +++ b/nodes.py @@ -552,7 +552,14 @@ class SDPromptSaver: output_to_terminal("Saved file: " + str(file)) comments.append(comment) - return {"ui": {"images": results}, "result": (files, file_paths, comments)} + return { + "ui": {"images": results}, + "result": ( + self.unpack_singleton(files), + self.unpack_singleton(file_paths), + self.unpack_singleton(comments), + ), + } @staticmethod def calculate_hash(name, hash_type): @@ -634,6 +641,10 @@ class SDPromptSaver: return "" + @staticmethod + def unpack_singleton(arr: list): + return arr[0] if len(arr) == 1 else arr + class SDParameterGenerator: ASPECT_RATIO_MAP = {