fix: Inpaint not working with some schedulers

Co-Authored-By: StAlKeR7779 <7768370+StAlKeR7779@users.noreply.github.com>
This commit is contained in:
blessedcoolant 2023-07-13 15:06:03 +12:00
parent 10bb05b753
commit 7e3b9f1320

View File

@ -127,7 +127,7 @@ class AddsMaskGuidance:
def _t_for_field(self, field_name: str, t): def _t_for_field(self, field_name: str, t):
if field_name == "pred_original_sample": if field_name == "pred_original_sample":
return torch.zeros_like(t, dtype=t.dtype) # it represents t=0 return self.scheduler.timesteps[-1]
return t return t
def apply_mask(self, latents: torch.Tensor, t) -> torch.Tensor: def apply_mask(self, latents: torch.Tensor, t) -> torch.Tensor: