Skip to content

Commit 32c5250

Browse files
authored
unconditional guidance with general s!=1.0
Example: "negative weights"
1 parent 4fa9f90 commit 32c5250

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ldm/models/diffusion/ddim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def p_sample_ddim(self, x, c, t, index, repeat_noise=False, use_original_steps=F
168168
b, *_, device = *x.shape, x.device
169169
e_t = self.model.apply_model(x, t, c)
170170

171-
if unconditional_guidance_scale > 1.:
171+
if unconditional_guidance_scale != 1.:
172172
assert unconditional_conditioning is not None
173173
e_t_uncond = self.model.apply_model(x, t, unconditional_conditioning)
174174
e_t = e_t_uncond + unconditional_guidance_scale * (e_t - e_t_uncond)

0 commit comments

Comments
 (0)