-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path__init__.py
120 lines (95 loc) · 4.33 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
# Thanks to RyanOnTheInside, KJNodes, MTB, Fill, Akatz, Matheo, their works helped me a lot
from pathlib import Path
from aiohttp import web
from .node_configs import CombinedMeta
from collections import OrderedDict
from server import PromptServer
class Yvann(metaclass=CombinedMeta):
@classmethod
def get_description(cls):
footer = "\n\n"
footer = "#### 🐙 Docs, Workflows and Code: [Yvann-Nodes GitHub](https://github.com/yvann-ba/ComfyUI_Yvann-Nodes) "
footer += " 👁️ Tutorials: [Yvann Youtube](https://www.youtube.com/@yvann.mp4)\n"
desc = ""
if hasattr(cls, 'DESCRIPTION'):
desc += f"{cls.DESCRIPTION}\n\n{footer}"
return desc
if hasattr(cls, 'TOP_DESCRIPTION'):
desc += f"{cls.TOP_DESCRIPTION}\n\n"
if hasattr(cls, "BASE_DESCRIPTION"):
desc += cls.BASE_DESCRIPTION + "\n\n"
additional_info = OrderedDict()
for c in cls.mro()[::-1]:
if hasattr(c, 'ADDITIONAL_INFO'):
info = c.ADDITIONAL_INFO.strip()
additional_info[c.__name__] = info
if additional_info:
desc += "\n\n".join(additional_info.values()) + "\n\n"
if hasattr(cls, 'BOTTOM_DESCRIPTION'):
desc += f"{cls.BOTTOM_DESCRIPTION}\n\n"
desc += footer
return desc
from .nodes.audio.LoadAudioSeparationModel import LoadAudioSeparationModel
from .nodes.audio.AudioAnalysis import AudioAnalysis
from .nodes.audio.AudioPeaksDetection import AudioPeaksDetection
from .nodes.audio.AudioIPAdapterTransitions import AudioIPAdapterTransitions
from .nodes.audio.AudioPromptSchedule import AudioPromptSchedule
from .nodes.audio.EditAudioWeights import EditAudioWeights
from .nodes.audio.AudioRemixer import AudioRemixer
#from .nodes.audio.AudioControlNetSchedule import AudioControlNetSchedule
from .nodes.utils.RepeatImageToCount import RepeatImageToCount
from .nodes.utils.InvertFloats import InvertFloats
from .nodes.utils.FloatsVisualizer import FloatsVisualizer
from .nodes.convert.MaskToFloat import MaskToFloat
from .nodes.convert.FloatsToWeightsStrategy import FloatsToWeightsStrategy
from .nodes.convert.FloatToInt import FloatToInt
#"Audio ControlNet Schedule": AudioControlNetSchedule,
NODE_CLASS_MAPPINGS = {
"Load Audio Separation Model": LoadAudioSeparationModel,
"Audio Analysis": AudioAnalysis,
"Audio Peaks Detection": AudioPeaksDetection,
"Audio IPAdapter Transitions": AudioIPAdapterTransitions,
"Audio Prompt Schedule": AudioPromptSchedule,
"Edit Audio Weights": EditAudioWeights,
"Audio Remixer": AudioRemixer,
"Repeat Image To Count": RepeatImageToCount,
"Invert Floats": InvertFloats,
"Floats Visualizer": FloatsVisualizer,
"Mask To Float": MaskToFloat,
"Floats To Weights Strategy": FloatsToWeightsStrategy,
"Float to Int": FloatToInt
}
WEB_DIRECTORY = "./web/js"
#"Audio ControlNet Schedule": "Audio ControlNet Schedule",
NODE_DISPLAY_NAME_MAPPINGS = {
"Load Audio Separation Model": "Load Audio Separation Model",
"Audio Analysis": "Audio Analysis",
"Audio Peaks Detection": "Audio Peaks Detection",
"Audio IPAdapter Transitions": "Audio IPAdapter Transitions",
"Audio Prompt Schedule": "Audio Prompt Schedule",
"Edit Audio Weights": "Edit Audio Weights",
"Audio Remixer": "Audio Remixer",
"Repeat Image To Count": "Repeat Image To Count",
"Invert Floats": "Invert Floats",
"Floats Visualizer": "Floats Visualizer",
"Mask To Float": "Mask To Float",
"Floats To Weights Strategy": "Floats To Weights Strategy",
"Float to Int" : "Float to Int",
}
Yvann_Print = """
🔊 Yvann Audio Reactive & Utils Node"""
print("\033[38;5;195m" + Yvann_Print +
"\033[38;5;222m" + " : Loaded\n" + "\033[0m")
if hasattr(PromptServer, "instance"):
# NOTE: we add an extra static path to avoid comfy mechanism
# that loads every script in web.
PromptServer.instance.app.add_routes(
[web.static("/yvann_web_async",
(Path(__file__).parent.absolute() / "yvann_web_async").as_posix())]
)
for node_name, node_class in NODE_CLASS_MAPPINGS.items():
if hasattr(node_class, 'get_description'):
desc = node_class.get_description()
node_class.DESCRIPTION = desc
__all__ = ["NODE_CLASS_MAPPINGS",
"NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]