build(core): use node setup helper

This commit is contained in:
yemiancheng
2025-06-03 20:54:33 +08:00
parent a4e03cc8a2
commit 8b399da4c3
4 changed files with 53 additions and 2 deletions
+30 -2
View File
@@ -1,3 +1,31 @@
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
# v1
# from yors_comfyui_node_setup import entry,node_install_requirements # global
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']
# # install requirements
# node_install_requirements(__file__)
# # export comfyui node vars
# __all__,NODE_CLASS_MAPPINGS,NODE_DISPLAY_NAME_MAPPINGS,NODE_MENU_NAMES = entry(__name__,__file__)
# v2
from yors_comfyui_node_setup import node_install_requirements,entry_pre_import,entry_import,get_all_classs_in_sys,register_node_list_local
# install requirements
node_install_requirements(__file__)
# gen __all__
__all__ = entry_pre_import(__name__,__file__)
# import moudle with __all__
entry_import(__name__,__all__)
# get class after importing moudle with __all__
this_module_all_classes = get_all_classs_in_sys(__name__)
# register node with default category
# NODE_CLASS_MAPPINGS,NODE_DISPLAY_NAME_MAPPINGS,NODE_MENU_NAMES = register_node_list(this_module_all_classes,False)
# addtional register node with custom category
NODE_CLASS_MAPPINGS,NODE_DISPLAY_NAME_MAPPINGS,NODE_MENU_NAMES = register_node_list_local(this_module_all_classes,True,"ymc/suite")
# print(NODE_CLASS_MAPPINGS,NODE_DISPLAY_NAME_MAPPINGS,NODE_MENU_NAMES)
print("\n".join(NODE_MENU_NAMES))
+2
View File
@@ -0,0 +1,2 @@
CURRENT_CATEGORY="ymc/suite"
CURRENT_FUNCTION="exec"
+20
View File
@@ -0,0 +1,20 @@
from .conf import CURRENT_CATEGORY,CURRENT_FUNCTION
class TextInput:
@classmethod
def INPUT_TYPES(s):
return {"required": {
"text": ("STRING",{"multiline": True,"default": ""}),
},
}
RETURN_TYPES = ("STRING",)
CATEGORY = CURRENT_CATEGORY
FUNCTION = CURRENT_FUNCTION
NODE_DESC = "text - input with multiline input"
INPUT_IS_LIST = False
OUTPUT_IS_LIST = (False,)
def exec(self,text):
return (text,)
+1
View File
@@ -33,6 +33,7 @@ import time
# import torch
# from tqdm import tqdm
# define manifest about this project in dict
MANIFEST = {
"name": "ymc node suite",
"version": (1,0,0),