Commit Graph
13 Commits
Author SHA1 Message Date
diodiogod 102f114ae6 Standardize resolved voice prompt logging 2026-07-10 00:20:00 -03:00
diodiogod 4a141fec0f Add inline edit tag support for classic ChatterBox SRT processor
Implements Step Audio EditX edit tag support for classic ChatterBox SRT following the batch processing pattern. Modified both chatterbox_srt_node.py and multilingual_engine.py to support edit tag extraction and batch processing.

Key changes:
- Modified multilingual_engine.py to extract edit tags per segment and add edit_tags field to AudioSegmentResult
- Implemented pause-first splitting when both pause and edit tags present to preserve pauses during editing
- Added batch edit processing infrastructure to collect all edit segments across subtitles
- Added segment_position tracking to properly reconstruct mixed edited/non-edited segments
- Fixed storage logic to prevent overwriting segment_audio_parts list with wav tensor
- Supports all processing paths: parameter_switching, multilingual/multicharacter, and simple

Follows SRT_Edit_Tag_Batch_Processing_Pattern.md - edit engine loads once for all segments instead of per-subtitle.
2025-12-08 12:17:15 -03:00
diodiogod 865940b47f Implement Italian ChatterBox prefix system and debug console output
- Updated character parser regex to exclude standalone [it]/[italian] tags while preserving [it:]/[italian:] syntax
- Added apply_italian_prefix_if_needed() method for automatic [it] prefix application when Italian language is detected
- Extended character parser with split_by_character_with_language_and_explicit_flag() to preserve explicit language flags
- Updated ChatterBox TTS and SRT nodes to use new parser method with automatic Italian prefix handling
- Fixed timing report text to show processed segments instead of raw input with character tags
- Added console debug prints to show final text sent to TTS models for verification

Italian ChatterBox model now correctly receives [it] prefix for Italian text when:
- User explicitly uses [it:Alice] or [italian:Bob] character syntax
- User uses [it:] or [italian:] language switching syntax
- Character is mapped to Italian in alias system
- Does NOT apply prefix when just using Italian model globally (preserves bilingual capability)
2025-09-04 02:01:13 -03:00
diodiogod 72d05fcf80 Fix pause tag caching: enable internal cache for pause segments
When text contains pause tags, use internal pause processor caching which
caches individual text segments separately from pause timing. This ensures
changing pause duration doesn't invalidate cache for text content.

- Detect pause tags in multilingual engine and enable pause processing
- Route pause tag segments to internal caching in adapter
- Route non-pause segments to external caching as before
2025-08-12 20:12:14 -03:00
diodiogod 2ea967e92f Fix model instance switching: ensure self.tts_model points to correct cached model
When multilingual engine detected a model was 'already loaded', it only updated
state variables but didn't switch self.tts_model to the correct cached model
instance. This caused German text to be generated with English model despite
logs showing German model was active.

Fixed by calling load_tts_model which will reuse cached model but properly
set self.tts_model to the correct language model instance.
2025-08-12 19:41:39 -03:00
diodiogod 8ce396ce8e Fix multilingual model switching: ensure adapter uses correct loaded model
The multilingual engine was loading the correct language model (e.g. German for [de:] tags)
but the adapter was still receiving the original default model language (English) in
parameters, causing German text to be generated with English model.

Fixed by updating current_language in params to match the actual loaded model before
calling the adapter, ensuring language tags use the correct model.
2025-08-12 18:52:58 -03:00
diodiogod 6df656e702 Fix cache character parameter for language-only tags
Language-only tags like [de:] were still using resolved character alias
'david_attenborough cc3' instead of 'narrator' for cache keys. Fixed by
passing 'narrator' as character parameter to engine adapter when
original_character was 'narrator' (language-only tag).
2025-08-12 18:33:20 -03:00
diodiogod d126c91d05 Fix critical ChatterBox multilingual tokenization regression
MAJOR FIXES:
- Fix character alias system overriding user voice selection for language-only tags
- Fix multilingual engine loading wrong tokenizer (English) for all languages
- Fix subtitle processing using wrong model after multilingual segment processing
- Preserve original character info to detect language-only tags vs explicit character tags

TECHNICAL DETAILS:
- Add original_character field to CharacterSegment to track pre-alias resolution names
- Fix multilingual engine to load correct language model first (not default English)
- Add model restoration logic after multilingual processing in traditional SRT
- Improve voice selection messages to show when using main voice vs character voice
- Fix cache coverage method to handle new 5-tuple segment data format

This resolves the regression where German/Norwegian segments sounded English
despite logs showing correct models loading. The issue was the multilingual engine
loading English tokenizer first, then caching it for all subsequent languages.
2025-08-10 21:25:37 -03:00
diodiogod 16d2ab6bf1 Fix model state communication and narrator voice priority
- Add current_model_name to Traditional SRT for multilingual engine compatibility
- Prioritize main narrator voice over character aliases for language-only tags
- Multilingual engine now detects already loaded models to prevent duplicates
2025-08-10 12:58:53 -03:00
diodiogod 8383403271 Optimize cache-aware model loading to skip unnecessary model loads when all segments are cached
- Add comprehensive cache checking before model loading decisions
- Skip model loading entirely when all language group segments are cached
- Use consistent model names in cache keys for reliable cache hits
- Track cache status properly across segment processing
- Implement early cache detection to prevent redundant model loading
- Make cached runs nearly instant by eliminating model loading overhead
2025-08-07 09:20:33 -03:00
diodiogod a440cd05b0 Fix model loading efficiency and language mapping issues
- Implement generic local-first fallback utility for all TTS engines
- Fix ChatterBox and F5-TTS duplicate model loading during language fallback
- Add F5-TTS language grouping to load models once per language group
- Fix pt-br language mapping support in language mapper
- Add model tracking to prevent redundant loading in multilingual engine
- Optimize SRT nodes to use unified language-grouped processing

This ensures efficient model loading with proper local model reuse,
eliminating unnecessary downloads and duplicate model loading for
low-VRAM scenarios while maintaining full language support.
2025-08-06 23:01:20 -03:00
diodiogod d67c48aeec Implement proper cache coverage analysis in multilingual engine
- Fix multilingual engine to check if segments are actually cached before loading models
- Replace stubbed _analyze_cache_coverage with real cache checking logic
- Skip model loading entirely when all segments in language group are cached
- Prevents unnecessary model reloading when only timing parameters change
- Should dramatically improve performance for cached SRT generations
- Addresses issue where models loaded even when audio was cached
2025-08-06 19:00: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