Skip to content

Commit

Permalink
Audio second setting in EmptyLatentAudio.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Jun 28, 2024
1 parent 0d9009c commit 7ecb2ec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions comfy_extras/nodes_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ def __init__(self):

@classmethod
def INPUT_TYPES(s):
return {"required": {}}
return {"required": {"seconds": ("FLOAT", {"default": 47.6, "min": 1.0, "max": 1000.0, "step": 0.1})}}
RETURN_TYPES = ("LATENT",)
FUNCTION = "generate"

CATEGORY = "_for_testing/audio"

def generate(self):
def generate(self, seconds):
batch_size = 1
latent = torch.zeros([batch_size, 64, 1024], device=self.device)
length = round((seconds * 44100 / 2048) / 2) * 2
latent = torch.zeros([batch_size, 64, length], device=self.device)
return ({"samples":latent, "type": "audio"}, )

class VAEEncodeAudio:
Expand Down

0 comments on commit 7ecb2ec

Please sign in to comment.