From 161b988522e5b67c7de9110a5a4f699fd7fc3662 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Sun, 14 Jan 2024 21:16:16 +0100 Subject: [PATCH] feat: delete temp images after yielding to gradio --- webui.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webui.py b/webui.py index 581e3101..ba1dddaf 100644 --- a/webui.py +++ b/webui.py @@ -71,6 +71,11 @@ def generate_clicked(*args): gr.update(visible=True, value=product) finished = True + # delete Fooocus temp images, only keep gradio temp images + if args_manager.args.disable_image_log: + for filepath in product: + os.remove(filepath) + execution_time = time.perf_counter() - execution_start_time print(f'Total time: {execution_time:.2f} seconds') return