Commit Graph
17 Commits
Author SHA1 Message Date
diodiogod 273229976b Version 4.24.7
Fix CosyVoice3 narrator reference and interrupt handling

Implementation details:
- Restore connected opt_narrator resolution in unified text and SRT nodes
- Propagate connected reference text and character names through CosyVoice3 processing
- Add mid-generation interrupt polling for CosyVoice3
- Patch bundled Qwen3-ASR generate loop for reliable ComfyUI interrupts
- Mark vendored Qwen3-ASR interrupt logic as a TTS Audio Suite patch
2026-03-27 22:05:56 -03:00
diodiogod b13ec81872 Version 4.19.1
Add CosyVoice3 <restore> tag support

Technical implementation:
- Add extract_restore_tags_only() function to filter only restore tags
- Integrate EditPostProcessor into CosyVoice processor
- Preserve CosyVoice native paralinguistic tags (<breath>, <laughter>, etc.)
- Apply ChatterBox VC restoration after TTS generation
- Block Step Audio EditX emotion/style/speed/paralinguistic tags
2026-01-28 11:43:23 -03:00
diodiogod c85f93b5c7 Version 4.16.6
Fix CosyVoice3 character voice mode selection

Technical details:
- Clear reference_text when character has audio but no .txt file
- Force cross_lingual mode for characters without text transcripts
- Prevent zero_shot mode from using wrong voice characteristics
- Fix both processor and adapter character handling
- Fixes issue where characters without .txt used default narrator's text
2026-01-03 10:30:23 -03:00
diodiogod 7d9438ced1 Version 4.16.5
Fix CosyVoice3 PyYAML compatibility across all entry points

Technical details:
- Add max_depth patch to all CosyVoice import chains
- Patch engine wrapper, adapter, processor, SRT processor, and engine node
- Ensure yaml module is patched before any hyperpyyaml imports
- Addresses GitHub issue #220 more comprehensively
2026-01-03 10:21:18 -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 8e17e130b0 Fix CosyVoice SRT character switching and multi-line subtitle support
Major fixes:
- SRT processor now uses process_text() for proper character switching
- Multi-line subtitles now process all lines, not just the first
- Connected narrator now takes priority over character folder narrator
- Fixed model reload loop - only update config instead of cleanup/reinit
- Added character_mapping parameter to CosyVoice processor
- Fixed cross_lingual debug output to not show system prompt

Technical details:
- CosyVoice processor accepts optional character_mapping override
- SRT processor builds mapping with connected narrator prioritized
- Lines without character tags fall back to narrator voice
- Removed duplicate character parsing - delegated to processor
- Fixed update_config() to not destroy and recreate processor
- Changed cross_lingual print to show original text not formatted_text
2025-12-29 18:09:05 -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
diodiogod a58c68d575 Add parameter switching support to CosyVoice3
Implemented per-segment parameter overrides for seed and speed:
- Register CosyVoice in segment_parameters.py for seed and speed
- Apply segment.parameters using modular apply_segment_parameters()
- Extract segment_seed and segment_speed with fallback to node defaults
- Pass parameters through all generation paths (pause tags, chunking, direct)
- Add speed parameter to _generate_audio_segment() method
- Print parameter application message matching other engines

Supports inline tags like [Alice|seed:42|speed:1.5] with automatic
warnings for unsupported parameters via modular validation system.
2025-12-29 16:11:10 -03:00
diodiogod dbfe1872bc Don't prepend English language tags (CosyVoice default)
Only prepend language tags for non-English languages (zh, ja, ko).
English is CosyVoice's default, so no tag needed - prevents forcing
English mode on all text and allows auto-detection when appropriate.
2025-12-29 15:43:18 -03:00
diodiogod 7a6d6ca77d Add language switching support to CosyVoice processor
- Prepend CosyVoice native language tags (<|en|>, <|zh|>, <|ja|>, <|ko|>) based on segment language
- Integrate with unified language system using resolve_language_alias()
- Support both explicit [lang:] tags and character language defaults
- Validate manual language tags to avoid duplicates
- Only prepend if no valid CosyVoice language tag already present
2025-12-29 15:37:08 -03:00
diodiogod 828e27b45c Add character switching support to CosyVoice processor
- Configure character parser with available characters and aliases
- Extract character names from text tags dynamically
- Build character voice mapping with audio_only mode (text optional)
- Use lowercase character names for consistent mapping lookup
- Prioritize connected opt_narrator over character mapping for narrator
- Fallback to character mapping when no connected narrator
- Fix voice discovery to return full character_info for audio_only engines
- Fix wrapper tag conversion order (single tags first, then wrappers)
2025-12-29 15:05:07 -03:00
diodiogod 273677b8a9 Fix CosyVoice VRAM management and cache invalidation
- Add CosyVoiceWrapper.update_config() to propagate config changes to processor
- Pass use_fp16 parameter to adapter for proper audio cache key generation
- Create CosyVoiceHandler for proper component-level device management
  - Manually moves llm, flow, hift, campplus components to CPU/GPU
  - Properly frees VRAM when unloading (AutoModel lacks .to() method)
- Improve console warning formatting for length mismatch
  - Clean separation of warning from text content
  - Show character counts instead of full text dump

Fixes:
- Cache now invalidates when changing instruction/reference text
- Cache now invalidates when changing use_fp16 setting
- Unload Models button now properly frees ~3GB VRAM from CosyVoice
- Console output is cleaner and more organized
2025-12-29 09:27:54 -03:00
diodiogod 9ea7dc7243 Fix CosyVoice3 mode auto-detection and cache invalidation
- Add mode parameter to adapter.generate() signature to avoid **kwargs conflicts
- Include mode explicitly in cache key generation for proper invalidation
- Remove hardcoded mode from processor - let adapter auto-detect based on parameters
- Auto-detection logic:
  * instruct_text provided → instruct mode (ignores reference_text)
  * reference_text provided → zero_shot mode
  * neither provided → cross_lingual mode

Cache now properly invalidates when:
- Changing narrator (different speaker_audio hash)
- Adding/removing instruction (different instruct_text + mode change)
- Changing reference text (different reference_text)
- Changing generation mode

Fixes issue where instruction was ignored and zero_shot mode was always used
2025-12-29 08:28:15 -03:00
diodiogod d6ffa42cc7 CosyVoice3: Fix chunking method name and add mode detection debug
- Fix: chunk_text -> split_into_chunks in processor
- Add debug logging for mode detection in adapter
- Fix test file to use command-line args instead of hardcoded paths
2025-12-29 01:46:46 -03:00
diodiogod 4265a5e8c1 CosyVoice3: Complete implementation fixes and dependency cleanup
- Implement auto-mode detection (zero_shot/instruct/cross_lingual)
- Remove mode dropdown and reference_text from engine node
- Fix sample rate from 22050 Hz to 24000 Hz across all files
- Add paralinguistic tag conversion (<tag> to [tag]) via cosyvoice_special_tags.py
- Clean up requirements.txt (remove 13 unnecessary deps, keep only inflect)
- Update engine node tooltip with clear mode mutual exclusivity warning

All dependencies now properly handled by install.py except inflect (needed for text normalization)
2025-12-29 01:14:26 -03:00
tazztone 142a295189 opus4.5 test fixes 2025-12-19 13:14:06 +01:00
tazztone 84a10d3ee4 All CosyVoice3 integration phases complete! The engine is fully integrated with:
✅ Pause tags
✅ Character switching
✅ SRT support
✅ All timing modes
✅ Documentation
2025-12-18 09:48:52 +01:00