From 40e00f22636f0e48d3aa94f08724d52c37a0b093 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Sun, 30 Jun 2024 13:33:28 +0200 Subject: [PATCH] fix: correctly break after user stopped during enhance inpainting --- modules/async_worker.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/async_worker.py b/modules/async_worker.py index 0a907a12..0d2d558d 100644 --- a/modules/async_worker.py +++ b/modules/async_worker.py @@ -1319,6 +1319,7 @@ def worker(): done_steps_upscaling = 0 done_steps_inpainting = 0 enhance_steps, _, _, _ = apply_overrides(async_task, async_task.original_steps, height, width) + exception_result = None for img in images_to_enhance: enhancement_image_start_time = time.perf_counter() @@ -1408,6 +1409,7 @@ def worker(): continue else: print('User stopped') + exception_result = 'break' break finally: done_steps_inpainting += enhance_steps @@ -1415,6 +1417,9 @@ def worker(): enhancement_task_time = time.perf_counter() - enhancement_task_start_time print(f'Enhancement time: {enhancement_task_time:.2f} seconds') + if exception_result == 'break': + break + if should_process_enhance_uov and async_task.enhance_uov_processing_order == flags.enhancement_uov_after: current_task_id += 1 current_task_id, done_steps_inpainting, done_steps_upscaling, img, exception_result = enhance_upscale(