mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-06-04 06:37:52 +08:00
Add NormalizedAmplitudeToFloatList
This commit is contained in:
parent
b848061104
commit
8436ac8166
@ -89,6 +89,7 @@ NODE_CONFIG = {
|
|||||||
"EmptyLatentImagePresets": {"class": EmptyLatentImagePresets, "name": "Empty Latent Image Presets"},
|
"EmptyLatentImagePresets": {"class": EmptyLatentImagePresets, "name": "Empty Latent Image Presets"},
|
||||||
#audioscheduler stuff
|
#audioscheduler stuff
|
||||||
"NormalizedAmplitudeToMask": {"class": NormalizedAmplitudeToMask},
|
"NormalizedAmplitudeToMask": {"class": NormalizedAmplitudeToMask},
|
||||||
|
"NormalizedAmplitudeToFloatList": {"class": NormalizedAmplitudeToFloatList},
|
||||||
"OffsetMaskByNormalizedAmplitude": {"class": OffsetMaskByNormalizedAmplitude},
|
"OffsetMaskByNormalizedAmplitude": {"class": OffsetMaskByNormalizedAmplitude},
|
||||||
"ImageTransformByNormalizedAmplitude": {"class": ImageTransformByNormalizedAmplitude},
|
"ImageTransformByNormalizedAmplitude": {"class": ImageTransformByNormalizedAmplitude},
|
||||||
#curve nodes
|
#curve nodes
|
||||||
|
|||||||
@ -96,6 +96,27 @@ Creates masks based on the normalized amplitude.
|
|||||||
|
|
||||||
return (torch.cat(out, dim=0),)
|
return (torch.cat(out, dim=0),)
|
||||||
|
|
||||||
|
class NormalizedAmplitudeToFloatList:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(s):
|
||||||
|
return {"required": {
|
||||||
|
"normalized_amp": ("NORMALIZED_AMPLITUDE",),
|
||||||
|
},}
|
||||||
|
|
||||||
|
CATEGORY = "KJNodes/audio"
|
||||||
|
RETURN_TYPES = ("FLOAT",)
|
||||||
|
FUNCTION = "convert"
|
||||||
|
DESCRIPTION = """
|
||||||
|
Works as a bridge to the AudioScheduler -nodes:
|
||||||
|
https://github.com/a1lazydog/ComfyUI-AudioScheduler
|
||||||
|
Creates a list of floats from the normalized amplitude.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def convert(self, normalized_amp):
|
||||||
|
# Ensure normalized_amp is an array and within the range [0, 1]
|
||||||
|
normalized_amp = np.clip(normalized_amp, 0.0, 1.0)
|
||||||
|
return (normalized_amp.tolist(),)
|
||||||
|
|
||||||
class OffsetMaskByNormalizedAmplitude:
|
class OffsetMaskByNormalizedAmplitude:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user