Update src/webui.py
Browse files- src/webui.py +33 -33
src/webui.py
CHANGED
|
@@ -168,22 +168,22 @@ if __name__ == '__main__':
|
|
| 168 |
|
| 169 |
with gr.Blocks(title='AICoverGenWebUI') as app:
|
| 170 |
# main tab
|
| 171 |
-
with gr.Tab("
|
| 172 |
|
| 173 |
-
with gr.Accordion('
|
| 174 |
with gr.Row():
|
| 175 |
with gr.Column():
|
| 176 |
rvc_model = gr.Dropdown(voice_models, label='Voice Models', info='Папка моделей «AICoverGen --> rvc_models». После добавления новых моделей в эту папку нажмите кнопку «Обновить».')
|
| 177 |
-
ref_btn = gr.Button('
|
| 178 |
|
| 179 |
with gr.Column() as yt_link_col:
|
| 180 |
-
song_input = gr.Text(label='
|
| 181 |
-
show_file_upload_button = gr.Button('
|
| 182 |
|
| 183 |
with gr.Column(visible=False) as file_upload_col:
|
| 184 |
-
local_file = gr.File(label='
|
| 185 |
-
song_input_file = gr.UploadButton('
|
| 186 |
-
show_yt_link_button = gr.Button('
|
| 187 |
song_input_file.upload(process_file_upload, inputs=[song_input_file], outputs=[local_file, song_input])
|
| 188 |
|
| 189 |
with gr.Column():
|
|
@@ -192,7 +192,7 @@ if __name__ == '__main__':
|
|
| 192 |
show_file_upload_button.click(swap_visibility, outputs=[file_upload_col, yt_link_col, song_input, local_file])
|
| 193 |
show_yt_link_button.click(swap_visibility, outputs=[yt_link_col, file_upload_col, song_input, local_file])
|
| 194 |
|
| 195 |
-
with gr.Accordion('
|
| 196 |
with gr.Row():
|
| 197 |
index_rate = gr.Slider(0, 1, value=0.5, label='Index Rate', info="Управляет тем, какую часть акцента голоса AI следует сохранить в вокале.")
|
| 198 |
filter_radius = gr.Slider(0, 7, value=3, step=1, label='Filter radius', info='Если >=3: применить медианную фильтрацию к собранным результатам основного тона. Может уменьшить одышку')
|
|
@@ -204,12 +204,12 @@ if __name__ == '__main__':
|
|
| 204 |
f0_method.change(show_hop_slider, inputs=f0_method, outputs=crepe_hop_length)
|
| 205 |
keep_files = gr.Checkbox(label='Keep intermediate files', info='Сохраняйте все сгенерированные аудиофайлы в каталоге song_output/id, например. Изолированный вокал/инструментал. Оставьте флажок снятым, чтобы сэкономить место')
|
| 206 |
|
| 207 |
-
with gr.Accordion('
|
| 208 |
-
gr.Markdown('###
|
| 209 |
with gr.Row():
|
| 210 |
-
main_gain = gr.Slider(-20, 20, value=0, step=1, label='
|
| 211 |
-
backup_gain = gr.Slider(-20, 20, value=0, step=1, label='
|
| 212 |
-
inst_gain = gr.Slider(-20, 20, value=0, step=1, label='
|
| 213 |
|
| 214 |
gr.Markdown('### Reverb Control on AI Vocals')
|
| 215 |
with gr.Row():
|
|
@@ -218,12 +218,12 @@ if __name__ == '__main__':
|
|
| 218 |
reverb_dry = gr.Slider(0, 1, value=0.8, label='Dryness level', info='Уровень AI-вокала без реверберации')
|
| 219 |
reverb_damping = gr.Slider(0, 1, value=0.7, label='Damping level', info='Поглощение высоких частот в реверберации')
|
| 220 |
|
| 221 |
-
gr.Markdown('###
|
| 222 |
-
output_format = gr.Dropdown(['mp3', 'wav'], value='mp3', label='
|
| 223 |
|
| 224 |
with gr.Row():
|
| 225 |
-
clear_btn = gr.ClearButton(value='
|
| 226 |
-
generate_btn = gr.Button("
|
| 227 |
ai_cover = gr.Audio(label='AI Cover', show_share_button=False)
|
| 228 |
|
| 229 |
ref_btn.click(update_models_list, None, outputs=rvc_model)
|
|
@@ -240,15 +240,15 @@ if __name__ == '__main__':
|
|
| 240 |
reverb_dry, reverb_damping, output_format, ai_cover])
|
| 241 |
|
| 242 |
# Download tab
|
| 243 |
-
with gr.Tab('
|
| 244 |
|
| 245 |
-
with gr.Tab('
|
| 246 |
with gr.Row():
|
| 247 |
-
model_zip_link = gr.Text(label='
|
| 248 |
-
model_name = gr.Text(label='
|
| 249 |
|
| 250 |
with gr.Row():
|
| 251 |
-
download_btn = gr.Button('
|
| 252 |
dl_output_message = gr.Text(label='Output Message', interactive=False, scale=20)
|
| 253 |
|
| 254 |
download_btn.click(download_online_model, inputs=[model_zip_link, model_name], outputs=dl_output_message)
|
|
@@ -266,7 +266,7 @@ if __name__ == '__main__':
|
|
| 266 |
download_online_model,
|
| 267 |
)
|
| 268 |
|
| 269 |
-
with gr.Tab('
|
| 270 |
|
| 271 |
gr.Markdown('## Как использовать')
|
| 272 |
gr.Markdown('- Нажмите «Инициализировать таблицу общедоступных моделей»')
|
|
@@ -275,16 +275,16 @@ if __name__ == '__main__':
|
|
| 275 |
gr.Markdown('- Нажмите Загрузить')
|
| 276 |
|
| 277 |
with gr.Row():
|
| 278 |
-
pub_zip_link = gr.Text(label='
|
| 279 |
-
pub_model_name = gr.Text(label='
|
| 280 |
|
| 281 |
with gr.Row():
|
| 282 |
-
download_pub_btn = gr.Button('
|
| 283 |
pub_dl_output_message = gr.Text(label='Output Message', interactive=False, scale=20)
|
| 284 |
|
| 285 |
-
filter_tags = gr.CheckboxGroup(value=[], label='
|
| 286 |
search_query = gr.Text(label='Search')
|
| 287 |
-
load_public_models_button = gr.Button(value='
|
| 288 |
|
| 289 |
public_models_table = gr.DataFrame(value=[], headers=['Model Name', 'Description', 'Credit', 'URL', 'Tags'], label='Available Public Models', interactive=False)
|
| 290 |
public_models_table.select(pub_dl_autofill, inputs=[public_models_table], outputs=[pub_zip_link, pub_model_name])
|
|
@@ -294,7 +294,7 @@ if __name__ == '__main__':
|
|
| 294 |
download_pub_btn.click(download_online_model, inputs=[pub_zip_link, pub_model_name], outputs=pub_dl_output_message)
|
| 295 |
|
| 296 |
# Upload tab
|
| 297 |
-
with gr.Tab('
|
| 298 |
gr.Markdown('## Загрузить локально обученную модель RVC v2 и индексный файл')
|
| 299 |
gr.Markdown('- Найти файл модели (папка весов) и дополнительный индексный файл (папка журналов/[имя])')
|
| 300 |
gr.Markdown('- Сжать файлы в zip-файл')
|
|
@@ -303,12 +303,12 @@ if __name__ == '__main__':
|
|
| 303 |
|
| 304 |
with gr.Row():
|
| 305 |
with gr.Column():
|
| 306 |
-
zip_file = gr.File(label='Zip
|
| 307 |
|
| 308 |
-
local_model_name = gr.Text(label='
|
| 309 |
|
| 310 |
with gr.Row():
|
| 311 |
-
model_upload_button = gr.Button('
|
| 312 |
local_upload_output_message = gr.Text(label='Output Message', interactive=False, scale=20)
|
| 313 |
model_upload_button.click(upload_local_model, inputs=[zip_file, local_model_name], outputs=local_upload_output_message)
|
| 314 |
|
|
|
|
| 168 |
|
| 169 |
with gr.Blocks(title='AICoverGenWebUI') as app:
|
| 170 |
# main tab
|
| 171 |
+
with gr.Tab("Генерация"):
|
| 172 |
|
| 173 |
+
with gr.Accordion('Основные настройки'):
|
| 174 |
with gr.Row():
|
| 175 |
with gr.Column():
|
| 176 |
rvc_model = gr.Dropdown(voice_models, label='Voice Models', info='Папка моделей «AICoverGen --> rvc_models». После добавления новых моделей в эту папку нажмите кнопку «Обновить».')
|
| 177 |
+
ref_btn = gr.Button('Обновить 🔁', variant='primary')
|
| 178 |
|
| 179 |
with gr.Column() as yt_link_col:
|
| 180 |
+
song_input = gr.Text(label='Песня', info='Ссылка на песню на YouTube или полный путь к локальному файлу. Для загрузки файла нажмите кнопку ниже. Пример: https://www.youtube.com/watch?v=M-mtdN6R3bQ')
|
| 181 |
+
show_file_upload_button = gr.Button('Загрузить файл')
|
| 182 |
|
| 183 |
with gr.Column(visible=False) as file_upload_col:
|
| 184 |
+
local_file = gr.File(label='Аудио файл')
|
| 185 |
+
song_input_file = gr.UploadButton('Загрузить 📂', file_types=['audio'], variant='primary')
|
| 186 |
+
show_yt_link_button = gr.Button('По ссылке')
|
| 187 |
song_input_file.upload(process_file_upload, inputs=[song_input_file], outputs=[local_file, song_input])
|
| 188 |
|
| 189 |
with gr.Column():
|
|
|
|
| 192 |
show_file_upload_button.click(swap_visibility, outputs=[file_upload_col, yt_link_col, song_input, local_file])
|
| 193 |
show_yt_link_button.click(swap_visibility, outputs=[yt_link_col, file_upload_col, song_input, local_file])
|
| 194 |
|
| 195 |
+
with gr.Accordion('Параметры образования голоса', open=False):
|
| 196 |
with gr.Row():
|
| 197 |
index_rate = gr.Slider(0, 1, value=0.5, label='Index Rate', info="Управляет тем, какую часть акцента голоса AI следует сохранить в вокале.")
|
| 198 |
filter_radius = gr.Slider(0, 7, value=3, step=1, label='Filter radius', info='Если >=3: применить медианную фильтрацию к собранным результатам основного тона. Может уменьшить одышку')
|
|
|
|
| 204 |
f0_method.change(show_hop_slider, inputs=f0_method, outputs=crepe_hop_length)
|
| 205 |
keep_files = gr.Checkbox(label='Keep intermediate files', info='Сохраняйте все сгенерированные аудиофайлы в каталоге song_output/id, например. Изолированный вокал/инструментал. Оставьте флажок снятым, чтобы сэкономить место')
|
| 206 |
|
| 207 |
+
with gr.Accordion('Параметры микширования звука', open=False):
|
| 208 |
+
gr.Markdown('### Изменение громкости (децибелы)')
|
| 209 |
with gr.Row():
|
| 210 |
+
main_gain = gr.Slider(-20, 20, value=0, step=1, label='Основной вокал')
|
| 211 |
+
backup_gain = gr.Slider(-20, 20, value=0, step=1, label='Бэк-вокал')
|
| 212 |
+
inst_gain = gr.Slider(-20, 20, value=0, step=1, label='Музыка')
|
| 213 |
|
| 214 |
gr.Markdown('### Reverb Control on AI Vocals')
|
| 215 |
with gr.Row():
|
|
|
|
| 218 |
reverb_dry = gr.Slider(0, 1, value=0.8, label='Dryness level', info='Уровень AI-вокала без реверберации')
|
| 219 |
reverb_damping = gr.Slider(0, 1, value=0.7, label='Damping level', info='Поглощение высоких частот в реверберации')
|
| 220 |
|
| 221 |
+
gr.Markdown('### Аудио')
|
| 222 |
+
output_format = gr.Dropdown(['mp3', 'wav'], value='mp3', label='Выходной формат аудио', info='mp3: небольшой размер файла, достойное качество. wav: большой размер файла, лучшее качество.')
|
| 223 |
|
| 224 |
with gr.Row():
|
| 225 |
+
clear_btn = gr.ClearButton(value='Очистить', components=[song_input, rvc_model, keep_files, local_file])
|
| 226 |
+
generate_btn = gr.Button("Сгенерировать", variant='primary')
|
| 227 |
ai_cover = gr.Audio(label='AI Cover', show_share_button=False)
|
| 228 |
|
| 229 |
ref_btn.click(update_models_list, None, outputs=rvc_model)
|
|
|
|
| 240 |
reverb_dry, reverb_damping, output_format, ai_cover])
|
| 241 |
|
| 242 |
# Download tab
|
| 243 |
+
with gr.Tab('Загрузка моделей'):
|
| 244 |
|
| 245 |
+
with gr.Tab('С HuggingFace/Pixeldrain URL'):
|
| 246 |
with gr.Row():
|
| 247 |
+
model_zip_link = gr.Text(label='Ссылка на скачивание модели', info='Это должен быть ZIP-файл, содержащий файл модели .pth и необязательный файл .index.')
|
| 248 |
+
model_name = gr.Text(label='Название', info='Дайте вашей новой модели уникальное имя среди других моделей голоса.')
|
| 249 |
|
| 250 |
with gr.Row():
|
| 251 |
+
download_btn = gr.Button('Скачать 🌐', variant='primary', scale=19)
|
| 252 |
dl_output_message = gr.Text(label='Output Message', interactive=False, scale=20)
|
| 253 |
|
| 254 |
download_btn.click(download_online_model, inputs=[model_zip_link, model_name], outputs=dl_output_message)
|
|
|
|
| 266 |
download_online_model,
|
| 267 |
)
|
| 268 |
|
| 269 |
+
with gr.Tab('Из общедоступного индекса'):
|
| 270 |
|
| 271 |
gr.Markdown('## Как использовать')
|
| 272 |
gr.Markdown('- Нажмите «Инициализировать таблицу общедоступных моделей»')
|
|
|
|
| 275 |
gr.Markdown('- Нажмите Загрузить')
|
| 276 |
|
| 277 |
with gr.Row():
|
| 278 |
+
pub_zip_link = gr.Text(label='Ссылка на скачивание модели')
|
| 279 |
+
pub_model_name = gr.Text(label='Название')
|
| 280 |
|
| 281 |
with gr.Row():
|
| 282 |
+
download_pub_btn = gr.Button('Скачать 🌐', variant='primary', scale=19)
|
| 283 |
pub_dl_output_message = gr.Text(label='Output Message', interactive=False, scale=20)
|
| 284 |
|
| 285 |
+
filter_tags = gr.CheckboxGroup(value=[], label='Показать модели голоса с тегами', choices=[])
|
| 286 |
search_query = gr.Text(label='Search')
|
| 287 |
+
load_public_models_button = gr.Button(value='Обновит�� таблицу общедоступных моделей', variant='primary')
|
| 288 |
|
| 289 |
public_models_table = gr.DataFrame(value=[], headers=['Model Name', 'Description', 'Credit', 'URL', 'Tags'], label='Available Public Models', interactive=False)
|
| 290 |
public_models_table.select(pub_dl_autofill, inputs=[public_models_table], outputs=[pub_zip_link, pub_model_name])
|
|
|
|
| 294 |
download_pub_btn.click(download_online_model, inputs=[pub_zip_link, pub_model_name], outputs=pub_dl_output_message)
|
| 295 |
|
| 296 |
# Upload tab
|
| 297 |
+
with gr.Tab('Загрузить свою модель):
|
| 298 |
gr.Markdown('## Загрузить локально обученную модель RVC v2 и индексный файл')
|
| 299 |
gr.Markdown('- Найти файл модели (папка весов) и дополнительный индексный файл (папка журналов/[имя])')
|
| 300 |
gr.Markdown('- Сжать файлы в zip-файл')
|
|
|
|
| 303 |
|
| 304 |
with gr.Row():
|
| 305 |
with gr.Column():
|
| 306 |
+
zip_file = gr.File(label='Zip файл')
|
| 307 |
|
| 308 |
+
local_model_name = gr.Text(label='Название')
|
| 309 |
|
| 310 |
with gr.Row():
|
| 311 |
+
model_upload_button = gr.Button('Загрузить модель', variant='primary', scale=19)
|
| 312 |
local_upload_output_message = gr.Text(label='Output Message', interactive=False, scale=20)
|
| 313 |
model_upload_button.click(upload_local_model, inputs=[zip_file, local_model_name], outputs=local_upload_output_message)
|
| 314 |
|