From 1184ff6008b5cdd96412149ddb7f985d8753ceaf Mon Sep 17 00:00:00 2001 From: Yuma Lenz Date: Sat, 31 Aug 2024 21:54:01 +0200 Subject: [PATCH] Add batch size argument for EmptyLatentAudio --- comfy_extras/nodes_audio.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/comfy_extras/nodes_audio.py b/comfy_extras/nodes_audio.py index 762b48279..61850c1e4 100644 --- a/comfy_extras/nodes_audio.py +++ b/comfy_extras/nodes_audio.py @@ -16,14 +16,13 @@ class EmptyLatentAudio: @classmethod def INPUT_TYPES(s): - return {"required": {"seconds": ("FLOAT", {"default": 47.6, "min": 1.0, "max": 1000.0, "step": 0.1})}} + return {"required": {"seconds": ("FLOAT", {"default": 47.6, "min": 1.0, "max": 1000.0, "step": 0.1}), "batch_size": ("INT", {"default": 1, "min": 1, "max": 16, "step": 1})}} RETURN_TYPES = ("LATENT",) FUNCTION = "generate" CATEGORY = "latent/audio" - def generate(self, seconds): - batch_size = 1 + def generate(self, seconds, batch_size): length = round((seconds * 44100 / 2048) / 2) * 2 latent = torch.zeros([batch_size, 64, length], device=self.device) return ({"samples":latent, "type": "audio"}, )