SVC Voice Changer#
so-vits-svc is one of simpler voice changers to set up on Linux. It can run on CPU as well as Nvidia and AMD GPUs.
This is an exert of their original readme off the GitHub repository, intended for people who are as bad with Python as I am.
Setup#
❗ ImportantDisclaimer: There’s probably a better way. I’m not good at Python, or machine learning.
Prerequisites#
Install the following packages using your distro’s package manager:
- Python 3
- pip for Python 3
- venv (virtual environment) for Python 3
Create virtualenv#
In this example, we will create the virtual environment inside ~/.var/venv/. Feel free to change the location, any folder will work.
Create virtual Python environment to not conflict with your system’s environment:
mkdir -p ~/.var/venv/svc/
python3 -m venv ~/.var/venv/svc/Activate venv
- On Bash/Zsh:
. ~/.var/venv/svc/bin/activate - On Fish:
. ~/.var/venv/svc/bin/activate.fish - On C shell:
. ~/.var/venv/svc/bin/activate.csh
At this point, if you call Python or pip, you will be running that command inside the virtualenv.
You can activate the virtualenv again by the activate command for your shell.
To exit the virtualenv, run deactivate.
Install SVC#
Do these while you have the virtualenv activated.
- Install the required tools:
python -m pip install -U pip setuptools wheel - Install your hardware-dependent PyTorch library:
- CUDA support for Nvidia GPUs:
- Please install CUDA 11.8 using your system package manager, newer versions may not work.
- Then install it to your venv:
pip install -U torch torchaudio --index-url https://download.pytorch.org/whl/cu118
- ROCm support for AMD GPUs:
- Please install ROCm 5.7.1 via your system package manager, newer versions may not work.
- Then install it to your venv:
pip install -U torch torchaudio --index-url https://download.pytorch.org/whl/rocm5.7
- CPU only (you can also choose CPU mode with the options above):
- No system package is required, just install it to your venv:
pip install -U torch torchaudio --index-url https://download.pytorch.org/whl/cpu
- No system package is required, just install it to your venv:
- CUDA support for Nvidia GPUs:
- Finally, install SVC:
pip install -U so-vits-svc-fork
Launch the GUI#
You can start the graphical UI by running svcg inside the virtualenv.
Example start script for bash:
#!/usr/bin/env bash
. ~/.var/venv/svc/bin/activate
svcgModels#
Grab a model from HuggingFace. Models that work with this setup are the ones tagged with so-vits-svc-4.0 or so-vits-svc-4.1.
You will need 2 files for SVC to work:
G_0000.pthwhere 0000 is some number. Usually a higher number means better, but only if you’re comparing files within the same repository.config.jsontells SVC how to use the pth file.
With SVC running, plop the G_0000.pth into Model Path on the top left, and config.json into Config Path.
Starting the Voice Changer#
Default settings usually work OK. What you want to change is Pitch. This will be different depending on how high your own voice is compared to the model’s voice. You will need different Pitch setting for different models.
Check Use GPU on the bottom center if you want to torture your GPU with your voice. It better not complain for how expensive it was.
Click (Re)Start Voice Changer to do just that. You also need to click this after changing any settings.
PipeWire Setup#
This is for ALVR-only right now. TODO the rest.
Use qpwgraph or helvum to:
- Disconnect
vrserverfromALVR-MIC-Sink. - Pipe the output of
vrserverto the input ofPython3.10. - Pipe the output of
Python3.10to the input ofALVR-MIC-Sink.