Commit Graph
3 Commits
Author SHA1 Message Date
diodiogod 9f2166a297 refactor: Implement Tier 1 model loading improvements
Fix critical device handling issues that cause cache mismatches and unnecessary reloads:

1. Cache 'auto' device resolution (torch_device_resolver.py)
   - 'auto' device now cached after first resolution
   - Prevents cache key instability when device availability changes mid-session
   - Add reset_device_cache() for manual reset if needed
   - Fixes: GPU memory pressure causing unexpected CPU fallback

2. Fix device comparison in unified interface (unified_model_interface.py)
   - Resolve both target and wrapper device before comparison
   - Handle both string and torch.device object representations
   - Fixes: Device type mismatch causing models to stay on wrong device

3. Consolidate device resolution (base_node.py)
   - Replace duplicate resolve_device() with centralized torch_device_resolver
   - Now supports MPS (Apple Silicon), CUDA, XPU, and CPU consistently
   - Fixes: Missing MPS/XPU detection in base node

Impact:
- Eliminates unnecessary model reloads in long sessions
- Consistent device handling across all node types
- Better GPU memory management with stable cache keys
2025-11-13 22:06:41 -03:00
diodiogod ac4508821c Version 4.14.19
Add Intel XPU support (tentative)

Implementation details:
- Add XPU detection to torch_device_resolver with proper fallback chain
- Update all engine nodes to include xpu device option
- Add defensive hasattr checks for systems without XPU installed
- Requires separate intel-extension-for-pytorch installation
2025-11-07 12:35:26 -03:00
diodiogod 573c2497d3 Add MPS (Apple Silicon) support for all TTS engines
- Created utils/device/torch_device_resolver.py with intelligent device detection
  - Supports MPS (Metal Performance Shaders) for Apple Silicon
  - Fallback chain: MPS > CUDA > CPU for auto-detection
  - Safe detection with torch.backends.mps.is_available() checks

- Updated all 7 engine nodes to expose 'mps' device option:
  - ChatterBox, F5-TTS, Higgs Audio, VibeVoice
  - ChatterBox Official 23-Lang, Index TTS, RVC

- Integrated device resolver across all engine implementations:
  - unified_model_interface.py (central point)
  - comfyui_model_wrapper/base_wrapper.py (ComfyUI integration)
  - All direct engine implementations (VibeVoice, Higgs Audio, F5-TTS edit, etc.)

- Maintains backward compatibility:
  - Existing workflows unchanged
  - MPS added as final option in device dropdowns
  - No behavior changes for Linux/Windows users

Resolves #160 - Users on Apple Silicon can now select MPS for GPU acceleration
2025-11-04 19:13:57 -03:00