From 6663c9bb71de4ee7beffe8f2d43865c9d8cb1981 Mon Sep 17 00:00:00 2001 From: rromb Date: Mon, 13 Jun 2022 23:35:05 +0200 Subject: [PATCH] add alternative guidance strategy --- ldm/models/diffusion/ddpm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ldm/models/diffusion/ddpm.py b/ldm/models/diffusion/ddpm.py index 8caaa92..4e7f5c3 100644 --- a/ldm/models/diffusion/ddpm.py +++ b/ldm/models/diffusion/ddpm.py @@ -1553,6 +1553,9 @@ class LatentUpscaleDiffusion(LatentDiffusion): if k == "c_crossattn": assert isinstance(c[k], list) and len(c[k]) == 1 uc[k] = [uc_tmp] + elif k == "c_adm": + assert isinstance(c[k], torch.Tensor) + uc[k] = torch.ones_like(c[k]) * (self.low_scale_model.max_max_noise_level-1) elif isinstance(c[k], list): uc[k] = [torch.zeros_like(c[k][i]) for i in range(len(c[k]))] else: