fix: correctly break after user stopped during enhance inpainting

This commit is contained in:
Manuel Schmid 2024-06-30 13:33:28 +02:00
parent c0e556a7f6
commit 40e00f2263
No known key found for this signature in database
GPG Key ID: 32C4F7569B40B84B
1 changed files with 5 additions and 0 deletions

View File

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