forked from kijai/ComfyUI-KJNodes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
222 lines (217 loc) · 9.51 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
from .nodes.nodes import *
from .nodes.curve_nodes import *
from .nodes.batchcrop_nodes import *
from .nodes.audioscheduler_nodes import *
from .nodes.image_nodes import *
from .nodes.intrinsic_lora_nodes import *
NODE_CLASS_MAPPINGS = {
#constants
"INTConstant": INTConstant,
"FloatConstant": FloatConstant,
"StringConstant": StringConstant,
"StringConstantMultiline": StringConstantMultiline,
#conditioning
"ConditioningMultiCombine": ConditioningMultiCombine,
"ConditioningSetMaskAndCombine": ConditioningSetMaskAndCombine,
"ConditioningSetMaskAndCombine3": ConditioningSetMaskAndCombine3,
"ConditioningSetMaskAndCombine4": ConditioningSetMaskAndCombine4,
"ConditioningSetMaskAndCombine5": ConditioningSetMaskAndCombine5,
"CondPassThrough": CondPassThrough,
#masking
"BatchCLIPSeg": BatchCLIPSeg,
"RoundMask": RoundMask,
"ResizeMask": ResizeMask,
"OffsetMask": OffsetMask,
"MaskBatchMulti": MaskBatchMulti,
"GrowMaskWithBlur": GrowMaskWithBlur,
"ColorToMask": ColorToMask,
"CreateGradientMask": CreateGradientMask,
"CreateTextMask": CreateTextMask,
"CreateAudioMask": CreateAudioMask,
"CreateFadeMask": CreateFadeMask,
"CreateFadeMaskAdvanced": CreateFadeMaskAdvanced,
"CreateFluidMask" :CreateFluidMask,
"CreateShapeMask": CreateShapeMask,
"CreateVoronoiMask": CreateVoronoiMask,
"CreateMagicMask": CreateMagicMask,
"RemapMaskRange": RemapMaskRange,
"GetMaskSize": GetMaskSize,
#images
"ImageBatchMulti": ImageBatchMulti,
"ColorMatch": ColorMatch,
"CrossFadeImages": CrossFadeImages,
"GetImageRangeFromBatch": GetImageRangeFromBatch,
"SaveImageWithAlpha": SaveImageWithAlpha,
"ReverseImageBatch": ReverseImageBatch,
"ImageGridComposite2x2": ImageGridComposite2x2,
"ImageGridComposite3x3": ImageGridComposite3x3,
"ImageConcanate": ImageConcanate,
"ImageBatchTestPattern": ImageBatchTestPattern,
"ReplaceImagesInBatch": ReplaceImagesInBatch,
"ImageGrabPIL": ImageGrabPIL,
"AddLabel": AddLabel,
"ImageUpscaleWithModelBatched": ImageUpscaleWithModelBatched,
"GetImagesFromBatchIndexed": GetImagesFromBatchIndexed,
"InsertImagesToBatchIndexed": InsertImagesToBatchIndexed,
"ImageBatchRepeatInterleaving": ImageBatchRepeatInterleaving,
"ImageNormalize_Neg1_To_1": ImageNormalize_Neg1_To_1,
"RemapImageRange": RemapImageRange,
"ImagePass": ImagePass,
"ImagePadForOutpaintMasked": ImagePadForOutpaintMasked,
"ImageAndMaskPreview": ImageAndMaskPreview,
"SplitImageChannels": SplitImageChannels,
"MergeImageChannels": MergeImageChannels,
#batch cropping
"BatchCropFromMask": BatchCropFromMask,
"BatchCropFromMaskAdvanced": BatchCropFromMaskAdvanced,
"FilterZeroMasksAndCorrespondingImages": FilterZeroMasksAndCorrespondingImages,
"InsertImageBatchByIndexes": InsertImageBatchByIndexes,
"BatchUncrop": BatchUncrop,
"BatchUncropAdvanced": BatchUncropAdvanced,
"SplitBboxes": SplitBboxes,
"BboxToInt": BboxToInt,
"BboxVisualize": BboxVisualize,
#noise
"GenerateNoise": GenerateNoise,
"FlipSigmasAdjusted": FlipSigmasAdjusted,
"InjectNoiseToLatent": InjectNoiseToLatent,
"CustomSigmas": CustomSigmas,
#utility
"WidgetToString": WidgetToString,
"DummyLatentOut": DummyLatentOut,
"GetLatentsFromBatchIndexed": GetLatentsFromBatchIndexed,
"ScaleBatchPromptSchedule": ScaleBatchPromptSchedule,
"CameraPoseVisualizer": CameraPoseVisualizer,
"JoinStrings": JoinStrings,
"JoinStringMulti": JoinStringMulti,
"Sleep": Sleep,
"VRAM_Debug" : VRAM_Debug,
"SomethingToString" : SomethingToString,
"EmptyLatentImagePresets": EmptyLatentImagePresets,
#audioscheduler stuff
"NormalizedAmplitudeToMask": NormalizedAmplitudeToMask,
"OffsetMaskByNormalizedAmplitude": OffsetMaskByNormalizedAmplitude,
"ImageTransformByNormalizedAmplitude": ImageTransformByNormalizedAmplitude,
#curve nodes
"SplineEditor": SplineEditor,
"CreateShapeMaskOnPath": CreateShapeMaskOnPath,
"WeightScheduleExtend": WeightScheduleExtend,
"MaskOrImageToWeight": MaskOrImageToWeight,
"WeightScheduleConvert": WeightScheduleConvert,
"FloatToMask": FloatToMask,
"FloatToSigmas": FloatToSigmas,
#experimental
"StabilityAPI_SD3": StabilityAPI_SD3,
"SoundReactive": SoundReactive,
"StableZero123_BatchSchedule": StableZero123_BatchSchedule,
"SV3D_BatchSchedule": SV3D_BatchSchedule,
"LoadResAdapterNormalization": LoadResAdapterNormalization,
"Superprompt": Superprompt,
"GLIGENTextBoxApplyBatchCoords": GLIGENTextBoxApplyBatchCoords,
"Intrinsic_lora_sampling": Intrinsic_lora_sampling,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"INTConstant": "INT Constant",
"FloatConstant": "Float Constant",
"ImageBatchMulti": "Image Batch Multi",
"MaskBatchMulti": "Mask Batch Multi",
"ConditioningMultiCombine": "Conditioning Multi Combine",
"ConditioningSetMaskAndCombine": "ConditioningSetMaskAndCombine",
"ConditioningSetMaskAndCombine3": "ConditioningSetMaskAndCombine3",
"ConditioningSetMaskAndCombine4": "ConditioningSetMaskAndCombine4",
"ConditioningSetMaskAndCombine5": "ConditioningSetMaskAndCombine5",
"GrowMaskWithBlur": "GrowMaskWithBlur",
"ColorToMask": "ColorToMask",
"CreateGradientMask": "CreateGradientMask",
"CreateTextMask" : "CreateTextMask",
"CreateFadeMask" : "CreateFadeMask (Deprecated)",
"CreateFadeMaskAdvanced" : "CreateFadeMaskAdvanced",
"CreateFluidMask" : "CreateFluidMask",
"CreateAudioMask" : "CreateAudioMask (Deprecated)",
"VRAM_Debug" : "VRAM Debug",
"CrossFadeImages": "CrossFadeImages",
"SomethingToString": "SomethingToString",
"EmptyLatentImagePresets": "EmptyLatentImagePresets",
"ColorMatch": "ColorMatch",
"GetImageRangeFromBatch": "GetImageRangeFromBatch",
"InsertImagesToBatchIndexed": "InsertImagesToBatchIndexed",
"SaveImageWithAlpha": "SaveImageWithAlpha",
"ReverseImageBatch": "ReverseImageBatch",
"ImageGridComposite2x2": "ImageGridComposite2x2",
"ImageGridComposite3x3": "ImageGridComposite3x3",
"ImageConcanate": "ImageConcatenate",
"ImageBatchTestPattern": "ImageBatchTestPattern",
"ReplaceImagesInBatch": "ReplaceImagesInBatch",
"BatchCropFromMask": "BatchCropFromMask",
"BatchCropFromMaskAdvanced": "BatchCropFromMaskAdvanced",
"FilterZeroMasksAndCorrespondingImages": "FilterZeroMasksAndCorrespondingImages",
"InsertImageBatchByIndexes": "InsertImageBatchByIndexes",
"BatchUncrop": "BatchUncrop",
"BatchUncropAdvanced": "BatchUncropAdvanced",
"BatchCLIPSeg": "BatchCLIPSeg",
"RoundMask": "RoundMask",
"ResizeMask": "ResizeMask",
"OffsetMask": "OffsetMask",
"WidgetToString": "WidgetToString",
"CreateShapeMask": "CreateShapeMask",
"CreateVoronoiMask": "CreateVoronoiMask",
"CreateMagicMask": "CreateMagicMask",
"BboxToInt": "BboxToInt",
"SplitBboxes": "SplitBboxes",
"ImageGrabPIL": "ImageGrabPIL",
"DummyLatentOut": "DummyLatentOut",
"FlipSigmasAdjusted": "FlipSigmasAdjusted",
"InjectNoiseToLatent": "InjectNoiseToLatent",
"AddLabel": "AddLabel",
"SoundReactive": "SoundReactive",
"GenerateNoise": "GenerateNoise",
"StableZero123_BatchSchedule": "StableZero123_BatchSchedule",
"SV3D_BatchSchedule": "SV3D_BatchSchedule",
"GetImagesFromBatchIndexed": "GetImagesFromBatchIndexed",
"ImageBatchRepeatInterleaving": "ImageBatchRepeatInterleaving",
"NormalizedAmplitudeToMask": "NormalizedAmplitudeToMask",
"OffsetMaskByNormalizedAmplitude": "OffsetMaskByNormalizedAmplitude",
"ImageTransformByNormalizedAmplitude": "ImageTransformByNormalizedAmplitude",
"GetLatentsFromBatchIndexed": "GetLatentsFromBatchIndexed",
"StringConstant": "StringConstant",
"CondPassThrough": "CondPassThrough",
"ImageUpscaleWithModelBatched": "ImageUpscaleWithModelBatched",
"ScaleBatchPromptSchedule": "ScaleBatchPromptSchedule",
"ImageNormalize_Neg1_To_1": "ImageNormalize_Neg1_To_1",
"Intrinsic_lora_sampling": "Intrinsic_lora_sampling",
"RemapMaskRange": "RemapMaskRange",
"LoadResAdapterNormalization": "LoadResAdapterNormalization",
"Superprompt": "Superprompt",
"RemapImageRange": "RemapImageRange",
"CameraPoseVisualizer": "CameraPoseVisualizer",
"BboxVisualize": "BboxVisualize",
"StringConstantMultiline": "StringConstantMultiline",
"JoinStrings": "JoinStrings",
"Sleep": "🛌 Sleep 🛌",
"ImagePadForOutpaintMasked": "Pad Image For Outpaint Masked",
"ImageAndMaskPreview": "Image & Mask Preview",
"StabilityAPI_SD3": "Stability API SD3",
"MaskOrImageToWeight": "Mask Or Image To Weight",
"WeightScheduleConvert": "Weight Schedule Convert",
"FloatToMask": "Float To Mask",
"FloatToSigmas": "Float To Sigmas",
"CustomSigmas": "Custom Sigmas",
"ImagePass": "ImagePass",
"SplitImageChannels": "Split Image Channels",
"MergeImageChannels": "Merge Image Channels",
#curve nodes
"SplineEditor": "Spline Editor",
"CreateShapeMaskOnPath": "Create Shape Mask On Path",
"WeightScheduleExtend": "Weight Schedule Extend"
}
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]
WEB_DIRECTORY = "./web"
from aiohttp import web
from server import PromptServer
from pathlib import Path
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("/kjweb_async", (Path(__file__).parent.absolute() / "kjweb_async").as_posix())]
)