-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy path__init__.py
More file actions
86 lines (76 loc) · 2.99 KB
/
__init__.py
File metadata and controls
86 lines (76 loc) · 2.99 KB
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
import os
import sys
# Add parent directory to path
current_dir = os.path.dirname(os.path.abspath(__file__))
parent_dir = os.path.dirname(current_dir)
if parent_dir not in sys.path:
sys.path.insert(0, parent_dir)
# Now import folder_paths
import folder_paths
# Then import your other modules
from .IFLLMNode import IFLLM
from .IFDisplayTextWildcardNode import IFDisplayTextWildcard
from .IFLLMSaveTextNode import IFSaveText
from .IFLLMDisplayTextNode import IFDisplayText
from .IFLLMDisplayOmniNode import IFDisplayOmni
from .IFLLMTextTyperNode import IFTextTyper
from .IFLLMJoinTextNode import IFJoinText
from .IFLLMLoadImagesNodeS import IFLoadImagess
from .ListModelsNode import ListModelsNode
from .send_request import *
'''# Unified omost import handling
try:
if "omost" not in sys.modules: # Check if already imported
try:
from .omost import omost_function # Try relative import first
print("Successfully imported omost_function from current directory")
except ImportError:
# If relative import fails, try from parent directory
parent_dir = os.path.dirname(current_dir)
parent_dir_name = os.path.basename(parent_dir)
if parent_dir_name == 'ComfyUI-IF_LLM':
sys.path.insert(0, parent_dir)
from omost import omost_function
print(f"Successfully imported omost_function from {parent_dir}/omost.py")
else:
omost_function = sys.modules["omost"].omost_function
print("Using already imported omost_function")
except ImportError as e:
print(f"Error importing omost_function: {e}")
print(f"Current sys.path: {sys.path}")
raise'''
class OmniType(str):
"""A special string type that acts as a wildcard for universal input/output.
It always evaluates as equal in comparisons."""
def __ne__(self, __value: object) -> bool:
return False
OMNI = OmniType("*")
NODE_CLASS_MAPPINGS = {
"IF_LLM": IFLLM,
"IF_LLM_SaveText": IFSaveText,
"IF_LLM_DisplayText": IFDisplayText,
"IF_LLM_DisplayTextWildcard": IFDisplayTextWildcard,
"IF_LLM_DisplayOmni": IFDisplayOmni,
"IF_LLM_TextTyper": IFTextTyper,
"IF_LLM_JoinText": IFJoinText,
"IF_LLM_LoadImagesS": IFLoadImagess,
"IF_LLM_ListModels": ListModelsNode,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"IF_LLM": "IF LLM🎨",
"IF_LLM_SaveText": "IF Save Text📝",
"IF_LLM_DisplayText": "IF Display Text📟",
"IF_LLM_DisplayTextWildcard": "IF Display Text Wildcard📟",
"IF_LLM_DisplayOmni": "IF Display Omni🔍",
"IF_LLM_TextTyper": "IF Text Typer✍️",
"IF_LLM_JoinText": "IF Join Text 📝",
"IF_LLM_LoadImagesS": "IF LLM Load Images S 🖼️",
"IF_LLM_ListModels": "IF LLM List Models 📚",
}
WEB_DIRECTORY = "./web"
__all__ = [
"NODE_CLASS_MAPPINGS",
"NODE_DISPLAY_NAME_MAPPINGS",
"WEB_DIRECTORY",
"omost_function"
]