-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path__init__.py
31 lines (22 loc) · 1.13 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
# v1
# from yors_comfyui_node_setup import entry,node_install_requirements # global
# # 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/as_x_type")
# print(NODE_CLASS_MAPPINGS,NODE_DISPLAY_NAME_MAPPINGS,NODE_MENU_NAMES)
print("\n".join(NODE_MENU_NAMES))