Commit Graph
4 Commits
Author SHA1 Message Date
diodiogodandNicolas Martel 6195d5407a Merge true lazy node PR 262 but keep instant check_dependencies
Co-authored-by: Nicolas Martel <teoxysoft@gmail.com>
2026-02-20 17:45:50 -03:00
diodiogod c42ab9d092 Fix PyTorch 2.9 TorchCodec error in Audio Analyzer node
Replace direct torchaudio.load() calls with safe_load_audio() utility in
AudioAnalyzer.load_audio() to handle PyTorch 2.9 TorchCodec DLL errors and
int16 normalization automatically.

Fixes 'Could not load libtorchcodec' error when using 🌊 Audio Wave Analyzer
node with Character Voices or direct audio input on PyTorch 2.9.0+cu128.
2025-11-07 03:02:55 -03:00
diodiogod c45c98f3e9 Fix CUDA device compatibility issues for ComfyUI video nodes
- Add CPU conversion for all audio outputs to prevent device mismatch errors
- Ensure float32 dtype for ComfyUI video node compatibility
- Fix tensor device issues in silence detection and audio analysis
- Maintain audio quality while ensuring ComfyUI core node compatibility

Changes:
- AudioProcessingUtils.format_for_comfyui: Add .cpu() and .float() conversion
- BaseChatterBoxNode.generate_stable_audio_component: Add device/dtype handling
- AudioProcessingUtils.detect_silence: Fix device parameter for torch.tensor
- AudioAnalyzer.analyze_audio: Add .cpu() before .numpy() conversion

Resolves "can't convert cuda:0 device type tensor to numpy" and
"Expected numpy array with dtype float32 but got float64" errors.
2025-08-15 00:32:46 -03:00
diodiogod b21d0212fb Major refactoring: Reorganize project structure for better maintainability
🔧 ENGINES SEPARATION:
- Move chatterbox/ → engines/chatterbox/ (TTS/VC engine + models)
- Move chatterbox/f5tts/ → engines/f5tts/ (F5-TTS engine)
- Move adapters/ → engines/adapters/ (engine adapters for multilingual system)

📁 NODES ORGANIZATION:
- Create nodes/chatterbox/ for ChatterBox nodes (TTS, VC, SRT)
- Create nodes/f5tts/ for F5-TTS nodes (TTS, SRT, Edit, Options)
- Create nodes/audio/ for audio processing nodes (analyzer, recorder)
- Create nodes/base/ for base classes
- Rename node files for clarity (tts_node.py → chatterbox_tts_node.py)

🗂️ UTILITIES RESTRUCTURE:
- Replace core/ with organized utils/ structure
- utils/audio/ - Audio processing, analysis, caching
- utils/text/ - Text processing, character parsing, chunking
- utils/voice/ - Voice discovery, multilingual engine
- utils/timing/ - SRT timing logic (from chatterbox_srt/)
- utils/models/ - Model management (ChatterBox + F5-TTS)
- utils/system/ - System utilities, import management

🔄 IMPORT PATH UPDATES:
- Update all import paths to use new organized structure
- Fix lazy imports in nodes for runtime compatibility
- Restore missing F5-TTS edit engine from git history
- Fix path resolution for voice discovery and character aliases

🎯 KEY IMPROVEMENTS:
- Engine-centric organization with clear separation
- Purpose-driven folder grouping for better navigation
- Self-documenting file names indicating ownership
- Scalable structure for future engine additions
- Maintains backward compatibility for existing workflows

All 10 nodes loading successfully with complete functionality preserved.
2025-08-02 18:50:26 -03:00