From 3a99824638027ff84cf6c4af3421741cc091e617 Mon Sep 17 00:00:00 2001 From: Andray Date: Fri, 23 Feb 2024 20:26:56 +0400 Subject: [PATCH] register_tmp_file also with mtime --- modules/ui_tempdir.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ui_tempdir.py b/modules/ui_tempdir.py index 621ed1eca..ecd6bdec3 100644 --- a/modules/ui_tempdir.py +++ b/modules/ui_tempdir.py @@ -35,7 +35,9 @@ def save_pil_to_file(self, pil_image, dir=None, format="png"): already_saved_as = getattr(pil_image, 'already_saved_as', None) if already_saved_as and os.path.isfile(already_saved_as): register_tmp_file(shared.demo, already_saved_as) - return f'{already_saved_as}?{os.path.getmtime(already_saved_as)}' + filename_with_mtime = f'{already_saved_as}?{os.path.getmtime(already_saved_as)}' + register_tmp_file(shared.demo, filename_with_mtime) + return filename_with_mtime if shared.opts.temp_dir != "": dir = shared.opts.temp_dir