mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix: Inpaint not working with some schedulers
Co-Authored-By: StAlKeR7779 <7768370+StAlKeR7779@users.noreply.github.com>
This commit is contained in:
parent
10bb05b753
commit
7e3b9f1320
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user