From 190e79fb07f2e8ffed898a3ceaac3c6725dd013c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E9=9B=AA=E5=B3=B0?= Date: Mon, 12 Jan 2026 12:48:33 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8Dcomfyui=E7=89=88=E6=9C=AC0.5.?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nodes/patch_lib/LTXVideoPatch.py | 10 ++++++++-- nodes/patch_lib/old/LTXVideoPatch.py | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/nodes/patch_lib/LTXVideoPatch.py b/nodes/patch_lib/LTXVideoPatch.py index 60e8853..68cd200 100644 --- a/nodes/patch_lib/LTXVideoPatch.py +++ b/nodes/patch_lib/LTXVideoPatch.py @@ -3,7 +3,10 @@ import math import torch from torch import Tensor -from comfy.ldm.lightricks.model import precompute_freqs_cis +try: + from comfy.ldm.lightricks.model import LTXBaseModel +except: + from comfy.ldm.lightricks.model import precompute_freqs_cis from comfy.ldm.lightricks.symmetric_patchifier import latent_to_pixel_coords from ..patch_util import PatchKeys @@ -60,7 +63,10 @@ def ltx_forward_orig( if attention_mask is not None and not torch.is_floating_point(attention_mask): attention_mask = (attention_mask - 1).to(x.dtype).reshape((attention_mask.shape[0], 1, -1, attention_mask.shape[-1])) * torch.finfo(x.dtype).max - pe = precompute_freqs_cis(fractional_coords, dim=self.inner_dim, out_dtype=x.dtype) + try: + pe = LTXBaseModel.precompute_freqs_cis(fractional_coords, dim=self.inner_dim, out_dtype=x.dtype) + except: + pe = precompute_freqs_cis(fractional_coords, dim=self.inner_dim, out_dtype=x.dtype) batch_size = x.shape[0] timestep, embedded_timestep = self.adaln_single( diff --git a/nodes/patch_lib/old/LTXVideoPatch.py b/nodes/patch_lib/old/LTXVideoPatch.py index f47b4b0..79f8a71 100644 --- a/nodes/patch_lib/old/LTXVideoPatch.py +++ b/nodes/patch_lib/old/LTXVideoPatch.py @@ -3,7 +3,10 @@ import math import torch from torch import Tensor -from comfy.ldm.lightricks.model import precompute_freqs_cis +try: + from comfy.ldm.lightricks.model import LTXBaseModel +except: + from comfy.ldm.lightricks.model import precompute_freqs_cis from ...patch_util import PatchKeys # changed in comfyui hash commit 93fedd92fe0eb67a09e29069b05adebb40678639 (between comfyui version 0.3.19 and 1.3.20) @@ -77,7 +80,10 @@ def ltx_forward_orig( if attention_mask is not None and not torch.is_floating_point(attention_mask): attention_mask = (attention_mask - 1).to(x.dtype).reshape((attention_mask.shape[0], 1, -1, attention_mask.shape[-1])) * torch.finfo(x.dtype).max - pe = precompute_freqs_cis(indices_grid, dim=self.inner_dim, out_dtype=x.dtype) + try: + pe = LTXBaseModel.precompute_freqs_cis(indices_grid, dim=self.inner_dim, out_dtype=x.dtype) + except: + pe = precompute_freqs_cis(indices_grid, dim=self.inner_dim, out_dtype=x.dtype) batch_size = x.shape[0] timestep, embedded_timestep = self.adaln_single(