Unverified Commit 4df5009a authored by hentailord85ez's avatar hentailord85ez Committed by GitHub

Update sd_samplers.py

parent 4af3ca53
......@@ -462,6 +462,9 @@ class KDiffusionSampler:
return extra_params_kwargs
def get_sigmas(self, p, steps):
disc = opts.always_discard_next_to_last_sigma or (self.config is not None and self.config.options.get('discard_next_to_last_sigma', False))
steps += 1 if disc else 0
if p.sampler_noise_scheduler_override:
sigmas = p.sampler_noise_scheduler_override(steps)
elif self.config is not None and self.config.options.get('scheduler', None) == 'karras':
......@@ -469,7 +472,7 @@ class KDiffusionSampler:
else:
sigmas = self.model_wrap.get_sigmas(steps)
if self.config is not None and self.config.options.get('discard_next_to_last_sigma', False):
if disc:
sigmas = torch.cat([sigmas[:-2], sigmas[-1:]])
return sigmas
......
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