feat: delete temp images after yielding to gradio

This commit is contained in:
Manuel Schmid 2024-01-14 21:16:16 +01:00
parent 3c855bd331
commit 161b988522
No known key found for this signature in database
GPG Key ID: 32C4F7569B40B84B
1 changed files with 5 additions and 0 deletions

View File

@ -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