Skip to content

Commit c60567c

Browse files
committed
feat: add basic main category mapping
1 parent 2ec5489 commit c60567c

1 file changed

Lines changed: 263 additions & 1 deletion

File tree

server.py

Lines changed: 263 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,262 @@
5151
import comfyui_manager
5252

5353

54+
MAIN_CATEGORY_OVERRIDES = {name: "Basics" for name in [
55+
"CLIPTextEncodeSDXL+",
56+
"ConditioningCombineMultiple+",
57+
"SD3NegativeConditioning+",
58+
"ImageEnhanceDifference+",
59+
"ImageBatchMultiple+",
60+
"ImageExpandBatch+",
61+
"ImageFromBatch+",
62+
"ImageListToBatch+",
63+
"ImageComposite+",
64+
"ImageCompositeFromMaskBatch+",
65+
"ImageCrop+",
66+
"ImageFlip+",
67+
"ImageRandomTransform+",
68+
"ImageRemoveBackground+",
69+
"ImageResize+",
70+
"ImageSeamCarving+",
71+
"ImageTile+",
72+
"ImageUntile+",
73+
"RemBGSession+",
74+
"TransparentBGSession+",
75+
"ImageApplyLUT+",
76+
"ImageCASharpening+",
77+
"ImageColorMatch+",
78+
"ImageColorMatchAdobe+",
79+
"ImageDesaturate+",
80+
"ImageHistogramMatch+",
81+
"ImagePosterize+",
82+
"PixelOEPixelize+",
83+
"GetImageSize+",
84+
"ImagePreviewFromLatent+",
85+
"ImageRemoveAlpha+",
86+
"ImageToDevice+",
87+
"NoiseFromImage+",
88+
"Mask Bounding Box Aspect Ratio",
89+
"MaskBlur+",
90+
"MaskBoundingBox+",
91+
"MaskFix+",
92+
"MaskFlip+",
93+
"MaskFromColor+",
94+
"MaskFromList+",
95+
"MaskFromRGBCMYBW+",
96+
"MaskFromSegmentation+",
97+
"MaskPreview+",
98+
"MaskSmooth+",
99+
"TransitionMask+",
100+
"MaskBatch+",
101+
"MaskExpandBatch+",
102+
"MaskFromBatch+",
103+
"FluxSamplerParams+",
104+
"InjectLatentNoise+",
105+
"KSamplerVariationsStochastic+",
106+
"KSamplerVariationsWithNoise+",
107+
"PlotParameters+",
108+
"ApplyCLIPSeg+",
109+
"LoadCLIPSegModels+",
110+
"DrawText+",
111+
"BatchCount+",
112+
"ConsoleDebug+",
113+
"DebugTensorShape+",
114+
"ModelCompile+",
115+
"RemoveLatentMask+",
116+
"SDXLEmptyLatentSizePicker+",
117+
"SimpleMath+",
118+
"Intrinsic_lora_sampling",
119+
"AudioConcatenate",
120+
"ImageTransformByNormalizedAmplitude",
121+
"NormalizedAmplitudeToFloatList",
122+
"NormalizedAmplitudeToMask",
123+
"OffsetMaskByNormalizedAmplitude",
124+
"SoundReactive",
125+
"BOOLConstant",
126+
"FloatConstant",
127+
"INTConstant",
128+
"StringConstant",
129+
"StringConstantMultiline",
130+
"CustomControlNetWeightsFluxFromList",
131+
"CreateAudioMask",
132+
"CreateFadeMask",
133+
"ApplyRifleXRoPE_HunuyanVideo",
134+
"ApplyRifleXRoPE_WanVideo",
135+
"CFGZeroStarAndInit",
136+
"CheckpointLoaderKJ",
137+
"CheckpointPerturbWeights",
138+
"DiffusionModelLoaderKJ",
139+
"DiffusionModelSelector",
140+
"DiTBlockLoraLoader",
141+
"FastPreview",
142+
"FluxBlockLoraSelect",
143+
"GGUFLoaderKJ",
144+
"GLIGENTextBoxApplyBatchCoords",
145+
"HunyuanVideoBlockLoraSelect",
146+
"InterpolateCoords",
147+
"LatentInpaintTTM",
148+
"LeapfusionHunyuanI2VPatcher",
149+
"LoadResAdapterNormalization",
150+
"ModelPatchTorchSettings",
151+
"NABLA_AttentionKJ",
152+
"PatchModelPatcherOrder",
153+
"PathchSageAttentionKJ",
154+
"PlotCoordinates",
155+
"PointsEditor",
156+
"ScheduledCFGGuidance",
157+
"StableZero123_BatchSchedule",
158+
"StyleModelApplyAdvanced",
159+
"SV3D_BatchSchedule",
160+
"Wan21BlockLoraSelect",
161+
"WanVideoEnhanceAVideoKJ",
162+
"WanVideoNAG",
163+
"WebcamCaptureCV2",
164+
"ColorMatch",
165+
"CreateGradientFromCoords",
166+
"CreateShapeImageOnPath",
167+
"CrossFadeImages",
168+
"CrossFadeImagesMulti",
169+
"CutAndDragOnPath",
170+
"GetImageRangeFromBatch",
171+
"GetImagesFromBatchIndexed",
172+
"GetImageSizeAndCount",
173+
"GetLatentSizeAndCount",
174+
"GradientToFloat",
175+
"ImageAddMulti",
176+
"ImageBatchExtendWithOverlap",
177+
"ImageBatchFilter",
178+
"ImageBatchJoinWithTransition",
179+
"ImageBatchMulti",
180+
"ImageBatchRepeatInterleaving",
181+
"ImageConcanate",
182+
"ImageConcatFromBatch",
183+
"ImageConcatMulti",
184+
"ImageCropByMask",
185+
"ImageCropByMaskAndResize",
186+
"ImageCropByMaskBatch",
187+
"ImageGrabPIL",
188+
"ImageGridComposite2x2",
189+
"ImageGridComposite3x3",
190+
"ImageGridtoBatch",
191+
"ImageNoiseAugmentation",
192+
"ImageNormalize_Neg1_To_1",
193+
"ImagePadKJ",
194+
"ImagePass",
195+
"ImageResizeKJ",
196+
"ImageResizeKJv2",
197+
"ImageTensorList",
198+
"ImageUncropByMask",
199+
"ImageUpscaleWithModelBatched",
200+
"InsertImageBatchByIndexes",
201+
"InsertImagesToBatchIndexed",
202+
"LoadAndResizeImage",
203+
"MergeImageChannels",
204+
"PadImageBatchInterleaved",
205+
"PreviewAnimation",
206+
"RemapImageRange",
207+
"ReplaceImagesInBatch",
208+
"ReverseImageBatch",
209+
"SaveImageWithAlpha",
210+
"Screencap_mss",
211+
"ShuffleImageBatch",
212+
"SplitImageChannels",
213+
"TransitionImagesInBatch",
214+
"TransitionImagesMulti",
215+
"AppendInstanceDiffusionTracking",
216+
"CreateInstanceDiffusionTracking",
217+
"DrawInstanceDiffusionTracking",
218+
"EmptyLatentImageCustomPresets",
219+
"EmptyLatentImagePresets",
220+
"GetLatentRangeFromBatch",
221+
"GetLatentsFromBatchIndexed",
222+
"InsertLatentToIndexed",
223+
"LoraExtractKJ",
224+
"LoraReduceRankKJ",
225+
"BatchCLIPSeg",
226+
"BatchCropFromMask",
227+
"BatchCropFromMaskAdvanced",
228+
"BatchUncrop",
229+
"BatchUncropAdvanced",
230+
"BboxToInt",
231+
"BboxVisualize",
232+
"BlockifyMask",
233+
"ColorToMask",
234+
"ConsolidateMasksKJ",
235+
"DownloadAndLoadCLIPSeg",
236+
"DrawGaussianNoiseOnImage",
237+
"DrawMaskOnImage",
238+
"FilterZeroMasksAndCorrespondingImages",
239+
"GetMaskSizeAndCount",
240+
"GrowMaskWithBlur",
241+
"ImageAndMaskPreview",
242+
"MaskBatchMulti",
243+
"OffsetMask",
244+
"RemapMaskRange",
245+
"ResizeMask",
246+
"RoundMask",
247+
"SeparateMasks",
248+
"SplitBboxes",
249+
"CameraPoseVisualizer",
250+
"CondPassThrough",
251+
"DummyOut",
252+
"LazySwitchKJ",
253+
"ModelPassThrough",
254+
"ScaleBatchPromptSchedule",
255+
"SimpleCalculatorKJ",
256+
"Sleep",
257+
"StringToFloatList",
258+
"TimerNodeKJ",
259+
"VRAM_Debug",
260+
"CustomSigmas",
261+
"FlipSigmasAdjusted",
262+
"FloatToSigmas",
263+
"GenerateNoise",
264+
"InjectNoiseToLatent",
265+
"SigmasToFloat",
266+
"WanVideoTeaCacheKJ",
267+
"AddLabel",
268+
"AppendStringsToList",
269+
"CreateTextMask",
270+
"ImageBatchTestPattern",
271+
"JoinStringMulti",
272+
"JoinStrings",
273+
"SomethingToString",
274+
"Superprompt",
275+
"WidgetToString",
276+
"TorchCompileControlNet",
277+
"TorchCompileCosmosModel",
278+
"TorchCompileLTXModel",
279+
"TorchCompileModelAdvanced",
280+
"TorchCompileModelFluxAdvanced",
281+
"TorchCompileModelFluxAdvancedV2",
282+
"TorchCompileModelHyVideo",
283+
"TorchCompileModelQwenImage",
284+
"TorchCompileModelWanVideo",
285+
"TorchCompileModelWanVideoV2",
286+
"TorchCompileVAE",
287+
"VAELoaderKJ",
288+
"HunyuanVideoEncodeKeyframesToCond",
289+
"MaskOrImageToWeight",
290+
"SplineEditor",
291+
"WeightScheduleConvert",
292+
"WeightScheduleExtend",
293+
"ConditioningMultiCombine",
294+
"ConditioningSetMaskAndCombine",
295+
"ConditioningSetMaskAndCombine3",
296+
"ConditioningSetMaskAndCombine4",
297+
"ConditioningSetMaskAndCombine5",
298+
"CreateFadeMaskAdvanced",
299+
"CreateFluidMask",
300+
"CreateGradientMask",
301+
"CreateMagicMask",
302+
"CreateShapeMask",
303+
"CreateShapeMaskOnPath",
304+
"CreateTextOnPath",
305+
"CreateVoronoiMask",
306+
"FloatToMask",
307+
]}
308+
309+
54310
def _remove_sensitive_from_queue(queue: list) -> list:
55311
"""Remove sensitive data (index 5) from queue item tuples."""
56312
return [item[:5] for item in queue]
@@ -652,7 +908,10 @@ async def get_prompt(request):
652908
def node_info(node_class):
653909
obj_class = nodes.NODE_CLASS_MAPPINGS[node_class]
654910
if issubclass(obj_class, _ComfyNodeInternal):
655-
return obj_class.GET_NODE_INFO_V1()
911+
info = obj_class.GET_NODE_INFO_V1()
912+
if node_class in MAIN_CATEGORY_OVERRIDES:
913+
info['main_category'] = MAIN_CATEGORY_OVERRIDES[node_class]
914+
return info
656915
info = {}
657916
info['input'] = obj_class.INPUT_TYPES()
658917
info['input_order'] = {key: list(value.keys()) for (key, value) in obj_class.INPUT_TYPES().items()}
@@ -694,6 +953,9 @@ def node_info(node_class):
694953
if hasattr(obj_class, 'MAIN_CATEGORY'):
695954
info['main_category'] = obj_class.MAIN_CATEGORY
696955

956+
if node_class in MAIN_CATEGORY_OVERRIDES:
957+
info['main_category'] = MAIN_CATEGORY_OVERRIDES[node_class]
958+
697959
return info
698960

699961
@routes.get("/object_info")

0 commit comments

Comments
 (0)