mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-20 11:23:29 +00:00
Audio second setting in EmptyLatentAudio.
This commit is contained in:
parent
0d9009c96e
commit
7ecb2ec169
@ -14,15 +14,16 @@ class EmptyLatentAudio:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(s):
|
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",)
|
RETURN_TYPES = ("LATENT",)
|
||||||
FUNCTION = "generate"
|
FUNCTION = "generate"
|
||||||
|
|
||||||
CATEGORY = "_for_testing/audio"
|
CATEGORY = "_for_testing/audio"
|
||||||
|
|
||||||
def generate(self):
|
def generate(self, seconds):
|
||||||
batch_size = 1
|
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"}, )
|
return ({"samples":latent, "type": "audio"}, )
|
||||||
|
|
||||||
class VAEEncodeAudio:
|
class VAEEncodeAudio:
|
||||||
|
Loading…
Reference in New Issue
Block a user