aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlambertae <dengm@mit.edu>2023-07-21 01:27:43 +0000
committerlambertae <dengm@mit.edu>2023-07-21 01:27:43 +0000
commitf87389029839a27464a18846815339e81787b882 (patch)
tree198052280a2082ff1b51a6b0e0dd3bf1e9683aaf
parent128d59c9ccfbc9c7fccd6f1b2fe58bbbb18459f9 (diff)
downloadstable-diffusion-webui-gfx803-f87389029839a27464a18846815339e81787b882.tar.gz
stable-diffusion-webui-gfx803-f87389029839a27464a18846815339e81787b882.tar.bz2
stable-diffusion-webui-gfx803-f87389029839a27464a18846815339e81787b882.zip
new restart scheme
-rw-r--r--modules/sd_samplers_kdiffusion.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/sd_samplers_kdiffusion.py b/modules/sd_samplers_kdiffusion.py
index 21b347ed..ed60670c 100644
--- a/modules/sd_samplers_kdiffusion.py
+++ b/modules/sd_samplers_kdiffusion.py
@@ -67,7 +67,10 @@ def restart_sampler(model, x, sigmas, extra_args=None, callback=None, disable=No
if restart_list is None:
if steps >= 20:
restart_steps = 9
- restart_times = 2 if steps >= 36 else 1
+ restart_times = 1
+ if steps >= 36:
+ restart_steps = steps // 4
+ restart_times = 2
sigmas = get_sigmas_karras(steps - restart_steps * restart_times, sigmas[-2].item(), sigmas[0].item(), device=sigmas.device)
restart_list = {0.1: [restart_steps + 1, restart_times, 2]}
else: