diff --git a/config.json b/config.json index 5730b3b..de99ac8 100644 --- a/config.json +++ b/config.json @@ -1,22 +1 @@ -{ - "activate": true, - "autoplay": true, - "branding": "AllTalk ", - "narrator_enabled": false, - "deepspeed_activate": false, - "delete_output_wavs": "Disabled", - "ip_address": "127.0.0.1", - "language": "English", - "low_vram": false, - "model_loaded": true, - "model_name": "tts_models/multilingual/multi-dataset/xtts_v2", - "narrator_voice": "female_02.wav", - "output_folder_wav": "extensions/alltalk_tts/outputs/", - "port_number": "7851", - "remove_trailing_dots": true, - "show_text": true, - "tts_method_api_local": false, - "tts_method_api_tts": false, - "tts_method_xtts_local": true, - "voice": "female_01.wav" -} \ No newline at end of file +{"activate": true, "autoplay": true, "branding": "AllTalk ", "narrator_enabled": false, "deepspeed_activate": false, "delete_output_wavs": "Disabled", "ip_address": "127.0.0.1", "language": "English", "low_vram": false, "local_temperature": "0.7", "local_repetition_penalty": "10.0", "model_loaded": true, "model_name": "tts_models/multilingual/multi-dataset/xtts_v2", "narrator_voice": "female_01.wav", "output_folder_wav": "extensions/alltalk_tts/outputs/", "port_number": "7851", "remove_trailing_dots": false, "show_text": true, "tts_method_api_local": false, "tts_method_api_tts": false, "tts_method_xtts_local": true, "voice": "female_01.wav"} \ No newline at end of file diff --git a/templates/generate_form.html b/templates/generate_form.html index 62e493e..6573355 100644 --- a/templates/generate_form.html +++ b/templates/generate_form.html @@ -18,13 +18,15 @@ margin-bottom: 10px; } - h1, h2, h3 { + h1, + h2, + h3 { text-decoration: underline; margin-bottom: 10px; } form { - max-width: 800px; + max-width: 975px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); @@ -67,12 +69,18 @@ font-size: 12px; grid-column: span 4; } - .warning { - grid-column: span 4; /* Span all 4 columns */ - text-align: center; /* Center-align the text */ - color: red; /* Adjusted color for emphasis */ - font-weight: bold; /* Make the text bold */ - margin-top: 10px; /* Add some space between the button and the warning */ + + .warning { + grid-column: span 4; + /* Span all 4 columns */ + text-align: center; + /* Center-align the text */ + color: red; + /* Adjusted color for emphasis */ + font-weight: bold; + /* Make the text bold */ + margin-top: 10px; + /* Add some space between the button and the warning */ } @@ -100,39 +108,39 @@ - + - - + + - + - - + + + - - + + + + + + - - + + @@ -186,8 +208,18 @@ - -{{ modeldownload_model_path }} + + {{ + modeldownload_model_path }} + + + + + + + @@ -198,24 +230,31 @@ -
- - -
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
- -

WARNING: Changing RED items or setting DeepSpeed to True on a system without DeepSpeed installed, may cause errors.

+ +

WARNING: Changing RED items or setting DeepSpeed to True on a system without DeepSpeed installed, + may cause errors.

- + \ No newline at end of file diff --git a/tts_server.py b/tts_server.py index 5abdb8f..89d701f 100644 --- a/tts_server.py +++ b/tts_server.py @@ -436,11 +436,11 @@ async def generate_audio(text, voice, language, output_file): language, gpt_cond_latent=gpt_cond_latent, speaker_embedding=speaker_embedding, - temperature=model.config.temperature, - length_penalty=model.config.length_penalty, - repetition_penalty=model.config.repetition_penalty, - top_k=model.config.top_k, - top_p=model.config.top_p, + temperature=float(params["local_temperature"]), + length_penalty=float(model.config.length_penalty), + repetition_penalty=float(params["local_repetition_penalty"]), + top_k=int(model.config.top_k), # Convert to int if necessary + top_p=float(model.config.top_p), enable_text_splitting=True, ) torchaudio.save(output_file, torch.tensor(out["wav"]).unsqueeze(0), 24000) @@ -453,9 +453,9 @@ async def generate_audio(text, voice, language, output_file): file_path=output_file, speaker_wav=[f"{this_dir}/voices/{voice}"], language=language, - temperature=model.config.temperature, + temperature=float(params["local_temperature"]), length_penalty=model.config.length_penalty, - repetition_penalty=model.config.repetition_penalty, + repetition_penalty=float(params["local_repetition_penalty"]), top_k=model.config.top_k, top_p=model.config.top_p, ) @@ -552,6 +552,8 @@ async def update_settings( delete_output_wavs: str = Form(...), ip_address: str = Form(...), language: str = Form(...), + local_temperature: str = Form(...), + local_repetition_penalty: str = Form(...), low_vram: bool = Form(...), model_loaded: bool = Form(...), model_name: str = Form(...), @@ -572,6 +574,8 @@ async def update_settings( data["delete_output_wavs"] = delete_output_wavs data["ip_address"] = ip_address data["language"] = language + data["local_temperature"] = local_temperature + data["local_repetition_penalty"] = local_repetition_penalty data["low_vram"] = low_vram data["model_loaded"] = model_loaded data["model_name"] = model_name @@ -705,13 +709,14 @@ simple_webpage = """

If you are looking for your Text generation webUI webpage, try visiting http://127.0.0.1:7860.

Text generation webUI documentation and wiki https://github.com/oobabooga/text-generation-webui/wiki.

- +

Table of Contents

Back to top of page

- + + +

Local Model Temperature and Repetition Settings

+

Caution: It is recommended not to modify these settings unless you fully comprehend their effects. A general overview is provided below for reference.

+

Note: Any changes to these two settings won't take effect until you restart AllTalk/Text generation webUI.

+ +

These settings only affect API Local and XTTSv2 Local methods.

+ +

Repetition Penalty:

+

In the context of text-to-speech (TTS), the Repetition Penalty (e.g., "local_repetition_penalty") influences how the model handles the repetition of sounds, phonemes, or intonation patterns. Here's how it works:

+ + +

Temperature:

+

In the context of text-to-speech (TTS), the Temperature (e.g., "local_temperature") influences the randomness of the generated speech. Here's how it affects the output:

+ + +

Temperature and Repetition Settings Examples:

+ + + +

Default Values for XTTSv2 version 2.0.2:

+ +

In the XTTSv2 version 2.0.2 model, the default factory values are:

+ + + +

The temperature has been set at 0.70 here though, as it often produces a slightly better result (in my estimation).

+ +

The default settings for any model are usually provided in the config.json file that comes wtih the model and this file can be found within the folder where the model is stored.

+

These default values are carefully chosen to offer a reasonable starting point for users, and adjustments can be made based on individual preferences and use cases. However, it's important to note that changing these settings or setting them to extremes may result in unexpected outcomes. Setting extremely high or low values, especially without a good understanding of their effects, may lead to flat-sounding output or very strange-sounding output. It's advisable to experiment with adjustments incrementally and observe the impact on the generated speech to find a balance that suits your desired outcome.

+

Back to top of page

+

Low VRAM Overview:

The Low VRAM option is a crucial feature designed to enhance performance under constrained Video Random Access Memory (VRAM) conditions, as the TTS models require 2GB-3GB of VRAM to run effectively. This feature strategically manages the relocation of the Text-to-Speech (TTS) model between your system's Random Access Memory (RAM) and VRAM, moving it between the two on the fly.

Note: An Nvidia Graphics card is required for LowVRAM, as you will be using system memory for the models otherwise.

@@ -943,6 +1008,8 @@ simple_webpage = """ "ip_address:" "127.0.0.1", Specifies the default IP address for the web server.
"language:" "English", Specifies the default language to use for TTS.
"low_vram:" false, Controls whether the Low VRAM option is enabled or disabled.
+ "local_temperature:" "0.70", Sets the temperature to use with the API Local and XTTSv2 Local methods.
+ "local_repetition_penalty:" "10.0", Sets the repetition penalty to use with the API Local and XTTSv2 Local methods.
"model_loaded:" true, Used within the code, do not change.
"model_name:" "tts_models/multilingual/multi-dataset/xtts_v2", Specifies the model that the "API TTS" method will use for TTS generation.
"narrator_enabled:" "female_02.wav", Specifies the default narrator voice to use for TTS.