mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
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:
@@ -563,8 +563,8 @@ def worker():
|
||||
|
||||
if direct_return:
|
||||
d = [('Upscale (Fast)', '2x')]
|
||||
log(uov_input_image, d)
|
||||
yield_result(async_task, uov_input_image, do_not_show_finished_images=True)
|
||||
uov_input_image_path = log(uov_input_image, d)
|
||||
yield_result(async_task, uov_input_image_path, do_not_show_finished_images=True)
|
||||
return
|
||||
|
||||
tiled = True
|
||||
@@ -828,6 +828,7 @@ def worker():
|
||||
if inpaint_worker.current_task is not None:
|
||||
imgs = [inpaint_worker.current_task.post_process(x) for x in imgs]
|
||||
|
||||
img_paths = []
|
||||
for x in imgs:
|
||||
d = [
|
||||
('Prompt', task['log_positive_prompt']),
|
||||
@@ -853,9 +854,9 @@ def worker():
|
||||
if n != 'None':
|
||||
d.append((f'LoRA {li + 1}', f'{n} : {w}'))
|
||||
d.append(('Version', 'v' + fooocus_version.version))
|
||||
log(x, d)
|
||||
img_paths.append(log(x, d))
|
||||
|
||||
yield_result(async_task, imgs, do_not_show_finished_images=len(tasks) == 1 or disable_intermediate_results)
|
||||
yield_result(async_task, img_paths, do_not_show_finished_images=len(tasks) == 1 or disable_intermediate_results)
|
||||
except ldm_patched.modules.model_management.InterruptProcessingException as e:
|
||||
if async_task.last_stop == 'skip':
|
||||
print('User skipped')
|
||||
|
||||
Reference in New Issue
Block a user