Commit Graph
82 Commits
Author SHA1 Message Date
diodiogod 2bc4c2a18d Add IndexTTS 2.5 support 2026-08-11 23:08:35 -03:00
diodiogod 517d11ed4c Add DramaBox and ChatterBox V3 support
- Integrate DramaBox with unified TTS and SRT generation, duration targeting, prompt templates, memory strategies, FP8, compile, and silence diagnostics
- Add ChatterBox 23-Lang V3 checkpoint support and artifact handling
- Extend parameter switching, generated-audio caching, tag editor controls, model downloads, and engine registration
- Add user documentation, engine metadata, generated comparison tables, and FL-MCP launcher reliability updates
2026-07-25 11:38:52 -03:00
diodiogod 3d7e8dfaa1 Version 5.5.1
Fix Step Audio EditX generation and runtime compatibility

Technical details:
- Restore the correct Step prompt, token layout, untied audio head, and memory-safe attention behavior
- Add shared and dedicated Transformers 4 runtime routing with worker progress reporting
- Preserve runtime selection across TTS, SRT, caching, and inline audio editing
- Fix character voice handling, empty audio validation, sample-rate interface, and deprecated dependency calls
2026-07-18 20:38:56 -03:00
diodiogod 97f4a0c365 Add unified MOSS audio generation workflows 2026-07-16 12:35:01 -03:00
diodiogod 6da635cf74 Sync IndexTTS updates and document editor features 2026-07-11 16:24:08 -03:00
diodiogod 9081d3c22a Add Fish Audio S2 engine and fix VibeVoice speaker remap 2026-07-06 23:35:13 -03:00
diodiogod af13209b47 Add OmniVoice engine with native SRT duration targeting 2026-06-18 22:23:32 -03:00
diodiogod cb6dfe3a11 Add Dots TTS engine integration 2026-06-14 15:27:58 -03:00
diodiogod a42f4d3083 Resume Higgs Audio v3 on transformers 5 2026-06-09 19:04:57 -03:00
diodiogod f75837834e Add Higgs Audio shared isolation runtime 2026-06-08 22:20:18 -03:00
diodiogod 70b04135ec Route Granite aligner through shared Qwen runtime 2026-06-07 21:55:14 -03:00
diodiogod 53df881108 Polish Qwen shared isolation runtime 2026-06-07 11:16:23 -03:00
diodiogod 14c32a96d1 Add Qwen3-TTS shared isolation runtime 2026-06-06 22:26:45 -03:00
diodiogod 2b61bafd73 Add shared VibeVoice isolation runtime 2026-06-06 15:09:27 -03:00
diodiogod f70654dc46 Version 4.26.4
Add MOSS LoRA loading support and compatibility validation

Implementation details:
- Add managed MOSS LoRA discovery and Hugging Face install flow under models/TTS/moss_tts/loras
- Wire PEFT adapter loading through the MOSS engine, adapter, cache, generation info, and unified model interface
- Validate adapter base-model compatibility before loading to prevent huge PEFT mismatch errors
- Raise real ComfyUI popup errors for MOSS LoRA/base model mismatches instead of generic engine creation failures
- Patch bundled MOSS Delay and TTSD classes for PEFT generation compatibility
- Upgrade installer requirement handling so outdated packages like peft are upgraded automatically
- Document the MOSS LoRA folder contract and update MOSS metadata
2026-05-23 17:42:01 -03:00
diodiogod f8c5c2b965 Version 4.26.2
Fix Qwen3-TTS auto attention fallback for broken flash-attn installs

Technical details:
- Validate flash_attn package metadata before selecting flash_attention_2 in auto mode
- Fall back to sdpa when flash-attn is missing or partially installed on Windows
- Add runtime retry to sdpa when auto-selected flash_attention_2 fails during model load

Address issue #294
2026-05-18 21:46:53 -03:00
diodiogod 2b69130a42 Add MOSS-TTS engine family with native TTSD support (#295)
* docs: add new engine integration guide flow

* docs: link new engine guide navigation

* docs: clarify SRT is required for TTS engines

* docs: document SRT reuse of TTS processor

* docs: move new engine guide link below timeline

* Add MOSS-TTS engine integration

* docs: add reference input mode to engine research

* Add MOSS-TTS engine checkpoint

* Refine MOSS prompt fields and parameter switching

* Refine MOSS prompt field warnings and caching

* Improve MOSS inline edit handling and VRAM handoff

* Improve MOSS native dialogue mapping and UI

* docs: add long-form model analysis and VibeVoice reference

* Improve MOSS TTSD chunking, interrupts, and SRT mapping

* Refine MOSS mapping, device checks, and metadata

* Make MOSS native incompatibilities hard-fail

* Document MOSS native hard-fail compatibility rules
2026-05-18 16:42:53 -03:00
diodiogod 984eaf1600 Fix VibeVoice local custom model loading
- discover local community VibeVoice folders from both TTS roots and direct vibevoice paths
- support nested snapshot layouts such as VibeVoice7b-low-vram/4bit
- align node dropdown discovery with runtime model path resolution
- avoid startup-time VibeVoice import poisoning by switching to lazy package loading
- apply transformers compatibility patches on the unified VibeVoice load path
- move quantized inner-model buffers on the real writable object instead of the read-only wrapper property
2026-03-28 22:17:11 -03:00
diodiogod c709f129fc Version 4.23.0
Add Granite ASR engine and expand unified ASR support

Implementation details:
- Add Granite ASR engine node, adapter, runtime, and unified downloader integration
- Reuse the Qwen forced aligner for optional custom Granite timestamps and SRT output
- Expose engine-side ASR translation target and prompt templates for Granite and Qwen
- Fix SRT overflow splitting so subtitle text is no longer silently dropped
- Update README and engine metadata for the expanded ASR lineup
2026-03-16 23:58:56 -03:00
diodiogod b3678bf513 Version 4.22.2
Improve ChatterBox community model loading and Russian model handling

Technical details:
- preserve language context when loading local ChatterBox models
- repair missing files in existing ChatterBox model folders before fallback
- infer ChatterBox T3 text vocabulary size from checkpoint weights for community finetunes
- adapt bundled tokenizer wrapper to community tokenizer space and case conventions
- remove unsupported Russian classic Cyrillic experimental dropdown entry after validation
2026-03-10 09:30:59 -03:00
diodiogod 597301fed9 fix(echo-tts): scope edit tags per pause fragment, fix VRAM reload, add to engine registry
- Fix inline edit tags (e.g. <Laughter>) incorrectly applying to entire
  combined audio when pause tags are present. Now parse pause tags first,
  extract edit tags per text fragment, apply edit post-processing per
  fragment before combining with silence.

- Fix force_speaker_kv + short fragments: replace hard error with smart
  auto-disable for fragments under 20 chars. Long fragments still benefit
  from force_speaker_kv; short ones generate cleanly without noisy tails.

- Fix VRAM unload/reload crash ("Inference tensors do not track version
  counter"): clone pca_state dict tensors before .to() to escape
  inference-mode version tracking after ComfyUI "Unload Models".

- Add Echo-TTS to tts_audio_suite_engines.yaml source of truth
  (English-only, ~7GB total, diffusion-based, CC-BY-NC-SA).
2026-03-01 00:45:33 -03:00
drphero 2cc6387892 feat: register echo-tts with ComfyUI model manager
- add echo-tts factory in unified model interface
- ensure fish-s1-dac-min loads via the same managed path
- load echo-tts via unified interface for VRAM management
2026-03-01 00:45:16 -03:00
diodiogod 43f95bc723 Revert overzealous Numba global monkey-patch and deferred checking 2026-02-22 12:14:35 -03:00
diodiogod 3dad764d2c Fix: Add deferred rigorous Numba compilation testing and global librosa fallback patching to prevent catastrophic JIT typing errors on NumPy 2.x 2026-02-21 22:39:37 -03:00
diodiogod 246f0d2bc0 Version 4.21.13
Integrate Egyptian Arabic (oddadmix) model and fix vocab mismatch

Technical details:
- Added 'oddadmix/chatterbox-egyptian-v0' to chatterbox-23l engine
- Implemented automatic download of 'resemble-ai/chatterbox' config.json to resolve vocabulary mismatch
- Updated engine documentation source of truth (YAML) with consistent Arabic flags
2026-02-21 11:21:00 -03:00
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 bab68fd256 Add unified ASR node with Qwen3-ASR support 2026-01-31 11:31:09 -03:00
diodiogod 7ea1f743fd Version 4.19.8
Fix Qwen3-TTS device mismatch via adapter refactoring

Technical details:
- Refactor adapter to query unified interface instead of storing engine references
- Add _get_engine() method that always fetches current engine from unified interface
- Remove self.engine storage to prevent stale CPU-bound references
- Add cache invalidation when unified interface unloads model variants
- Fix language dropdown being ignored (character parser language default)
- Improve device management centralization in unified model interface
2026-01-28 21:59:39 -03:00
diodiogod a8f49bea1e Add sage_attn support to Qwen3-TTS with proper cache invalidation
Implements sage attention (sageattention) for Qwen3-TTS with:
- Auto-detection priority: sage_attn > flash_attention_2 > sdpa > eager
- Post-load attention module patching for sage_attn
- Graceful fallback to sdpa if sage_attn fails
- Proper cache invalidation on attention mode changes

Cache improvements:
- Added attn_implementation to engine instance cache key
- Added attn_implementation to audio cache key generator
- Added x_vector_only_mode to audio cache key (was missing)
- Prevents cache hits when switching attention modes

VRAM management improvements:
- Proactively unload old same-engine model variants before loading new ones
- Prevents VRAM accumulation when changing parameters (attn, dtype, etc.)
- Smart offloading when VRAM pressure detected by ComfyUI

Files changed:
- nodes/engines/qwen3_tts_engine_node.py: Added sage_attn to dropdown
- utils/models/unified_model_interface.py: Sage attention detection & patching
- nodes/unified/tts_text_node.py: Include attn_implementation in cache key
- engines/adapters/qwen3_tts_adapter.py: Pass attn_implementation to cache
- utils/audio/cache.py: Include attn_implementation & x_vector_only in cache
- utils/models/.../model_manager.py: Proactive same-engine variant unloading
2026-01-28 01:13:40 -03:00
diodiogod 88feb3a99a Add Qwen3-TTS engine with Phase 1 implementation
Implements complete Qwen3-TTS integration following NEW_ENGINE_IMPLEMENTATION_GUIDE
with unified architecture, character switching, language support, and Voice Designer.

## Core Engine Implementation

**Engine Wrapper** (`engines/qwen3_tts/qwen3_tts.py`):
- Wraps official Qwen3-TTS implementation with .to() method for VRAM management
- Device checking before generation with automatic model reload
- Support for 3 model types: CustomVoice (presets), VoiceDesign (text-to-voice), Base (voice cloning)
- Progress bar integration via transformers streamer interface
- 24kHz mono audio output in ComfyUI-compatible format

**Bundled Implementation** (`engines/qwen3_tts/impl/`):
- Official Qwen3-TTS library bundled for stability
- Patched modeling_qwen3_tts.py (line 2069) for progress callback support
- Sox dependency stubbed out (25Hz models only, we use 12Hz)
- Supports 6 models: 0.6B/1.7B × CustomVoice/VoiceDesign/Base

**Adapter** (`engines/adapters/qwen3_tts_adapter.py`):
- Intelligent model selection based on context (voice_preset/node_type)
- Automatic switching: preset→CustomVoice, None→Base, Designer→VoiceDesign
- Full caching integration with audio_cache.generate_cache_key()
- Voice reference processing for Base model (audio + transcript)
- Character-to-speaker mapping for CustomVoice presets (deterministic MD5 hashing)

## Node Implementation

**Engine Configuration Node** (`nodes/engines/qwen3_tts_engine_node.py`):
- Unified interface with voice_preset dropdown (9 preset speakers + None for zero-shot)
- Model size selection: 0.6B (low VRAM) / 1.7B (high quality)
- Language dropdown: Auto + 10 languages (Chinese, English, Japanese, Korean, German, French, Russian, Portuguese, Spanish, Italian)
- Conditional instruction field (locked when unsupported: Base model or 0.6B CustomVoice)
- Generation parameters: top_k, top_p, temperature, repetition_penalty, max_new_tokens
- Advanced: dtype, attn_implementation, x_vector_only_mode

**Voice Designer Node** (`nodes/qwen3_tts/qwen3_tts_voice_designer_node.py`):
- UNIQUE FEATURE: Create voices from natural language descriptions
- Smart disk check: loads existing characters without model loading/generation
- Runtime caching for same-session regeneration optimization
- Saves to models/voices/ with standard format (.wav + .reference.txt + .txt metadata)
- Outputs unified NARRATOR_VOICE format matching Character Voices node
- Duplicate detection prevents regenerating identical voices

**TTS Processor** (`nodes/qwen3_tts/qwen3_tts_processor.py`):
- Full character switching support via character parser
- CustomVoice: deterministic character→preset mapping (preserves narrator's chosen preset)
- Base: uses models/voices/ audio references (standard voice cloning)
- VoiceDesign: uses saved voice descriptions from Designer node
- Pause tag processing with silence generation
- Language switching support via [language:Character] tags
- Segment parameter support ([seed:X], [temperature:0.8])
- Interrupt handling for cancellation
- Chunk combining with ChunkCombiner + ChunkTimingHelper

## JavaScript Widget

**Widget Locking** (`web/qwen3_tts_widgets.js`):
- Conditional UI: locks instruction field when unsupported
- Locked when: voice_preset="None" OR (model_size="0.6B" + preset selected)
- Console warnings explain limitations
- Preserves field value when locked (doesn't clear)

## System Integration

**Language Support** (`utils/models/language_mapper.py`):
- Added QWEN3_TTS_LANGUAGE_MAP: maps ISO codes to full names (e.g., "po"→"Portuguese")
- Added map_language_code_to_qwen3_tts() helper function
- Added "po" to global LANGUAGE_ALIASES (maps to pt-pt)
- Qwen3-TTS expects FULL language names, not ISO codes

**Unified Model Interface** (`utils/models/unified_model_interface.py`):
- Registered qwen3_tts factory in initialize_all_factories()
- Consolidated loading messages (single-line model loading output)
- Context-based model selection (VoiceDesign/CustomVoice/Base)

**Segment Parameters** (`utils/text/segment_parameters.py`):
- Added "qwen3_tts" to PARAMETER_ENGINES for inline tag support

**Voice Discovery** (`utils/voice/discovery.py`):
- Enhanced get_character_mapping() to detect VoiceDesign saved voices
- Checks for voice metadata format (description vs audio reference)
- Returns voice type for processor to handle correctly

**TTS Text Node** (`nodes/unified/tts_text_node.py`):
- Added qwen3_tts processor routing
- CustomVoice console messages (shows preset speaker instead of narrator warning)
- Recognizes unified NARRATOR_VOICE format from Voice Designer
- Language code mapping display (shows "po" → "Portuguese" conversion)

**Node Registration** (`nodes.py`):
- Registered Qwen3TTSEngineNode and Qwen3TTSVoiceDesignerNode
- Added error handling with fallback messages

## Features Implemented (Phase 1 Complete)

✅ Basic engine integration with unified architecture
✅ Character switching (CustomVoice presets + Base model cloning)
✅ Language switching (10 languages + Auto detection)
✅ Pause tags ([pause:1.5])
✅ Segment parameters ([seed:42], [temperature:0.8])
✅ Audio caching (prevents duplicate generation)
✅ VRAM management (.to() method + device checking)
✅ Interrupt handling (user cancellation)
✅ Progress bars (console + ComfyUI)
✅ Voice Designer (text-to-voice creation)
✅ Smart disk caching (skips regeneration for saved voices)
✅ Unified NARRATOR_VOICE output format

## Technical Details

- **Sample Rate**: 24kHz mono
- **Models**: 6 variants (0.6B/1.7B × CustomVoice/VoiceDesign/Base)
- **Tokenizer**: Qwen3-TTS-Tokenizer-12Hz (12.5 fps, 16 quantizers)
- **Languages**: 10 (Chinese, English, Japanese, Korean, German, French, Russian, Portuguese, Spanish, Italian)
- **CustomVoice Presets**: 9 (Vivian, Serena, Uncle_Fu, Dylan, Eric, Ryan, Aiden, Ono_Anna, Sohee)
- **Audio Format**: torch.Tensor [1, 1, samples] at 24kHz
- **Cache Integration**: Uses audio_cache with stable key generation
- **Character Mapping**: MD5-based deterministic assignment (cache-friendly)

## Testing Completed

- Engine node loads and configures correctly
- Preset voice generation (CustomVoice with 9 speakers)
- Zero-shot cloning (Base model with voice references)
- Voice Designer text-to-voice generation
- Character switching with automatic preset mapping
- Pause tags create correct silence durations
- Language selection and switching
- Caching prevents duplicate generation
- VRAM management (Clear VRAM + reload)
- Generation info reports with timing
- Interrupt cancellation
- Widget locking behavior
- Disk check optimization (skips model loading for existing voices)

## Phase 2+ (Future)

- SRT processor integration (Phase 4)
- Streaming generation (requires special deployment)
- Fine-tuning nodes (advanced feature)
2026-01-28 00:02:02 -03:00
diodiogod a8e2de16e7 Version 4.17.0
Add Vietnamese (Viterbox) community finetune support

Implementation details:
- Add Vietnamese (Viterbox) as model_version option for ChatterBox Official 23-Lang
- Support dolly-vn/viterbox repository with expanded Vietnamese tokenization (2549 tokens)
- Add flexible T3 model filename detection for community finetunes
- Add version normalization for file lookups and tokenizer selection
- Add Vietnamese language code mapping in language_mapper.py
- Fix vocab size detection by loading tokenizer before T3 model initialization
- Support 'as-is' format handling for mixed .pt/.safetensors community models
2026-01-25 01:20:30 -03:00
diodiogod bf624cac57 Version 4.16.9
Fix CosyVoice TensorRT implementation bugs

Technical details:
- Fix missing 't' and 'spks' inputs in TensorRT shape configuration
- Fix hardcoded batch_size=2 to use dynamic batch size from input
- Fix lazy loading losing TRT/vLLM initialization parameters
- Add optimization loading debug messages
2026-01-07 15:17:47 -03:00
diodiogod 6fdaa0a188 Version 4.16.2
Fix IndexTTS-2 external installation detection

Technical changes:
- Replace keyword-based path detection with path-based detection
- Check if indextts module is inside TTS Audio Suite directory structure
- Fix false positives when ComfyUI installed in directories containing 'conda', 'pip', etc.
- Improve error message to show both detected and expected paths

Address issue #213 - User reported false positive when using conda environment
2026-01-02 13:30:19 -03:00
diodiogod 524c2d7bd4 Add CosyVoice3 model variant support with lazy downloading
Implements support for Fun-CosyVoice3-0.5B (standard) and Fun-CosyVoice3-0.5B-RL variants with lazy downloading:
- Only downloads variant-specific LLM file (~2GB) when needed
- Shared files (flow.pt, hift.pt, etc.) downloaded once and reused
- Both variants use same folder: Fun-CosyVoice3-0.5B
- Proper cache invalidation when switching between variants

Technical changes:
- Patched bundled CosyVoice library to accept llm_filename parameter
- Modified downloader to use SHARED_FILES + variant-specific LLM
- Audio cache now includes model_variant in hash calculation
- Model loading cache uses llm_filename in additional_params
- Added variant detection in path resolution and verification
2025-12-29 21:52:13 -03:00
diodiogod bcbc52376b Clean up CosyVoice logging output
Removed verbose/redundant messages:
- Commented out mode detection debug message
- Changed 📊 to ✅ for RTF generation messages
- Removed "Next generations will be faster" message (fast model)
- Removed "Initializing engine (first run...)" message
- Removed "Loading: LLM → Flow → HiFT..." component list
- Removed redundant "engine loaded via unified interface" message
- Commented out bundled library path (internal detail)
- Kept useful "Loading CosyVoice model from..." with actual model path
- Commented out "input frame rate" debug messages (internal model param)
- Commented out "use wetext frontend" debug message
- Consolidated text length warnings to single message at processor level
  with friendlier wording about quality impact

Result: Cleaner output showing only relevant info to users.
2025-12-29 16:26:53 -03:00
tazztone b85861bc15 Merge branch 'diodiogod:main' into main 2025-12-23 12:54:58 +01:00
diodiogod cf33d03d43 Version 4.15.12
Fix Step Audio EditX Audio Editor compatibility issues

Technical fixes:
- Fix factory wrapper to provide both edit() and edit_single() methods
- Fix BytesIO WAV saving on Windows (torchcodec compatibility)
- Fix Audio Editor model path resolution with extra_model_paths.yaml
- Remove duplicate wrapper creation in Audio Editor node
- Add proper delegation pattern for raw StepAudioTTS engine

Note: Includes bundled code patch (📦 marker) for Windows torchcodec BytesIO issue
2025-12-19 00:27:07 -03:00
tazztone 053b0510c3 bunch of fixes 2025-12-18 09:26:58 +01:00
tazztone 0e13a52e24 Implementing CosyVoice Engine Core
Completed Phase 1 core implementation
2025-12-17 14:29:02 +01:00
diodiogod 5925f4df27 Version 4.15.4
Add Step Audio EditX CosyVoice model validation

Technical improvements:
- Add CosyVoice folder and file existence checks
- Validate all required CosyVoice files before loading
- Add overrides parameter to load_hyperpyyaml for version compatibility
- Improve error messages with clear fix instructions

Address issue #196 - provide better diagnostics for model loading failures
2025-12-16 10:53:52 -03:00
diodiogod 2709718db7 Merge branch 'CrispyToken/main' 2025-12-12 21:27:56 -03:00
diodiogod 3887dffb54 Fix Step Audio EditX int8/int4 quantization unload and reload
Multiple critical fixes for bitsandbytes quantized models:

1. **Factory return type**: unified_model_interface now returns raw StepAudioTTS
   instead of wrapped StepAudioEditXEngine to fix tuple unpacking in adapter

2. **Quantization detection**: StepAudioEditXHandler now properly detects
   bitsandbytes int8/int4 models by checking model.llm.modules() for
   Linear8bitLt and Linear4bit classes

3. **Model deletion**: Handler now properly deletes llm, cosy_model, and
   audio_tokenizer components for quantized models that can't use .to()

4. **Cache key differentiation**: Added quantization and torch_dtype to
   tts_text_node cache key so int8/int4 changes create new instances

5. **Dead wrapper detection**: unified_model_interface now checks if cached
   wrapper's model was deleted and forces reload instead of returning dead wrapper

6. **Auto-unload prevention**: Disabled adapter cleanup() auto-unload to keep
   models loaded between generations

7. **Path handling**: Downloader now handles cached filesystem paths without
   KeyError by checking for absolute paths

Fixes:
- Models no longer auto-delete after second generation
- Quantization changes properly trigger model reload
- Manual unload button correctly frees VRAM (2.3GB int4, 3.8GB int8)
- Reload after unload works without "NoneType has no attribute 'frontend'" error
- "local:" prefix resolution now works via downloader pattern
2025-12-09 00:18:21 -03:00
diodiogod 9915b1ca08 Switch Step Audio EditX to downloader pattern for local: resolution
- Follow Higgs Audio/VibeVoice pattern instead of IndexTTS engine pattern
- Add resolve_model_path() method to downloader for 'local:' prefix handling
- Downloader searches all configured TTS paths (yaml-aware)
- Factory now calls downloader.resolve_model_path() instead of engine method
- Cleaner separation: downloader owns model paths, factory owns model loading
- Consistent with other engines using downloader pattern
2025-12-08 22:24:27 -03:00
diodiogod 3627980bc5 Fix VRAM management with proper model clearing and synchronization
Resolved OOM errors during model switching by implementing proper VRAM clearing:
- Added real VRAM measurement using torch.cuda.memory_allocated() in model_manager
- Removed fake VRAM reporting from VibeVoice handler
- Removed class-level caching from VibeVoice engine (unified manager handles all caching)
- Centralized device movement through ensure_device() in model manager
- Models now move to CPU instead of deletion for fast reload from cache
- Added CUDA synchronization after clearing to ensure memory is actually freed
- Fixed recursion by adding _from_ensure_device flag to model_load()
- model_load() now calls ensure_device() first to clear other models before loading

Also fixed inline edit tag spacing issues:
- Tags now properly add space after paralinguistic tags when followed by alphanumeric text
- Fixed both parser and post-processor to handle spacing correctly
2025-12-06 16:18:32 -03:00
diodiogod 1fb2a242bc Fix Step Audio EditX inline tags and unified interface integration
ModelLoadConfig parameter fixes:
- Use additional_params dict for torch_dtype and quantization (not direct kwargs)
- Fixed in both adapter and Audio Editor node
- Added model_path resolution to default ComfyUI models directory

Factory fixes:
- Return StepAudioEditXEngine wrapper instead of StepAudioTTS
- Wrapper provides get_sample_rate() and other methods needed by nodes
- Maintains compatibility with adapter and Audio Editor node

Adapter fixes:
- Handle both tuple and tensor returns from engine.clone()
- Inner engine returns (audio, sample_rate), wrapper returns just audio

Paralinguistic tag spacing:
- Auto-insert space before paralinguistic tags when glued to words
- 'whispering<Laughter>' becomes 'whispering [Laughter]'
- Required for Step Audio EditX paralinguistic insertion to work correctly
2025-12-05 22:19:21 -03:00
CrispyToken 7d053c1cdc Merge branch 'diodiogod:main' into main 2025-12-04 22:10:57 +01:00
CrispyToken ce5404d13e Added low_vram mode functionality to IndexTTS-2 Engine node 2025-12-04 22:08:20 +01:00
diodiogod 4ed2a36aef Fix Step Audio EditX transformers 4.54+ compatibility
Fixes critical bug where transformers 4.54+ incorrectly ties lm_head weights
to embed_tokens, causing Step Audio EditX to generate text tokens instead of
audio tokens (silent/gibberish output).

Root cause:
- Transformers 4.54+ ties lm_head to embed_tokens even when checkpoint has different values
- Step-Audio-EditX has lm_head (norm=227) and embed_tokens (norm=255) as separate weights
- Tying overwrites correct lm_head, breaking audio generation

Changes:
- model_loader.py: Add workaround to restore correct lm_head weights after loading
  - Detects incorrect weight tying by comparing data pointers
  - Loads correct lm_head.weight from safetensors
  - Works with transformers 4.54-4.57+
- Clean up debug code and console spam:
  - Remove torch_complex warnings (funasr_detach files)
  - Remove sox import and unused audio functions
  - Silence FunASR registration tables
  - Filter torchaudio deprecation warnings

Upstream fix:
- Submitted PR to transformers: https://github.com/huggingface/transformers/pull/42612
- Workaround will remain for backward compatibility with unfixed versions

Tested with transformers 4.57.3 - generates audio tokens correctly.
2025-12-03 23:18:39 -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 a9de25696a Version 4.14.26
Fix model wrapper consistency in unified interface

Technical changes:
- Fix unified_model_interface.py line 140: return wrapper instead of wrapper.model for cached models
- Remove obsolete model unwrapping code in chatterbox_streaming_adapter.py (lines 315-336)
- Wrapper now has __getattr__ forwarding, no manual unwrapping needed
- Fixes 'Model not wrapped - using direct .to() (legacy path)' warning

This completes the Tier 2/3 refactor wrapper consistency that was partially missed.
2025-11-15 16:58:03 -03:00