mirror of
https://github.com/hanzoai/live.git
synced 2026-10-30 18:29:41 +00:00
This commit adds full macOS Apple Silicon (M1/M2/M3) support by fixing all MPS (Metal Performance Shaders) compatibility issues in the WAN model. ## Changes: ### MPS Float64 Compatibility Fixes (5 locations): - model.py: Fix sinusoidal_embedding_1d to use float32 instead of float64 - model.py: Fix rope_params to use float32 for theta calculations - model.py: Fix rope_apply to use float32 for complex number operations - causal_model.py: Fix causal_rope_apply to use float32 - wan_wrapper.py: Change .double() to .float() in _convert_flow_pred_to_x0 ### Flash Attention Auto-Detection: - attention.py: Add CUDA availability detection - attention.py: Auto-disable flash attention on non-CUDA devices (MPS/CPU) - attention.py: Use PyTorch's scaled_dot_product_attention as fallback on MPS - model.py: Replace direct flash_attention() calls with attention() wrapper - clip.py: Replace direct flash_attention() calls with attention() wrapper ### UI Improvements: - Update Hanzo logo to use filled white SVG for better visibility - Add proper favicon support with multiple sizes ### Configuration: - Change default resolution to 128x128 for better performance on Apple Silicon ## Testing: Successfully tested real-time video generation on Apple Silicon using MPS backend. Pipeline loads, processes frames, and generates output without errors. Fixes compatibility with macOS Metal/MPS acceleration while maintaining full CUDA support for NVIDIA GPUs.