Integrate German F5-TTS model (HPI) with Juergen reference audio and RVC 300e refinement into WebUI and CLI
This commit is contained in:
1 parent
bf244d2c82
commit
651faa49a0
9 files changed
+2969
-116
No files matched your search
@@ -16,3 +16,6 @@ cleaned_dataset/
|
||||
*.pth
|
||||
*.index
|
||||
*.pt
|
||||
*.safetensors
|
||||
models/F5-TTS-German/*.safetensors
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
import os
|
||||
import requests
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
import time
|
||||
|
||||
URL = "https://huggingface.co/aihpi/F5-TTS-German/resolve/main/F5TTS_Base/model_420000.safetensors"
|
||||
OUT_PATH = r"C:\GitHub\VocoLoom\models\F5-TTS-German\model_420000.safetensors"
|
||||
NUM_WORKERS = 16
|
||||
|
||||
# Get direct download URL by following redirects
|
||||
session = requests.Session()
|
||||
r_head = session.head(URL, allow_redirects=True)
|
||||
download_url = r_head.url
|
||||
total_size = int(r_head.headers.get("Content-Length", 0))
|
||||
|
||||
print(f"Total size: {total_size / (1024*1024):.2f} MB")
|
||||
chunk_size = total_size // NUM_WORKERS
|
||||
|
||||
# Allocate empty file of total_size
|
||||
with open(OUT_PATH, "wb") as f:
|
||||
f.seek(total_size - 1)
|
||||
f.write(b"\0")
|
||||
|
||||
def download_range(idx):
|
||||
start = idx * chunk_size
|
||||
end = total_size - 1 if idx == NUM_WORKERS - 1 else (idx + 1) * chunk_size - 1
|
||||
headers = {"Range": f"bytes={start}-{end}"}
|
||||
resp = requests.get(download_url, headers=headers, stream=True)
|
||||
with open(OUT_PATH, "r+b") as f:
|
||||
f.seek(start)
|
||||
for chunk in resp.iter_content(chunk_size=1024*1024):
|
||||
if chunk:
|
||||
f.write(chunk)
|
||||
return idx
|
||||
|
||||
print(f"Downloading with {NUM_WORKERS} concurrent threads...")
|
||||
t0 = time.time()
|
||||
with ThreadPoolExecutor(max_workers=NUM_WORKERS) as executor:
|
||||
futures = [executor.submit(download_range, i) for i in range(NUM_WORKERS)]
|
||||
for f in futures:
|
||||
f.result()
|
||||
|
||||
dur = time.time() - t0
|
||||
print(f"Done in {dur:.1f}s! Average speed: {total_size / (1024*1024*dur):.2f} MB/s")
|
||||
@@ -0,0 +1 @@
|
||||
Frag mal ob du die Fotos vom Tobias bekommst. Wir haben keine gemacht. Aber nicht in die Gruppen rein senden! Der Kenny stellt es bloß wieder online!
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,64 @@
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
ref_audio = r"C:\GitHub\VocoLoom\real_juergen_short.wav"
|
||||
ref_text = "Soll mich aufregen? Eigentlich gar nicht. Lässt mich von der Sache her ein bisschen alles."
|
||||
gen_file = r"C:\GitHub\VocoLoom\gen_text_utf8.txt"
|
||||
|
||||
out_dir = r"C:\GitHub\VocoLoom"
|
||||
out_file = "juergen_german_clean_f5.wav"
|
||||
|
||||
cmd = [
|
||||
r"C:\GitHub\VocoLoom\.venv\Scripts\f5-tts_infer-cli.exe",
|
||||
"-m", "F5TTS_Base",
|
||||
"-p", r"C:\GitHub\VocoLoom\models\F5-TTS-German\model_420000.safetensors",
|
||||
"-v", r"C:\GitHub\VocoLoom\models\F5-TTS-German\vocab.txt",
|
||||
"-r", ref_audio,
|
||||
"-s", ref_text,
|
||||
"-f", gen_file,
|
||||
"-o", out_dir,
|
||||
"-w", out_file,
|
||||
"--device", "cuda",
|
||||
"--remove_silence"
|
||||
]
|
||||
|
||||
print("Starting F5-TTS German inference with Jürgen Seiferth reference audio...")
|
||||
res = subprocess.run(cmd)
|
||||
print("F5-TTS German finished with return code:", res.returncode)
|
||||
|
||||
f5_out = os.path.join(out_dir, out_file)
|
||||
if os.path.exists(f5_out):
|
||||
print("Now generating RVC refined version with Jürgen 300-epoch model...")
|
||||
os.chdir(r"C:\GitHub\VocoLoom\Applio")
|
||||
sys.path.insert(0, r"C:\GitHub\VocoLoom\Applio")
|
||||
from core import run_infer_script
|
||||
|
||||
rvc_out = os.path.join(out_dir, "juergen_german_clean_rvc.wav")
|
||||
run_infer_script(
|
||||
pitch=0,
|
||||
index_rate=0.40,
|
||||
volume_envelope=1.0,
|
||||
protect=0.33,
|
||||
f0_method="rmvpe",
|
||||
input_path=f5_out,
|
||||
output_path=rvc_out,
|
||||
pth_path=r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth_300e_7800s.pth",
|
||||
index_path=r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth.index",
|
||||
f0_autotune=False,
|
||||
f0_autotune_strength=1.0,
|
||||
proposed_pitch=False,
|
||||
proposed_pitch_threshold=155.0,
|
||||
export_format="WAV",
|
||||
embedder_model="contentvec",
|
||||
embedder_model_custom=None,
|
||||
formant_shifting=False,
|
||||
formant_qfrency=1.0,
|
||||
formant_timbre=1.0,
|
||||
sid=0,
|
||||
inference_engine=None,
|
||||
onnx_precision="auto",
|
||||
cleanup_mode="off",
|
||||
cleanup_strength=12
|
||||
)
|
||||
print("Done! Generated:", rvc_out)
|
||||
@@ -0,0 +1,62 @@
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
ref_audio = r"C:\GitHub\VocoLoom\real_juergen_short.wav"
|
||||
ref_text = "Soll ich mich aufregen? Eigentlich gar nicht. Lässt mich von der Sache her ein bisschen alles eiskalt."
|
||||
gen_text = "Frag mal ob du die Fotos vom Tobias bekommst. Wir haben keine gemacht. Aber nicht in die Gruppen rein senden! Der Kenny stellt es bloß wieder online!"
|
||||
|
||||
out_dir = r"C:\GitHub\VocoLoom"
|
||||
out_file = "juergen_f5_clone.wav"
|
||||
|
||||
cmd = [
|
||||
r"C:\GitHub\VocoLoom\.venv\Scripts\f5-tts_infer-cli.exe",
|
||||
"-r", ref_audio,
|
||||
"-s", ref_text,
|
||||
"-t", gen_text,
|
||||
"-o", out_dir,
|
||||
"-w", out_file,
|
||||
"--device", "cuda",
|
||||
"--remove_silence"
|
||||
]
|
||||
|
||||
print("Running F5-TTS Zero-Shot Voice Clone with Jürgen Seiferth reference audio...")
|
||||
res = subprocess.run(cmd)
|
||||
print("Returncode:", res.returncode)
|
||||
|
||||
# If successful, also run RVC polish
|
||||
f5_output_path = os.path.join(out_dir, out_file)
|
||||
if os.path.exists(f5_output_path):
|
||||
print("F5-TTS generated successfully! Now refining with 300-epoch RVC model...")
|
||||
os.chdir(r"C:\GitHub\VocoLoom\Applio")
|
||||
sys.path.insert(0, r"C:\GitHub\VocoLoom\Applio")
|
||||
from core import run_infer_script
|
||||
|
||||
rvc_refined_path = os.path.join(out_dir, "juergen_f5_rvc_perfected.wav")
|
||||
run_infer_script(
|
||||
pitch=0,
|
||||
index_rate=0.70,
|
||||
volume_envelope=1.0,
|
||||
protect=0.33,
|
||||
f0_method="rmvpe",
|
||||
input_path=f5_output_path,
|
||||
output_path=rvc_refined_path,
|
||||
pth_path=r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth_300e_7800s.pth",
|
||||
index_path=r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth.index",
|
||||
f0_autotune=False,
|
||||
f0_autotune_strength=1.0,
|
||||
proposed_pitch=False,
|
||||
proposed_pitch_threshold=155.0,
|
||||
export_format="WAV",
|
||||
embedder_model="contentvec",
|
||||
embedder_model_custom=None,
|
||||
formant_shifting=False,
|
||||
formant_qfrency=1.0,
|
||||
formant_timbre=1.0,
|
||||
sid=0,
|
||||
inference_engine=None,
|
||||
onnx_precision="auto",
|
||||
cleanup_mode="off",
|
||||
cleanup_strength=12
|
||||
)
|
||||
print("RVC refined audio generated at:", rvc_refined_path)
|
||||
@@ -0,0 +1,63 @@
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
ref_audio = r"C:\GitHub\VocoLoom\ref_juergen_platz.wav"
|
||||
ref_text = "Fertig Ballett oder Fertig Öl oder was? Was?"
|
||||
gen_file = r"C:\GitHub\VocoLoom\gen_text_utf8.txt"
|
||||
|
||||
out_dir = r"C:\GitHub\VocoLoom"
|
||||
out_file = "juergen_german_platz_f5.wav"
|
||||
|
||||
cmd = [
|
||||
r"C:\GitHub\VocoLoom\.venv\Scripts\f5-tts_infer-cli.exe",
|
||||
"-m", "F5TTS_Base",
|
||||
"-p", r"C:\GitHub\VocoLoom\models\F5-TTS-German\model_420000.safetensors",
|
||||
"-v", r"C:\GitHub\VocoLoom\models\F5-TTS-German\vocab.txt",
|
||||
"-r", ref_audio,
|
||||
"-s", ref_text,
|
||||
"-f", gen_file,
|
||||
"-o", out_dir,
|
||||
"-w", out_file,
|
||||
"--device", "cuda",
|
||||
"--remove_silence"
|
||||
]
|
||||
|
||||
print("Generating energetic Platz version...")
|
||||
res = subprocess.run(cmd)
|
||||
|
||||
f5_out = os.path.join(out_dir, out_file)
|
||||
if os.path.exists(f5_out):
|
||||
print("Refining with RVC...")
|
||||
os.chdir(r"C:\GitHub\VocoLoom\Applio")
|
||||
sys.path.insert(0, r"C:\GitHub\VocoLoom\Applio")
|
||||
from core import run_infer_script
|
||||
|
||||
rvc_out = os.path.join(out_dir, "juergen_german_platz_rvc.wav")
|
||||
run_infer_script(
|
||||
pitch=0,
|
||||
index_rate=0.40,
|
||||
volume_envelope=1.0,
|
||||
protect=0.33,
|
||||
f0_method="rmvpe",
|
||||
input_path=f5_out,
|
||||
output_path=rvc_out,
|
||||
pth_path=r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth_300e_7800s.pth",
|
||||
index_path=r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth.index",
|
||||
f0_autotune=False,
|
||||
f0_autotune_strength=1.0,
|
||||
proposed_pitch=False,
|
||||
proposed_pitch_threshold=155.0,
|
||||
export_format="WAV",
|
||||
embedder_model="contentvec",
|
||||
embedder_model_custom=None,
|
||||
formant_shifting=False,
|
||||
formant_qfrency=1.0,
|
||||
formant_timbre=1.0,
|
||||
sid=0,
|
||||
inference_engine=None,
|
||||
onnx_precision="auto",
|
||||
cleanup_mode="off",
|
||||
cleanup_strength=12
|
||||
)
|
||||
print("Done:", rvc_out)
|
||||
+93
-59
@@ -1,92 +1,126 @@
|
||||
import os
|
||||
import sys
|
||||
import argparse
|
||||
import subprocess
|
||||
|
||||
applio_dir = r"C:\GitHub\VocoLoom\Applio"
|
||||
sys.path.insert(0, applio_dir)
|
||||
os.chdir(applio_dir)
|
||||
BASE_DIR = r"C:\GitHub\VocoLoom"
|
||||
F5_CLI = r"C:\GitHub\VocoLoom\.venv\Scripts\f5-tts_infer-cli.exe"
|
||||
GERMAN_CKPT = r"C:\GitHub\VocoLoom\models\F5-TTS-German\model_420000.safetensors"
|
||||
GERMAN_VOCAB = r"C:\GitHub\VocoLoom\models\F5-TTS-German\vocab.txt"
|
||||
|
||||
from core import run_tts_script
|
||||
REF_LKW = r"C:\GitHub\VocoLoom\real_juergen_short.wav"
|
||||
REF_TEXT_LKW = "Soll mich aufregen? Eigentlich gar nicht. Lässt mich von der Sache her ein bisschen alles."
|
||||
|
||||
REF_PLATZ = r"C:\GitHub\VocoLoom\ref_juergen_platz.wav"
|
||||
REF_TEXT_PLATZ = "Fertig Ballett oder Fertig Öl oder was? Was?"
|
||||
|
||||
MODEL_PATH = r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth_300e_7800s.pth"
|
||||
INDEX_PATH = r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth.index"
|
||||
OUTPUT_DIR = r"C:\GitHub\VocoLoom"
|
||||
|
||||
def speak(text, mode="platz", output_file="juergen_speech.wav", play_audio=False):
|
||||
def speak(text, mode="platz", output_file="juergen_speech.wav", use_rvc=True, play_audio=False):
|
||||
"""
|
||||
Synthesizes speech in Jürgen Seiferth's voice.
|
||||
mode: 'platz' (impulsiv, schnell, energisch) oder 'lkw' (stoisch, ruhig, brummig)
|
||||
Synthesizes speech in Jürgen Seiferth's voice using German F5-TTS + 300e RVC.
|
||||
mode: 'platz' (impulsiv, energisch) oder 'lkw' (ruhig, stoisch)
|
||||
"""
|
||||
if mode == "lkw":
|
||||
base_voice = "de-DE-ConradNeural"
|
||||
tts_rate = 5
|
||||
pitch = 0
|
||||
else: # platz
|
||||
base_voice = "de-DE-KillianNeural"
|
||||
tts_rate = 12
|
||||
pitch = 0
|
||||
if mode == "platz":
|
||||
ref_audio = REF_PLATZ
|
||||
ref_text = REF_TEXT_PLATZ
|
||||
else:
|
||||
ref_audio = REF_LKW
|
||||
ref_text = REF_TEXT_LKW
|
||||
|
||||
out_tts = os.path.join(OUTPUT_DIR, "temp_tts_base.wav")
|
||||
out_rvc = os.path.join(OUTPUT_DIR, output_file)
|
||||
temp_text_file = os.path.join(BASE_DIR, "temp_gen_text.txt")
|
||||
with open(temp_text_file, "w", encoding="utf-8") as f:
|
||||
f.write(text.strip())
|
||||
|
||||
print(f"\n[VocoLoom] Jürgen Seiferth spricht (Modus: {mode.upper()}):")
|
||||
print(f'"{text}"')
|
||||
f5_out = os.path.join(BASE_DIR, "temp_f5_speech.wav")
|
||||
final_out = os.path.join(BASE_DIR, output_file)
|
||||
|
||||
run_tts_script(
|
||||
tts_file="",
|
||||
tts_text=text,
|
||||
tts_voice=base_voice,
|
||||
tts_rate=tts_rate,
|
||||
pitch=pitch,
|
||||
index_rate=0.75,
|
||||
volume_envelope=1.0,
|
||||
protect=0.33,
|
||||
f0_method="rmvpe",
|
||||
output_tts_path=out_tts,
|
||||
output_rvc_path=out_rvc,
|
||||
pth_path=MODEL_PATH,
|
||||
index_path=INDEX_PATH,
|
||||
f0_autotune=False,
|
||||
f0_autotune_strength=1.0,
|
||||
proposed_pitch=False,
|
||||
proposed_pitch_threshold=155.0,
|
||||
export_format="WAV",
|
||||
embedder_model="contentvec",
|
||||
embedder_model_custom=None,
|
||||
sid=0,
|
||||
formant_shifting=False,
|
||||
formant_qfrency=1.0,
|
||||
formant_timbre=1.0,
|
||||
cleanup_mode="off",
|
||||
cleanup_strength=12,
|
||||
)
|
||||
print(f"\n[VocoLoom] Generiere Jürgens Stimme (Modus: {mode.upper()})...")
|
||||
print(f'Text: "{text}"')
|
||||
|
||||
print(f"[OK] Fertig generiert: {out_rvc}")
|
||||
cmd = [
|
||||
F5_CLI,
|
||||
"-m", "F5TTS_Base",
|
||||
"-p", GERMAN_CKPT,
|
||||
"-v", GERMAN_VOCAB,
|
||||
"-r", ref_audio,
|
||||
"-s", ref_text,
|
||||
"-f", temp_text_file,
|
||||
"-o", BASE_DIR,
|
||||
"-w", "temp_f5_speech.wav",
|
||||
"--device", "cuda",
|
||||
"--remove_silence"
|
||||
]
|
||||
subprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
|
||||
if not os.path.exists(f5_out):
|
||||
print("Fehler bei der F5-TTS Generierung.")
|
||||
return None
|
||||
|
||||
if use_rvc:
|
||||
print("[VocoLoom] Wende 300-Epochen RVC Stimmenveredelung an...")
|
||||
os.chdir(r"C:\GitHub\VocoLoom\Applio")
|
||||
sys.path.insert(0, r"C:\GitHub\VocoLoom\Applio")
|
||||
from core import run_infer_script
|
||||
|
||||
run_infer_script(
|
||||
pitch=0,
|
||||
index_rate=0.40,
|
||||
volume_envelope=1.0,
|
||||
protect=0.33,
|
||||
f0_method="rmvpe",
|
||||
input_path=f5_out,
|
||||
output_path=final_out,
|
||||
pth_path=MODEL_PATH,
|
||||
index_path=INDEX_PATH,
|
||||
f0_autotune=False,
|
||||
f0_autotune_strength=1.0,
|
||||
proposed_pitch=False,
|
||||
proposed_pitch_threshold=155.0,
|
||||
export_format="WAV",
|
||||
embedder_model="contentvec",
|
||||
embedder_model_custom=None,
|
||||
formant_shifting=False,
|
||||
formant_qfrency=1.0,
|
||||
formant_timbre=1.0,
|
||||
sid=0,
|
||||
inference_engine=None,
|
||||
onnx_precision="auto",
|
||||
cleanup_mode="off",
|
||||
cleanup_strength=12
|
||||
)
|
||||
else:
|
||||
import shutil
|
||||
shutil.copyfile(f5_out, final_out)
|
||||
|
||||
print(f"[OK] Fertig: {final_out}")
|
||||
|
||||
if play_audio:
|
||||
try:
|
||||
import winsound
|
||||
winsound.PlaySound(out_rvc, winsound.SND_FILENAME)
|
||||
winsound.PlaySound(final_out, winsound.SND_FILENAME)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return out_rvc
|
||||
return final_out
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Lass Jürgen Seiferth beliebigen Text sprechen!")
|
||||
parser.add_argument("text", nargs="?", default=None, help="Der Text, den Jürgen sprechen soll")
|
||||
parser.add_argument("--mode", choices=["platz", "lkw"], default="platz", help="Stimm-Modus ('platz' = energisch/schnell, 'lkw' = ruhig/brummig)")
|
||||
parser.add_argument("--play", action="store_true", help="Audio nach Generierung sofort abspielen")
|
||||
parser.add_argument("--out", default="juergen_speech.wav", help="Dateiname für die Ausgabe-WAV")
|
||||
parser = argparse.ArgumentParser(description="Lass Jürgen Seiferth sprechen (F5-TTS German + RVC)!")
|
||||
parser.add_argument("text", nargs="?", default=None, help="Der Satz für Jürgen")
|
||||
parser.add_argument("--mode", choices=["platz", "lkw"], default="platz", help="Stimmung ('platz' = impulsiv/laut, 'lkw' = ruhig/brummig)")
|
||||
parser.add_argument("--no-rvc", action="store_true", help="Nur F5-TTS ohne RVC Veredelung")
|
||||
parser.add_argument("--play", action="store_true", help="Sofort abspielen")
|
||||
parser.add_argument("--out", default="juergen_speech.wav", help="Ausgabedatei")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.text:
|
||||
print("=== VocoLoom: Jürgen Seiferth Text-to-Speech ===")
|
||||
print("=== VocoLoom: Jürgen Seiferth Voice Generator ===")
|
||||
user_input = input("Gib den Satz ein, den Jürgen sprechen soll:\n> ")
|
||||
if not user_input.strip():
|
||||
print("Kein Text eingegeben. Beende.")
|
||||
sys.exit(0)
|
||||
speak(user_input, mode=args.mode, output_file=args.out, play_audio=True)
|
||||
speak(user_input, mode=args.mode, output_file=args.out, use_rvc=not args.no_rvc, play_audio=True)
|
||||
else:
|
||||
speak(args.text, mode=args.mode, output_file=args.out, play_audio=args.play)
|
||||
speak(args.text, mode=args.mode, output_file=args.out, use_rvc=not args.no_rvc, play_audio=args.play)
|
||||
@@ -1,65 +1,101 @@
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
import gradio as gr
|
||||
|
||||
applio_dir = r"C:\GitHub\VocoLoom\Applio"
|
||||
sys.path.insert(0, applio_dir)
|
||||
os.chdir(applio_dir)
|
||||
BASE_DIR = r"C:\GitHub\VocoLoom"
|
||||
F5_CLI = r"C:\GitHub\VocoLoom\.venv\Scripts\f5-tts_infer-cli.exe"
|
||||
GERMAN_CKPT = r"C:\GitHub\VocoLoom\models\F5-TTS-German\model_420000.safetensors"
|
||||
GERMAN_VOCAB = r"C:\GitHub\VocoLoom\models\F5-TTS-German\vocab.txt"
|
||||
|
||||
from core import run_tts_script, run_infer_script
|
||||
REF_LKW = r"C:\GitHub\VocoLoom\real_juergen_short.wav"
|
||||
REF_TEXT_LKW = "Soll mich aufregen? Eigentlich gar nicht. Lässt mich von der Sache her ein bisschen alles."
|
||||
|
||||
REF_PLATZ = r"C:\GitHub\VocoLoom\ref_juergen_platz.wav"
|
||||
REF_TEXT_PLATZ = "Fertig Ballett oder Fertig Öl oder was? Was?"
|
||||
|
||||
MODEL_PATH = r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth_300e_7800s.pth"
|
||||
INDEX_PATH = r"C:\GitHub\VocoLoom\Applio\logs\Juergen_Seiferth\Juergen_Seiferth.index"
|
||||
OUTPUT_DIR = r"C:\GitHub\VocoLoom"
|
||||
|
||||
def tts_generate(text, mode, speed_boost):
|
||||
def tts_generate(text, mood, use_rvc):
|
||||
if not text.strip():
|
||||
return None, "Bitte gib einen Text ein."
|
||||
|
||||
rate = 12 if mode == "platz" else 5
|
||||
if speed_boost:
|
||||
rate += 10
|
||||
ref_audio = REF_PLATZ if mood == "platz" else REF_LKW
|
||||
ref_text = REF_TEXT_PLATZ if mood == "platz" else REF_TEXT_LKW
|
||||
|
||||
base_voice = "de-DE-KillianNeural" if mode == "platz" else "de-DE-ConradNeural"
|
||||
out_tts = os.path.join(OUTPUT_DIR, "temp_web_tts.wav")
|
||||
out_rvc = os.path.join(OUTPUT_DIR, "temp_web_juergen.wav")
|
||||
temp_text_file = os.path.join(BASE_DIR, "web_gen_text.txt")
|
||||
with open(temp_text_file, "w", encoding="utf-8") as f:
|
||||
f.write(text.strip())
|
||||
|
||||
run_tts_script(
|
||||
tts_file="",
|
||||
tts_text=text,
|
||||
tts_voice=base_voice,
|
||||
tts_rate=rate,
|
||||
pitch=0,
|
||||
index_rate=0.75,
|
||||
volume_envelope=1.0,
|
||||
protect=0.33,
|
||||
f0_method="rmvpe",
|
||||
output_tts_path=out_tts,
|
||||
output_rvc_path=out_rvc,
|
||||
pth_path=MODEL_PATH,
|
||||
index_path=INDEX_PATH,
|
||||
f0_autotune=False,
|
||||
f0_autotune_strength=1.0,
|
||||
proposed_pitch=False,
|
||||
proposed_pitch_threshold=155.0,
|
||||
export_format="WAV",
|
||||
embedder_model="contentvec",
|
||||
embedder_model_custom=None,
|
||||
sid=0,
|
||||
formant_shifting=False,
|
||||
formant_qfrency=1.0,
|
||||
formant_timbre=1.0,
|
||||
cleanup_mode="off",
|
||||
cleanup_strength=12,
|
||||
)
|
||||
f5_out = os.path.join(BASE_DIR, "web_f5_output.wav")
|
||||
final_out = os.path.join(BASE_DIR, "web_juergen_speech.wav")
|
||||
|
||||
return out_rvc, f"Erfolgreich generiert ({mode.upper()}, +{rate}% Tempo)"
|
||||
cmd = [
|
||||
F5_CLI,
|
||||
"-m", "F5TTS_Base",
|
||||
"-p", GERMAN_CKPT,
|
||||
"-v", GERMAN_VOCAB,
|
||||
"-r", ref_audio,
|
||||
"-s", ref_text,
|
||||
"-f", temp_text_file,
|
||||
"-o", BASE_DIR,
|
||||
"-w", "web_f5_output.wav",
|
||||
"--device", "cuda",
|
||||
"--remove_silence"
|
||||
]
|
||||
subprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
|
||||
if not os.path.exists(f5_out):
|
||||
return None, "Fehler bei der F5-TTS Synthese."
|
||||
|
||||
if use_rvc:
|
||||
os.chdir(r"C:\GitHub\VocoLoom\Applio")
|
||||
sys.path.insert(0, r"C:\GitHub\VocoLoom\Applio")
|
||||
from core import run_infer_script
|
||||
|
||||
run_infer_script(
|
||||
pitch=0,
|
||||
index_rate=0.40,
|
||||
volume_envelope=1.0,
|
||||
protect=0.33,
|
||||
f0_method="rmvpe",
|
||||
input_path=f5_out,
|
||||
output_path=final_out,
|
||||
pth_path=MODEL_PATH,
|
||||
index_path=INDEX_PATH,
|
||||
f0_autotune=False,
|
||||
f0_autotune_strength=1.0,
|
||||
proposed_pitch=False,
|
||||
proposed_pitch_threshold=155.0,
|
||||
export_format="WAV",
|
||||
embedder_model="contentvec",
|
||||
embedder_model_custom=None,
|
||||
formant_shifting=False,
|
||||
formant_qfrency=1.0,
|
||||
formant_timbre=1.0,
|
||||
sid=0,
|
||||
inference_engine=None,
|
||||
onnx_precision="auto",
|
||||
cleanup_mode="off",
|
||||
cleanup_strength=12
|
||||
)
|
||||
else:
|
||||
import shutil
|
||||
shutil.copyfile(f5_out, final_out)
|
||||
|
||||
status_msg = f"Erfolgreich generiert ({'🔥 Impulsiv / Auf dem Platz' if mood == 'platz' else '☕ Ruhig / LKW'}) mit {'RVC 300e Veredelung' if use_rvc else 'Pure F5-TTS'}."
|
||||
return final_out, status_msg
|
||||
|
||||
def vc_convert(audio_path):
|
||||
if not audio_path:
|
||||
return None, "Bitte nimm Audio auf oder lade eine Datei hoch."
|
||||
|
||||
out_rvc = os.path.join(OUTPUT_DIR, "temp_web_vc_juergen.wav")
|
||||
os.chdir(r"C:\GitHub\VocoLoom\Applio")
|
||||
sys.path.insert(0, r"C:\GitHub\VocoLoom\Applio")
|
||||
from core import run_infer_script
|
||||
|
||||
out_rvc = os.path.join(BASE_DIR, "web_vc_juergen.wav")
|
||||
run_infer_script(
|
||||
pitch=0,
|
||||
index_rate=0.75,
|
||||
@@ -86,11 +122,11 @@ def vc_convert(audio_path):
|
||||
cleanup_mode="off",
|
||||
cleanup_strength=12,
|
||||
)
|
||||
return out_rvc, "Stimme erfolgreich in Jürgen Seiferth umgewandelt!"
|
||||
return out_rvc, "Stimme erfolgreich 1:1 in Jürgen Seiferth umgewandelt!"
|
||||
|
||||
with gr.Blocks(title="VocoLoom - Jürgen Seiferth Voice Clone") as demo:
|
||||
gr.Markdown("# 🎡 VocoLoom: Jürgen Seiferth (1995 Original)")
|
||||
gr.Markdown("*Breakdance-Schausteller-Stimme geklont aus MDR 'Die Welt ist unser Feld' (300 Epochen RVC + FAISS Index)*")
|
||||
gr.Markdown("*Breakdance-Schausteller-Stimme geklont aus MDR 'Die Welt ist unser Feld' (F5-TTS German + 300 Epochen RVC)*")
|
||||
|
||||
with gr.Tab("✍️ Text-to-Speech (Schreiben -> Jürgen spricht)"):
|
||||
with gr.Row():
|
||||
@@ -99,26 +135,27 @@ with gr.Blocks(title="VocoLoom - Jürgen Seiferth Voice Clone") as demo:
|
||||
label="Text eingeben",
|
||||
placeholder="Schreib hier, was Jürgen sagen soll...",
|
||||
lines=3,
|
||||
value="Frag ma, ob de die Fotos vom Tobias kriegst! Wir ham keene gemacht. Aber nich in die Gruppen neistellen... der Kenny stellt's bloß wieder online!"
|
||||
value="Frag mal ob du die Fotos vom Tobias bekommst. Wir haben keine gemacht. Aber nicht in die Gruppen rein senden! Der Kenny stellt es bloß wieder online!"
|
||||
)
|
||||
with gr.Row():
|
||||
mode_radio = gr.Radio(
|
||||
mood_radio = gr.Radio(
|
||||
choices=[("🔥 Impulsiv / Auf dem Platz", "platz"), ("☕ Ruhig / LKW-Fahrerkabine", "lkw")],
|
||||
value="platz",
|
||||
label="Stimmung / Modus"
|
||||
label="Stimmung / Sprechweise"
|
||||
)
|
||||
speed_check = gr.Checkbox(label="Schnelleres Sprechtempo (+10%)", value=False)
|
||||
|
||||
rvc_toggle = gr.Checkbox(label="300-Epochen RVC Veredelung (Empfohlen)", value=True)
|
||||
|
||||
generate_btn = gr.Button("🎙️ Jürgen sprechen lassen", variant="primary")
|
||||
|
||||
gr.Examples(
|
||||
examples=[
|
||||
["Frag ma, ob de die Fotos vom Tobias kriegst! Wir ham keene gemacht. Aber nich in die Gruppen neistellen... der Kenny stellt's bloß wieder online!", "platz"],
|
||||
["Fertig Ballett oder was?! Mensch, da guckt man nicht zu, da packt man an!", "platz"],
|
||||
["Was soll mich aufregen? Eigentlich gar nicht. Von der Sache her lässt mich alles eiskalt. Hauptsache angekommen, stimmt's?!", "lkw"],
|
||||
["Pass mal auf! Was nicht ganz läuft so wie ich das will, das wird so gemacht, damit das läuft!", "platz"],
|
||||
["Frag mal ob du die Fotos vom Tobias bekommst. Wir haben keine gemacht. Aber nicht in die Gruppen rein senden! Der Kenny stellt es bloß wieder online!", "platz", True],
|
||||
["Frag ma, ob de die Fotos vom Tobias kriegst! Wir ham keene gemacht. Aber nich in die Gruppen neistellen... der Kenny stellt's bloß wieder online!", "platz", True],
|
||||
["Fertig Ballett oder was?! Mensch, da guckt man nicht zu, da packt man an!", "platz", True],
|
||||
["Soll mich aufregen? Eigentlich gar nicht. Von der Sache her lässt mich alles eiskalt. Hauptsache angekommen!", "lkw", True],
|
||||
["Pass mal auf! Was nicht ganz läuft so wie ich das will, das wird so gemacht, damit das läuft!", "platz", True],
|
||||
],
|
||||
inputs=[text_input, mode_radio]
|
||||
inputs=[text_input, mood_radio, rvc_toggle]
|
||||
)
|
||||
|
||||
with gr.Column(scale=1):
|
||||
@@ -127,12 +164,12 @@ with gr.Blocks(title="VocoLoom - Jürgen Seiferth Voice Clone") as demo:
|
||||
|
||||
generate_btn.click(
|
||||
tts_generate,
|
||||
inputs=[text_input, mode_radio, speed_check],
|
||||
inputs=[text_input, mood_radio, rvc_toggle],
|
||||
outputs=[audio_output, status_box]
|
||||
)
|
||||
|
||||
with gr.Tab("🎤 Voice Changer (Mikrofon / Audio -> Jürgen)"):
|
||||
gr.Markdown("Sprich selbst ins Mikrofon (mit Dialekt/Betonung) oder lade Audio hoch – das Modell wandelt deine Stimme 1:1 in Jürgen Seiferth um!")
|
||||
gr.Markdown("Sprich selbst ins Mikrofon (mit Dialekt & Betonung) oder lade Audio hoch – das Modell wandelt deine Stimme 1:1 in Jürgen Seiferth um!")
|
||||
with gr.Row():
|
||||
with gr.Column():
|
||||
audio_input = gr.Audio(label="Deine Stimme aufnehmen oder hochladen", type="filepath")
|
||||
@@ -148,4 +185,4 @@ with gr.Blocks(title="VocoLoom - Jürgen Seiferth Voice Clone") as demo:
|
||||
)
|
||||
|
||||
if __name__ == "__main__":
|
||||
demo.launch(server_name="127.0.0.1", server_port=7860, inbrowser=False)
|
||||
demo.launch(server_name="127.0.0.1", server_port=7860, inbrowser=False, allowed_paths=[BASE_DIR])
|
||||
Reference in new issue
Block a user