diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-06 20:10:12 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-06 20:10:12 +0000 |
commit | 7ce7fb01e035a7ba8ca9cb35784cd75cca3d99fd (patch) | |
tree | c5b60ee07477249577260b421d52de9840dfc1ef /modules/ui.py | |
parent | 0bfa0d4381c65077ffa7bd014040813dbad84fed (diff) | |
download | stable-diffusion-webui-gfx803-7ce7fb01e035a7ba8ca9cb35784cd75cca3d99fd.tar.gz stable-diffusion-webui-gfx803-7ce7fb01e035a7ba8ca9cb35784cd75cca3d99fd.tar.bz2 stable-diffusion-webui-gfx803-7ce7fb01e035a7ba8ca9cb35784cd75cca3d99fd.zip |
fix for live progress breaking lowvram and medvram optimizations
Diffstat (limited to 'modules/ui.py')
-rw-r--r-- | modules/ui.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/modules/ui.py b/modules/ui.py index fb3c4d33..92d8bcdd 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -160,13 +160,11 @@ def check_progress_call(): preview_visibility = gr_show(False)
if opts.show_progress_every_n_steps > 0:
- if shared.state.current_progress_index % opts.show_progress_every_n_steps == 0 and shared.state.current_latent is not None:
- x_sample = shared.sd_model.decode_first_stage(shared.state.current_latent[0:1].type(shared.sd_model.dtype))[0]
- x_sample = torch.clamp((x_sample + 1.0) / 2.0, min=0.0, max=1.0)
- x_sample = 255. * np.moveaxis(x_sample.cpu().numpy(), 0, 2)
- x_sample = x_sample.astype(np.uint8)
- shared.state.current_image = Image.fromarray(x_sample)
+ if shared.parallel_processing_allowed:
+ if shared.state.sampling_step - shared.state.current_image_sampling_step >= opts.show_progress_every_n_steps and shared.state.current_latent is not None:
+ shared.state.current_image = modules.sd_samplers.sample_to_image(shared.state.current_latent)
+ shared.state.current_image_sampling_step = shared.state.sampling_step
image = shared.state.current_image
@@ -175,8 +173,6 @@ def check_progress_call(): else:
preview_visibility = gr_show(True)
- shared.state.current_progress_index += 1
-
return f"<span style='display: none'>{time.time()}</span><p>{progressbar}</p>", preview_visibility, image
|