From 379ecce687ce7b0a70e033a64941d65902066a85 Mon Sep 17 00:00:00 2001 From: 3dluvr <3dluvr@users.noreply.github.com> Date: Tue, 28 Jan 2025 19:59:44 -0500 Subject: [PATCH] Fix check_module_exists() to use folder_paths In Windows, module detection was failing because the method couldn't find the hard-coded custom_nodes/ folder in os.join.path. We switch to using folder_paths which will return a correct path regardless of the platform. --- __init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index d0eaf58..67fb03a 100644 --- a/__init__.py +++ b/__init__.py @@ -369,7 +369,7 @@ def override_class_with_distorch(cls): NODE_CLASS_MAPPINGS = {"DeviceSelectorMultiGPU": DeviceSelectorMultiGPU} def check_module_exists(module_path): - full_path = os.path.join("custom_nodes", module_path) + full_path = os.path.join(folder_paths.get_folder_paths("custom_nodes")[0], module_path) logging.info(f"MultiGPU: Checking for module at {full_path}") if not os.path.exists(full_path): @@ -1048,4 +1048,4 @@ if check_module_exists("ComfyUI-HunyuanVideoWrapper") or check_module_exists("co register_DownloadAndLoadHyVideoTextEncoder() -logging.info(f"MultiGPU: Registration complete. Final mappings: {', '.join(NODE_CLASS_MAPPINGS.keys())}") \ No newline at end of file +logging.info(f"MultiGPU: Registration complete. Final mappings: {', '.join(NODE_CLASS_MAPPINGS.keys())}")