- Fixed tensor type mismatch error between DoubleTensor and FloatTensor
- Added explicit tensor type conversion in MiDaSWrapper
- Improved error handling for tensor type mismatches
- Enhanced process_image to handle float64 tensors properly
- Added debugging logs to track tensor types
- Add explicit dimension handling for improved tensor shape control
- Add check to ensure tensors are in [0, 1] range
- Respect force_cpu flag when moving tensor to device
- Add debug logging for output tensor shape
- Improve code comments for clarity
This comprehensive update improves the depth estimation node with:
- Robust error handling that continues workflow execution instead of crashing
- Visual error reporting with informative messages displayed on error images
- Intelligent resource management with VRAM usage tracking and requirements
- Automatic fallback to CPU when insufficient VRAM is detected
- Multiple fallback strategies for model loading issues
- Better handling of problematic inputs like NaN values
- Detailed logging for easier troubleshooting
These changes make the node much more stable and user-friendly in
complex ComfyUI setups, preventing workflow-breaking errors.
This change implements multiple fallback paths for depth model loading, handles both online and offline scenarios, and provides clear error messages for troubleshooting. It maintains backward compatibility while addressing the 'model not found' error.