Commit Graph
25 Commits
Author SHA1 Message Date
diodiogod bb9a64f564 Fix tokenizer caching and console cleanup
- Consolidate character voice info into block generation messages
- Fix tokenizer path structure to match actual storage location (vibevoice/ instead of VibeVoice/tokenizer/)
- Use consistent path for tokenizer downloads so they're found on subsequent runs
- Comment out non-error device_map debug messages
- Remove duplicate SINGLE SEGMENT text printing
- Fix logged_characters to only log once per character (not per priority check)
2025-10-29 01:27:14 -03:00
diodiogod 19cad461ae Fix VibeVoice and RVC device management + VRAM spike fixes
VibeVoice:
- Added .to() method for device management
- Added device checking before generation that properly detects parameter device
- Fixed target_device to always use cuda if available (not self.device which gets updated)

RVC:
- Created RVCModelWrapper class to wrap model dicts with .to() method
- Added .to() method to RVCEngine for device management
- Added device checking to convert_voice() method
- Updated rvc_factory to properly load and wrap RVC models
- Added model caching to minimal_reference_wrapper to prevent reloading
- Added clear_model_cache() method for VRAM management
- Disabled CUDNN benchmark in vc_infer_pipeline.py to prevent VRAM spikes on Python 3.12+

All engines now support Clear VRAM button across multiple cycles.
2025-10-27 22:40:59 -03:00
diodiogod 43cd4f5bd9 Version 4.11.24
Fix ChatterBox Official 23-Lang device placement bug

Technical implementation:
- Add .to() method to ChatterBoxOfficial23LangTTS class for device migration
- Add .to() method to ChatterboxVC class for voice conversion device handling
- Improve wrapper's _move_all_components_to_device() with better recursion depth
- Fix unified_model_interface device resolution for 'auto' mode
- Add ComfyUI model management re-registration after wrapper.model_load()
- Fix model_finalizer setup when re-registering with ComfyUI
- Add device check in processor to call wrapper.model_load() instead of direct .to()

Fixes device mismatch errors:
- Fix 'Expected all tensors to be on the same device' error on second run
- Fix 'Inference tensors do not track version counter' after CPU detachment
- Fix 'Clear VRAM' button not working after model reload
2025-10-27 19:10:52 -03:00
diodiogod 955aff40a7 Fix ChatterBox v2 auto-download and pass model_version through entire chain
Fixed critical issues preventing v2 model auto-download:
1. Removed silent v1 fallback in from_local - now raises FileNotFoundError to trigger download
2. Updated unified_model_interface factory to pass model_version parameter
3. Factory now properly tries from_local first, then from_pretrained for auto-download
4. Added model_version parameter to generate_speech and load_tts_model signatures
5. Pass model_version from engine config through unified TTS node to processor
6. Updated README to clarify v1/v2 files coexist in same directory

Now when v2 is selected but files missing:
- from_local raises error instead of falling back to v1
- from_pretrained downloads missing v2 files automatically
- Model loads correctly with v2 tokenization enabled
2025-10-07 23:54:00 -03:00
diodiogod 793722aa9a Version 4.10.12
Fix VibeVoice accelerate compatibility issues

Technical implementation:
- Add comprehensive transformers patches for accelerate detection
- Fix missing check_tied_parameters_on_same_device function
- Fix missing dispatch_model function for device mapping
- Smart patch application only when compatibility issues detected
- Add accelerate to critical dependencies monitoring
2025-09-26 14:54:28 -03:00
diodiogod df128496ba Fix IndexTTS-2 import conflicts with external installations
- Add detection for external IndexTTS installations that conflict with bundled version
- Display clear error message with uninstall instructions when conflicts are found
- Remove unnecessary adapter initialization log message
- Resolves import errors reported in issues #115, #116, and #101
2025-09-26 09:18:05 -03:00
diodiogod 827eb78428 Fix PyTorch installation commands in warnings
- Corrected invalid torchaudio+cu128 syntax to proper pip install torchaudio --index-url format
- Updated both torchaudio and torchvision warning commands to use cu129 index
- Fixes installation errors where users got 'Expected end or semicolon' pip errors
2025-09-26 00:13:32 -03:00
diodiogod e7d191612c Version 4.9.21
Fix IndexTTS-2 auto-download system with complete model verification

Technical implementation:
- Move auto-download logic from unified interface to IndexTTS engine initialization
- Add comprehensive model verification using IndexTTSDownloader._verify_model()
- Handle mixed missing files scenarios (partial downloads, corrupted files)
- Improve error messages showing specific missing files and download status
- Fix auto-download trigger timing to occur before model loading attempt
2025-09-18 14:41:36 -03:00
diodiogod 307a482a7e Version 4.9.13
Fix IndexTTS-2 module import KeyError with bundled version

Technical fix:
- Simplify sys.modules override to prevent KeyError during import resolution
- Remove conflicting indextts modules before importing bundled version
- Keep bundled module available during IndexTTS-2 initialization
- Improve module path resolution for nested indextts imports
2025-09-17 20:13:32 -03:00
diodiogod ca156a103f Version 4.9.12
Fix IndexTTS-2 bundled import conflicts with system packages

Technical fix:
- Add sys.modules override to force bundled indextts during import
- Prevent conflicts with system-installed indextts packages
- Ensure bundled IndexTTS-2 code resolves internal imports correctly
- Restore original module state after import to avoid side effects
2025-09-17 19:55:17 -03:00
diodiogod a3a7c4a50c Add PyTorch consistency warning to unified model interface
- Detects mixed CUDA/CPU PyTorch installations on first model load
- Warns about GPU PyTorch + CPU TorchAudio performance issues
- Shows exact fix commands with proper CUDA index URLs
- Prevents performance degradation debugging sessions
- Only shows warning once per session
2025-09-12 17:38:40 -03:00
diodiogod b965a38326 Add IndexTTS-2 engine - initial implementation and basic testing
- Initial IndexTTS-2 TTS engine implementation
- Basic unified interface integration
- Auto-download system for IndexTTS-2 models
- Character voice switching support via QwenEmotion
- Token-based chunking system
- ComfyUI model management integration
- Fixed debug output and basic inference working
- Multi-language text preprocessing foundation
- Basic error handling framework

Note: Initial implementation - requires further testing and refinement
2025-09-12 09:33:55 -03:00
diodiogod e129c5314b IndexTTS-2 implementation with modular character parser
MAJOR: IndexTTS-2 TTS engine integration
- Core IndexTTS engine with unified model interface integration
- Auto-downloader for HuggingFace models + GitHub source code
- Engine adapter with emotion support [Alice:angry_bob] syntax
- Cache integration for IndexTTS-2 parameters
- Factory registration for proper model management

MAJOR: Character parser modularization (930 → 300 lines each)
- Split into base_parser.py, language_resolver.py, segment_processor.py, validation.py
- Added emotion support with backward compatibility
- New split_by_character_with_emotions() method for advanced engines
- Flexible tag parsing: [de:Alice:angry_bob] support
- Language disambiguation to avoid Alice vs language code conflicts
- Full backward compatibility maintained

FEATURES:
- IndexTTS-2 emotion disentanglement (speaker vs emotion separation)
- Duration control and precise voice cloning
- Multi-modal emotion control (audio refs, text, vectors)
- Character switching with emotion references
- All official IndexTTS-2 parameters exposed

DOCS: Implementation plan and architectural TODO items added
2025-09-11 20:26:51 -03:00
diodiogod 450e7c80d3 Version 4.8.24
Fix VibeVoice model reloading and transformers compatibility

Technical changes:
- Fix unified model interface cache key missing additional_params
- Add transformers>=4.51.3 requirement for VibeVoice compatibility
- Remove excessive debug prints from VibeVoice engine
- Fix RVC numba JIT disable logic for correct Python version detection
- Fix attention_mode and quantize_llm_4bit not triggering model reloads
2025-09-07 10:13:23 -03:00
diodiogod e7136cbefe Version 4.8.23
Add ChatterBox Official 23-Lang to ComfyUI VRAM management

Technical improvements:
- Register ChatterBox 23-Lang in unified model interface
- Update processors to use unified interface for model loading
- Fix Python 3.13 compatibility by replacing librosa.effects.trim with safe_trim fallback
- Add proper factory method using ChatterboxOfficial23LangTTS.from_local()
2025-09-07 00:17:35 -03:00
diodiogod e9c0199a81 Version 4.8.22
Fix VibeVoice model reloading and add VRAM management

Technical improvements:
- Add class-level model caching to prevent reloading on each run
- Register VibeVoice in unified model interface
- Update adapter to use unified interface for ComfyUI integration
- Fix OOM errors on subsequent runs
2025-09-07 00:01:23 -03:00
diodiogod 3e5f9a3721 Fix RVC Python 3.13 compatibility - comprehensive numba/librosa solution
Major compatibility overhaul for RVC engine in Python 3.13 environments:

🔧 Core Compatibility Fixes:
• Disabled numba JIT compilation for Python 3.13+ via environment variables
• Added comprehensive librosa compatibility patches for missing functions:
  - pad_center, tiny (as function), fill_off_diagonal, is_positive_int, expand_to
• Replaced librosa.resample with torchaudio.resample to eliminate numba dependency
• Fixed all relative imports in RVC implementation (. notation)

⚡ Performance Improvements:
• Manual RMS calculation replacing librosa.feature.rms (avoids numba)
• Higher quality audio resampling using torchaudio
• Maintains backward compatibility with Python 3.12

🐛 Bug Fixes:
• Fixed 'function' object has no attribute 'get_call_template' errors
• Resolved 'float' object is not callable in librosa.sequence.viterbi
• Fixed ImportError for missing librosa utility functions
• Enhanced error handling and debugging throughout RVC pipeline

✨ Features:
• Comprehensive monkey-patching system for librosa compatibility
• Automatic fallbacks for failed operations
• Detailed logging for troubleshooting

Successfully tested with full RVC voice conversion workflow in Python 3.13.6.
2025-09-06 17:22:33 -03:00
diodiogod e86be32b1a Fix ChatterBox VC language support and improve error handling
- Add VC component detection system to check s3gen availability for all languages
- Implement universal ChatterBox model loading with component mixing fallback
- Fix VC download system to handle subdirectories (German havok2 model)
- Add graceful handling of optional files (conds.pt) vs required files (s3gen)
- Propagate 401 authentication errors properly through download system
- Add intelligent fallback: German variants → German base → English
- Return silent audio for unsupported VC languages instead of crashing
- Remove misleading claims about unverified VC language support
- Fix file format detection (.pt vs .safetensors) in VC downloads

Resolves VC crashes with Japanese/incomplete models and improves German model support
2025-09-04 16:06:18 -03:00
diodiogod 04940f013e Implement CUDA Graph toggle for Higgs Audio with DynamicCache support
Adds user toggle to choose between high performance (CUDA Graphs) and memory safety:

**High Performance Mode (CUDA Graphs ON):**
- Uses StaticCache for CUDA Graph optimization
- ~55 tokens/sec generation speed
- Cannot safely unload memory (crashes on "Unload Models")
- Users must restart ComfyUI to free VRAM

**Memory Safe Mode (CUDA Graphs OFF):**
- Uses DynamicCache for safe memory management
- ~12 tokens/sec generation speed (78% slower)
- Safe memory unloading with "Unload Models" button
- Full VRAM cleanup and reload cycles work

**Key Implementation Changes:**
- Add enable_cuda_graphs parameter to HiggsAudioServeEngine constructor
- Conditional cache creation: StaticCache vs DynamicCache based on toggle
- Fix DynamicCache compatibility issues:
  - Manual cache clearing (key_cache.clear(), value_cache.clear())
  - Compatible get_seq_length() handling for both cache types
  - Proper cache copying between DynamicCache instances
- Update tooltip with accurate performance numbers (12 tok/s vs 55+ tok/s)
- Complete parameter passing chain from UI to engine constructor

**Files Modified:**
- serve_engine.py: Add constructor parameter, conditional cache creation, DynamicCache reset
- modeling_higgs_audio.py: Fix get_cache_seq_length() compatibility, DynamicCache copying
- unified_model_interface.py: Pass enable_cuda_graphs to constructor
- higgs_audio_engine_node.py: Add toggle UI with accurate performance tooltip
- stateless_wrapper.py: Conditional cleanup logic based on cache type
- higgs_audio.py: Parameter passing integration
- higgs_audio_adapter.py: Extract and pass toggle parameter

Resolves fundamental CUDA Graph vs ComfyUI memory management incompatibility by giving users choice.
2025-08-28 15:01:51 -03:00
diodiogod 5700ec3f0c Implement Higgs Audio stateless wrapper for ComfyUI model management integration
✅ Major Achievement: Higgs Audio can now be safely unloaded from VRAM without crashes!

Key Implementation:
- Created StatelessHiggsAudioWrapper that isolates tensor state to prevent CUDA Graph corruption
- Unified model interface integration with CPU-first loading to prevent VRAM overflow
- Enhanced ComfyUI model wrapper to handle stateless TTS models generically
- Fixed device consistency for all model components (main_model, audio_tokenizer, semantic_model, tokenizer_encoder, tokenizer_quantizer)

Results:
- Successfully freed 11007MB VRAM without crashes
- Model unloading/reloading cycle works correctly
- CUDA Graph corruption issue resolved through tensor isolation

Note: Device mismatch issue during voice cloning still needs resolution, but core memory management functionality is working.
2025-08-28 00:52:49 -03:00
diodiogod bad1dd4a12 Version 4.5.13: Clean up excessive startup logging messages 2025-08-26 09:47:39 -03:00
diodiogod c0ed537a00 Remove unnecessary debug messages from TTS output
- Remove repeated 'TTS Model loaded_size query' messages
- Only show CUDA graph checking for Higgs Audio models (not ChatterBox)
- Comment out cache key generation debug (not needed for end users)
- Reduces console spam while preserving relevant debugging for Higgs models
2025-08-25 22:53:23 -03:00
diodiogod 9a37b2826b Fix F5-TTS language model switching for character alias system
Remove restrictive logic that blocked language switching when no explicit [lang:character] tags present. Character alias system (Alice→German, Bob→French) now correctly loads language-specific models:

- F5-DE for German segments
- F5-FR for French segments
- F5TTS_v1_Base for English segments

Language switching works with both explicit tags and character alias mappings.
2025-08-25 21:48:00 -03:00
diodiogod 5c741f7403 Implement comprehensive CUDA graph memory corruption fix for Higgs Audio models
- Add global cache invalidation system to prevent reuse of corrupted model state
- Implement deferred CUDA graph initialization in Higgs Audio engine (prevents corruption during model loading)
- Add shadow storage system for Higgs Audio models to avoid PyTorch memory conflicts
- Implement timestamped engine caching across all unified nodes (TTS Text, TTS SRT, Voice Changer)
- Add comprehensive ComfyUI model management integration with proper device handling
- Fix model unloading/reloading cycle to prevent "Assertion input[0] != 0 failed" CUDA crashes
- Add model resurrection system that reuses existing models instead of creating new instances
- Implement intelligent cache validation with global invalidation flags
- Add extensive debugging and state tracking for model lifecycle management
- Fix device compatibility between string and torch.device objects in ComfyUI integration

This resolves the critical memory corruption issue that occurred when using ComfyUI's
"Unload models" or "Clear VRAM" buttons with Higgs Audio models containing CUDA graphs.
2025-08-25 17:56:11 -03:00
diodiogod 6857c7437e Version 4.5.10: Fix Higgs Audio seed parameter cache bug and implement ComfyUI model management integration 2025-08-25 13:34:38 -03:00