-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
__init__.py
177 lines (159 loc) · 6.19 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# only import if running as a custom node
"""
@author: jags111
@title: Jags_Audiotools
@nickname: Audiotools
@description: This extension offers various audio generation tools
"""
import sys, os, shutil
import importlib
import traceback
import json
import folder_paths
custom_nodes_path = os.path.join(folder_paths.base_path, "custom_nodes")
ComfyUI_Jags_Audiotools_path = os.path.join(custom_nodes_path, "ComfyUI_Jags_Audiotools")
sys.path.append(ComfyUI_Jags_Audiotools_path)
#from server import server
from .AudioManipulation import *
from .PedalBoard import *
from .SampleDiffusion import *
from .Spectrology import *
from .VariationUtils import *
from .WaveGen import *
from .soundplayer import *
"""module_js_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), "js")
application_root_directory = os.path.dirname(folder_paths.__file__)
extension_web_extensions_directory = os.path.join(application_root_directory, "web", "extensions", "comfyui_jags_audiotools")
shutil.copytree(module_js_directory, extension_web_extensions_directory, dirs_exist_ok=True)"""
NODE_CLASS_MAPPINGS = {
"JoinAudio": JoinAudio,
"BatchJoinAudio": BatchJoinAudio,
"CutAudio": CutAudio,
"DuplicateAudio": DuplicateAudio,
"StretchAudio": StretchAudio,
"ReverseAudio": ReverseAudio,
"ResampleAudio": ResampleAudio,
"OTTAudioFX": OTT,
"LoadVST3": LoadVST,
"BitCrushAudioFX": BitCrushEffect,
"ChorusAudioFX": ChorusEffect,
"ClippingAudioFX": ClippingEffect,
"CompressorAudioFX": CompressorEffect,
"ConvolutionAudioFX": ConvolutionEffect,
"DelayAudioFX": DelayEffect,
"DistortionAudioFX": DistortionEffect,
"GainAudioFX": GainEffect,
"InvertAudioFX": InvertEffect,
"LimiterAudioFX": LimiterEffect,
"MP3CompressorAudioFX": MP3CompressorEffect,
"NoiseGateAudioFX": NoiseGateEffect,
"PitchShiftAudioFX": PitchShiftEffect,
"PhaserEffectAudioFX": PhaserEffect,
"ReverbAudioFX": ReverbEffect,
"HighShelfFilter": HighShelfFilterEffect,
"HighpassFilter": HighpassFilterEffect,
"LadderFilter": LadderFilterEffect,
"LowShelfFilter": LowShelfFilterEffect,
"LowpassFilter": LowpassFilterEffect,
"PeakFilter": PeakFilterEffect,
"GenerateAudioSample": AudioInference,
"SaveAudioTensor": SaveAudio,
"LoadAudioFile": LoadAudio,
"PreviewAudioFile": PreviewAudioFile,
"PreviewAudioTensor": PreviewAudioTensor,
"GetStringByIndex": StringListIndex,
"LoadAudioModel (DD)": LoadAudioModelDD,
"MixAudioTensors": MergeTensors,
"GetAudioFromFolderIndex": AudioIndex,
"ImageToSpectral": ImageToSpectral,
"PlotSpectrogram": Plot_Spectrogram,
'SliceAudio': SliceAudio,
'BatchToList': BatchToList,
'LoadAudioDir': LoadAudioDir,
'ListToBatch': ListToBatch,
'ConcatAudioList': ConcatAudioList,
'GetSingle': GetSingle,
'SequenceVariation': SequenceVariation,
'BulkVariation': BulkVariation,
"GenerateAudioWave": WaveGenerator,
"samplerate": samplerate,
"SoundPlayer": SoundPlayer,
}
NODE_DISPLAY_NAME_MAPPINGS = {
'JoinAudio': 'Jags_JoinAudio',
'BatchJoinAudio': 'Jags_BatchJoinAudio',
'CutAudio': 'Jags_CutAudio',
'DuplicateAudio': 'Jags_DuplicateAudio',
'StretchAudio': 'Jags_StretchAudio',
'ReverseAudio': 'Jags_ReverseAudio',
'ResampleAudio': 'Jags_ResampleAudio',
"OTTAudioFX": "OTT",
"LoadVST3": "Load VST3",
"BitCrushAudioFX": "Bit Crush",
"ChorusAudioFX": "Chorus",
"ClippingAudioFX": "Clipping",
"CompressorAudioFX": "Compressor",
"ConvolutionAudioFX": "Convolution",
"DelayAudioFX": "Delay",
"DistortionAudioFX": "Distortion",
"GainAudioFX": "Gain",
"InvertAudioFX": "Invert",
"LimiterAudioFX": "Limiter",
"MP3CompressorAudioFX": "MP3 Compressor",
"NoiseGateAudioFX": "Noise Gate",
"PitchShiftAudioFX": "Pitch Shift",
"PhaserEffectAudioFX": "Phaser",
"ReverbAudioFX": "Reverb",
"HighShelfFilter": "High Shelf Filter",
"HighpassFilter": "Highpass Filter",
"LadderFilter": "Ladder Filter",
"LowShelfFilter": "Low Shelf Filter",
"LowpassFilter": "Lowpass Filter",
"PeakFilter": "Peak Filter",
"GenerateAudioSample": "Jags-AudioInference",
"SaveAudioTensor": "Jags_SaveAudio",
"LoadAudioFile": "Jags_LoadAudio",
"PreviewAudioFile": "Jags_PreviewAudioFile",
"PreviewAudioTensor": "Jags_PreviewAudioTensor",
"GetStringByIndex": "Jags_StringListIndex",
"LoadAudioModel (DD)": "Jags_LoadAudioModelDD",
"MixAudioTensors": "Jags_MergeTensors",
"GetAudioFromFolderIndex": "Jags_AudioIndex",
'ImageToSpectral': 'Jags Image To Spectral',
'PlotSpectrogram': 'Jags Plot Spectrogram',
'SliceAudio': 'Jags_SliceAudio',
'BatchToList': 'Jags_BatchToList',
'LoadAudioDir': 'Jags_LoadAudioDir',
'ListToBatch': 'Jags_ListToBatch',
'ConcatAudioList': 'Jags_ConcatAudioList',
'SequenceVariation': 'Jags_SequenceVariation',
'GetSingle': 'Jags_GetSingle',
'BulkVariation': 'Jags_BulkVariation',
"GenerateAudioWave": 'Jags_Wave Generator',
"samplerate": "Jags_samplerate",
"SoundPlayer": "Jags_SoundPlayer",
}
CC_VERSION = 1.0
THIS_DIR=os.path.dirname(os.path.abspath(__file__))
DIR_DEV_JS=os.path.abspath(f'{THIS_DIR}/js')
DIR_PY=os.path.abspath(f'{THIS_DIR}/py')
DIR_WEB_JS=os.path.abspath(f'{THIS_DIR}/../../web/extensions/comfyui_jags_audiotools')
if not os.path.exists(DIR_WEB_JS):
os.makedirs(DIR_WEB_JS)
shutil.copytree(DIR_DEV_JS, DIR_WEB_JS, dirs_exist_ok=True)
# web ui feature
WEB_DIRECTORY = "js"
#print confirmation
print('--------------')
print('*ComfyUI_Jags_Audiotools- nodes_loaded*')
print('--------------')
#__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']
__ALL__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS', 'CC_VERSION']
"""for node in os.listdir(os.path.dirname(__file__)):
if node.startswith('EXT_'):
node = node.split('.')[0]
node_import = importlib.import_module('custom_nodes.ComfyUI_Jags_Audiotools.' + node)
# get class node mappings from py file
NODE_CLASS_MAPPINGS.update(node_import.NODE_CLASS_MAPPINGS)
NODE_DISPLAY_NAME_MAPPINGS.update(node_import.NODE_DISPLAY_NAME_MAPPINGS)"""
# NODE_CLASS_MAPPINGS.update(node_import.NODE_CLASS_MAPPINGS)