Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 799a457

Browse files
committed
Version 3.0.12
Fix F5-TTS model switching and improve initialization messages - Fixed F5-TTS model cache not reloading when changing model names - Added F5-TTS availability checking to initialization messages - Improved F5-TTS model loading to only check matching local folders - Removed redundant SRT success messages (only show on actual issues) - Enhanced error handling for missing F5-TTS dependencies
1 parent ce0f9a4 commit 799a457

12 files changed

Lines changed: 153 additions & 52 deletions

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.0.12] - 2025-07-16
9+
10+
### Added
11+
12+
- Added F5-TTS availability checking to initialization messages
13+
14+
### Fixed
15+
16+
- Fix F5-TTS model switching and improve initialization messages
17+
- Fixed F5-TTS model cache not reloading when changing model names
18+
- Removed redundant SRT success messages (only show on actual issues)
19+
- Enhanced error handling for missing F5-TTS dependencies
20+
21+
### Changed
22+
23+
- Improved F5-TTS model loading to only check matching local folders
824
## [3.0.11] - 2025-07-16
925

1026
### Removed

README.md

Lines changed: 48 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,26 @@
66
[![Forks][forks-shield]][forks-url]
77
[![Dynamic TOML Badge][version-shield]][version-url]
88

9-
# ComfyUI ChatterBox SRT Voice (diogod) v3.0.11
9+
# ComfyUI ChatterBox SRT Voice (diogod) v3.0.12
1010

1111
*This is a refactored node, originally created by [ShmuelRonen](https://github.com/ShmuelRonen/ComfyUI_ChatterBox_Voice).*
1212

13+
<div align="center">
14+
<img src="images/AllNodesShowcase.png" alt="ComfyUI ChatterBox Voice Nodes Showcase" />
15+
</div>
16+
1317
An unofficial ComfyUI custom node integration for High-quality Text-to-Speech and Voice Conversion nodes for ComfyUI using ResembleAI's ChatterboxTTS with unlimited text length and with a node specially made for dealing with SRT timings.
1418

15-
## 🆕 What's New in v3.0+
19+
## 🆕 What's New in my Project?
1620

1721
### SRT Timing and TTS Node
18-
![SRT Node Screenshot](images/srt.png)
22+
23+
<img title="" src="images/srt.png" alt="SRT Node Screenshot" width="500" data-align="center">
1924

2025
The **"ChatterBox SRT Voice TTS"** node allows TTS generation by processing SRT content (SubRip Subtitle) files, ensuring precise timing and synchronization with your audio.
2126

2227
**Key SRT Features:**
28+
2329
* **SRT style Processing**: Uses SRT style to generate TTS, aligning audio with subtitle timings
2430
* **`smart_natural` Timing Mode**: Intelligent shifting logic that prevents overlaps and ensures natural speech flow
2531
* **`Adjusted_SRT` Output**: Provides actual timings for generated audio for accurate post-processing
@@ -32,16 +38,25 @@ For comprehensive technical information, refer to the [SRT_IMPLEMENTATION.md](do
3238

3339
</details>
3440

35-
### F5-TTS Integration and Audio Analyzer
36-
![F5-TTS and Audio Analyzer](images/f5_tts_audio_analyzer_screenshot.png)
37-
> 📸 **Placeholder image** - Screenshot coming soon
41+
### 🆕 F5-TTS Integration and 🆕 Audio Analyzer
42+
43+
<img title="" src="images/waveanalgif.gif" alt="Audio Wave gif" width="500" data-align="center">
3844

3945
* **F5-TTS Voice Synthesis**: High-quality voice cloning with reference audio + text
4046
* **Audio Wave Analyzer**: Interactive waveform visualization for precise timing extraction
4147
* **Multi-language Support**: English, German, Spanish, French, Japanese models
42-
* **Speech Editing Workflows**: Advanced F5-TTS editing capabilities
48+
* **Speech Editing Workflows**: Advanced F5-TTS editing capabilities
49+
50+
## 🎥 Demo Video
51+
52+
<a href="https://youtu.be/VyOawMrCB1g?si=7BubljRhsudGqG3s">
53+
<img src="https://img.youtube.com/vi/VyOawMrCB1g/maxresdefault.jpg" width="400" alt="ChatterBox SRT Voice Demo">
54+
</a>
55+
56+
**[▶️ Watch Full Demo](https://youtu.be/VyOawMrCB1g?si=7BubljRhsudGqG3s)**
57+
58+
### [ShmuelRonen](https://github.com/ShmuelRonen/ComfyUI_ChatterBox_Voice) ChatterBox TTS Nodes
4359

44-
### Enhanced ChatterBox TTS
4560
<div align="center">
4661
<img src="https://github.com/user-attachments/assets/4197818c-8093-4da4-abd5-577943ac902c" width="45%" alt="ChatterBox TTS Nodes" />
4762
<img src="https://github.com/user-attachments/assets/701c219b-12ff-4567-b414-e58560594ffe" width="45%" alt="ChatterBox Voice Capture" />
@@ -51,14 +66,6 @@ For comprehensive technical information, refer to the [SRT_IMPLEMENTATION.md](do
5166
* **Enhanced Chunking**: Intelligent text splitting with multiple combination methods
5267
* **Unlimited Text Length**: No character limits with smart processing
5368

54-
## 🎥 Demo Video
55-
56-
<a href="https://youtu.be/VyOawMrCB1g?si=7BubljRhsudGqG3s">
57-
<img src="https://img.youtube.com/vi/VyOawMrCB1g/maxresdefault.jpg" width="400" alt="ChatterBox SRT Voice Demo">
58-
</a>
59-
60-
**[▶️ Watch Full Demo](https://youtu.be/VyOawMrCB1g?si=7BubljRhsudGqG3s)**
61-
6269
## Features
6370

6471
- 🎤 **ChatterBox TTS** - Generate speech from text with optional voice cloning
@@ -78,17 +85,20 @@ For comprehensive technical information, refer to the [SRT_IMPLEMENTATION.md](do
7885
**Get running in 5 minutes:**
7986

8087
1. **Clone & Install**
88+
8189
```bash
8290
cd ComfyUI/custom_nodes
8391
git clone https://github.com/diodiogod/ComfyUI_ChatterBox_SRT_Voice.git
8492
pip install -r ComfyUI_ChatterBox_SRT_Voice/requirements.txt
8593
```
8694

8795
2. **Download Models** (Required)
96+
8897
- Download from [HuggingFace ChatterBox](https://huggingface.co/ResembleAI/chatterbox/tree/main)
8998
- Place in `ComfyUI/models/chatterbox/`
9099

91100
3. **Try a Workflow**
101+
92102
- Download: [ChatterBox Integration Workflow](example_workflows/Chatterbox%20integration.json)
93103
- Drag into ComfyUI and start generating!
94104

@@ -181,26 +191,29 @@ ComfyUI/models/F5-TTS/
181191

182192
**Available F5-TTS Models:**
183193

184-
| Model | Language | Download | Size |
185-
|-------|----------|----------|------|
186-
| **F5TTS_Base** | English | [HuggingFace](https://huggingface.co/SWivid/F5-TTS/tree/main/F5TTS_Base) | ~1.2GB |
187-
| **F5TTS_v1_Base** | English (v1) | [HuggingFace](https://huggingface.co/SWivid/F5-TTS/tree/main/F5TTS_v1_Base) | ~1.2GB |
188-
| **E2TTS_Base** | English (E2-TTS) | [HuggingFace](https://huggingface.co/SWivid/E2-TTS/tree/main/E2TTS_Base) | ~1.2GB |
189-
| **F5-DE** | German | [HuggingFace](https://huggingface.co/aihpi/F5-TTS-German) | ~1.2GB |
190-
| **F5-ES** | Spanish | [HuggingFace](https://huggingface.co/jpgallegoar/F5-Spanish) | ~1.2GB |
191-
| **F5-FR** | French | [HuggingFace](https://huggingface.co/RASPIAUDIO/F5-French-MixedSpeakers-reduced) | ~1.2GB |
192-
| **F5-JP** | Japanese | [HuggingFace](https://huggingface.co/Jmica/F5TTS) | ~1.2GB |
194+
| Model | Language | Download | Size |
195+
| ----------------- | ---------------- | -------------------------------------------------------------------------------- | ------ |
196+
| **F5TTS_Base** | English | [HuggingFace](https://huggingface.co/SWivid/F5-TTS/tree/main/F5TTS_Base) | ~1.2GB |
197+
| **F5TTS_v1_Base** | English (v1) | [HuggingFace](https://huggingface.co/SWivid/F5-TTS/tree/main/F5TTS_v1_Base) | ~1.2GB |
198+
| **E2TTS_Base** | English (E2-TTS) | [HuggingFace](https://huggingface.co/SWivid/E2-TTS/tree/main/E2TTS_Base) | ~1.2GB |
199+
| **F5-DE** | German | [HuggingFace](https://huggingface.co/aihpi/F5-TTS-German) | ~1.2GB |
200+
| **F5-ES** | Spanish | [HuggingFace](https://huggingface.co/jpgallegoar/F5-Spanish) | ~1.2GB |
201+
| **F5-FR** | French | [HuggingFace](https://huggingface.co/RASPIAUDIO/F5-French-MixedSpeakers-reduced) | ~1.2GB |
202+
| **F5-JP** | Japanese | [HuggingFace](https://huggingface.co/Jmica/F5TTS) | ~1.2GB |
193203

194204
**Vocoder (Optional but Recommended):**
205+
195206
```
196207
ComfyUI/models/F5-TTS/vocos/
197208
├── config.yaml
198209
├── pytorch_model.bin
199210
└── vocab.txt
200211
```
212+
201213
Download from: [Vocos Mel-24kHz](https://huggingface.co/charactr/vocos-mel-24khz)
202214

203215
**Complete Folder Structure:**
216+
204217
```
205218
ComfyUI/models/F5-TTS/
206219
├── F5TTS_Base/
@@ -215,6 +228,7 @@ ComfyUI/models/F5-TTS/
215228
```
216229

217230
**Required Files for Each Model:**
231+
218232
- `model_XXXXXX.safetensors` - The main model weights
219233
- `vocab.txt` - Vocabulary/tokenizer file (download from same HuggingFace repo)
220234

@@ -238,6 +252,7 @@ ComfyUI/models/voices/
238252
```
239253

240254
**Voice Reference Requirements:**
255+
241256
- **Audio files**: WAV format, 5-30 seconds, clean speech, 24kHz recommended
242257
- **Text files**: Exact transcription of what's spoken in the audio file
243258
- **Naming**: `filename.wav` + `filename.reference.txt` (preferred) or `filename.txt` (fallback)
@@ -360,17 +375,17 @@ ComfyUI/models/voices/
360375

361376
### Available Workflows
362377

363-
| Workflow | Description | Files |
364-
|----------|-------------|-------|
365-
| **ChatterBox SRT** | SRT subtitle timing and TTS generation | [📁 JSON](example_workflows/Chatterbox%20SRT.json) [🖼️ Preview](example_workflows/Chatterbox%20SRT.jpg) |
366-
| **ChatterBox Integration** | General ChatterBox TTS and Voice Conversion | [📁 JSON](example_workflows/Chatterbox%20integration.json) [🖼️ Preview](example_workflows/Chatterbox%20integration.jpg) |
378+
| Workflow | Description | Files |
379+
| -------------------------- | ------------------------------------------- | ---------------------------------------------------------- |
380+
| **ChatterBox SRT** | SRT subtitle timing and TTS generation | [📁 JSON](example_workflows/Chatterbox%20SRT.json) |
381+
| **ChatterBox Integration** | General ChatterBox TTS and Voice Conversion | [📁 JSON](example_workflows/Chatterbox%20integration.json) |
367382

368383
### Coming Soon (Placeholders)
369384

370-
| Workflow | Description | Status |
371-
|----------|-------------|--------|
372-
| **Audio Wave Analyzer + F5 Speech Edit** | Interactive waveform analysis for F5-TTS speech editing | [📁 JSON](example_workflows/👄%20F5-TTS%20Speech%20Editor%20Workflow.json) • 🖼️ **Screenshot Coming Soon** |
373-
| **F5-TTS SRT Workflows** | F5-TTS integration with SRT subtitle processing | 🚧 **Coming Soon** |
385+
| Workflow | Description | Status |
386+
| ---------------------------------------- | ------------------------------------------------------- | -------------------------------------------------------------------------- |
387+
| **Audio Wave Analyzer + F5 Speech Edit** | Interactive waveform analysis for F5-TTS speech editing | [📁 JSON](example_workflows/👄%20F5-TTS%20Speech%20Editor%20Workflow.json) |
388+
| **F5-TTS SRT Workflows** | F5-TTS integration with SRT subtitle processing | 🚧 **Coming Soon** |
374389

375390
> **Note:** To use workflows, download the `.json` files and drag them directly into your ComfyUI interface. The workflows will automatically load with the proper node connections.
376391

chatterbox_srt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55

66
# Version info
7-
__version__ = "3.0.11"
7+
__version__ = "3.0.12"
88
__author__ = "Diogod"
99

1010
# Import the new SRT modules

core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55

66
# Version info
7-
__version__ = "3.0.11"
7+
__version__ = "3.0.12"
88
__author__ = "Diogod"
99

1010
# Make imports available at package level

core/f5tts_model_manager.py

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,15 @@ def _check_f5tts_availability(self):
3939
except ImportError:
4040
self.f5tts_available = False
4141

42-
def find_f5tts_models(self) -> List[Tuple[str, Optional[str]]]:
42+
def find_f5tts_models(self, model_name: str = None) -> List[Tuple[str, Optional[str]]]:
4343
"""
4444
Find F5-TTS model files in order of priority:
45-
1. ComfyUI models/F5-TTS/ directory
45+
1. ComfyUI models/F5-TTS/ directory (only matching model name if specified)
4646
2. HuggingFace download
4747
48+
Args:
49+
model_name: Optional specific model name to search for
50+
4851
Returns:
4952
List of tuples containing (source_type, path) in priority order
5053
"""
@@ -56,6 +59,10 @@ def find_f5tts_models(self) -> List[Tuple[str, Optional[str]]]:
5659
for item in os.listdir(comfyui_f5tts_path):
5760
item_path = os.path.join(comfyui_f5tts_path, item)
5861
if os.path.isdir(item_path):
62+
# If specific model name provided, only check matching folders
63+
if model_name and item.lower() != model_name.lower():
64+
continue
65+
5966
# Check if it contains model files
6067
has_model = False
6168
for ext in [".safetensors", ".pt"]:
@@ -111,12 +118,21 @@ def load_f5tts_model(self, model_name: str = "F5TTS_Base", device: str = "auto",
111118
if device == "auto":
112119
device = "cuda" if torch.cuda.is_available() else "cpu"
113120

114-
# Get available model paths
115-
model_paths = self.find_f5tts_models()
121+
# Get available model paths for specific model
122+
model_paths = self.find_f5tts_models(model_name)
116123

117124
model_loaded = False
118125
last_error = None
119126

127+
# Check if this model should be available locally
128+
local_model_expected = False
129+
comfyui_f5tts_path = os.path.join(folder_paths.models_dir, "F5-TTS")
130+
if os.path.exists(comfyui_f5tts_path):
131+
for item in os.listdir(comfyui_f5tts_path):
132+
if item.lower() == model_name.lower() or model_name.lower() in item.lower():
133+
local_model_expected = True
134+
break
135+
120136
for source, path in model_paths:
121137
try:
122138
cache_key = self.get_f5tts_model_cache_key(model_name, device, source, path)
@@ -133,6 +149,18 @@ def load_f5tts_model(self, model_name: str = "F5TTS_Base", device: str = "auto",
133149
from chatterbox.f5tts import ChatterBoxF5TTS
134150
model = ChatterBoxF5TTS.from_local(path, device, model_name)
135151
elif source == "huggingface":
152+
# If a local model was expected but failed, don't fallback to HuggingFace
153+
if local_model_expected and last_error:
154+
print(f"❌ Model '{model_name}' found in local directory but failed to load")
155+
print(f"❌ Fallback to HuggingFace disabled for locally expected models")
156+
raise RuntimeError(f"Model '{model_name}' exists locally but failed to load. Please check the model files or use a different model.")
157+
158+
# Check if model is available on HuggingFace
159+
from chatterbox.f5tts.f5tts import F5TTS_MODELS
160+
if model_name not in F5TTS_MODELS:
161+
print(f"❌ Model '{model_name}' not available on HuggingFace")
162+
raise RuntimeError(f"Model '{model_name}' is not available on HuggingFace. Please install it locally or use a different model.")
163+
136164
from chatterbox.f5tts import ChatterBoxF5TTS
137165
model = ChatterBoxF5TTS.from_pretrained(device, model_name)
138166
else:
@@ -168,9 +196,11 @@ def get_f5tts_model_source(self, model_name: str, device: str) -> Optional[str]:
168196
Returns:
169197
Model source string or None if not cached
170198
"""
171-
# Try to find in cache by checking different sources
172-
for source in ["comfyui", "huggingface"]:
173-
cache_key = self.get_f5tts_model_cache_key(model_name, device, source)
199+
# Try to find in cache by checking different sources with their paths
200+
model_paths = self.find_f5tts_models(model_name)
201+
202+
for source, path in model_paths:
203+
cache_key = self.get_f5tts_model_cache_key(model_name, device, source, path)
174204
if cache_key in self._f5tts_model_sources:
175205
return self._f5tts_model_sources[cache_key]
176206

core/import_manager.py

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def __init__(self, node_dir: Optional[str] = None, is_dev: bool = True):
3232
self.import_status: Dict[str, Dict[str, Any]] = {
3333
"chatterbox_tts": {"available": False, "source": None, "error": None},
3434
"chatterbox_vc": {"available": False, "source": None, "error": None},
35+
"f5tts": {"available": False, "source": None, "error": None},
3536
"srt_parser": {"available": False, "source": None, "error": None},
3637
"audio_timing": {"available": False, "source": None, "error": None},
3738
}
@@ -149,6 +150,41 @@ def import_chatterbox_vc(self) -> Tuple[bool, Optional[Any], str]:
149150
self._log_debug(f"❌ ChatterboxVC not available: {system_error}")
150151
return False, None, "none"
151152

153+
def import_f5tts(self) -> Tuple[bool, Any, str]:
154+
"""
155+
Import F5-TTS with fallback handling.
156+
157+
Returns:
158+
Tuple of (success, f5tts_module, source)
159+
"""
160+
module_key = "f5tts"
161+
162+
# Return cached if available
163+
if self.import_status[module_key]["available"]:
164+
return True, self.loaded_modules[module_key], self.import_status[module_key]["source"]
165+
166+
try:
167+
# Try to import F5-TTS API
168+
from f5_tts.api import F5TTS
169+
170+
self.loaded_modules[module_key] = F5TTS
171+
self.import_status[module_key] = {
172+
"available": True,
173+
"source": "system",
174+
"error": None
175+
}
176+
self._log_debug("✅ F5-TTS loaded from system package")
177+
return True, F5TTS, "system"
178+
179+
except ImportError as error:
180+
self.import_status[module_key] = {
181+
"available": False,
182+
"source": None,
183+
"error": str(error)
184+
}
185+
self._log_debug(f"❌ F5-TTS not available: {error}")
186+
return False, None, "none"
187+
152188
def import_srt_modules(self) -> Tuple[bool, Dict[str, Any], str]:
153189
"""
154190
Import SRT-related modules with multiple fallback strategies.
@@ -210,11 +246,11 @@ def import_srt_modules(self) -> Tuple[bool, Dict[str, Any], str]:
210246
"source": "direct_file",
211247
"error": None
212248
}
213-
self._log_debug("✅ SRT modules loaded from direct files")
249+
# SRT modules are bundled - no need to show success message
214250
return True, modules, "direct_file"
215251

216252
except Exception as file_error:
217-
self._log_debug(f"❌ Failed to load SRT from files: {file_error}")
253+
self._log_debug(f"❌ SRT modules failed to load (bundled files corrupted?): {file_error}")
218254

219255
# Strategy 2: Try bundled package import
220256
if os.path.exists(self.bundled_chatterbox_dir):
@@ -299,7 +335,7 @@ def import_srt_modules(self) -> Tuple[bool, Dict[str, Any], str]:
299335
"source": None,
300336
"error": f"All import strategies failed. Last error: {system_error}"
301337
}
302-
self._log_debug(f"❌ SRT modules not available: {system_error}")
338+
self._log_debug(f"❌ SRT modules critically failed to load: {system_error}")
303339
return False, self._create_dummy_srt_modules(), "none"
304340

305341
def _create_fallback_audio_timing(self) -> Dict[str, Any]:

core/model_manager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
# Try imports first to populate availability status
1515
tts_success, ChatterboxTTS, tts_source = import_manager.import_chatterbox_tts()
1616
vc_success, ChatterboxVC, vc_source = import_manager.import_chatterbox_vc()
17+
f5tts_success, F5TTS, f5tts_source = import_manager.import_f5tts()
1718

1819
# Set availability flags
1920
CHATTERBOX_TTS_AVAILABLE = tts_success
2021
CHATTERBOX_VC_AVAILABLE = vc_success
22+
F5TTS_AVAILABLE = f5tts_success
2123
USING_BUNDLED_CHATTERBOX = tts_source == "bundled" or vc_source == "bundled"
2224

2325

images/AllNodesShowcase.png

720 KB
Loading

images/waveanalgif.gif

8.35 MB
Loading

nodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Version and constants
2-
VERSION = "3.0.11"
2+
VERSION = "3.0.12"
33
IS_DEV = False # Set to False for release builds
44
VERSION_DISPLAY = f"v{VERSION}" + (" (dev)" if IS_DEV else "")
55
SEPARATOR = "=" * 70

0 commit comments

Comments
 (0)