From aa5416634c02c40226478c46308e8bd79f76d73a Mon Sep 17 00:00:00 2001 From: pydn <25550995+pydn@users.noreply.github.com> Date: Sat, 14 Sep 2024 13:43:10 -0500 Subject: [PATCH] Small update to allow comfyui_to_python.py to run from any subdirectory inside of ComfyUI. --- comfyui_to_python.py | 4 ++-- comfyui_to_python_utils.py | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/comfyui_to_python.py b/comfyui_to_python.py index 69cdc06..9b61692 100644 --- a/comfyui_to_python.py +++ b/comfyui_to_python.py @@ -20,7 +20,7 @@ from comfyui_to_python_utils import ( get_value_at_index, ) -sys.path.append("../") +add_comfyui_directory_to_sys_path() from nodes import NODE_CLASS_MAPPINGS @@ -617,7 +617,7 @@ def main() -> None: default=DEFAULT_QUEUE_SIZE, ) pargs = parser.parse_args() - ComfyUItoPython(**vars(pargs)) + run(**vars(pargs)) print("Done.") diff --git a/comfyui_to_python_utils.py b/comfyui_to_python_utils.py index ef10a49..12b3be2 100644 --- a/comfyui_to_python_utils.py +++ b/comfyui_to_python_utils.py @@ -2,8 +2,6 @@ import os from typing import Sequence, Mapping, Any, Union import sys -sys.path.append("../") - def import_custom_nodes() -> None: """Find all custom nodes in the custom_nodes folder and add those node objects to NODE_CLASS_MAPPINGS