The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Fix float64 device in ltx diffusion decoder. (#15516)
comfyanonymousbd34f338ac50
diff --git a/comfy/ldm/lightricks/vae/na_diffusion_decoder.py b/comfy/ldm/lightricks/vae/na_diffusion_decoder.pyindex 8a172e101..ec539c665 100644--- a/comfy/ldm/lightricks/vae/na_diffusion_decoder.py+++ b/comfy/ldm/lightricks/vae/na_diffusion_decoder.py@@ -22,6 +22,7 @@ import torchimport torch.nn.functional as Ffrom einops import rearrangefrom torch import nn+import comfy.model_managementfrom comfy.ldm.lightricks.model import get_timestep_embeddingfrom .causal_video_autoencoder import Encoder, processor@@ -74,8 +75,12 @@ def default_rope_dim_split(head_dim):def rope_inv_freqs(dim, base=10000.0, device=None):+ out_device = device+ if not comfy.model_management.supports_fp64(device):+ device = torch.device("cpu")+exponents = torch.arange(0, dim, 2, dtype=torch.float64, device=device) / dim- return (1.0 / torch.pow(torch.tensor(float(base), dtype=torch.float64, device=device), exponents)).to(torch.float32)+ return (1.0 / torch.pow(torch.tensor(float(base), dtype=torch.float64, device=device), exponents)).to(dtype=torch.float32, device=out_device)def _rope_tables(lengths, inv_freqs, device):