File size: 1,532 Bytes
54c1767
 
 
aac14c4
 
 
54c1767
1b03216
 
9a450b8
54c1767
 
 
1b03216
54c1767
 
aac14c4
 
9a450b8
54c1767
 
9a450b8
54c1767
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""
UI components and helper functions for Gradio.
"""

import gradio as gr

from .config import OUTPUT_FORMATS, DEFAULT_OUTPUT_FORMAT
from .models import list_models

# Funções originais (mantidas)
def refresh_models():
    models = list_models()
    return gr.update(value=models, choices=models), models

def toggle_autotune(enable):
    return gr.update(visible=enable)

def upload_model(zip_file, model_name):
    # Implementação original
    return "Model uploaded", list_models(), list_models()

# Novas funções para UI
def create_video_section():
    return gr.Video(
        label="Upload Video (MP4, WebM, etc.)",
        sources=["upload"],
        format="mp4",
        height=300,
    )

def create_five_outputs():
    with gr.Row():
        with gr.Column():
            gr.Markdown("#### 🎤 Input Files (no RVC)")
            entrada_acapella = gr.Audio(label="Acapella (extracted)", type="filepath", interactive=False)
            entrada_audio = gr.Audio(label="Original Audio", type="filepath", interactive=False)
            entrada_instrumental = gr.Audio(label="Instrumental (extracted)", type="filepath", interactive=False)
        with gr.Column():
            gr.Markdown("#### 🎙️ Output Files (with RVC)")
            saida_audio = gr.Audio(label="RVC on original", type="filepath", interactive=False)
            saida_acapella = gr.Audio(label="RVC on acapella", type="filepath", interactive=False)
    return entrada_acapella, entrada_audio, entrada_instrumental, saida_audio, saida_acapella