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.
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.
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 ✓