[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"readme:luxtts":3},"\u003Ch1>LuxTTS\u003C\u002Fh1>\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002FYatharthS\u002FLuxTTS\" rel=\"nofollow ugc noopener\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97%20Hugging%20Face-Model-FFD21E\" alt=\"Hugging Face Model\" \u002F>\n  \u003C\u002Fa>\n   \n  \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FYatharthS\u002FLuxTTS\" rel=\"nofollow ugc noopener\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97%20Hugging%20Face-Space-blue\" alt=\"Hugging Face Space\" \u002F>\n  \u003C\u002Fa>\n   \n  \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1cDaxtbSDLRmu6tRV_781Of_GSjHSo1Cu?usp=sharing\" rel=\"nofollow ugc noopener\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FColab-Notebook-F9AB00?logo=googlecolab&amp;logoColor=white\" alt=\"Colab Notebook\" \u002F>\n  \u003C\u002Fa>\n\u003C\u002Fp>\u003Cp>LuxTTS is an lightweight zipvoice based text-to-speech model designed for high quality voice cloning and realistic generation at speeds exceeding 150x realtime.\u003C\u002Fp>\n\u003Cp>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fa3b57152-8d97-43ce-bd99-26dc9a145c29\" rel=\"nofollow ugc noopener\">https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fa3b57152-8d97-43ce-bd99-26dc9a145c29\u003C\u002Fa>\u003C\u002Fp>\n\u003Ch3>The main features are\u003C\u002Fh3>\n\u003Cul>\n\u003Cli>Voice cloning: SOTA voice cloning on par with models 10x larger.\u003C\u002Fli>\n\u003Cli>Clarity: Clear 48khz speech generation unlike most TTS models which are limited to 24khz.\u003C\u002Fli>\n\u003Cli>Speed: Reaches speeds of 150x realtime on a single GPU and faster then realtime on CPU's as well.\u003C\u002Fli>\n\u003Cli>Efficiency: Fits within 1gb vram meaning it can fit in any local gpu.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2>Usage\u003C\u002Fh2>\n\u003Cp>You can try it locally, colab, or spaces.\u003C\u002Fp>\n\u003Cp>\u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1cDaxtbSDLRmu6tRV_781Of_GSjHSo1Cu?usp=sharing\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\" alt=\"Open In Colab\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FYatharthS\u002FLuxTTS\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fhuggingface\u002Fbadges\u002Fresolve\u002Fmain\u002Fopen-in-hf-spaces-sm.svg\" alt=\"Open in Spaces\" \u002F>\u003C\u002Fa>\u003C\u002Fp>\n\u003Ch4>Simple installation:\u003C\u002Fh4>\n\u003Cpre>\u003Ccode>git clone https:\u002F\u002Fgithub.com\u002Fysharma3501\u002FLuxTTS.git\ncd LuxTTS\npip install -r requirements.txt\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch4>Load model:\u003C\u002Fh4>\n\u003Cpre>\u003Ccode class=\"language-python\">from zipvoice.luxvoice import LuxTTS\n\n# load model on GPU\nlux_tts = LuxTTS('YatharthS\u002FLuxTTS', device='cuda')\n\n# load model on CPU\n# lux_tts = LuxTTS('YatharthS\u002FLuxTTS', device='cpu', threads=2)\n\n# load model on MPS for macs\n# lux_tts = LuxTTS('YatharthS\u002FLuxTTS', device='mps')\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch4>Simple inference\u003C\u002Fh4>\n\u003Cpre>\u003Ccode class=\"language-python\">import soundfile as sf\nfrom IPython.display import Audio\n\ntext = \"Hey, what's up? I'm feeling really great if you ask me honestly!\"\n\n## change this to your reference file path, can be wav\u002Fmp3\nprompt_audio = 'audio_file.wav'\n\n## encode audio(takes 10s to init because of librosa first time)\nencoded_prompt = lux_tts.encode_prompt(prompt_audio, rms=0.01)\n\n## generate speech\nfinal_wav = lux_tts.generate_speech(text, encoded_prompt, num_steps=4)\n\n## save audio\nfinal_wav = final_wav.numpy().squeeze()\nsf.write('output.wav', final_wav, 48000)\n\n## display speech\nif display is not None:\n  display(Audio(final_wav, rate=48000))\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch4>Inference with sampling params:\u003C\u002Fh4>\n\u003Cpre>\u003Ccode class=\"language-python\">import soundfile as sf\nfrom IPython.display import Audio\n\ntext = \"Hey, what's up? I'm feeling really great if you ask me honestly!\"\n\n## change this to your reference file path, can be wav\u002Fmp3\nprompt_audio = 'audio_file.wav'\n\nrms = 0.01 ## higher makes it sound louder(0.01 or so recommended)\nt_shift = 0.9 ## sampling param, higher can sound better but worse WER\nnum_steps = 4 ## sampling param, higher sounds better but takes longer(3-4 is best for efficiency)\nspeed = 1.0 ## sampling param, controls speed of audio(lower=slower)\nreturn_smooth = False ## sampling param, makes it sound smoother possibly but less cleaner\nref_duration = 5 ## Setting it lower can speedup inference, set to 1000 if you find artifacts.\n\n## encode audio(takes 10s to init because of librosa first time)\nencoded_prompt = lux_tts.encode_prompt(prompt_audio, duration=ref_duration, rms=rms)\n\n## generate speech\nfinal_wav = lux_tts.generate_speech(text, encoded_prompt, num_steps=num_steps, t_shift=t_shift, speed=speed, return_smooth=return_smooth)\n\n## save audio\nfinal_wav = final_wav.numpy().squeeze()\nsf.write('output.wav', final_wav, 48000)\n\n## display speech\nif display is not None:\n  display(Audio(final_wav, rate=48000))\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>Tips\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>Please use at minimum a 3 se\u003C\u002Fli>\n\u003C\u002Ful>\n",1784240407533]