Skip to content

Commit 39981da

Browse files
committed
Added Hindi support
#15
1 parent aed8360 commit 39981da

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

F5TTS.py

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
class F5TTSCreate:
3131
voice_reg = re.compile(r"\{([^\}]+)\}")
32-
model_types = ["F5", "F5-JP", "F5-FR", "E2"]
32+
model_types = ["F5", "F5-HI", "F5-JP", "F5-FR", "E2"]
3333
vocoder_types = ["vocos", "bigvgan"]
3434
tooltip_seed = "Seed. -1 = random"
3535

@@ -87,6 +87,7 @@ def load_voice(ref_audio, ref_text):
8787
def get_model_funcs(self):
8888
return {
8989
"F5": self.load_f5_model,
90+
"F5-HI": self.load_f5_model_hi,
9091
"F5-JP": self.load_f5_model_jp,
9192
"F5-FR": self.load_f5_model_fr,
9293
"E2": self.load_e2_model,
@@ -170,13 +171,29 @@ def cached_path(self, url):
170171
return None
171172
return str(cached_path(url)) # noqa E501
172173

173-
def load_f5_model_url(self, url, vocoder_name, vocab_url=None):
174-
vocoder = self.load_vocoder(vocoder_name)
175-
model_cls = DiT
174+
def load_f5_model_hi(self, vocoder):
176175
model_cfg = dict(
177-
dim=1024, depth=22, heads=16,
176+
dim=768, depth=18, heads=12,
178177
ff_mult=2, text_dim=512, conv_layers=4
179178
)
179+
return self.load_f5_model_url(
180+
"hf://SPRINGLab/F5-Hindi-24KHz/model_2500000.safetensors",
181+
"vocos",
182+
"hf://SPRINGLab/F5-Hindi-24KHz/vocab.txt",
183+
model_cfg=model_cfg,
184+
)
185+
186+
def load_f5_model_url(
187+
self, url, vocoder_name, vocab_url=None, model_cfg=None
188+
):
189+
vocoder = self.load_vocoder(vocoder_name)
190+
model_cls = DiT
191+
if model_cfg is None:
192+
model_cfg = dict(
193+
dim=1024, depth=22, heads=16,
194+
ff_mult=2, text_dim=512, conv_layers=4
195+
)
196+
180197
ckpt_file = str(self.cached_path(url)) # noqa E501
181198

182199
if vocab_url is None:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "comfyui-f5-tts"
33
description = "Text to speech with F5-TTS"
4-
version = "1.0.8"
4+
version = "1.0.9"
55
license = {text = "MIT License"}
66

77
[project.urls]

0 commit comments

Comments
 (0)