-
Notifications
You must be signed in to change notification settings - Fork 5
/
__init__.py
33 lines (28 loc) · 1.12 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
from .AnyText.utils import is_folder_exist
import folder_paths
import os
#加载插件前先检查是否在os.listdir里存在自定义目录,没有则自动创建,防止加载节点失败,官方目录可无视。
fonts_path = os.path.join(folder_paths.models_dir, 'fonts')
translator_path = os.path.join(folder_paths.models_dir, 'prompt_generator')
comfy_temp_dir = folder_paths.get_temp_directory()
if not is_folder_exist(fonts_path):
os.makedirs(fonts_path)
if not is_folder_exist(translator_path):
os.makedirs(translator_path)
if not is_folder_exist(comfy_temp_dir):
os.makedirs(comfy_temp_dir)
# only import if running as a custom node
try:
pass
except ImportError:
pass
else:
NODE_CLASS_MAPPINGS = {}
# AnyText
from .AnyText.nodes import NODE_CLASS_MAPPINGS as AnyText_Nodes
NODE_CLASS_MAPPINGS.update(AnyText_Nodes)
# AnyText_utils
from .AnyText.utils import NODE_CLASS_MAPPINGS as AnyText_loader_Nodes
NODE_CLASS_MAPPINGS.update(AnyText_loader_Nodes)
NODE_DISPLAY_NAME_MAPPINGS = {k:v.TITLE for k,v in NODE_CLASS_MAPPINGS.items()}
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']