mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-03-01 11:11:28 -08:00
added preview option
This commit is contained in:
parent
db6db585eb
commit
fd66199769
7 changed files with 102 additions and 12 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue