added progressbar

added an option to disable progressbar
added interrupt support to DDIM/PLMS
This commit is contained in:
AUTOMATIC
2022-09-06 02:09:01 +03:00
parent b6763fb884
commit a243bc7859
11 changed files with 170 additions and 9 deletions

View File

@@ -153,6 +153,8 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
with torch.no_grad(), precision_scope("cuda"), ema_scope():
p.init()
state.job_count = p.n_iter
for n in range(p.n_iter):
if state.interrupted:
break
@@ -207,6 +209,8 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
output_images.append(image)
state.nextjob()
unwanted_grid_because_of_img_count = len(output_images) < 2 and opts.grid_only_if_multiple
if not p.do_not_save_grid and not unwanted_grid_because_of_img_count:
return_grid = opts.return_grid