Add a way to interrupt current processing in the backend.

This commit is contained in:
comfyanonymous
2023-03-02 14:42:03 -05:00
parent 1e2c4df972
commit 69cc75fbf8
5 changed files with 44 additions and 1 deletions

View File

@@ -172,6 +172,8 @@ def sampling_function(model_function, x, timestep, uncond, cond, cond_scale, con
output = model_function(input_x, timestep_, cond=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]