Skip to content

Commit 8ebacb8

Browse files
committed
Add vocoder selection.
#24
1 parent a821662 commit 8ebacb8

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

F5TTS.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
)
2727
sys.path.pop()
2828

29+
Install.check_install()
30+
2931

3032
class F5TTSCreate:
3133
voice_reg = re.compile(r"\{([^\}]+)\}")
@@ -299,7 +301,9 @@ def INPUT_TYPES(s):
299301
"tooltip": F5TTSCreate.tooltip_seed,
300302
}),
301303
"model": (model_types,),
302-
# "vocoder": (F5TTSCreate.vocoder_types,),
304+
"vocoder": (F5TTSCreate.vocoder_types, {
305+
"tooltip": "Most models are usally vocos",
306+
}),
303307
},
304308
}
305309

@@ -342,9 +346,10 @@ def remove_wave_file(self):
342346
print(e)
343347

344348
def create(
345-
self, sample_audio, sample_text, speech, seed=-1, model="F5"
349+
self,
350+
sample_audio, sample_text,
351+
speech, seed=-1, model="F5", vocoder="vocos"
346352
):
347-
vocoder = "vocos"
348353
try:
349354
main_voice = self.load_voice_from_input(sample_audio, sample_text)
350355

@@ -362,13 +367,14 @@ def create(
362367
return (audio, )
363368

364369
@classmethod
365-
def IS_CHANGED(s, sample_audio, sample_text, speech, seed, model):
370+
def IS_CHANGED(s, sample_audio, sample_text, speech, seed, model, vocoder):
366371
m = hashlib.sha256()
367372
m.update(sample_text)
368373
m.update(sample_audio)
369374
m.update(speech)
370375
m.update(seed)
371376
m.update(model)
377+
m.update(vocoder)
372378
return m.digest().hex()
373379

374380

@@ -404,7 +410,9 @@ def INPUT_TYPES(s):
404410
"tooltip": F5TTSCreate.tooltip_seed,
405411
}),
406412
"model": (model_types,),
407-
# "vocoder": (F5TTSCreate.vocoder_types,),
413+
"vocoder": (F5TTSCreate.vocoder_types, {
414+
"tooltip": "Most models are usally vocos",
415+
}),
408416
}
409417
}
410418

@@ -463,8 +471,8 @@ def load_voices_from_files(self, sample, voice_names):
463471
voices[voice_name] = self.load_voice_from_file(sample_file)
464472
return voices
465473

466-
def create(self, sample, speech, seed=-2, model="F5"):
467-
vocoder = "vocos"
474+
def create(self, sample, speech, seed=-2, model="F5", vocoder="vocos"):
475+
# vocoder = "vocos"
468476
# Install.check_install()
469477
main_voice = self.load_voice_from_file(sample)
470478

@@ -488,7 +496,7 @@ def create(self, sample, speech, seed=-2, model="F5"):
488496
return (audio, )
489497

490498
@classmethod
491-
def IS_CHANGED(s, sample, speech, seed, model):
499+
def IS_CHANGED(s, sample, speech, seed, model, vocoder):
492500
m = hashlib.sha256()
493501
audio_path = folder_paths.get_annotated_filepath(sample)
494502
audio_txt_path = F5TTSCreate.get_txt_file_path(audio_path)
@@ -500,4 +508,5 @@ def IS_CHANGED(s, sample, speech, seed, model):
500508
m.update(speech)
501509
m.update(seed)
502510
m.update(model)
511+
m.update(vocoder)
503512
return m.digest().hex()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You can use the examples here...
1717
* [Workflow with all features](examples/F5TTS-test-all.json)
1818

1919

20-
### Custom models...
20+
### Other languages / custom models...
2121

2222
You can put the model & vocab txt files into "models/checkpoints/F5-TTS" folder if you have any more models. Name the .txt vocab file and the .pt model file the same names. Press "refresh" and it should appear under the "model" selection.
2323

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.9"
4+
version = "1.0.10"
55
license = {text = "MIT License"}
66

77
[project.urls]

0 commit comments

Comments
 (0)