From 7e3b9f1320bc7f0db2b8beba1f2417f5806c6439 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Thu, 13 Jul 2023 15:06:03 +1200 Subject: [PATCH] fix: Inpaint not working with some schedulers Co-Authored-By: StAlKeR7779 <7768370+StAlKeR7779@users.noreply.github.com> --- invokeai/backend/stable_diffusion/diffusers_pipeline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invokeai/backend/stable_diffusion/diffusers_pipeline.py b/invokeai/backend/stable_diffusion/diffusers_pipeline.py index 25f1704c1d..3705bebe83 100644 --- a/invokeai/backend/stable_diffusion/diffusers_pipeline.py +++ b/invokeai/backend/stable_diffusion/diffusers_pipeline.py @@ -127,7 +127,7 @@ class AddsMaskGuidance: def _t_for_field(self, field_name: str, t): 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 def apply_mask(self, latents: torch.Tensor, t) -> torch.Tensor: