Blane187 commited on
Commit
3b3d90a
ยท
verified ยท
1 Parent(s): 631ee6f

Update src/webui.py

Browse files
Files changed (1) hide show
  1. src/webui.py +48 -47
src/webui.py CHANGED
@@ -175,56 +175,57 @@ if __name__ == '__main__':
175
  with gr.Tabs():
176
  rvc_model = gr.Dropdown(voice_models, label='Voice Models', info='Models folder "AICoverGen --> rvc_models". After new models are added into this folder, click the refresh button')
177
  ref_btn = gr.Button('Refresh Models ๐Ÿ”', variant='primary')
178
- clear_btn = gr.ClearButton(value='Clear Settings', components=[song_input, rvc_model, keep_files, local_file])
179
-
180
- with gr.Tab("Inference"):
181
- with gr.Row():
182
-
183
- with gr.Column() as yt_link_col:
184
- song_input = gr.Text(label='Song input', info='Link to a song on YouTube or full path to a local file. For file upload, click the button below. Example: https://www.youtube.com/watch?v=M-mtdN6R3bQ')
185
- show_file_upload_button = gr.Button('Upload file instead')
186
-
187
- with gr.Column(visible=False) as file_upload_col:
188
- local_file = gr.File(label='Audio file')
189
- song_input_file = gr.UploadButton('Upload ๐Ÿ“‚', file_types=['audio'], variant='primary')
190
- show_yt_link_button = gr.Button('Paste YouTube link/Path to local file instead')
191
- song_input_file.upload(process_file_upload, inputs=[song_input_file], outputs=[local_file, song_input])
192
-
193
- with gr.Column():
194
- pitch = gr.Slider(-3, 3, value=0, step=1, label='Pitch Change (Vocals ONLY)', info='Generally, use 1 for male to female conversions and -1 for vice-versa. (Octaves)')
195
- pitch_all = gr.Slider(-12, 12, value=0, step=1, label='Overall Pitch Change', info='Changes pitch/key of vocals and instrumentals together. Altering this slightly reduces sound quality. (Semitones)')
196
- show_file_upload_button.click(swap_visibility, outputs=[file_upload_col, yt_link_col, song_input, local_file])
197
- show_yt_link_button.click(swap_visibility, outputs=[yt_link_col, file_upload_col, song_input, local_file])
198
-
199
- with gr.Accordion('Voice conversion options', open=False):
200
  with gr.Row():
201
- index_rate = gr.Slider(0, 1, value=0.5, label='Index Rate', info="Controls how much of the AI voice's accent to keep in the vocals")
202
- filter_radius = gr.Slider(0, 7, value=3, step=1, label='Filter radius', info='If >=3: apply median filtering median filtering to the harvested pitch results. Can reduce breathiness')
203
- rms_mix_rate = gr.Slider(0, 1, value=0.25, label='RMS mix rate', info="Control how much to mimic the original vocal's loudness (0) or a fixed loudness (1)")
204
- protect = gr.Slider(0, 0.5, value=0.33, label='Protect rate', info='Protect voiceless consonants and breath sounds. Set to 0.5 to disable.')
 
 
 
 
 
 
 
205
  with gr.Column():
206
- f0_method = gr.Dropdown(['rmvpe', 'mangio-crepe'], value='rmvpe', label='Pitch detection algorithm', info='Best option is rmvpe (clarity in vocals), then mangio-crepe (smoother vocals)')
207
- crepe_hop_length = gr.Slider(32, 320, value=128, step=1, visible=False, label='Crepe hop length', info='Lower values leads to longer conversions and higher risk of voice cracks, but better pitch accuracy.')
208
- f0_method.change(show_hop_slider, inputs=f0_method, outputs=crepe_hop_length)
209
- keep_files = gr.Checkbox(label='Keep intermediate files', info='Keep all audio files generated in the song_output/id directory, e.g. Isolated Vocals/Instrumentals. Leave unchecked to save space')
210
-
211
- with gr.Accordion('Audio mixing options', open=False):
212
- gr.Markdown('### Volume Change (decibels)')
213
- with gr.Row():
214
- main_gain = gr.Slider(-20, 20, value=0, step=1, label='Main Vocals')
215
- backup_gain = gr.Slider(-20, 20, value=0, step=1, label='Backup Vocals')
216
- inst_gain = gr.Slider(-20, 20, value=0, step=1, label='Music')
217
-
218
- gr.Markdown('### Reverb Control on AI Vocals')
219
- with gr.Row():
220
- reverb_rm_size = gr.Slider(0, 1, value=0.15, label='Room size', info='The larger the room, the longer the reverb time')
221
- reverb_wet = gr.Slider(0, 1, value=0.2, label='Wetness level', info='Level of AI vocals with reverb')
222
- reverb_dry = gr.Slider(0, 1, value=0.8, label='Dryness level', info='Level of AI vocals without reverb')
223
- reverb_damping = gr.Slider(0, 1, value=0.7, label='Damping level', info='Absorption of high frequencies in the reverb')
224
-
225
- gr.Markdown('### Audio Output Format')
226
- output_format = gr.Dropdown(['mp3', 'wav'], value='mp3', label='Output file type', info='mp3: small file size, decent quality. wav: Large file size, best quality')
 
 
 
 
 
 
 
 
 
 
 
 
227
 
 
 
228
  with gr.Row():
229
  generate_btn = gr.Button("Generate", variant='primary')
230
  ai_cover = gr.Audio(label='AI Cover', show_share_button=False)
 
175
  with gr.Tabs():
176
  rvc_model = gr.Dropdown(voice_models, label='Voice Models', info='Models folder "AICoverGen --> rvc_models". After new models are added into this folder, click the refresh button')
177
  ref_btn = gr.Button('Refresh Models ๐Ÿ”', variant='primary')
178
+
179
+ with gr.Tab("Inference"):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  with gr.Row():
181
+
182
+ with gr.Column() as yt_link_col:
183
+ song_input = gr.Text(label='Song input', info='Link to a song on YouTube or full path to a local file. For file upload, click the button below. Example: https://www.youtube.com/watch?v=M-mtdN6R3bQ')
184
+ show_file_upload_button = gr.Button('Upload file instead')
185
+
186
+ with gr.Column(visible=False) as file_upload_col:
187
+ local_file = gr.File(label='Audio file')
188
+ song_input_file = gr.UploadButton('Upload ๐Ÿ“‚', file_types=['audio'], variant='primary')
189
+ show_yt_link_button = gr.Button('Paste YouTube link/Path to local file instead')
190
+ song_input_file.upload(process_file_upload, inputs=[song_input_file], outputs=[local_file, song_input])
191
+
192
  with gr.Column():
193
+ pitch = gr.Slider(-3, 3, value=0, step=1, label='Pitch Change (Vocals ONLY)', info='Generally, use 1 for male to female conversions and -1 for vice-versa. (Octaves)')
194
+ pitch_all = gr.Slider(-12, 12, value=0, step=1, label='Overall Pitch Change', info='Changes pitch/key of vocals and instrumentals together. Altering this slightly reduces sound quality. (Semitones)')
195
+ show_file_upload_button.click(swap_visibility, outputs=[file_upload_col, yt_link_col, song_input, local_file])
196
+ show_yt_link_button.click(swap_visibility, outputs=[yt_link_col, file_upload_col, song_input, local_file])
197
+
198
+ with gr.Accordion('Voice conversion options', open=False):
199
+ with gr.Row():
200
+ index_rate = gr.Slider(0, 1, value=0.5, label='Index Rate', info="Controls how much of the AI voice's accent to keep in the vocals")
201
+ filter_radius = gr.Slider(0, 7, value=3, step=1, label='Filter radius', info='If >=3: apply median filtering median filtering to the harvested pitch results. Can reduce breathiness')
202
+ rms_mix_rate = gr.Slider(0, 1, value=0.25, label='RMS mix rate', info="Control how much to mimic the original vocal's loudness (0) or a fixed loudness (1)")
203
+ protect = gr.Slider(0, 0.5, value=0.33, label='Protect rate', info='Protect voiceless consonants and breath sounds. Set to 0.5 to disable.')
204
+ with gr.Column():
205
+ f0_method = gr.Dropdown(['rmvpe', 'mangio-crepe'], value='rmvpe', label='Pitch detection algorithm', info='Best option is rmvpe (clarity in vocals), then mangio-crepe (smoother vocals)')
206
+ crepe_hop_length = gr.Slider(32, 320, value=128, step=1, visible=False, label='Crepe hop length', info='Lower values leads to longer conversions and higher risk of voice cracks, but better pitch accuracy.')
207
+ f0_method.change(show_hop_slider, inputs=f0_method, outputs=crepe_hop_length)
208
+ keep_files = gr.Checkbox(label='Keep intermediate files', info='Keep all audio files generated in the song_output/id directory, e.g. Isolated Vocals/Instrumentals. Leave unchecked to save space')
209
+
210
+ with gr.Accordion('Audio mixing options', open=False):
211
+ gr.Markdown('### Volume Change (decibels)')
212
+ with gr.Row():
213
+ main_gain = gr.Slider(-20, 20, value=0, step=1, label='Main Vocals')
214
+ backup_gain = gr.Slider(-20, 20, value=0, step=1, label='Backup Vocals')
215
+ inst_gain = gr.Slider(-20, 20, value=0, step=1, label='Music')
216
+
217
+ with gr.Accordion('Reverb Control on AI Vocals',open=False):
218
+ with gr.Row():
219
+ reverb_rm_size = gr.Slider(0, 1, value=0.15, label='Room size', info='The larger the room, the longer the reverb time')
220
+ reverb_wet = gr.Slider(0, 1, value=0.2, label='Wetness level', info='Level of AI vocals with reverb')
221
+ reverb_dry = gr.Slider(0, 1, value=0.8, label='Dryness level', info='Level of AI vocals without reverb')
222
+ reverb_damping = gr.Slider(0, 1, value=0.7, label='Damping level', info='Absorption of high frequencies in the reverb')
223
+
224
+ with gr.Accordion('Audio Output Format',open=False):
225
+ output_format = gr.Dropdown(['mp3', 'wav'], value='mp3', label='Output file type', info='mp3: small file size, decent quality. wav: Large file size, best quality')
226
 
227
+ clear_btn = gr.ClearButton(value='Clear Settings', components=[song_input, rvc_model, keep_files, local_file])
228
+
229
  with gr.Row():
230
  generate_btn = gr.Button("Generate", variant='primary')
231
  ai_cover = gr.Audio(label='AI Cover', show_share_button=False)