From 326577d04c99590cbf91324f507fdc2c7d37832d Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Thu, 7 Sep 2023 23:37:03 -0400 Subject: [PATCH] Allow cancelling of everything with a progress bar. --- comfy/samplers.py | 2 -- main.py | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/comfy/samplers.py b/comfy/samplers.py index 3250b2e..c60288f 100644 --- a/comfy/samplers.py +++ b/comfy/samplers.py @@ -263,8 +263,6 @@ def sampling_function(model_function, x, timestep, uncond, cond, cond_scale, con output = model_function(input_x, timestep_, **c).chunk(batch_chunks) del input_x - model_management.throw_exception_if_processing_interrupted() - for o in range(batch_chunks): if cond_or_uncond[o] == COND: out_cond[:,:,area[o][2]:area[o][0] + area[o][2],area[o][3]:area[o][1] + area[o][3]] += output[o] * mult[o] diff --git a/main.py b/main.py index a4038db..9f0f804 100644 --- a/main.py +++ b/main.py @@ -104,6 +104,7 @@ async def run(server, address='', port=8188, verbose=True, call_on_start=None): def hijack_progress(server): def hook(value, total, preview_image): + comfy.model_management.throw_exception_if_processing_interrupted() server.send_sync("progress", {"value": value, "max": total}, server.client_id) if preview_image is not None: server.send_sync(BinaryEventTypes.UNENCODED_PREVIEW_IMAGE, preview_image, server.client_id)