diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-06 17:26:09 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-06 17:26:09 +0000 |
commit | 7e5b8becf959ba869f1fd476e397b83744fc7289 (patch) | |
tree | f5f3b5a3fe5fdb8a177e69c868a12ca1dd84b90f /modules/ui.py | |
parent | fd66199769ebe0851d2ff33fdc7b191421822454 (diff) | |
download | stable-diffusion-webui-gfx803-7e5b8becf959ba869f1fd476e397b83744fc7289.tar.gz stable-diffusion-webui-gfx803-7e5b8becf959ba869f1fd476e397b83744fc7289.tar.bz2 stable-diffusion-webui-gfx803-7e5b8becf959ba869f1fd476e397b83744fc7289.zip |
fix for progress bar
Diffstat (limited to 'modules/ui.py')
-rw-r--r-- | modules/ui.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/ui.py b/modules/ui.py index 8e7a3ee4..fb3c4d33 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -160,13 +160,14 @@ def check_progress_call(): preview_visibility = gr_show(False)
if opts.show_progress_every_n_steps > 0:
- if (shared.state.sampling_step-1) % opts.show_progress_every_n_steps == 0 and shared.state.current_latent is not None:
+ 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)
+
image = shared.state.current_image
if image is None or progress >= 1:
@@ -174,6 +175,8 @@ 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
|