Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Allow using float fps for LTXVEmptyLatentAudio (#15106)

Jukka Seppänena3572c4832f3
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: