Audio-to-Audio
Transformers
English
music
art
voice-cloning
so-vits-svc
so-vits-svc-fork
quevedo
spanish
Instructions to use lagosproject/quevedo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lagosproject/quevedo with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("lagosproject/quevedo", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +180 -1
- app.py +218 -0
- assets/banner.png +3 -0
- requirements.txt +2 -0
.gitattributes
CHANGED
|
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
assets/banner.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,8 +1,187 @@
|
|
| 1 |
---
|
| 2 |
pipeline_tag: audio-to-audio
|
|
|
|
|
|
|
| 3 |
tags:
|
| 4 |
- music
|
| 5 |
- art
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
---
|
| 7 |
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
pipeline_tag: audio-to-audio
|
| 3 |
+
language: es
|
| 4 |
+
license: creativeml-openrail-m
|
| 5 |
tags:
|
| 6 |
- music
|
| 7 |
- art
|
| 8 |
+
- voice-cloning
|
| 9 |
+
- so-vits-svc
|
| 10 |
+
- so-vits-svc-fork
|
| 11 |
+
- quevedo
|
| 12 |
+
- spanish
|
| 13 |
---
|
| 14 |
|
| 15 |
+
<p align="center">
|
| 16 |
+
<img src="assets/banner.png" alt="Quevedo Voice Model Banner" width="100%">
|
| 17 |
+
</p>
|
| 18 |
+
|
| 19 |
+
# 🗣️ Quevedo Voice Model (`so-vits-svc-fork`)
|
| 20 |
+
|
| 21 |
+
Este repositorio contiene el modelo de voz del cantante español **Quevedo**, entrenado para su uso con la biblioteca **`so-vits-svc-fork`** (versión 3.10.3+ / 4.0.0+).
|
| 22 |
+
|
| 23 |
+
This repository contains the voice model of the Spanish singer **Quevedo**, trained for use with the **`so-vits-svc-fork`** library (version 3.10.3+ / 4.0.0+).
|
| 24 |
+
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
## 📋 Tabla de Contenidos / Table of Contents
|
| 28 |
+
- [Especificaciones del Modelo / Model Specifications](#-especificaciones-del-modelo--model-specifications)
|
| 29 |
+
- [Estructura del Repositorio / Repository Structure](#-estructura-del-repositorio--repository-structure)
|
| 30 |
+
- [Instalación Rápida / Quick Installation](#-instalación-rápida--quick-installation)
|
| 31 |
+
- [Uso por Consola (CLI) / CLI Usage](#-uso-por-consola-cli--cli-usage)
|
| 32 |
+
- [Uso por Python API / Python API Usage](#-uso-por-python-api--python-api-usage)
|
| 33 |
+
- [Interfaz Web (Gradio WebUI) / Web Interface](#-interfaz-web-gradio-webui--web-interface)
|
| 34 |
+
- [Despliegue en Hugging Face Spaces / Hugging Face Spaces Deployment](#-despliegue-en-hugging-face-spaces--hugging-face-spaces-deployment)
|
| 35 |
+
- [Consejos de Configuración / Optimization & Tips](#-consejos-de-configuración--optimization--tips)
|
| 36 |
+
- [Aviso de Uso Ético / Ethical Disclaimer](#-aviso-de-uso-ético--ethical-disclaimer)
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
## 📊 Especificaciones del Modelo / Model Specifications
|
| 41 |
+
|
| 42 |
+
| Característica / Feature | Valor / Value |
|
| 43 |
+
| --- | --- |
|
| 44 |
+
| **Speaker ID / Nombre** | `quevedo` (Index: `0`) |
|
| 45 |
+
| **Frecuencia de Muestreo / Sampling Rate** | `44100 Hz` (44.1 kHz) |
|
| 46 |
+
| **Algoritmo Base / Architecture** | VITS with SoftVC content encoder (HuBERT) |
|
| 47 |
+
| **Versión del Fork / Fork Version** | `so-vits-svc-fork` v3.x / v4.x |
|
| 48 |
+
| **Tipo de Modelo / Pipeline** | Audio-to-Audio (Singing/Speech Voice Conversion) |
|
| 49 |
+
|
| 50 |
+
---
|
| 51 |
+
|
| 52 |
+
## 📁 Estructura del Repositorio / Repository Structure
|
| 53 |
+
- `G_777.pth`: Pesos del generador del modelo (Git LFS).
|
| 54 |
+
- `config.json`: Archivo de configuración del modelo que incluye los parámetros de entrenamiento y el índice del speaker.
|
| 55 |
+
- `app.py`: Interfaz gráfica interactiva y profesional construida con **Gradio**.
|
| 56 |
+
- `requirements.txt`: Dependencias requeridas para la ejecución de la UI y la inferencia.
|
| 57 |
+
- `assets/banner.png`: Imagen de portada representativa para el repositorio.
|
| 58 |
+
|
| 59 |
+
---
|
| 60 |
+
|
| 61 |
+
## 🛠️ Instalación Rápida / Quick Installation
|
| 62 |
+
|
| 63 |
+
Para empezar a utilizar el modelo en tu ordenador local, primero debes configurar tu entorno de Python (se recomienda Python 3.10 o 3.11):
|
| 64 |
+
|
| 65 |
+
```bash
|
| 66 |
+
# 1. Clonar el repositorio / Clone repository
|
| 67 |
+
git clone https://huggingface.co/lagosproject/quevedo
|
| 68 |
+
cd quevedo
|
| 69 |
+
|
| 70 |
+
# 2. Crear y activar un entorno virtual / Create & activate virtual environment
|
| 71 |
+
python3 -m venv venv
|
| 72 |
+
source venv/bin/activate # En Windows usa: venv\Scripts\activate
|
| 73 |
+
|
| 74 |
+
# 3. Instalar dependencias / Install dependencies
|
| 75 |
+
pip install -r requirements.txt
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
> [!IMPORTANT]
|
| 79 |
+
> Se requiere tener instalado **FFmpeg** en tu sistema para el procesamiento de archivos de audio. Si eres usuario de Ubuntu/Debian ejecuta `sudo apt install ffmpeg`, o en Windows/macOS instálalo usando tu gestor de paquetes favorito (ej: `brew install ffmpeg` o `choco install ffmpeg`).
|
| 80 |
+
|
| 81 |
+
---
|
| 82 |
+
|
| 83 |
+
## 💻 Uso por Consola (CLI) / CLI Usage
|
| 84 |
+
|
| 85 |
+
Puedes realizar conversiones de voz directamente desde tu terminal utilizando el comando unificado `svc`:
|
| 86 |
+
|
| 87 |
+
```bash
|
| 88 |
+
# Inferencia básica / Basic inference
|
| 89 |
+
svc infer path/to/input.wav -m G_777.pth -c config.json -s quevedo -o output.wav
|
| 90 |
+
|
| 91 |
+
# Inferencia con ajuste de tono (+3 semitonos para voces más agudas) / Inference with +3 semitones pitch shift
|
| 92 |
+
svc infer path/to/input.wav -m G_777.pth -c config.json -s quevedo -t 3 -fm crepe -o output.wav
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
### Parámetros útiles de CLI:
|
| 96 |
+
* `-m` / `--model-path`: Ruta al modelo generador (`G_777.pth`).
|
| 97 |
+
* `-c` / `--config-path`: Ruta a la configuración (`config.json`).
|
| 98 |
+
* `-s` / `--spk-list`: Nombre del speaker (`quevedo`).
|
| 99 |
+
* `-t` / `--trans`: Ajuste de tono en semitones (usa números negativos para hacer la voz más grave, y positivos para hacerla más aguda).
|
| 100 |
+
* `-fm` / `--f0-method`: Método de pitch tracking. Opciones recomendadas: `crepe` (mejor calidad) o `dio` (más rápido).
|
| 101 |
+
|
| 102 |
+
---
|
| 103 |
+
|
| 104 |
+
## 🐍 Uso por Python API / Python API Usage
|
| 105 |
+
|
| 106 |
+
Si quieres integrar la conversión de voz directamente dentro de tus scripts en Python:
|
| 107 |
+
|
| 108 |
+
```python
|
| 109 |
+
from pathlib import Path
|
| 110 |
+
from so_vits_svc_fork.inference.main import infer
|
| 111 |
+
|
| 112 |
+
# Definición de rutas
|
| 113 |
+
input_audio = Path("mi_entrada.wav")
|
| 114 |
+
output_audio = Path("quevedo_output.wav")
|
| 115 |
+
model_path = Path("G_777.pth")
|
| 116 |
+
config_path = Path("config.json")
|
| 117 |
+
|
| 118 |
+
# Invocación de la inferencia
|
| 119 |
+
infer(
|
| 120 |
+
input_path=input_audio,
|
| 121 |
+
output_path=output_audio,
|
| 122 |
+
model_path=model_path,
|
| 123 |
+
config_path=config_path,
|
| 124 |
+
recursive=False,
|
| 125 |
+
speaker="quevedo",
|
| 126 |
+
transpose=0, # Cambiar si el tono original difiere mucho del de Quevedo
|
| 127 |
+
auto_predict_f0=False, # False para cantar (mantiene la melodía), True para hablar
|
| 128 |
+
f0_method="crepe", # Crepe ofrece la mejor precisión de tono
|
| 129 |
+
noise_scale=0.4
|
| 130 |
+
)
|
| 131 |
+
|
| 132 |
+
print(f"Conversión finalizada: {output_audio}")
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
---
|
| 136 |
+
|
| 137 |
+
## 🎨 Interfaz Web (Gradio WebUI) / Web Interface
|
| 138 |
+
|
| 139 |
+
El repositorio incluye una WebUI moderna y estilizada construida con Gradio. Para lanzarla localmente, ejecuta:
|
| 140 |
+
|
| 141 |
+
```bash
|
| 142 |
+
python app.py
|
| 143 |
+
```
|
| 144 |
+
Una vez iniciado, abre tu navegador en `http://localhost:7860` para acceder a la aplicación web.
|
| 145 |
+
|
| 146 |
+
### Captura de Características / Feature highlights:
|
| 147 |
+
- **Arrastrar y soltar (Drag and Drop):** Permite subir archivos fácilmente o grabar directamente usando el micrófono.
|
| 148 |
+
- **Acceso Avanzado:** Controla el Pitch Shift, el método F0 predictor (`crepe`, `dio`, `harvest`), y la Escala de Ruido de forma visual.
|
| 149 |
+
- **Bilingüe:** Totalmente adaptado en inglés y español.
|
| 150 |
+
- **Estilo Moderno:** Diseñado con un tema oscuro tipo "glassmorphism" en tonos azul y púrpura de alta calidad.
|
| 151 |
+
|
| 152 |
+
---
|
| 153 |
+
|
| 154 |
+
## 🚀 Despliegue en Hugging Face Spaces / Hugging Face Spaces Deployment
|
| 155 |
+
|
| 156 |
+
Si quieres hacer este modelo interactivo directamente en Hugging Face para que cualquier persona del mundo lo pruebe sin instalar nada localmente:
|
| 157 |
+
|
| 158 |
+
1. Crea un nuevo **Space** en tu cuenta de Hugging Face.
|
| 159 |
+
2. Selecciona **Gradio** como el SDK del Space.
|
| 160 |
+
3. Elige el hardware correspondiente (CPU básica gratuita es suficiente, aunque una GPU aumentará drásticamente la velocidad).
|
| 161 |
+
4. Sube todos los archivos de este repositorio a tu Space (incluyendo `app.py`, `requirements.txt`, `config.json`, `G_777.pth` y `assets/`).
|
| 162 |
+
5. El Space se compilará automáticamente y lanzará la interfaz web de manera pública y gratuita.
|
| 163 |
+
|
| 164 |
+
---
|
| 165 |
+
|
| 166 |
+
## 💡 Consejos de Configuración / Optimization & Tips
|
| 167 |
+
|
| 168 |
+
Para obtener la mejor calidad de audio al clonar la voz de Quevedo:
|
| 169 |
+
|
| 170 |
+
* **Ajuste de Tono (Pitch Shift):** Quevedo tiene un registro de barítono medio/bajo muy característico y profundo.
|
| 171 |
+
* Si tu audio de entrada es cantado por una **voz femenina**, debes aplicar un pitch shift negativo substancial (típicamente entre **-8 y -12 semitonos**) para que suene natural.
|
| 172 |
+
* Si el origen es una **voz masculina aguda/tenor**, ajusta el pitch a **-3 a -6 semitonos**.
|
| 173 |
+
* Si es una **voz masculina grave/barítono**, puedes mantenerlo en **0**.
|
| 174 |
+
* **Voz de Canto vs Voz Hablada:**
|
| 175 |
+
* Para canciones, asegúrate de tener desactivada la opción `Auto Predicción de F0`. Esto preservará las notas musicales del cantante original.
|
| 176 |
+
* Para diálogos o voz de doblaje, activa `Auto Predicción de F0` para que el modelo aplique la entonación y prosodia típica de Quevedo al texto hablado.
|
| 177 |
+
* **Preparación del Audio de Entrada:**
|
| 178 |
+
* Usa siempre audios de entrada limpios (acapellas). Cualquier música de fondo, eco, reverberación o ruido ambiental se distorsionará y arruinará la calidad de conversión.
|
| 179 |
+
* Si tus audios son muy largos (más de 30-45 segundos), divídelos en pequeños segmentos para evitar errores por falta de memoria (Out of Memory).
|
| 180 |
+
|
| 181 |
+
---
|
| 182 |
+
|
| 183 |
+
## ⚠️ Aviso de Uso Ético / Ethical Disclaimer
|
| 184 |
+
|
| 185 |
+
Este modelo ha sido desarrollado con fines artísticos, educativos y de investigación científica. **No está diseñado para ser usado en suplantaciones de identidad con fines fraudulentos o difamatorios.**
|
| 186 |
+
* Si publicas música o covers creados con este modelo, debes aclarar explícitamente en el título y descripción que se trata de un cover creado mediante Inteligencia Artificial (ej: "Cover IA").
|
| 187 |
+
* Respeta las directrices éticas locales y los derechos morales del artista original. El desarrollador de este repositorio no se hace responsable del uso indebido del modelo por parte de terceros.
|
app.py
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import json
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
import gradio as gr
|
| 5 |
+
|
| 6 |
+
# Setup paths
|
| 7 |
+
MODEL_PATH = Path("G_777.pth")
|
| 8 |
+
CONFIG_PATH = Path("config.json")
|
| 9 |
+
BANNER_PATH = Path("assets/banner.png")
|
| 10 |
+
|
| 11 |
+
# Dynamic speaker loader
|
| 12 |
+
speakers = ["quevedo"]
|
| 13 |
+
if CONFIG_PATH.exists():
|
| 14 |
+
try:
|
| 15 |
+
with open(CONFIG_PATH, "r", encoding="utf-8") as f:
|
| 16 |
+
config_data = json.load(f)
|
| 17 |
+
if "spk" in config_data:
|
| 18 |
+
speakers = list(config_data["spk"].keys())
|
| 19 |
+
except Exception as e:
|
| 20 |
+
print(f"Error loading speakers from config: {e}")
|
| 21 |
+
|
| 22 |
+
# Inference function
|
| 23 |
+
def convert_voice(input_audio, speaker, transpose, auto_predict_f0, f0_method, noise_scale):
|
| 24 |
+
if input_audio is None:
|
| 25 |
+
return None, "Por favor, sube un archivo de audio o usa el micrófono / Please upload an audio file or use the microphone."
|
| 26 |
+
|
| 27 |
+
input_path = Path(input_audio)
|
| 28 |
+
output_path = input_path.parent / f"{input_path.stem}_quevedo.wav"
|
| 29 |
+
|
| 30 |
+
# Lazy import to avoid startup errors if so-vits-svc-fork is not yet installed
|
| 31 |
+
try:
|
| 32 |
+
from so_vits_svc_fork.inference.main import infer
|
| 33 |
+
except ImportError:
|
| 34 |
+
return None, (
|
| 35 |
+
"Error: 'so-vits-svc-fork' no está instalado en este entorno.\n"
|
| 36 |
+
"Ejecuta: pip install so-vits-svc-fork\n\n"
|
| 37 |
+
"Error: 'so-vits-svc-fork' is not installed in this environment.\n"
|
| 38 |
+
"Run: pip install so-vits-svc-fork"
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
if not MODEL_PATH.exists():
|
| 42 |
+
return None, f"Error: No se encontró el archivo del modelo {MODEL_PATH} / Model file {MODEL_PATH} not found."
|
| 43 |
+
if not CONFIG_PATH.exists():
|
| 44 |
+
return None, f"Error: No se encontró el archivo de configuración {CONFIG_PATH} / Config file {CONFIG_PATH} not found."
|
| 45 |
+
|
| 46 |
+
try:
|
| 47 |
+
# Perform inference using the fork's main infer function
|
| 48 |
+
infer(
|
| 49 |
+
input_path=input_path,
|
| 50 |
+
output_path=output_path,
|
| 51 |
+
model_path=MODEL_PATH,
|
| 52 |
+
config_path=CONFIG_PATH,
|
| 53 |
+
recursive=False,
|
| 54 |
+
speaker=speaker,
|
| 55 |
+
transpose=int(transpose),
|
| 56 |
+
auto_predict_f0=bool(auto_predict_f0),
|
| 57 |
+
noise_scale=float(noise_scale),
|
| 58 |
+
f0_method=f0_method
|
| 59 |
+
)
|
| 60 |
+
|
| 61 |
+
if output_path.exists():
|
| 62 |
+
return str(output_path), "¡Conversión completada con éxito! / Conversion completed successfully!"
|
| 63 |
+
else:
|
| 64 |
+
return None, "Error al generar el archivo de salida / Output file was not generated."
|
| 65 |
+
|
| 66 |
+
except Exception as e:
|
| 67 |
+
return None, f"Error durante la inferencia / Error during inference: {str(e)}"
|
| 68 |
+
|
| 69 |
+
# Custom CSS for premium styling matching the blue-purple theme
|
| 70 |
+
custom_css = """
|
| 71 |
+
body {
|
| 72 |
+
background-color: #0b0c10;
|
| 73 |
+
}
|
| 74 |
+
.gradio-container {
|
| 75 |
+
background-color: #0b0c10 !important;
|
| 76 |
+
font-family: 'Outfit', 'Inter', sans-serif !important;
|
| 77 |
+
max-width: 900px !important;
|
| 78 |
+
margin: 0 auto !important;
|
| 79 |
+
border-radius: 12px;
|
| 80 |
+
}
|
| 81 |
+
.header-area {
|
| 82 |
+
text-align: center;
|
| 83 |
+
padding: 20px 0;
|
| 84 |
+
}
|
| 85 |
+
.header-title {
|
| 86 |
+
color: #4f46e5;
|
| 87 |
+
background: linear-gradient(90deg, #818cf8 0%, #c084fc 100%);
|
| 88 |
+
-webkit-background-clip: text;
|
| 89 |
+
-webkit-text-fill-color: transparent;
|
| 90 |
+
font-weight: 800 !important;
|
| 91 |
+
font-size: 2.5rem !important;
|
| 92 |
+
margin-bottom: 0.5rem;
|
| 93 |
+
}
|
| 94 |
+
.header-desc {
|
| 95 |
+
color: #9ca3af;
|
| 96 |
+
font-size: 1.1rem;
|
| 97 |
+
margin-bottom: 20px;
|
| 98 |
+
}
|
| 99 |
+
.main-box {
|
| 100 |
+
background: rgba(17, 24, 39, 0.7);
|
| 101 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 102 |
+
backdrop-filter: blur(10px);
|
| 103 |
+
border-radius: 16px;
|
| 104 |
+
padding: 20px;
|
| 105 |
+
margin-bottom: 20px;
|
| 106 |
+
}
|
| 107 |
+
.convert-btn {
|
| 108 |
+
background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
|
| 109 |
+
border: none !important;
|
| 110 |
+
color: white !important;
|
| 111 |
+
font-weight: bold !important;
|
| 112 |
+
transition: all 0.3s ease !important;
|
| 113 |
+
}
|
| 114 |
+
.convert-btn:hover {
|
| 115 |
+
transform: translateY(-2px);
|
| 116 |
+
box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
|
| 117 |
+
}
|
| 118 |
+
"""
|
| 119 |
+
|
| 120 |
+
# Build Gradio UI
|
| 121 |
+
with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
|
| 122 |
+
# Banner/Header
|
| 123 |
+
with gr.Row():
|
| 124 |
+
if BANNER_PATH.exists():
|
| 125 |
+
gr.Image(str(BANNER_PATH), show_label=False, container=False, interactive=False)
|
| 126 |
+
|
| 127 |
+
with gr.Row(elem_classes=["header-area"]):
|
| 128 |
+
gr.HTML(
|
| 129 |
+
"<h1 class='header-title'>🗣️ Quevedo Voice Model (so-vits-svc-fork)</h1>"
|
| 130 |
+
"<p class='header-desc'>Convierte cualquier archivo de voz o canto en la voz de Quevedo.</p>"
|
| 131 |
+
"<p style='color: #6b7280; font-size: 0.9rem; margin-top: -10px;'>"
|
| 132 |
+
"Convert any voice or singing file into the voice of Quevedo.</p>"
|
| 133 |
+
)
|
| 134 |
+
|
| 135 |
+
# Main conversion section
|
| 136 |
+
with gr.Row(elem_classes=["main-box"]):
|
| 137 |
+
with gr.Column(scale=1):
|
| 138 |
+
gr.Markdown("### 📥 1. Entrada de Audio / Audio Input")
|
| 139 |
+
input_audio = gr.Audio(
|
| 140 |
+
label="Audio a Convertir (Voz limpia / Acapella)",
|
| 141 |
+
type="filepath",
|
| 142 |
+
sources=["upload", "microphone"]
|
| 143 |
+
)
|
| 144 |
+
|
| 145 |
+
gr.Markdown("### ⚙️ 2. Parámetros de Conversión / Parameters")
|
| 146 |
+
speaker = gr.Dropdown(
|
| 147 |
+
choices=speakers,
|
| 148 |
+
value=speakers[0],
|
| 149 |
+
label="Speaker (Personaje)"
|
| 150 |
+
)
|
| 151 |
+
|
| 152 |
+
transpose = gr.Slider(
|
| 153 |
+
minimum=-12,
|
| 154 |
+
maximum=12,
|
| 155 |
+
value=0,
|
| 156 |
+
step=1,
|
| 157 |
+
label="Ajuste de Tono (Semitonos) / Pitch Shift (Semitones)",
|
| 158 |
+
info="Aumenta para voces femeninas a masculinas (ej: -5 a -12), o disminuye para masculinas a femeninas."
|
| 159 |
+
)
|
| 160 |
+
|
| 161 |
+
with gr.Accordion("Parámetros Avanzados / Advanced Options", open=False):
|
| 162 |
+
auto_predict_f0 = gr.Checkbox(
|
| 163 |
+
value=False,
|
| 164 |
+
label="Auto Predicción de F0 / Auto Predict F0",
|
| 165 |
+
info="Recomendado para voz hablada. DESMARCAR para canto / Recommended for speech, UNCHECK for singing."
|
| 166 |
+
)
|
| 167 |
+
|
| 168 |
+
f0_method = gr.Dropdown(
|
| 169 |
+
choices=["crepe", "crepe-tiny", "parselmouth", "dio", "harvest"],
|
| 170 |
+
value="crepe",
|
| 171 |
+
label="F0 Predictor (Algoritmo de Tono)",
|
| 172 |
+
info="crepe es el de mayor calidad pero más lento; dio es el más rápido."
|
| 173 |
+
)
|
| 174 |
+
|
| 175 |
+
noise_scale = gr.Slider(
|
| 176 |
+
minimum=0.1,
|
| 177 |
+
maximum=1.0,
|
| 178 |
+
value=0.4,
|
| 179 |
+
step=0.05,
|
| 180 |
+
label="Escala de Ruido / Noise Scale",
|
| 181 |
+
info="Controla la vibración/varianza del tono (0.4 es estándar)."
|
| 182 |
+
)
|
| 183 |
+
|
| 184 |
+
with gr.Column(scale=1):
|
| 185 |
+
gr.Markdown("### 📤 3. Resultado / Output")
|
| 186 |
+
output_audio = gr.Audio(
|
| 187 |
+
label="Audio Convertido (Quevedo)",
|
| 188 |
+
type="filepath"
|
| 189 |
+
)
|
| 190 |
+
|
| 191 |
+
status_output = gr.Textbox(
|
| 192 |
+
label="Estado / Status",
|
| 193 |
+
value="Listo / Ready",
|
| 194 |
+
interactive=False
|
| 195 |
+
)
|
| 196 |
+
|
| 197 |
+
submit_btn = gr.Button(
|
| 198 |
+
"Convertir Voz / Convert 🚀",
|
| 199 |
+
variant="primary",
|
| 200 |
+
elem_classes=["convert-btn"]
|
| 201 |
+
)
|
| 202 |
+
|
| 203 |
+
submit_btn.click(
|
| 204 |
+
fn=convert_voice,
|
| 205 |
+
inputs=[input_audio, speaker, transpose, auto_predict_f0, f0_method, noise_scale],
|
| 206 |
+
outputs=[output_audio, status_output]
|
| 207 |
+
)
|
| 208 |
+
|
| 209 |
+
# Footer
|
| 210 |
+
gr.HTML(
|
| 211 |
+
"<div style='text-align: center; color: #4b5563; font-size: 0.85rem; padding: 20px 0;'>"
|
| 212 |
+
"Modelo para fines de demostración artística y de investigación. "
|
| 213 |
+
"Usa so-vits-svc-fork para la inferencia.<br>"
|
| 214 |
+
"Developed with 💜 for the open voice community.</div>"
|
| 215 |
+
)
|
| 216 |
+
|
| 217 |
+
if __name__ == "__main__":
|
| 218 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|
assets/banner.png
ADDED
|
Git LFS Details
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
so-vits-svc-fork>=3.10.3
|
| 2 |
+
gradio>=4.0.0
|