Commit Graph
100 Commits
Author SHA1 Message Date
diodiogod 28a738662e Clean up README condensed engine table
- Remove Speed column (unnecessary for overview)
- Remove 🎯 emoji from title (too many emojis)
- Add ChatterBox to featured engines (now shows 7 engines)
2026-01-28 11:10:29 -03:00
diodiogod 6c87d67ed7 Add YAML-driven engine documentation table generator
- Created comprehensive YAML source of truth for all TTS engines
- Implemented Python generator for 3 documentation tables:
  * ENGINE_COMPARISON.md - Main engine overview with capabilities
  * LANGUAGE_SUPPORT.md - Detailed language support matrix
  * FEATURE_COMPARISON.md - Feature capabilities comparison
- YAML captures all engine metadata without information loss
- Tables auto-generated via scripts/generate_engine_tables.py
- Added flag emojis to language support table for easy scanning
- Speed performance fixes: F5-TTS marked as "Very Fast"
2026-01-28 10:50:10 -03:00
diodiogod fa74973ad5 Fix Qwen3-TTS audio hash error with nested dict structure
Fixed 'dict' object has no attribute 'cpu' error when using Voice Designer
voices with TTS Text node.

## Root Cause

Voice Designer and Character Voices nodes output unified NARRATOR_VOICE format:
{
    "audio": {"waveform": tensor, "sample_rate": 24000},
    "audio_path": "...",
    "reference_text": "...",
    ...
}

But TTS Text node was wrapping this AGAIN when creating voice_mapping:
{
    "waveform": audio_tensor,  # audio_tensor was already a dict!
    "sample_rate": 24000,
    "text": "..."
}

This created triple-nested structure that broke audio hashing.

## Fixes Applied

**TTS Text Node** (nodes/unified/tts_text_node.py):
- Extract actual waveform tensor from audio dict before creating voice_mapping
- Applied to all 6 places where audio_tensor is used:
  - Narrator voice mapping (line 1151)
  - Character ICL fallback (line 1183)
  - Character x_vector fallback (line 1217)
  - Character no-text fallback (line 1220)
  - Character no-audio fallback (line 1237)
- Pattern: Check if audio_tensor is dict, extract waveform/sample_rate if so

**Qwen3-TTS Adapter** (engines/adapters/qwen3_tts_adapter.py):
- Extract inner audio dict before passing to hash function
- Changed from passing full voice_ref to passing voice_ref['audio']

**Audio Hash Utility** (utils/audio/audio_hash.py):
- Added nested structure handling with fallback
- Detects Character Voices format {"audio": {...}} vs direct format
- Enhanced debug logging to diagnose structure issues

## Testing

- Voice Designer → TTS Text: Works without hash error
- Character Voices → TTS Text: Works without hash error
- Audio hashing generates stable keys for caching
- Both VoiceDesign and traditional voices function correctly
2026-01-28 00:15:21 -03:00
diodiogod 41b1bda1e5 Add CosyVoice3 model variant support and documentation
- Add Fun-CosyVoice3-0.5B-RL (default, better quality) and Fun-CosyVoice3-0.5B variants
- Use ChatterBox 23-Lang pattern: shared folder, both llm.pt/llm.rl.pt files, symlink switching
- Saves ~3.4GB by sharing common files (flow.pt, hift.pt, campplus.onnx, CosyVoice-BlankEN/)
- Switching variants invalidates cache (different model_identifier)
- Add COSYVOICE3_TAGS_GUIDE.md: concise guide for native paralinguistic tags
- Update README: What's New section, model download links, shared folder structure
2025-12-29 20:54:46 -03:00
tazztone a2cac49587 implemented a comprehensive pytest testing infrastructure for the TTS-Audio-Suite custom node. The infrastructure supports both **unit tests** (fast, no ComfyUI needed) and **integration tests** (requires running ComfyUI server).
## Key Files Created/Modified

### Configuration
- [pytest.ini](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/pytest.ini) - Pytest configuration with markers
- [tests/conftest.py](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/tests/conftest.py) - Session fixtures and ComfyUI API client

### Unit Tests
- [tests/unit/test_srt_parser.py](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/tests/unit/test_srt_parser.py) - 23 tests ✅
- [tests/unit/test_pause_processor.py](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/tests/unit/test_pause_processor.py) - 19 tests ✅
- [tests/unit/test_audio_processing.py](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/tests/unit/test_audio_processing.py) - 18/22 tests ✅

### Integration Tests
- [tests/integration/test_workflows.py](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/tests/integration/test_workflows.py) - Node registration & CosyVoice3 tests
- [tests/fixtures/workflows/](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/tests/fixtures/workflows/) - Test workflow JSON files

### Bug Fix
- [nodes.py](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/nodes.py) - Moved [os](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/tests/unit/test_audio_processing.py#174-206)/[sys](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/tests/conftest.py#60-65) imports to top level (was causing NameError during testing)

---

## Test Isolation Strategy

The key challenge was preventing pytest from importing the full ComfyUI node infrastructure during unit tests. We solved this using:

1. **Module-level mocking** in [conftest.py](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/conftest.py) - Mocks ComfyUI modules (`folder_paths`, [comfy](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/tests/conftest.py#135-216), [server](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/tests/conftest.py#135-216), etc.) before pytest imports test modules
2. **Environment variables** - Sets `COMFYUI_TESTING=1` and `PYTEST_CURRENT_TEST=true`
3. **Direct imports via importlib** - Unit tests load utility modules directly, bypassing package [__init__.py](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/__init__.py)

```python
# conftest.py - Mocks ComfyUI at module level
_MOCK_MODULES = ['comfy', 'folder_paths', 'server', 'execution', ...]
for _module_name in _MOCK_MODULES:
    if _module_name not in sys.modules:
        sys.modules[_module_name] = MagicMock()
```

---

## Running Tests

### Unit Tests (Fast, No Server)
```bash
cd C:\_stability_matrix\Data\Packages\Comfy-new\custom_nodes\TTS-Audio-Suite
..\..\venv\Scripts\python -m pytest tests/unit/ -m unit -v
```

### Integration Tests (Requires ComfyUI)
```bash
# Start ComfyUI first, OR the fixture will start it automatically
..\..\venv\Scripts\python -m pytest tests/integration/ -m integration -v
```

### Specific Test Markers
```bash
# Run only CosyVoice3 tests
..\..\venv\Scripts\python -m pytest -m cosyvoice -v

# Run slow tests
..\..\venv\Scripts\python -m pytest -m slow -v
```

---

## Test Results

| Test Suite | Passed | Failed | Notes |
|------------|--------|--------|-------|
| SRT Parser | 23 | 0 | ✅ All timestamp, validation, and parsing tests |
| Pause Processor | 19 | 0 | ✅ Tag detection, parsing, silence generation |
| Audio Processing | 18 | 4 | ⚠️ Minor tensor dimension mismatches |
| **Total** | **60** | **4** | 94% pass rate |

---

## Known Issues

1. **4 failing audio tests** - Due to tensor dimension return type differences in [pad_audio_to_duration](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/utils/audio/processing.py#136-178) and [crossfade_audio](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/utils/audio/processing.py#179-228). The actual implementations work correctly; tests need minor adjustments.

2. **Integration tests** - Require ComfyUI server. The [comfyui_server](file:///C:/_stability_matrix/Data/Packages/Comfy-new/custom_nodes/TTS-Audio-Suite/tests/conftest.py#135-216) fixture will auto-start ComfyUI if not running, but this adds startup time.

---

## Future Enhancements

- [ ] Add `pytest-watcher` configuration for auto-rerun on file changes
- [ ] Fix remaining 4 audio processing test assertions
- [ ] Add more CosyVoice3 integration test workflows
- [ ] GPU-specific test markers for model inference tests
2025-12-18 21:51:42 +01:00
diodiogod 7d3b171ab3 Add voice restoration with iteration reference support
New Feature: <restore:N@M> Syntax
- <restore> - Restore using original pre-edit audio (1 VC pass)
- <restore:N> - N VC passes using original audio as reference
- <restore:N@M> - N VC passes using audio from iteration M as reference

Implementation:
- Store audio snapshots after each edit iteration
- Parse iteration reference from @ syntax in restore tags
- Use specified iteration audio as VC reference instead of original
- Allows preserving partial effects (e.g., keep whisper, remove laughter)

Use Case Example:
<style:whisper:2> <Laughter:3> <restore:1@2>
- Applies whisper (iterations 1-2)
- Applies laughter (iterations 3-5)
- Restores using iteration 2 (whispered audio) with 1 VC pass
- Result: Keeps whisper effect but removes laughter voice degradation

Documentation:
- Updated INLINE_EDIT_TAGS_USER_GUIDE.md with restore tag section
- Added examples for basic and iteration-reference restoration
- Explained use cases and when to use each syntax
- Updated processing order and reference sections
2025-12-08 20:04:39 -03:00
diodiogod e01f3515ef Add comprehensive inline edit tags user guide
- Complete guide for Step Audio EditX inline tag system
- Covers all tag types: paralinguistic, emotion, style, speed
- ChatterBox 23-Lang v2 native vs post-processing tag distinction
- Language support warnings (Chinese, English, Japanese, Korean only)
- Voice resemblance degradation warnings for 3+ iterations
- Performance tips and best practices
- Inline vs manual node workflow comparison
- Pro tips for stronger effects with contextual text
- Planned voice restoration feature note
- FAQ and troubleshooting sections
2025-12-08 15:21:07 -03:00
diodiogod 08b52f63c3 Add inline edit tag support for Higgs Audio and fix CUDA graph unloading crash
Added edit tag extraction and batch processing for Higgs Audio TTS and SRT processors following the established pattern from VibeVoice and Step Audio EditX.

Key changes:
- Extract edit tags at top level before pause processing to keep nested functions returning tensors
- Apply edit post-processing after all audio generation completes
- For SRT: batch process all subtitle edits at end instead of per-subtitle
- Fix CUDA graph crash: detect original engine for stateless wrappers and refuse unloading when CUDA graphs enabled
- Store original_engine in ModelInfo to track Higgs even when masked as stateless_tts
- Update Higgs handler to check correct attribute paths for _cuda_graphs_enabled flag

Files modified:
- nodes/higgs_audio/higgs_audio_tts_processor.py: Add edit tag extraction and post-processing
- nodes/higgs_audio/higgs_audio_srt_processor.py: Batch edit processing for all subtitles
- utils/models/comfyui_model_wrapper/base_wrapper.py: Track original_engine for masked engines
- utils/models/comfyui_model_wrapper/model_manager.py: Store original engine when masking
- utils/models/comfyui_model_wrapper/engine_handlers/higgs_audio_handler.py: Refuse unload when CUDA graphs enabled
- docs/Dev reports/SRT_Edit_Tag_Batch_Processing_Pattern.md: Mark Higgs as implemented
2025-12-06 19:04:27 -03:00
diodiogod 96877fec99 Refactor SRT processors to batch edit post-processing at the end
Fixed inefficient per-subtitle edit processing that caused multiple engine loads.
Now all edit processing happens in a single batch after all subtitles are generated.

Changes:
- VibeVoice SRT: Collects all segments with edit_tags, applies edits once at end
- Step Audio EditX SRT: Same batching pattern, skips edits in _process_character_switching when in SRT mode
- Step processor: Added check to only apply edits when NOT in SRT mode
- Subtitle processing functions: Return segment dicts instead of applying edits directly

Benefits:
- Edit engine loads ONCE instead of once per subtitle
- Significantly faster SRT generation with edit tags
- Less VRAM thrashing from repeated model loading/unloading
- Maintains same quality output

Added dev report documenting the pattern for future engine implementations.
2025-12-06 17:12:33 -03:00
diodiogod d1b093d273 Refactor inline edit tags to use Audio Editor node + fix unified interface
Major changes:
1. Post-processor now uses Audio Editor node instead of calling engine directly
   - Inherits progress bars, caching, tested code
   - Much simpler and more maintainable

2. Fixed unified model interface usage across Step Audio EditX
   - Adapter now loads via unified_model_interface.load_model()
   - Audio Editor node now loads via unified_model_interface.load_model()
   - Both use model_type="tts" for consistent cache keys
   - Prevents duplicate model loading (was loading twice before)

3. Fixed pause tag + edit tag interaction
   - Pause tags split FIRST, then edit tags extracted per segment
   - Allows: "Hello <Laughter> [pause:1] World <Sigh>"
   - Laughter applies to "Hello", Sigh applies to "World"

4. Added lesson to fails document
   - All engines must use unified interface in ALL code paths
   - Cache key must match across adapters/nodes/processors

Bug fixes:
- Missing Dict import in post-processor
- Import path for Audio Editor node (use importlib)
- Progress bars now work during editing

Files modified:
- utils/audio/edit_post_processor.py - refactored to use Audio Editor node
- nodes/step_audio_editx/step_audio_editx_processor.py - pause handling
- engines/adapters/step_audio_editx_adapter.py - unified interface
- nodes/step_audio_editx_special/step_audio_editx_audio_editor_node.py - unified interface
- docs/Dev reports/fails_to_avoid_TTS_Engine_Implementation.md - added lesson
2025-12-05 21:43:05 -03:00
diodiogod 1f629737d2 Implement inline edit tags for Step Audio EditX post-processing
Added support for inline edit tags in TTS text that automatically apply
Step Audio EditX edits to generated audio from ANY engine.

Syntax examples:
- <Laughter:2> - paralinguistic with iterations
- <emotion:happy:1> - emotion edit
- <style:whisper:3> - style edit
- <speed:faster> - speed adjustment
- <Laughter:2|style:whisper> - multiple effects

Key changes:
- Extended step_audio_editx_special_tags.py with EditTag dataclass and iteration parsing
- Created edit_post_processor.py for centralized post-TTS edit application
- Integrated into Step Audio EditX processor with proper pause tag handling
- Pause tags split FIRST, then edit tags extracted per pause-segment
- Reuses already-loaded engine to avoid duplicate loading

Flow:
1. Parse text, split by pause tags first
2. Extract edit tags from each pause-delimited segment
3. Generate TTS with clean text (tags stripped)
4. Post-processor applies edits to segments with tags
5. Assemble final audio

Currently working for Step Audio EditX TTS and SRT nodes.
2025-12-05 21:20:21 -03:00
diodiogod 353c87de55 Fix Step Audio EditX transformers 4.54+ compatibility with simple config fix
Replace complex weight restoration workaround with a simple one-line config fix.

The root cause: Step-Audio-EditX model config was missing 'tie_word_embeddings'
setting, so transformers 4.54+ defaulted to True and tied lm_head to embed_tokens
even though the checkpoint has different weights for each.

Solution: Add 'tie_word_embeddings': false to config.json to prevent tying.

This is much simpler and cleaner than the previous safetensors weight restoration
approach. One line in config.json fixes the issue for all transformers versions.
2025-12-05 12:52:22 -03:00
diodiogod da30410099 Add Step Audio EditX SRT processor with full character switching support
- Create step_audio_editx_srt_processor.py following IndexTTS-2 pattern
- Register Step Audio EditX in unified SRT node (wrapper + processing)
- Add SRT-level progress tracking (job management at subtitle level)
- Build complete voice mapping with alias resolution for character switching
- Handle ComfyUI audio dict format extraction for temp file saving
- Skip internal job tracking in processor when SRT manages it
2025-12-04 16:02:36 -03:00
diodiogod f9c88d7e89 Add Step Audio EditX segment parameter support and fix tooltips
- Add step_audio_editx to PARAMETER_ENGINES for seed and temperature
- Fix engine node tooltips: parameters ARE used in clone mode (not hardcoded)
- Add reference implementation paths to implementation plan
- Update fails doc with latest lessons learned
2025-12-04 13:59:49 -03:00
diodiogod b550b5b3f8 Fix generation_info consistency across IndexTTS and Step Audio EditX
Make both engines follow ChatterBox 23-Lang modular pattern:

**Step Audio EditX:**
- Update combine_audio_segments() to use ChunkCombiner with return_info=True
- Return (audio, chunk_info) tuple when requested
- Fix single segment shape handling (ensure 2D [channels, samples])

**IndexTTS:**
- Add combine_audio_segments() method using ChunkCombiner
- Update process_text() to accept return_info parameter
- Build chunk_info from text segments and return timing data

**Unified Node:**
- Call both engines with return_info=True
- Use ChunkTimingHelper.enhance_generation_info() for detailed reports
- Clean text without tags before calculating length

**Documentation:**
- Add generation_info consistency requirement to fails document
- Document correct pattern: ChunkCombiner + ChunkTimingHelper
- Note wrong pattern: inline torch.cat without timing

Now both engines provide detailed timing reports like F5-TTS and ChatterBox.
2025-12-04 09:51:10 -03:00
diodiogod 701f98ca8a Remove automatic __del__ unload from IndexTTS and Step Audio EditX engines
Models should only unload when explicitly requested (Clear VRAM button) or when
switching engines - NOT automatically after generation completes.

__del__ was causing models to unload immediately after wrapper instance goes
out of scope, preventing model reuse between generations.

Pattern: F5-TTS and ChatterBox don't have __del__, only Index2 and StepAudio had it.
Removed to match correct behavior.
2025-12-04 09:18:25 -03:00
diodiogod b0b41e464f Fix 8-bit quantization device movement error
- Wrap .to() calls in try-except for quantized models
- Show warning only once per engine instance
- Add quantization notes to fails document
2025-12-04 01:37:48 -03:00
diodiogod 9128899a15 Fix Step Audio EditX character switching bug
- Configure character parser with available characters and language defaults like IndexTTS
- Add characters from text tags to available_characters to prevent fallback to "narrator"
- Add fallback voice mapping entries for characters without voice files
- Update fails document with character switching implementation lessons
2025-12-04 01:17:44 -03:00
diodiogod 89d12285b5 Add Step Audio EditX TTS engine implementation
Implemented Step Audio EditX integration with the following components:

Engine Implementation:
- Bundled Step Audio EditX reference code in step_audio_editx_impl/
- Created engine wrapper (step_audio_editx.py) with clone/edit methods
- Created adapter (step_audio_editx_adapter.py) for unified interface
- Created processor (step_audio_editx_processor.py) for TTS Suite integration

Model Management:
- Created downloader (step_audio_editx_downloader.py) for:
  - Main Step-Audio-EditX model (3B LLM + CosyVoice vocoder)
  - Step-Audio-Tokenizer files (linguistic_tokenizer.npy, speech_tokenizer_v1.onnx)
  - FunASR-Paraformer model with correct config for bundled funasr_detach
- Fixed FunASR config to use bundled class names (ParaformerStreaming, WavFrontendOnline, SpecAugLFR)
- Added auto-download for all required models on first use
- Updated unified_model_interface.py to auto-download Step-Audio-EditX components

Node Configuration:
- Created Step Audio EditX engine config node
- Registered in nodes.py and unified TTS text node

Known Issues:
- LLM generation hangs during inference despite:
  - torch.no_grad() wrapper
  - torch.cuda.synchronize()
  - Eager attention mode (Step1ForCausalLM doesn't support SDPA)
  - Reduced max_new_tokens
  - Removed logits processor
- Model loads successfully, all components initialized correctly
- Issue appears to be with transformers.generate() call itself
- Requires further investigation of Step1ForCausalLM compatibility

Files Modified:
- nodes.py: Added Step Audio EditX registration
- requirements.txt: Added FunASR dependencies
- utils/models/unified_model_interface.py: Added Step Audio EditX factory
- Various Step Audio EditX implementation files

Model Downloads:
- Step-Audio-EditX: 7GB (3B LLM + vocoder)
- FunASR-Paraformer: 881MB (from custom HF repo with fixed config)
- Step-Audio-Tokenizer: Bundled with main model download
2025-12-03 13:27:02 -03:00
diodiogod 5c5a1393ca Version 4.14.28
Fix Italian ChatterBox case-sensitive language prefix detection

- Make [it] prefix detection case-insensitive to prevent double-prefixing
- Users can now use [it], [IT], [It] or any capitalization without issues
- Avoids duplication that caused 'IT' to be spoken in output
2025-11-19 23:18:19 -03:00
diodiogod 43d1342b4b Fix: Move TIER2-3_REFACTOR_PLAN.md to correct directory
Remove incorrectly escaped 'Dev\ reports' directory
2025-11-14 23:02:11 -03:00
diodiogod a8c62f2307 TIER 3: Complete architecture standardization for model loading
Implement standardized factory infrastructure enabling future engines:

1. ModelLoadConfig dataclass - Single canonical config class for all factories
   - Replaces duplicate UnifiedModelConfig
   - Contains device, model_name, language, model_path, repo_id, additional_params
   - Device resolution in __post_init__ for consistency

2. Engine capability registry - Data-driven engine specifications
   - Defines supports_voice_conversion, multilingual_model_switching, corruption recovery
   - Enables generic error handling without hardcoded engine checks
   - Covers all 7 TTS engines + IndexTTS-2

3. Fallback handler utility - Reusable fallback chain for graceful degradation
   - Try local → download → fallback language pattern
   - Eliminates duplicate fallback code across engines
   - Used by future engines automatically

4. Exception hierarchy - Standardized error types
   - TTSModelLoadingError base class
   - Specific types: NotFoundError, DeviceError, FormatError, InitializationError, LanguageNotSupportedError

Architecture benefits:
- All 8 factories now accept config: ModelLoadConfig instead of **kwargs
- Type-safe, clear factory signatures
- Future engines follow identical pattern
- No deprecated code left behind
- ComfyUI model manager handles both old and new patterns

Testing:
- All 7 TTS engines working correctly
- Device switching and caching working
- No syntax errors, all files compile

Note: SmartModelLoader still in use (Tier 2 cleanup pending) causing benign double-loads on some engines.
2025-11-14 10:10:52 -03:00
diodiogod dfecc41910 docs: Add model loading architecture analysis and refactor recommendations
- MODEL_LOADING_ANALYSIS.md: Comprehensive technical analysis of current system
  - Adoption rates, factory patterns, device management, caching strategies
  - 8 critical issues identified with severity levels
  - File impact analysis

- MODEL_LOADING_REFACTOR_REPORT.md: Executive summary with actionable recommendations
  - Tier 1 (quick wins): auto device caching, device comparison, resolution consolidation
  - Tier 2 (medium effort): cache unification, key collision fix, error standardization
  - Tier 3 (major refactor): factory signatures, capability registry, fallback handlers
  - Priority matrix and implementation timeline
2025-11-13 20:47:00 -03:00
diodiogod ae2998b67d Apply IndexTTS-2 upstream updates (September 18 → November 6, 2025)
Integrated all 5 upstream commits with custom modifications preserved:

1. Empty generator fix (750d9d9) - Refactored infer() to generator pattern
   - Created wrapper infer() that delegates to infer_generator()
   - Renamed monolithic method to infer_generator()
   - Changed final returns to yield for generator compatibility
   - Handles both streaming and non-streaming modes

2. Streaming implementation (b0c6ab8) - Added low-latency streaming
   - Added stream_return parameter for generator mode
   - Added more_segment_before parameter for streaming segmentation
   - Integrated with generator-based inference

3. UNK token warnings (34be9bf) - Token validation and user feedback
   - Detects unknown tokens in BPE model
   - Warns users with token IDs and suggestions

4. S2Mel optimization (31e7e85) - Mel-spectrogram generation speedup
   - Optimized fused_add_tanh_sigmoid_multiply() with torch.split
   - Fixed sequence_mask() with max_length parameter
   - Added enable_torch_compile() to CFM and MyModel classes
   - Added use_torch_compile parameter to infer_v2.py

5. GPT2 acceleration (c1ef414) - KV-cache and FlashAttention optimization
   - Created new /accel/ module with 5 files (609-2500 lines)
   - Added use_accel parameter to UnifiedVoice
   - Integrated AccelInferenceEngine for 1.5-3x speedup
   - Optional feature (requires flash-attn library)

Custom modifications preserved:
- QwenEmotion lazy loading with path fallbacks
- W2V-BERT loading from TTS folder (unified downloader integration)
- All custom logging and error handling
- Custom emotion vector processing

Generated upstream tracking documentation in docs/Upstream_Engine_Tracking/
2025-11-06 19:32:28 -03:00
diodiogod f0e29dbd94 Add reminder to specify component/engine in changelog entries 2025-11-03 18:47:40 -03:00
diodiogod 9d5d6968b4 Implement 🏷️ String Multiline Tag Editor with full persistence, undo/redo, and preset system 2025-10-30 14:54:04 -03:00
diodiogod e4a48045a1 Add per-segment parameter switching system (VibeVoice Custom Character Switching)
- New utils/text/segment_parameters.py with parameter validation, aliases, and engine compatibility
- Extended CharacterSegment to include per-segment parameters
- Extended language resolver to parse pipe-separated parameters: [Alice|seed:42|temp:0.5]
- Support for: seed, temperature, cfg, speed, top_p, top_k, inference_steps, exaggeration, emotion_alpha
- Case-insensitive aliases and order-independent syntax
- Integrated into VibeVoice Custom Character Switching mode (text and SRT)
- Fixed grouping logic to break groups when parameters change
- Added PARAMETER_SWITCHING_GUIDE.md documentation
- Updated PROJECT_INDEX.md

NOTE: Currently implemented for VibeVoice Custom Character Switching only.
Native Multi-Speaker mode and other engines will be added in future updates.
2025-10-29 00:36:44 -03:00
diodiogod 90fb8d1f45 Document interrupt handling for future TTS engine implementations
Add Step 9.5 to NEW_ENGINE_IMPLEMENTATION_GUIDE.md:
- Explain ComfyUI interrupt mechanism and why it's critical
- Provide import pattern and code examples
- Show where to add interrupt checks in SRT and TTS processors
- Add test checklist item for interrupt handling
- Reference real implementation examples
- Add interrupt checking to critical integration points list

This ensures future engine implementations include proper cancellation support from day one.
2025-10-28 19:37:19 -03:00
diodiogod 7ad5b8227e Update documentation for Clear VRAM integration
- Add engine_handlers.py to PROJECT_INDEX.md
- Add comprehensive Clear VRAM integration guide to NEW_ENGINE_IMPLEMENTATION_GUIDE.md
- Document .to() method implementation patterns for simple, medium, and complex engines
- Document device checking and wrapper re-registration patterns
- Provide code examples for proper ComfyUI model management integration
2025-10-27 23:46:16 -03:00
diodiogod 56c561c219 Update documentation to reflect experimental nature of v2 special tokens
- Add prominent warning that special tokens have limited effectiveness
- Link to ResembleAI issue #186 showing lack of official documentation
- Note that implementation is ready for future improvements
- Be honest about testing results: tokens may produce minimal effects
- Don't recommend v1 over v2 (v2 has other improvements beyond tags)
2025-10-08 18:05:53 -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 373983993d Move COMFYUI_REGRESSION_FINDINGS.md to proper docs location 2025-09-26 15:44:43 -03:00
diodiogod b24bd37897 Version 4.9.20
Update bundled IndexTTS-2 to latest upstream version

Technical implementation:
- Sync with https://github.com/index-tts/index-tts commits 8336824..64cb31a
- Add normalize_emo_vec() function from commit 8aa8064 for voice identity protection
- Add _load_and_cut_audio() helper from commit 0828dcb for 15s audio truncation
- Add persistent cache clearing from commit 64cb31a with torch.cuda.empty_cache()
- Fix BigVGAN CUDA kernel import path from commits ee23371, e409c4a
- Enhance emotion vector logging for better user feedback
2025-09-18 14:19:30 -03:00
diodiogod dcfae4fc81 Update README.md with IndexTTS-2 features and model documentation
- Add IndexTTS-2 to Multi-Engine TTS feature list
- Add IndexTTS-2 With Emotion Control section to What's New
- Add IndexTTS-2 Model Downloads section with correct model structure
- Include proper repository links (IndexTeam/IndexTTS-2, facebook/w2v-bert-2.0)
- Document unified emotion control architecture and features
- Add comprehensive IndexTTS-2 Emotion Control Guide
2025-09-16 14:52:56 -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 51de42754f Complete IndexTTS-2 TTS engine integration with emotion disentanglement
Major Features:
• IndexTTS-2 engine with zero-shot voice cloning and emotion control
• Multi-modal emotion support (audio refs, text descriptions, manual vectors)
• Character switching with emotion references: [Alice:angry_bob]
• Native IndexTTS-2 token-based chunking integration
• Comprehensive parameter exposure with 25+ engine-specific options

Core Components:
• engines/processors/index_tts_processor.py - Main processor with emotion support
• nodes/engines/index_tts_engine_node.py - Engine configuration node
• Updated unified TTS Text node with IndexTTS-2 integration
• Node registration in main nodes.py

Dependencies:
• Added 8 safe IndexTTS-2 dependencies to install.py and requirements.txt
• Dependency testing confirmed only descript-audiotools conflicts (already handled)
• All new deps use flexible versioning (>=) to avoid lock conflicts

Character Parser Fix:
• Fixed circular import by moving CharacterSegment to separate types.py
• Maintains backward compatibility while supporting emotion references
• Modular structure preserved (4 modules under 500 lines each)

Technical Details:
• Emotion disentanglement separates speaker identity from emotional expression
• Supports [character:emotion] syntax for per-segment emotion control
• IndexTTS-2 native chunking overrides character-based chunking when enabled
• Full caching integration and pause tag support included
• Error handling with graceful fallbacks for missing voices/emotions
2025-09-11 21:59:19 -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 d01e5cb807 Refactor comfyui_model_wrapper.py into modular architecture
- Split 970-line monolith into focused modules following 500-600 line policy
- Created utils/models/comfyui_model_wrapper/ directory structure:
  - base_wrapper.py (302 lines): Core ComfyUIModelWrapper class
  - model_manager.py (318 lines): ComfyUITTSModelManager class
  - cache_utils.py (28 lines): Cache invalidation utilities
  - engine_handlers/: Engine-specific memory management
    - higgs_audio_handler.py: CUDA graph management and unload blocking
    - vibevoice_handler.py: RAM cleanup and complete deletion logic
    - generic_handler.py: Standard CPU migration for other engines
- Fixed engine routing bug where stateless_tts wrappers weren't using HiggsAudioHandler
- Maintained full backward compatibility with existing imports
- All engine-specific behaviors preserved (VibeVoice deletion, Higgs CUDA graphs)
- Updated PROJECT_INDEX.md to reflect modular structure
2025-09-11 14:57:52 -03:00
diodiogod 663c790073 Version 4.8.38
Fix pkg_resources deprecation warning in installer

- Replace deprecated pkg_resources with importlib.metadata
- Add fallback support for Python < 3.8 compatibility
- Suppress warnings when using legacy fallback
2025-09-10 19:27:24 -03:00
diodiogod 9ad7c78893 Add extra_model_paths.yaml support and enhance voice discovery
Technical implementation:
- Add TtsExtraPathsManager for ComfyUI extra_model_paths.yaml integration
- Support shared model directories across multiple ComfyUI installations
- Implement intelligent model discovery across configured paths
- Add voice discovery fallback: models/voices → models/TTS/voices → examples
- Update character alias map loading with proper priority system
- Enhance voice directory scanning to include TTS organization structure
- Add changelog guidelines requiring engine names in titles
- Reference: GitHub issue #63
2025-09-10 12:12:32 -03:00
diodiogod 1e61db1fca Version 4.8.20
Fix Python 3.13 RVC and vocal separation compatibility

Technical fixes:
- Fix RVC f0 method dependencies (pyworld, torchfcpe) for complete functionality
- Fix vocal separation numba/librosa compatibility issues in Python 3.13
- Fix MDX23C model path resolution and Karafan engine integration
- Fix model substitution and fallback error handling
- Improve default model selection (MelBand over slow ONNX on CPU)
- Add comprehensive safe wrapper functions for librosa operations
2025-09-06 22:55:31 -03:00
diodiogod 5c16a6ebb2 Update CHARACTER_SWITCHING_GUIDE.md 2025-09-06 13:26:43 -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 1ae879d134 Version 4.6.24
Update VibeVoice 7B to official Microsoft repository

Technical details:
- Change repo from WestZhang/VibeVoice-Large-pt to microsoft/VibeVoice-Large
- Update documentation and downloader references
- Maintain backward compatibility with existing installations
2025-09-01 10:44:16 -03:00
diodiogod 6e32362dc4 Integrate VibeVoice with ModelManager caching system
Technical details:
- Add VibeVoice model loading and caching to ModelManager class
- Modify VibeVoice adapter to use ModelManager instead of creating own engine instances
- Add load_vibevoice_model() and unload_vibevoice_models() methods to ModelManager
- Import VibeVoice components into ModelManager with availability checking
- Update adapter to cache model and processor instances via ModelManager
- Follow ChatterBox pattern for persistent model caching across node executions
2025-08-30 12:26:06 -03:00
diodiogod 5b5f8d603c Version 4.6.13
Fix MelBandRoFormer architecture compatibility issues

Technical details:
- Implement proper MelBandRoFormer model loading with correct config
- Add Kijai's safetensors model support and auto-download
- Fix tensor size mismatch in instrumentals calculation
- Add model-specific output inversion handling
- Prevent incompatible RVC fallback for MelBand models
2025-08-30 10:53:22 -03:00
diodiogod 57330f9621 Version 4.5.30
Fix F5-TTS model name case sensitivity issue

- Fix uppercase V1 being rejected in model validation
- Add regex normalization for version numbers (V1 -> v1)
- Ensure backward compatibility with saved workflows
2025-08-28 23:31:52 -03:00
diodiogod b371c11b95 Version 4.5.27
Fix Higgs Audio model management with CUDA Graph compatibility toggle

Technical implementation:
- Add enable_cuda_graphs parameter to resolve CUDA Graph vs model unloading conflict
- Implement DynamicCache support for safe memory management mode
- Fix DynamicCache compatibility issues (reset, seq_length, copying)
- Add conditional cache creation and cleanup logic
- Update tooltip with accurate performance trade-offs (12 vs 55+ tok/s)
2025-08-28 17:41:42 -03:00
diodiogod d2878ab666 Clean up debug output from RAS parameter implementation
Remove debug logging statements from Higgs Audio engine and TTS processor:
- Remove RAS parameter debug prints from higgs_audio.py
- Remove cache key and parameter validation debug output
- Remove TTS processor config debug statements
- Remove unified node debug output
- Clean up command configuration file

Production ready - all debug output removed
2025-08-27 23:15:23 -03:00
diodiogod 4197e73bb0 Improve version bump system with better dry-run and documentation
Technical improvements:
- Refactor version_utils.py to extract changelog generation logic
- Add preview_changelog_entry method for dry-run testing
- Enhance dry-run to show actual categorized changelog preview
- Fix code duplication by using shared content generation method

Documentation improvements:
- Consolidate version bump documentation in BUMP_SCRIPT_INSTRUCTIONS.md
- Add comprehensive multiline examples and auto-increment usage
- Add auto-categorization keyword explanations and writing tips
- Add troubleshooting section with common issues and solutions
- Remove redundant CLAUDE_VERSION_MANAGEMENT_GUIDE.md file
2025-08-27 20:19:47 -03:00