# svc-develop-team/so-vits-svc architecture

> Architecture diagram of the GitHub repository svc-develop-team/so-vits-svc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/svc-develop-team/so-vits-svc
- Repository: https://github.com/svc-develop-team/so-vits-svc

## Overview

SoftVC VITS Singing Voice Conversion converts vocal audio while preserving its content and intonation. The principal path is an audio request through the inference entry point, speech-feature and pitch extraction, the conversion model, and waveform decoding; optional retrieval, enhancement, and shallow diffusion extend inference. The repository also includes dataset preparation and model training, plus web and API entry points. The README documents several capabilities whose wiring is not shown in the excerpts, so those links are omitted rather than inferred.

Main entry points: [`inference/infer_tool.py`](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/inference/infer_tool.py) (SVC Inference), [`models.py`](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/models.py) (SVC Generator), [`inference_main.py`](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/inference_main.py) (Inference CLI), [`train.py`](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/train.py) (Model Training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_cli["Inference CLI<br/>[inference_main.py]"]
  node_webui["Web UI<br/>[webUI.py]"]
  node_api["Flask API<br/>[flask_api.py]"]
end

subgraph group_inference["Conversion Inference"]
  node_svc["SVC Inference<br/>[infer_tool.py]"]
  node_slicing["Audio Slicing<br/>[slicer.py]"]
  node_encoders["Speech Encoders"]
  node_pitch["Pitch Prediction"]
  node_retrieval["Feature Retrieval"]
  node_diffusion["Shallow Diffusion<br/>[unit2mel.py]"]
  node_enhancer["Audio Enhancement<br/>[enhancer.py]"]
end

subgraph group_models["Conversion Models"]
  node_vits["SVC Generator<br/>[models.py]"]
  node_layers["Neural Layers<br/>[modules.py]"]
  node_attention["Attention Blocks<br/>[attentions.py]"]
  node_vocoder["Waveform Decoders"]
end

subgraph group_training["Training Data"]
  node_preprocess["Feature Preparation"]
  node_dataset["Data Utilities<br/>[data_utils.py]"]
  node_trainer["Model Training<br/>[train.py]"]
  node_diffusion_trainer["Diffusion Training<br/>[train_diff.py]"]
end

node_user(("Audio User"))

node_user -.->|"provides audio"| node_cli
node_user -.->|"submits audio"| node_webui
node_user -.->|"submits audio"| node_api
node_cli -->|"invokes"| node_svc
node_svc -->|"uses"| node_slicing
node_svc -->|"runs conversion"| node_vits
node_svc -->|"loads encoder"| node_encoders
node_svc -->|"selects predictor"| node_pitch
node_svc -->|"uses retrieval"| node_retrieval
node_svc -->|"uses diffusion"| node_diffusion
node_svc -->|"uses enhancer"| node_enhancer
node_vits -->|"uses layers"| node_layers
node_vits -->|"uses attention"| node_attention
node_vits -->|"decodes waveform"| node_vocoder
node_preprocess -.->|"extracts features"| node_encoders
node_trainer -.->|"trains generator"| node_vits
node_dataset -.->|"supplies data"| node_trainer
node_diffusion_trainer -.->|"trains model"| node_diffusion

click node_cli "https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/inference_main.py"
click node_webui "https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/webUI.py"
click node_api "https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/flask_api.py"
click node_svc "https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/inference/infer_tool.py"
click node_slicing "https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/inference/slicer.py"
click node_encoders "https://github.com/svc-develop-team/so-vits-svc/tree/4.1-Stable/vencoder"
click node_pitch "https://github.com/svc-develop-team/so-vits-svc/tree/4.1-Stable/modules/F0Predictor"
click node_retrieval "https://github.com/svc-develop-team/so-vits-svc/tree/4.1-Stable/cluster"
click node_diffusion "https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/diffusion/unit2mel.py"
click node_enhancer "https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/modules/enhancer.py"
click node_vits "https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/models.py"
click node_layers "https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/modules/modules.py"
click node_attention "https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/modules/attentions.py"
click node_vocoder "https://github.com/svc-develop-team/so-vits-svc/tree/4.1-Stable/vdecoder"
click node_preprocess "https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/preprocess_hubert_f0.py"
click node_dataset "https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/data_utils.py"
click node_trainer "https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/train.py"
click node_diffusion_trainer "https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/train_diff.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_webui,node_api,node_user toneBlue
class node_svc,node_slicing,node_encoders,node_pitch,node_retrieval,node_diffusion,node_enhancer toneAmber
class node_vits,node_layers,node_attention,node_vocoder toneMint
class node_preprocess,node_dataset,node_trainer,node_diffusion_trainer toneRose
```

## Components

### User Interfaces

- [Inference CLI](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/inference_main.py): `inference_main.py`
- [Web UI](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/webUI.py): `webUI.py`
- [Flask API](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/flask_api.py): `flask_api.py`

### Conversion Inference

- [SVC Inference](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/inference/infer_tool.py): `inference/infer_tool.py`
- [Audio Slicing](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/inference/slicer.py): `inference/slicer.py`
- [Speech Encoders](https://github.com/svc-develop-team/so-vits-svc/tree/4.1-Stable/vencoder): `vencoder`
- [Pitch Prediction](https://github.com/svc-develop-team/so-vits-svc/tree/4.1-Stable/modules/F0Predictor): `modules/F0Predictor`
- [Feature Retrieval](https://github.com/svc-develop-team/so-vits-svc/tree/4.1-Stable/cluster): `cluster`
- [Shallow Diffusion](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/diffusion/unit2mel.py): `diffusion/unit2mel.py`
- [Audio Enhancement](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/modules/enhancer.py): `modules/enhancer.py`

### Conversion Models

- [SVC Generator](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/models.py): `models.py`
- [Neural Layers](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/modules/modules.py): `modules/modules.py`
- [Attention Blocks](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/modules/attentions.py): `modules/attentions.py`
- [Waveform Decoders](https://github.com/svc-develop-team/so-vits-svc/tree/4.1-Stable/vdecoder): `vdecoder`

### Training Data

- [Feature Preparation](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/preprocess_hubert_f0.py): `preprocess_hubert_f0.py`
- [Data Utilities](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/data_utils.py): `data_utils.py`
- [Model Training](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/train.py): `train.py`
- [Diffusion Training](https://github.com/svc-develop-team/so-vits-svc/blob/4.1-Stable/train_diff.py): `train_diff.py`

### Other components

- **Audio User**

## Connections

- Audio User → Inference CLI: provides audio
- Audio User → Web UI: submits audio
- Audio User → Flask API: submits audio
- Inference CLI → SVC Inference: invokes (evidence: `inference_main.py`)
- SVC Inference → Audio Slicing: uses (evidence: `inference/infer_tool.py`)
- SVC Inference → SVC Generator: runs conversion (evidence: `inference/infer_tool.py`)
- SVC Inference → Speech Encoders: loads encoder
- SVC Inference → Pitch Prediction: selects predictor
- SVC Inference → Feature Retrieval: uses retrieval (evidence: `inference/infer_tool.py`)
- SVC Inference → Shallow Diffusion: uses diffusion (evidence: `inference/infer_tool.py`)
- SVC Inference → Audio Enhancement: uses enhancer (evidence: `inference/infer_tool.py`)
- SVC Generator → Neural Layers: uses layers (evidence: `models.py`)
- SVC Generator → Attention Blocks: uses attention (evidence: `models.py`)
- SVC Generator → Waveform Decoders: decodes waveform (evidence: `models.py`)
- Feature Preparation → Speech Encoders: extracts features
- Model Training → SVC Generator: trains generator
- Data Utilities → Model Training: supplies data
- Diffusion Training → Shallow Diffusion: trains model
