Skip to content

Commit fdf3756

Browse files
Add batch size to EmptyLatentAudio.
1 parent 08c8968 commit fdf3756

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

comfy_extras/nodes_audio.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ def __init__(self):
1616

1717
@classmethod
1818
def INPUT_TYPES(s):
19-
return {"required": {"seconds": ("FLOAT", {"default": 47.6, "min": 1.0, "max": 1000.0, "step": 0.1})}}
19+
return {"required": {"seconds": ("FLOAT", {"default": 47.6, "min": 1.0, "max": 1000.0, "step": 0.1}),
20+
"batch_size": ("INT", {"default": 1, "min": 1, "max": 4096, "tooltip": "The number of latent images in the batch."}),
21+
}}
2022
RETURN_TYPES = ("LATENT",)
2123
FUNCTION = "generate"
2224

2325
CATEGORY = "latent/audio"
2426

25-
def generate(self, seconds):
26-
batch_size = 1
27+
def generate(self, seconds, batch_size):
2728
length = round((seconds * 44100 / 2048) / 2) * 2
2829
latent = torch.zeros([batch_size, 64, length], device=self.device)
2930
return ({"samples":latent, "type": "audio"}, )

0 commit comments

Comments
 (0)