revert accidental change to LoadVideosFromFolder node

This commit is contained in:
stephennilor 2025-10-01 18:41:29 +08:00
parent 051c10382b
commit 629a2bf423

View File

@ -3807,29 +3807,29 @@ class LoadVideosFromFolder:
try: try:
cls.vhs_nodes = importlib.import_module("comfyui-videohelpersuite.videohelpersuite") cls.vhs_nodes = importlib.import_module("comfyui-videohelpersuite.videohelpersuite")
except ImportError: except ImportError:
# Fallback to sys.modules sweep for Windows/packaging variations # Fallback to sys.modules search for Windows compatibility
import sys import sys
vhs_module = None vhs_module = None
for module_name in sys.modules: for module_name in sys.modules:
try: if 'videohelpersuite' in module_name and 'videohelpersuite' in sys.modules[module_name].__dict__:
mod = sys.modules[module_name] vhs_module = sys.modules[module_name]
if mod and hasattr(mod, "videohelpersuite"):
vhs_module = mod
break break
except Exception:
continue
if vhs_module is None: if vhs_module is None:
# Try direct access to the videohelpersuite submodule
for module_name in sys.modules: for module_name in sys.modules:
if module_name.endswith('videohelpersuite'): if module_name.endswith('videohelpersuite'):
vhs_module = sys.modules.get(module_name) vhs_module = sys.modules[module_name]
if vhs_module is not None:
break break
if vhs_module is not None: if vhs_module is not None:
cls.vhs_nodes = vhs_module cls.vhs_nodes = vhs_module
else: else:
raise ImportError("This node requires ComfyUI-VideoHelperSuite to be installed.") raise ImportError("This node requires ComfyUI-VideoHelperSuite to be installed.")
except ImportError:
raise ImportError("This node requires ComfyUI-VideoHelperSuite to be installed.")
@classmethod @classmethod
def INPUT_TYPES(s): def INPUT_TYPES(s):
return { return {