Commit Graph
24 Commits
Author SHA1 Message Date
diodiogod fff23447f0 Analyzer: analyze in mono but preserve original stereo in output
- _extract_audio_tensor now returns both original and mono versions
- Analysis (silence detection, energy, peaks) performed on MONO version only
- Visualization and graphs generated from MONO version
- Output audio (processed and segmented) uses ORIGINAL stereo format
- Timing regions found from mono are applied directly to stereo samples
- Stereo audio now passes through analyzer without quality loss
- Segmented audio preserves stereo channel information
2025-10-29 15:08:18 -03:00
diodiogod f3168e940e Add ChatterBox Official 23-Lang v2 support with special emotion tokens
Implemented full support for ChatterBox v2 with enhanced tokenization featuring
30+ special tokens for emotions, sounds, and vocal effects.

Key Features:
- Model version selection (v1/v2) in engine configuration node
- Auto-download of v2 model files (t3_mtl23ls_v2.safetensors, grapheme mappings)
- Special tags system using <emotion> syntax to avoid character switching conflicts
- Automatic conversion of <giggle>, <sigh>, <whisper> etc. to v2 format
- Cache invalidation between v1/v2 to prevent conflicts
- Full integration with character switching and pause tags

Technical Changes:
- Added model_version parameter throughout TTS and SRT processing chain
- Created chatterbox_v2_special_tags.py for tag conversion
- Updated cache keys to include model_version
- Version-aware model loading and validation
- Tag conversion happens after character/pause parsing, before engine

User can now write:
[Alice] Hello! <giggle> Nice to meet you. [pause:0.5] <whisper> Secret!

Documentation added in docs/CHATTERBOX_V2_SPECIAL_TOKENS.md
2025-10-07 23:43:13 -03:00
diodiogod abf14e0474 Version 4.10.13
Fix VibeVoice cache invalidation for attention modes

Technical details:
- Fix cache key missing attention_mode parameter
- Add quantize parameter to cache key generation
- Remove debug cache logging statements
2025-09-26 15:27:56 -03:00
diodiogod 9a71ee2d61 Fix IndexTTS-2 cache system for consistent segment caching
- Add seed parameter support throughout IndexTTS-2 pipeline
- Fix cache key generation using stable audio content hashing
- Resolve temporary file path invalidation preventing cache hits
- Use centralized audio_hash utility for consistent audio identification
- Enable proper cache hits for identical text/character/emotion combinations
2025-09-15 23:31:18 -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 f35395a072 Version 4.8.30
Fix VibeVoice cache invalidation and DynamicCache compatibility

Technical details:
- Add inference_steps parameter to VibeVoice cache key generator
- Disable deprecated transformers compatibility patches causing DynamicCache errors
- Add targeted DynamicCache key_cache/value_cache properties for VibeVoice compatibility
- Fix cache not invalidating when changing diffusion inference steps
2025-09-09 14:35:23 -03:00
diodiogod e6b9a5ab80 Version 4.8.27
Centralize numba compatibility system with smart testing

Technical implementation:
- Replace 15+ duplicate JIT workaround blocks with unified system
- Add utils/compatibility/numba_compat.py with startup testing
- Implement fallback for environments without compatibility module
- Test librosa.stft() at startup and apply workarounds only when needed
- Eliminate contradictory startup messages between init and nodes
- Maintain backward compatibility with legacy Python 3.13 fixes
2025-09-09 00:40:06 -03:00
diodiogod ee95cad1f1 Version 4.8.26
Fix Python 3.13 numba compatibility in audio hashing

Technical details:
- Add NUMBA_DISABLE_JIT fix to utils/audio/audio_hash.py
- Resolve 'get_call_template' errors in conda environments
- Ensure numba JIT disabling before librosa import
2025-09-08 18:58:09 -03:00
diodiogod a5743ed03e Fix ChatterBox Official 23-Lang cache invalidation and character voice inheritance
Cache invalidation fixes:
- Create specialized ChatterBoxOfficial23LangCacheKeyGenerator with advanced parameters
- Include repetition_penalty, min_p, top_p in cache keys for proper invalidation
- Pass all ChatterBox Official 23-Lang specific parameters to cache function calls
- Now parameter changes properly invalidate cache and regenerate audio

Character voice inheritance fixes:
- Add character parameter to generate_speech() method signature
- Forward character name through pause tag processing pipeline
- Fix character voice inheritance after pause tags in SRT segments
- Now Alice's voice persists after [pause:10s] instead of reverting to narrator
- Pass character name from SRT character parser to TTS generation

Both issues resolved - cache properly invalidates and character voices persist through pauses
2025-09-05 20:55:43 -03:00
diodiogod 366af73003 Fix ChatterBox Official 23-Lang cache invalidation for advanced parameters
- Add repetition_penalty, min_p, and top_p to ChatterBox cache key generation
- These parameters were missing from cache keys, causing stale cached audio
- Now changing these parameters properly invalidates cache and regenerates audio
- Fixes the persistent cache issue with ChatterBox Official 23-Lang settings
2025-09-05 20:43:05 -03:00
diodiogod 127f46e0ee Fix ChatterBox Official 23-Lang SRT processing implementation
- Complete SRT processor following Higgs Audio modular pattern
- Fixed cache system to recognize chatterbox_official_23lang engine type
- Corrected timing engine parameter format and method calls
- Fixed audio assembly to use assemble_smart_natural method
- Added key mapping for report generator compatibility
- Removed debug output for clean production logs
- Added comprehensive TODO.md documenting architectural inconsistencies
2025-09-05 11:35:16 -03:00
diodiogod f58bf7d560 Version 4.6.28
Fix VideoHelper audio compatibility with universal normalizer

Technical implementation:
- Add _get_audio() method to BaseChatterBoxNode for universal audio format handling
- Update Voice Changer, Merge Audio, and ChatterBox VC nodes to use normalizer
- Centralize audio input processing in AudioProcessingUtils.normalize_audio_input()
- Support VideoHelper LazyAudioMap, Character Voices, and standard AUDIO formats
- Maintain backward compatibility with existing workflows

Fixes issue #32: VideoHelper Suite audio inputs now work with all audio-processing nodes
2025-09-03 23:24:47 -03:00
diodiogod e05f0614bd Clean up verbose debug logs after VibeVoice implementation 2025-08-30 01:14:37 -03:00
diodiogod edbcb3422d Fix VibeVoice multi-character switching and pause tag support
Major fixes for VibeVoice engine functionality:

Audio Quality Improvements:
- Replace linear interpolation resampling with librosa.resample (matches official)
- Fix normalization to use -25 dB FS RMS instead of peak normalization (matches official)
- Implement proper stereo-to-mono conversion with channel averaging (matches official)

Multi-Character Voice Switching:
- Add proper character mapping using get_character_mapping() like F5-TTS does
- Build complete voice_mapping with fallbacks for all parsed characters
- Fix character parser to auto-discover characters when available_characters is None
- Remove unnecessary fallback logic from processor (handled at wrapper level)

Pause Tag Support:
- Add modular pause tag processing like F5-TTS using generate_vibevoice_with_pause_tags()
- Integrate PauseTagProcessor for [pause:X] support in VibeVoice
- Follow established modular pattern from F5-TTS and ChatterBox implementations

Cache System Improvements:
- Fix floating point precision issues in cache key generation (round to 3 decimals)
- Add proper parameter propagation to cached engine instances
- Ensure cache keys include all generation parameters properly

All changes tested and working - multi-character switching now works correctly
and pause tags are processed properly using the modular system.
2025-08-29 09:01:25 -03:00
diodiogod 661c9737c8 Fix VibeVoice cache system: character isolation, floating point precision, and parameter inclusion
Cache Key Generation:
- Fix floating point precision issues by rounding cfg_scale, temperature, top_p to 3 decimals
- Ensure all generation parameters are included in cache key (cfg_scale, use_sampling, etc.)
- Fixed VibeVoiceCacheKeyGenerator to properly handle parameter precision

Character Name Isolation:
- Fix character name normalization breaking cache isolation across different characters
- Pass character name explicitly to generate_segment() instead of relying on params fallback
- Update all generate_segment() calls to include character parameter
- Prevent different characters from sharing same cache key due to 'narrator' fallback

Parameter Updates:
- Round floating point parameters before cache function creation
- Fix cache parameter display to show actual values being used
- Ensure parameter changes (CFG 1.4→1.3, sampling True→False) properly invalidate cache

This fixes the issue where changing generation parameters still hit cache with old values.
2025-08-29 02:15:34 -03:00
diodiogod 271a3691b1 Version 4.5.26
Fix Higgs Audio RAS parameter integration

Technical details:
- Add missing force_audio_gen, ras_win_len, ras_max_num_repeat parameters to engine node
- Fix parameter passthrough from engine node to TTS processor
- Fix cache key generation to include new RAS parameters
- Update unified node config handling for proper parameter flow
- Add comprehensive debug logging for RAS parameter validation
2025-08-27 23:05:01 -03:00
diodiogod efff0eb159 Version 4.5.8: Fix Python 3.13 compatibility with comprehensive librosa fallback system 2025-08-25 11:31:12 -03:00
diodiogod 7eb0c62d50 Enhance chunk combiner with smart per-junction analysis
- Replace global method selection with intelligent per-junction analysis
- Analyze each chunk boundary individually for optimal transition method
- Add comprehensive junction analysis rules (sentence boundaries, commas, conjunctions, forced splits)
- Implement per-junction audio processing with crossfade, silence, and concatenate methods
- Enhance generation info reporting with detailed per-junction method breakdown
- Add backward compatibility for silence_padding method alias
- Fix tensor dimension mismatches in silence generation
- Update method descriptions to reflect new per-junction capabilities

The auto method now intelligently selects different combination methods for each junction
based on text analysis, resulting in more natural audio transitions.
2025-08-21 00:31:27 -03:00
diodiogod 73a821a962 Add smart modular chunk combination system
- Create ChunkCombiner utility with intelligent auto-selection
- Replace duplicate combination logic across all engines
- Smart auto method analyzes chunk split patterns (sentence boundaries, commas, forced splits)
- Higgs Audio: Add tqdm progress bars, fix cache invalidation, modular combination
- F5-TTS: Replace duplicate logic with ChunkCombiner
- ChatterBox: Upgrade from basic concatenation to full modular system
- Fix max_new_tokens minimum from 128 to 1, clarify tooltip
- All combination methods preserve cache optimization (post-processing)
2025-08-20 23:20:46 -03:00
diodiogod e85b622792 Add tqdm progress bars to Higgs Audio generation and fix parameter flow
- Add TqdmProgressStreamer class to boson_multimodal serve engine
- Shows real-time token generation progress with rate (tokens/s)
- Displays: "🗣️ Generating: 45%|████▌ | 234/512 tokens [00:12<00:15, 18.2it/s]"
- Fix generation parameters not flowing to SRT/TTS segment calls
- Add seed parameter to Higgs Audio cache key generation
- Clean up generation logging messages for better readability

Now Higgs Audio has same detailed progress feedback as ChatterBox and F5-TTS.
2025-08-20 22:12:51 -03:00
diodiogod 29ffeacc15 Fix Higgs Audio cache invalidation through centralized cache system
ROOT CAUSE: Higgs Audio was creating isolated cache instances instead of
using the global shared cache system used by other engines.

Changes:
- Move HiggsAudioCacheKeyGenerator to centralized utils/audio/cache.py
- Register Higgs Audio generator in global cache alongside F5-TTS/ChatterBox
- Fix HiggsAudioEngine to use get_audio_cache() instead of AudioCache()
- Remove duplicate cache key generator from higgs_audio.py
- Ensure all engines use same global GLOBAL_AUDIO_CACHE

RESULT: Temperature/generation parameter changes now properly invalidate
cache since all engines share the same centralized cache system.

This is the proper architectural fix using existing unified cache infrastructure.
2025-08-20 19:42:19 -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 5d9b285e0f Implement centralized audio content hashing for cache consistency
- Create utils/audio/audio_hash.py for centralized content-based hashing
- Fix cache invalidation bug across ALL TTS nodes and modes:
  * TTS streaming/non-streaming: Use centralized audio hash
  * SRT streaming/non-streaming: Use centralized audio hash
- Replace unreliable temp file paths with audio content hashing
- Same audio content now produces same cache key regardless of file names
- Remove misleading debug messages about voice_path usage
- Cache hits now work properly for dropdown voice selections and timing changes
2025-08-12 10:12:31 -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