mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
Merge pull request #5797 from mcmonkey4eva/dpm2-a-fix
Add a workaround patch for DPM2 a issue
This commit is contained in:
commit
5667ec4ca7
@ -454,6 +454,9 @@ class KDiffusionSampler:
|
||||
else:
|
||||
sigmas = self.model_wrap.get_sigmas(steps)
|
||||
|
||||
if self.funcname in ['sample_dpm_2_ancestral', 'sample_dpm_2']:
|
||||
sigmas = torch.cat([sigmas[:-2], sigmas[-1:]])
|
||||
|
||||
sigma_sched = sigmas[steps - t_enc - 1:]
|
||||
xi = x + noise * sigma_sched[0]
|
||||
|
||||
@ -494,6 +497,9 @@ class KDiffusionSampler:
|
||||
|
||||
x = x * sigmas[0]
|
||||
|
||||
if self.funcname in ['sample_dpm_2_ancestral', 'sample_dpm_2']:
|
||||
sigmas = torch.cat([sigmas[:-2], sigmas[-1:]])
|
||||
|
||||
extra_params_kwargs = self.initialize(p)
|
||||
if 'sigma_min' in inspect.signature(self.func).parameters:
|
||||
extra_params_kwargs['sigma_min'] = self.model_wrap.sigmas[0].item()
|
||||
|
Loading…
Reference in New Issue
Block a user