fix: correctly break after user stopped during enhance inpainting
This commit is contained in:
parent
c0e556a7f6
commit
40e00f2263
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue