feat: use consistent file name in gradio (#1932)

* feat: use consistent file name in gradio

returns and uses filepaths instead of numpy image by saving to temp dir
uses double the temp dir file storage on disk as it saves to temp dir and gradio temp dir when displaying the image, but reuses logged output image

* feat: delete temp images after yielding to gradio

* feat: use args temp path if given

* chore: code cleanup, remove redundant if statement
This commit is contained in:
Manuel Schmid
2024-02-25 22:56:38 +01:00
committed by GitHub
parent c898e6a4dc
commit d3113f5c3f
5 changed files with 25 additions and 12 deletions
+5
View File
@@ -72,6 +72,11 @@ def generate_clicked(task):
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