8 Commits
Author SHA1 Message Date
jk 2f8173d31c Add device selection for improved QoL
- Add device parameter to all preprocessor wrapper nodes
- Allow users to specify processing device (cuda:0, cuda:1, etc.)
- Move input tensors to match selected device
- Improves MultiGPU workflow agency and eliminates device mismatches
2025-06-13 04:12:19 -04:00
Jason Kende 3c1dfd087c Fix: Change wrapper target device to cuda:1 to match workflow tensor flow 2025-06-13 02:28:28 -04:00
jk 7d1ca2ae77 Revert "Fix: Clear model cache in wrappers to prevent CUDA device mismatch after long sessions"
This reverts commit fc29f8753f.
2025-06-13 01:28:53 -04:00
Jason Kende fc29f8753f Fix: Clear model cache in wrappers to prevent CUDA device mismatch after long sessions
Adds model cache clearing and preprocessor instance reset before execution to prevent stale cached models with wrong device assignments from causing "Expected all tensors to be on the same device" errors in MultiGPU setups after extended runtime.
2025-06-13 01:11:39 -04:00
samizdat 4413057a33 Fix function name resolution for different preprocessors
Use getattr to dynamically call the correct function name for each
preprocessor (e.g. 'estimate_pose' for DWPose, 'execute' for others).
This resolves the 'object has no attribute execute' error.
2025-06-10 06:20:58 -04:00
samizdat 08130f179c Fix imports to use NODE_CLASS_MAPPINGS from comfyui_controlnet_aux
Import preprocessor classes from the dynamically loaded NODE_CLASS_MAPPINGS
dictionary rather than trying to import directly from module paths.
This matches how comfyui_controlnet_aux actually exports its classes.

Verified correct node names:
- DepthAnythingV2Preprocessor ✓
- DWPreprocessor ✓
- CannyEdgePreprocessor ✓
- OpenposePreprocessor ✓
- MiDaS-DepthMapPreprocessor ✓
2025-06-10 06:04:55 -04:00
samizdat 799b35cea6 Fix import paths for comfyui_controlnet_aux preprocessors
Import directly from comfyui_controlnet_aux module instead of
node_wrappers submodules to match actual package structure.
2025-06-10 05:48:25 -04:00
samizdat d112928e44 Initial implementation of ComfyUI GPU Preprocessor Wrapper
Implements wrapper nodes that solve multi-GPU device conflicts for ControlNet
preprocessors by temporarily overriding device placement during model loading.

Core features:
- MultiGPUPreprocessorWrapper base class with device override logic
- 5 specific wrapper instances (DepthAnything, DWPose, Canny, OpenPose, Midas)
- Graceful ImportError handling with conditional registration
- Try/finally blocks ensuring device function restoration
- Drop-in replacements maintaining identical INPUT_TYPES/RETURN_TYPES
2025-06-10 05:12:35 -04:00