From 4dfb85dcc52e4315c33170d97bb987baa46d128b Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sun, 23 Nov 2025 02:18:47 +0200 Subject: [PATCH] Update nodes.py --- nodes/nodes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nodes/nodes.py b/nodes/nodes.py index 083528c..535289a 100644 --- a/nodes/nodes.py +++ b/nodes/nodes.py @@ -2671,7 +2671,10 @@ class TTM_ApplyModel_Wrapper: if current_step_index != 0 and current_step_index < self.steps: noisy_latent = self.scale_latent_inpaint(x=x, sigma=torch.tensor([next_sigma]), noise=self.noise.to(x), latent_image=self.reference_samples.to(x)) - x = x * (1-self.motion_mask).to(x) + noisy_latent * self.motion_mask.to(x) + if self.motion_mask is not None: + x = x * (1-self.motion_mask).to(x) + noisy_latent * self.motion_mask.to(x) + else: + x = noisy_latent return executor(x, t, c_concat, c_crossattn, control, transformer_options, **kwargs)