mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-11 02:15:17 +00:00
Add ConditioningStableAudio.
This lets you control the seconds_start and seconds_total parameters for the Stable Audio model.
This commit is contained in:
parent
37e5390f5f
commit
79badea452
@ -8,6 +8,7 @@ import json
|
|||||||
import struct
|
import struct
|
||||||
import random
|
import random
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import node_helpers
|
||||||
from comfy.cli_args import args
|
from comfy.cli_args import args
|
||||||
|
|
||||||
class EmptyLatentAudio:
|
class EmptyLatentAudio:
|
||||||
@ -29,6 +30,27 @@ class EmptyLatentAudio:
|
|||||||
latent = torch.zeros([batch_size, 64, length], device=self.device)
|
latent = torch.zeros([batch_size, 64, length], device=self.device)
|
||||||
return ({"samples":latent, "type": "audio"}, )
|
return ({"samples":latent, "type": "audio"}, )
|
||||||
|
|
||||||
|
class ConditioningStableAudio:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(s):
|
||||||
|
return {"required": {"positive": ("CONDITIONING", ),
|
||||||
|
"negative": ("CONDITIONING", ),
|
||||||
|
"seconds_start": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 1000.0, "step": 0.1}),
|
||||||
|
"seconds_total": ("FLOAT", {"default": 47.0, "min": 0.0, "max": 1000.0, "step": 0.1}),
|
||||||
|
}}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("CONDITIONING","CONDITIONING")
|
||||||
|
RETURN_NAMES = ("positive", "negative")
|
||||||
|
|
||||||
|
FUNCTION = "append"
|
||||||
|
|
||||||
|
CATEGORY = "conditioning"
|
||||||
|
|
||||||
|
def append(self, positive, negative, seconds_start, seconds_total):
|
||||||
|
positive = node_helpers.conditioning_set_values(positive, {"seconds_start": seconds_start, "seconds_total": seconds_total})
|
||||||
|
negative = node_helpers.conditioning_set_values(negative, {"seconds_start": seconds_start, "seconds_total": seconds_total})
|
||||||
|
return (positive, negative)
|
||||||
|
|
||||||
class VAEEncodeAudio:
|
class VAEEncodeAudio:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
@ -225,4 +247,5 @@ NODE_CLASS_MAPPINGS = {
|
|||||||
"SaveAudio": SaveAudio,
|
"SaveAudio": SaveAudio,
|
||||||
"LoadAudio": LoadAudio,
|
"LoadAudio": LoadAudio,
|
||||||
"PreviewAudio": PreviewAudio,
|
"PreviewAudio": PreviewAudio,
|
||||||
|
"ConditioningStableAudio": ConditioningStableAudio,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user