aboutsummaryrefslogtreecommitdiffstats
path: root/modules/processing.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-09-06 16:33:51 +0000
committerAUTOMATIC <16777216c@gmail.com>2022-09-06 16:33:51 +0000
commitfd66199769ebe0851d2ff33fdc7b191421822454 (patch)
tree58665e755d560046e06792ba2da8ed56ec683a8a /modules/processing.py
parentdb6db585eb9ee48e7315e28603e18531dbc87067 (diff)
downloadstable-diffusion-webui-gfx803-fd66199769ebe0851d2ff33fdc7b191421822454.tar.gz
stable-diffusion-webui-gfx803-fd66199769ebe0851d2ff33fdc7b191421822454.tar.bz2
stable-diffusion-webui-gfx803-fd66199769ebe0851d2ff33fdc7b191421822454.zip
added preview option
Diffstat (limited to 'modules/processing.py')
-rw-r--r--modules/processing.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/processing.py b/modules/processing.py
index e8923a7a..e615ffdc 100644
--- a/modules/processing.py
+++ b/modules/processing.py
@@ -176,6 +176,11 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
shared.state.job = f"Batch {n+1} out of {p.n_iter}"
samples_ddim = p.sample(x=x, conditioning=c, unconditional_conditioning=uc)
+ if state.interrupted:
+
+ # if we are interruped, sample returns just noise
+ # use the image collected previously in sampler loop
+ samples_ddim = shared.state.current_latent
x_samples_ddim = p.sd_model.decode_first_stage(samples_ddim)
x_samples_ddim = torch.clamp((x_samples_ddim + 1.0) / 2.0, min=0.0, max=1.0)