use file modification time instead of current time for #9760

This commit is contained in:
AUTOMATIC 2023-05-08 15:09:20 +03:00
parent 879ed5422c
commit 505a10ad92
2 changed files with 3 additions and 1 deletions

View File

@ -27,6 +27,7 @@
* make the lightbox fullscreen image function properly * make the lightbox fullscreen image function properly
* fix squished thumbnails in extras tab * fix squished thumbnails in extras tab
* keep "search" filter for extra networks when user refreshes the tab (previously it showed everthing after you refreshed) * keep "search" filter for extra networks when user refreshes the tab (previously it showed everthing after you refreshed)
* fix webui showing the same image if you configure the generation to always save results into same file
## 1.1.1 ## 1.1.1

View File

@ -35,7 +35,8 @@ def check_tmp_file(gradio, filename):
def save_pil_to_file(pil_image, dir=None): def save_pil_to_file(pil_image, dir=None):
already_saved_as = getattr(pil_image, 'already_saved_as', None) already_saved_as = getattr(pil_image, 'already_saved_as', None)
if already_saved_as and os.path.isfile(already_saved_as): if already_saved_as and os.path.isfile(already_saved_as):
already_saved_as += f'?{int(time())}' already_saved_as += f'?{os.path.getmtime(already_saved_as)}'
register_tmp_file(shared.demo, already_saved_as) register_tmp_file(shared.demo, already_saved_as)
file_obj = Savedfile(already_saved_as) file_obj = Savedfile(already_saved_as)