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

Update sd_samplers.py

parent 4af3ca53
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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