Merge pull request #10 from asagi4/main

Don't fail in momentum samplers when self.guidance is None
This commit is contained in:
blepping
2024-09-02 10:20:25 -06:00
committed by GitHub
+1 -2
View File
@@ -157,8 +157,7 @@ class SonarGuidanceMixin:
return ((latent - avg_s) / std_s).to(latent.dtype)
def guidance_step(self, step_index: int, x: Tensor, denoised: Tensor):
step_matched = self.guidance.start_step <= step_index <= self.guidance.end_step
if self.guidance is None or self.guidance.factor == 0.0 or not step_matched:
if self.guidance is None or self.guidance.factor == 0.0 or not self.guidance.start_step <= step_index <= self.guidance.end_step:
return x
if self.ref_latent.device != x.device:
self.ref_latent = self.ref_latent.to(device=x.device)