From 772b4c594549fb42f70833053be8613d79932965 Mon Sep 17 00:00:00 2001 From: Andrew Kvochko Date: Mon, 28 Apr 2025 20:42:04 +0300 Subject: [PATCH] ltxv: overwrite existing mask on conditioned frame. (#7845) This commit overwrites the noise mask on the latent frame that is being conditioned with keyframe conditioning, setting it to one. --- comfy_extras/nodes_lt.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/comfy_extras/nodes_lt.py b/comfy_extras/nodes_lt.py index 1a667e01..e6dc122c 100644 --- a/comfy_extras/nodes_lt.py +++ b/comfy_extras/nodes_lt.py @@ -153,6 +153,15 @@ class LTXVAddGuide: return node_helpers.conditioning_set_values(cond, {"keyframe_idxs": keyframe_idxs}) def append_keyframe(self, positive, negative, frame_idx, latent_image, noise_mask, guiding_latent, strength, scale_factors): + _, latent_idx = self.get_latent_index( + cond=positive, + latent_length=latent_image.shape[2], + guide_length=guiding_latent.shape[2], + frame_idx=frame_idx, + scale_factors=scale_factors, + ) + noise_mask[:, :, latent_idx:latent_idx + guiding_latent.shape[2]] = 1.0 + positive = self.add_keyframe_index(positive, frame_idx, guiding_latent, scale_factors) negative = self.add_keyframe_index(negative, frame_idx, guiding_latent, scale_factors)