Add a workaround patch for DPM2 a issue

DPM2 a and DPM2 a Karras samplers are both affected by an issue described by https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/3483 and can be resolved by a workaround suggested by the k-diffusion author at https://github.com/crowsonkb/k-diffusion/issues/43#issuecomment-1305195666
This commit is contained in:
Alex "mcmonkey" Goodwin 2022-12-16 08:18:29 -08:00
parent 685f9631b5
commit 8b0703b8fc

View File

@ -494,6 +494,9 @@ class KDiffusionSampler:
x = x * sigmas[0]
if self.funcname == "sample_dpm_2_ancestral": # workaround dpm2 a issue
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()