diff --git a/OneButtonPromptNodes.py b/OneButtonPromptNodes.py index c0fe8a5..c1763bd 100644 --- a/OneButtonPromptNodes.py +++ b/OneButtonPromptNodes.py @@ -4,10 +4,8 @@ import folder_paths from datetime import datetime import uuid -# adding Folder_2/subfolder to the system path -# sys.path.insert(0, '/home/amninder/Desktop/project/Folder_2/subfolder') -custom_nodes_path = os.path.dirname(__file__) -onebuttonprompt_path = os.path.join(custom_nodes_path, "..", "onebuttonprompt") +custom_nodes_path = os.path.join(folder_paths.base_path, "custom_nodes") +onebuttonprompt_path = os.path.join(custom_nodes_path, "onebuttonprompt") sys.path.insert(0, onebuttonprompt_path) from build_dynamic_prompt import * diff --git a/__init__.py b/__init__.py index 206c4c1..ab17cd6 100644 --- a/__init__.py +++ b/__init__.py @@ -1,3 +1,11 @@ +import os +import sys +import folder_paths + +custom_nodes_path = os.path.join(folder_paths.base_path, "custom_nodes") +onebuttonprompt_path = os.path.join(custom_nodes_path, "onebuttonprompt") +sys.path.insert(0, onebuttonprompt_path) + from .OneButtonPromptNodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS __all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS'] \ No newline at end of file