Views
No views yet
pip install outetts --upgradellama-cpp-python manually. Installation Guideexllamav2 manually. Installation Guide1import outetts
2
3# Configure the model
4model_config = outetts.HFModelConfig_v1(
5 model_path="OuteAI/OuteTTS-0.2-500M",
6 language="en", # Supported languages in v0.2: en, zh, ja, ko
7)
8
9# Initialize the interface
10interface = outetts.InterfaceHF(model_version="0.2", cfg=model_config)
11
12# Print available default speakers
13interface.print_default_speakers()
14
15# Load a default speaker
16speaker = interface.load_default_speaker(name="male_1")
17
18# Generate speech
19output = interface.generate(
20 text="Speech synthesis is the artificial production of human speech.",
21 temperature=0.1,
22 repetition_penalty=1.1,
23 max_length=4096,
24
25 # Optional: Use a speaker profile for consistent voice characteristics
26 # Without a speaker profile, the model will generate a voice with random characteristics
27 speaker=speaker,
28)
29
30# Save the generated speech to a file
31output.save("output.wav")
32
33# Optional: Play the generated audio
34# output.play()1import outetts
2
3model_config = outetts.HFModelConfig_v1(
4 model_path="OuteAI/OuteTTS-0.2-500M",
5 language="en", # Supported languages in v0.2: en, zh, ja, ko
6)
7
8interface = outetts.InterfaceHF(model_version="0.2", cfg=model_config)1import outetts
2
3model_config = outetts.GGUFModelConfig_v1(
4 model_path="local/path/to/model.gguf",
5 language="en", # Supported languages in v0.2: en, zh, ja, ko
6 n_gpu_layers=0,
7)
8
9interface = outetts.InterfaceGGUF(model_version="0.2", cfg=model_config)1import outetts
2
3model_config = outetts.EXL2ModelConfig_v1(
4 model_path="local/path/to/model",
5 language="en", # Supported languages in v0.2: en, zh, ja, ko
6)
7
8interface = outetts.InterfaceEXL2(model_version="0.2", cfg=model_config)1speaker = interface.create_speaker(
2 audio_path="path/to/audio/file.wav",
3
4 # If transcript is not provided, it will be automatically transcribed using Whisper
5 transcript=None, # Set to None to use Whisper for transcription
6
7 whisper_model="turbo", # Optional: specify Whisper model (default: "turbo")
8 whisper_device=None, # Optional: specify device for Whisper (default: None)
9)1# Save speaker profile
2interface.save_speaker(speaker, "speaker.json")
3
4# Load speaker profile
5speaker = interface.load_speaker("speaker.json")1# Print available default speakers
2interface.print_default_speakers()
3# Load a default speaker
4speaker = interface.load_default_speaker(name="male_1")1output = interface.generate(
2 text="Speech synthesis is the artificial production of human speech.",
3 temperature=0.1,
4 repetition_penalty=1.1,
5 max_length=4096,
6 speaker=speaker, # Optional: speaker profile
7)
8
9output.save("output.wav")
10# Optional: Play the audio
11# output.play()1model_config = outetts.HFModelConfig_v1(
2 model_path="OuteAI/OuteTTS-0.2-500M",
3 language="en",
4 dtype=torch.bfloat16,
5 additional_model_config={
6 'attn_implementation': "flash_attention_2"
7 }
8)temperature in the generate function to refine the expressive quality and consistency of the synthesized voice.