add pause button

This commit is contained in:
Vladimir Mandic
2023-05-31 11:47:22 -04:00
parent d9f72b066f
commit fcb9bde068
9 changed files with 91 additions and 214 deletions
+7
View File
@@ -64,6 +64,13 @@ class VanillaStableDiffusionSampler:
def before_sample(self, x, ts, cond, unconditional_conditioning):
if state.interrupted or state.skipped:
raise sd_samplers_common.InterruptedException
if state.paused:
shared.log.debug('Sampling paused')
while state.paused:
if state.interrupted or state.skipped:
raise sd_samplers_common.InterruptedException
import time
time.sleep(0.1)
if self.stop_at is not None and self.step > self.stop_at:
raise sd_samplers_common.InterruptedException