The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Add ConditioningStableAudio.
comfyanonymous79badea452ff
diff --git a/comfy_extras/nodes_audio.py b/comfy_extras/nodes_audio.pyindex e5cc4dffe..3cb918e09 100644--- a/comfy_extras/nodes_audio.py+++ b/comfy_extras/nodes_audio.py@@ -8,6 +8,7 @@ import jsonimport structimport randomimport hashlib+import node_helpersfrom comfy.cli_args import argsclass EmptyLatentAudio:@@ -29,6 +30,27 @@ class EmptyLatentAudio:latent = torch.zeros([batch_size, 64, length], device=self.device)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:@classmethoddef INPUT_TYPES(s):@@ -225,4 +247,5 @@ NODE_CLASS_MAPPINGS = {"SaveAudio": SaveAudio,"LoadAudio": LoadAudio,"PreviewAudio": PreviewAudio,+ "ConditioningStableAudio": ConditioningStableAudio,}