The project's README from github.com/svc-develop-team/so-vits-svc. As one markdown file: README.md.
This round of limited time update is coming to an end, the warehouse will enter the Archieve state, please know
✨ A studio that contains visible f0 editor, speaker mix timeline editor and other features (Where the Onnx models are used) : MoeVoiceStudio
✨ A fork with a greatly improved user interface: 34j/so-vits-svc-fork
✨ A client supports real-time conversion: w-okada/voice-changer
This project differs fundamentally from VITS, as it focuses on Singing Voice Conversion (SVC) rather than Text-to-Speech (TTS). In this project, TTS functionality is not supported, and VITS is incapable of performing SVC tasks. It's important to note that the models used in these two projects are not interchangeable or universally applicable.
The purpose of this project was to enable developers to have their beloved anime characters perform singing tasks. The developers' intention was to focus solely on fictional characters and avoid any involvement of real individuals, anything related to real individuals deviates from the developer's original intention.
This project is an open-source, offline endeavor, and all members of SvcDevelopTeam, as well as other developers and maintainers involved (hereinafter referred to as contributors), have no control over the project. The contributors have never provided any form of assistance to any organization or individual, including but not limited to dataset extraction, dataset processing, computing support, training support, inference, and so on. The contributors do not and cannot be aware of the purposes for which users utilize the project. Therefore, any AI models and synthesized audio produced through the training of this project are unrelated to the contributors. Any issues or consequences arising from their use are the sole responsibility of the user.
This project is run completely offline and does not collect any user information or gather user input data. Therefore, contributors to this project are not aware of all user input and models and therefore are not responsible for any user input.
This project serves as a framework only and does not possess speech synthesis functionality by itself. All functionalities require users to train the models independently. Furthermore, this project does not come bundled with any models, and any secondary distributed projects are independent of the contributors of this project.
The singing voice conversion model uses SoftVC content encoder to extract speech features from the source audio. These feature vectors are directly fed into VITS without the need for conversion to a text-based intermediate representation. As a result, the pitch and intonations of the original audio are preserved. Meanwhile, the vocoder was replaced with NSF HiFiGAN to solve the problem of sound interruption.
config.json file. Add the speech_encoder field to the "model" section as shown below: "model": {
.........
"ssl_dim": 256,
"n_speakers": 200,
"speech_encoder":"vec256l9"
}

Based on our testing, we have determined that the project runs stable on Python 3.8.9.
You need to select one encoder from the list below
vec768l12 and vec256l9 require the encoder
pretrain directoryOr download the following ContentVec, which is only 199MB in size but has the same effect:
checkpoint_best_legacy_500.pt and place it in the pretrain directory# contentvec
wget -P pretrain/ https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt -O checkpoint_best_legacy_500.pt
# Alternatively, you can manually download and place it in the hubert directory
pretrain directorywhisper-ppgwhisper-ppg-largepretrain directorypretrain directorypretrain directorywavlmbase+pretrain directorypretrain directoryPre-trained model files: G_0.pth D_0.pth
logs/44k directoryDiffusion model pretraining base model file: model_0.pt
logs/44k/diffusion directoryGet Sovits Pre-trained model from svc-develop-team(TBD) or anywhere else.
Diffusion model references Diffusion-SVC diffusion model. The pre-trained diffusion model is universal with the DDSP-SVC's. You can go to Diffusion-SVC's repo to get the pre-trained diffusion model.
While the pretrained model typically does not pose copyright concerns, it is essential to remain vigilant. It is advisable to consult with the author beforehand or carefully review the description to ascertain the permissible usage of the model. This helps ensure compliance with any specified guidelines or restrictions regarding its utilization.
If you are using the NSF-HIFIGAN enhancer or shallow diffusion, you will need to download the pre-trained NSF-HIFIGAN model.
pretrain/nsf_hifigan directory# nsf_hifigan
wget -P pretrain/ https://github.com/openvpi/vocoders/releases/download/nsf-hifigan-v1/nsf_hifigan_20221211.zip
unzip -od pretrain/nsf_hifigan pretrain/nsf_hifigan_20221211.zip
# Alternatively, you can manually download and place it in the pretrain/nsf_hifigan directory
# URL: https://github.com/openvpi/vocoders/releases/tag/nsf-hifigan-v1
If you are using the rmvpe F0 Predictor, you will need to download the pre-trained RMVPE model.
rmvpe.zip,and rename the model.pt file to rmvpe.pt and place it under the pretrain directory.pretrain directoryFCPE(Fast Context-base Pitch Estimator) is a dedicated F0 predictor designed for real-time voice conversion and will become the preferred F0 predictor for sovits real-time voice conversion in the future.(The paper is being written)
If you are using the fcpe F0 Predictor, you will need to download the pre-trained FCPE model.
pretrain directorySimply place the dataset in the dataset_raw directory with the following file structure:
dataset_raw
├───speaker0
│ ├───xxx1-xxx1.wav
│ ├───...
│ └───Lxx-0xx8.wav
└───speaker1
├───xx2-0xxx2.wav
├───...
└───xxx7-xxx007.wav
There are no specific restrictions on the format of the name for each audio file (naming conventions such as 000001.wav to 999999.wav are also valid), but the file type must be `WAV``.
You can customize the speaker's name as showed below:
dataset_raw
└───suijiSUI
├───1.wav
├───...
└───25788785-20221210-200143-856_01_(Vocals)_0_0.wav
To avoid video memory overflow during training or pre-processing, it is recommended to limit the length of audio clips. Cutting the audio to a length of "5s - 15s" is more recommended. Slightly longer times are acceptable, however, excessively long clips may cause problems such as torch.cuda.OutOfMemoryError.
To facilitate the slicing process, you can use audio-slicer-GUI or audio-slicer-CLI
In general, only the Minimum Interval needs to be adjusted. For spoken audio, the default value usually suffices, while for singing audio, it can be adjusted to around 100 or even 50, depending on the specific requirements.
After slicing, it is recommended to remove any audio clips that are excessively long or too short.
If you are using whisper-ppg encoder for training, the audio clips must shorter than 30s.
python resample.py
Although this project has resample.py scripts for resampling, mono and loudness matching, the default loudness matching is to match to 0db. This can cause damage to the sound quality. While python's loudness matching package pyloudnorm does not limit the level, this can lead to sonic boom. Therefore, it is recommended to consider using professional sound processing software, such as adobe audition for loudness matching. If you are already using other software for loudness matching, add the parameter -skip_loudnorm to the run command:
python resample.py --skip_loudnorm
python preprocess_flist_config.py --speech_encoder vec768l12
speech_encoder has the following options
vec768l12
vec256l9
hubertsoft
whisper-ppg
cnhubertlarge
dphubert
whisper-ppg-large
wavlmbase+
If the speech_encoder argument is omitted, the default value is vec768l12
Use loudness embedding
Add --vol_aug if you want to enable loudness embedding:
python preprocess_flist_config.py --speech_encoder vec768l12 --vol_aug
After enabling loudness embedding, the trained model will match the loudness of the input source; otherwise, it will match the loudness of the training set.
keep_ckpts: Keep the the the number of previous models during training. Set to 0 to keep them all. Default is 3.
all_in_mem: Load all dataset to RAM. It can be enabled when the disk IO of some platforms is too low and the system memory is much larger than your dataset.
batch_size: The amount of data loaded to the GPU for a single training session can be adjusted to a size lower than the GPU memory capacity.
vocoder_name: Select a vocoder. The default is nsf-hifigan.
cache_all_data: Load all dataset to RAM. It can be enabled when the disk IO of some platforms is too low and the system memory is much larger than your dataset.
duration: The duration of the audio slicing during training, can be adjusted according to the size of the video memory, Note: this value must be less than the minimum time of the audio in the training set!
batch_size: The amount of data loaded to the GPU for a single training session can be adjusted to a size lower than the video memory capacity.
timesteps: The total number of steps in the diffusion model, which defaults to 1000.
k_step_max: Training can only train k_step_max step diffusion to save training time, note that the value must be less than timesteps, 0 is to train the entire diffusion model, Note: if you do not train the entire diffusion model will not be able to use only_diffusion!
nsf-hifigan
nsf-snake-hifigan
python preprocess_hubert_f0.py --f0_predictor dio
f0_predictor has the following options
crepe
dio
pm
harvest
rmvpe
fcpe
If the training set is too noisy,it is recommended to use crepe to handle f0
If the f0_predictor parameter is omitted, the default value is rmvpe
If you want shallow diffusion (optional), you need to add the --use_diff parameter, for example:
python preprocess_hubert_f0.py --f0_predictor dio --use_diff
Speed Up preprocess
If your dataset is pretty large,you can increase the param --num_processes like that:
python preprocess_hubert_f0.py --f0_predictor dio --num_processes 8
All the worker will be assigned to different GPU if you have more than one GPUs.
After completing the above steps, the dataset directory will contain the preprocessed data, and the dataset_raw folder can be deleted.
python train.py -c configs/config.json -m 44k
If the shallow diffusion function is needed, the diffusion model needs to be trained. The diffusion model training method is as follows:
python train_diff.py -c configs/diffusion.yaml
During training, the model files will be saved to logs/44k, and the diffusion model will be saved to logs/44k/diffusion
# Example
python inference_main.py -m "logs/44k/G_30400.pth" -c "configs/config.json" -n "君の知らない物語-src.wav" -t 0 -s "nen"
Required parameters:
-m | --model_path: path to the model.-c | --config_path: path to the configuration file.-n | --clean_names: a list of wav file names located in the raw folder.-t | --trans: pitch shift, supports positive and negative (semitone) values.-s | --spk_list: Select the speaker ID to use for conversion.-cl | --clip: Forced audio clipping, set to 0 to disable(default), setting it to a non-zero value (duration in seconds) to enable.Optional parameters: see the next section
-lg | --linear_gradient: The cross fade length of two audio slices in seconds. If there is a discontinuous voice after forced slicing, you can adjust this value. Otherwise, it is recommended to use the default value of 0.-f0p | --f0_predictor: Select a F0 predictor, options are