From a3572c4832f3a047dc1fdd4017cad2ff7ffeab9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Sepp=C3=A4nen?= <40791699+kijai@users.noreply.github.com> Date: Mon, 27 Jul 2026 23:04:14 +0300 Subject: [PATCH] Allow using float fps for LTXVEmptyLatentAudio (#15106) --- comfy/ldm/lightricks/vae/audio_vae.py | 2 +- comfy_extras/nodes_lt_audio.py | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/comfy/ldm/lightricks/vae/audio_vae.py b/comfy/ldm/lightricks/vae/audio_vae.py index dd5320c8f..b4a8c7524 100644 --- a/comfy/ldm/lightricks/vae/audio_vae.py +++ b/comfy/ldm/lightricks/vae/audio_vae.py @@ -185,7 +185,7 @@ class AudioVAE(torch.nn.Module): self.autoencoder.mel_bins, ) - def num_of_latents_from_frames(self, frames_number: int, frame_rate: int) -> int: + def num_of_latents_from_frames(self, frames_number: int, frame_rate: float) -> int: return math.ceil((float(frames_number) / frame_rate) * self.latents_per_second) def run_vocoder(self, mel_spec: torch.Tensor) -> torch.Tensor: diff --git a/comfy_extras/nodes_lt_audio.py b/comfy_extras/nodes_lt_audio.py index 2d774a0a3..3ff18d8d4 100644 --- a/comfy_extras/nodes_lt_audio.py +++ b/comfy_extras/nodes_lt_audio.py @@ -107,14 +107,17 @@ class LTXVEmptyLatentAudio(io.ComfyNode): display_mode=io.NumberDisplay.number, tooltip="Number of frames.", ), - io.Int.Input( - "frame_rate", - default=25, - min=1, - max=1000, - step=1, - display_mode=io.NumberDisplay.number, - tooltip="Number of frames per second.", + io.MultiType.Input( + io.Float.Input( + "frame_rate", + default=25.0, + min=1.0, + max=1000.0, + step=0.01, + display_mode=io.NumberDisplay.number, + tooltip="Number of frames per second.", + ), + [io.Int], ), io.Int.Input( "batch_size", @@ -137,7 +140,7 @@ class LTXVEmptyLatentAudio(io.ComfyNode): def execute( cls, frames_number: int, - frame_rate: int, + frame_rate: float, batch_size: int, audio_vae, ) -> io.NodeOutput: