From e85fcb822b342a9743b5c5c8e67511ea8dccda3f Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Mon, 20 Mar 2023 14:55:28 -0400 Subject: [PATCH] Small fix. --- nodes.py | 10 +++++----- web/scripts/app.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nodes.py b/nodes.py index 6adf7b4e..1658a4c8 100644 --- a/nodes.py +++ b/nodes.py @@ -744,16 +744,16 @@ class SaveImage: except: digits = 0 return (digits, prefix) - + subfolder = os.path.dirname(os.path.normpath(filename_prefix)) filename = os.path.basename(os.path.normpath(filename_prefix)) - full_output_folder = os.path.join(self.output_dir, subfolder) + full_output_folder = os.path.join(self.output_dir, subfolder) if os.path.commonpath((self.output_dir, os.path.realpath(full_output_folder))) != self.output_dir: print("Saving image outside the output folder is not allowed.") - return - + return {} + try: counter = max(filter(lambda a: a[1][:-1] == filename and a[1][-1] == "_", map(map_filename, os.listdir(full_output_folder))))[0] + 1 except ValueError: @@ -784,7 +784,7 @@ class SaveImage: "type": self.type }); counter += 1 - + return { "ui": { "images": results } } class PreviewImage(SaveImage): diff --git a/web/scripts/app.js b/web/scripts/app.js index 5f853ca0..3f06629e 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -109,7 +109,7 @@ class ComfyApp { return new Promise((r) => { const img = new Image(); img.onload = () => r(img); - img.onerror = () => r(null); + img.onerror = () => r(null); img.src = "/view?" + new URLSearchParams(src).toString(); }); })