From 3a64fe3eb376d8c89dda839f169733a79edcca43 Mon Sep 17 00:00:00 2001 From: Manuel Schmid <9307310+mashb1t@users.noreply.github.com> Date: Tue, 5 Mar 2024 21:16:21 +0100 Subject: [PATCH] fix: do not attempt to remove non-existing image grid file (#2456) image grid is actually not an image here but a numpy array, as the grid isn't saved by default --- webui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webui.py b/webui.py index 42dd890..80b1a3d 100644 --- a/webui.py +++ b/webui.py @@ -76,7 +76,8 @@ def generate_clicked(task): # delete Fooocus temp images, only keep gradio temp images if args_manager.args.disable_image_log: for filepath in product: - os.remove(filepath) + if isinstance(filepath, str) and os.path.exists(filepath): + os.remove(filepath) execution_time = time.perf_counter() - execution_start_time print(f'Total time: {execution_time:.2f} seconds')