VM8gkAs c116d3396f
Fix LoadVideosFromFolder import issues, improve variable naming, and optimize video loading logic
### Extended Description
This commit addresses the AttributeError in the LoadVideosFromFolder node from ComfyUI-KJNodes, where the VHS (VideoHelperSuite) module lacked the 'load_video_nodes' attribute. The issue arose due to inconsistent module naming and import failures on Windows systems.

#### Key Changes:
- Improved `__init__` method: Simplified the fallback logic for importing VHS modules. Added case-insensitive checks for module names in `sys.modules` to handle platform-specific import variations (e.g., "ComfyUI-VideoHelperSuite" vs. "comfyui-videohelpersuite"). This ensures robust loading of the `videohelpersuite` submodule across different environments.
- Optimized `load_video` method: 
  - Changed `VIDEO_EXTS` from a set to a list for simplicity (no performance impact for small collections).
  - Moved file processing logic (e.g., `root = kwargs['video']`, directory scanning, and video list preparation).

#### Testing:
- Verified that the node now correctly imports VHS modules without errors.
- The original order (from os.listdir()) was clip1, clip3, clip2 (unsorted).
After applying natural sorting with _natural_key, the order becomes clip1, clip2, clip3 (correct numerical order).

This resolves the import issues reported in the KJNodes repository and improves the overall reliability of video loading features.
2025-11-03 15:29:21 +08:00
..
2025-07-21 14:34:56 +03:00
2025-10-02 01:31:04 +03:00
2025-10-03 19:35:15 +03:00
2025-08-20 21:06:39 +03:00