Commit 00117a07 authored by Trung Ngo's avatar Trung Ngo Committed by AUTOMATIC1111

check specifically for skipped

parent 786d9f63
......@@ -34,8 +34,6 @@ def process_batch(p, input_dir, output_dir, args):
state.job = f"{i+1} out of {len(images)}"
if state.skipped:
state.skipped = False
state.interrupted = False
continue
if state.interrupted:
break
......
......@@ -357,7 +357,6 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
for n in range(p.n_iter):
if state.skipped:
state.skipped = False
state.interrupted = False
if state.interrupted:
break
......@@ -385,7 +384,7 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
with devices.autocast():
samples_ddim = p.sample(conditioning=c, unconditional_conditioning=uc, seeds=seeds, subseeds=subseeds, subseed_strength=p.subseed_strength)
if state.interrupted:
if state.interrupted or state.skipped:
# if we are interruped, sample returns just noise
# use the image collected previously in sampler loop
......
......@@ -106,7 +106,7 @@ def extended_tdqm(sequence, *args, desc=None, **kwargs):
seq = sequence if cmd_opts.disable_console_progressbars else tqdm.tqdm(sequence, *args, desc=state.job, file=shared.progress_print_out, **kwargs)
for x in seq:
if state.interrupted:
if state.interrupted or state.skipped:
break
yield x
......@@ -254,7 +254,7 @@ def extended_trange(sampler, count, *args, **kwargs):
seq = range(count) if cmd_opts.disable_console_progressbars else tqdm.trange(count, *args, desc=state.job, file=shared.progress_print_out, **kwargs)
for x in seq:
if state.interrupted:
if state.interrupted or state.skipped:
break
if sampler.stop_at is not None and x > sampler.stop_at:
......
......@@ -99,7 +99,6 @@ class State:
def skip(self):
self.skipped = True
self.interrupted = True
def interrupt(self):
self.interrupted = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment