From e651b7bef55a5376343dcb1c0edb79f0142c985e Mon Sep 17 00:00:00 2001 From: Barish Ozbay <17261091+drozbay@users.noreply.github.com> Date: Tue, 28 Jul 2026 23:24:08 -0400 Subject: [PATCH] Fix LTXAV crash when sampling without an audio latent (#15132) --- comfy/ldm/lightricks/model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/comfy/ldm/lightricks/model.py b/comfy/ldm/lightricks/model.py index 92bb8118c..f9de3a38e 100644 --- a/comfy/ldm/lightricks/model.py +++ b/comfy/ldm/lightricks/model.py @@ -671,9 +671,9 @@ def freqs_cis_matrix(freqs, pad_size, split_mode, num_attention_heads, out_dtype cos_freq = torch.cat((cos_padding, cos_freq), dim=-1) sin_freq = torch.cat((sin_padding, sin_freq), dim=-1) - B, T, _ = cos_freq.shape - cos_freq = cos_freq.reshape(B, T, num_attention_heads, -1) - sin_freq = sin_freq.reshape(B, T, num_attention_heads, -1) + B, T, half_HD = cos_freq.shape + cos_freq = cos_freq.reshape(B, T, num_attention_heads, half_HD // num_attention_heads) + sin_freq = sin_freq.reshape(B, T, num_attention_heads, half_HD // num_attention_heads) rotation_matrix = torch.stack( (cos_freq, -sin_freq, sin_freq, cos_freq), dim=-1 )