TulipAIs commited on
Commit
3b44621
1 Parent(s): 66e2da5

going back to <<commenting out "MusicGen" and "Audio Info" tabs>>

Browse files
Files changed (1) hide show
  1. app.py +329 -112
app.py CHANGED
@@ -968,7 +968,7 @@ def ui_full(launch_kwargs):
968
  )
969
  with gr.Tab("Generate Sound Effects"):
970
  with gr.Row():
971
- #with gr.Column():
972
  with gr.Tab("Generation"):
973
  with gr.Accordion("Structure Prompts", open=False):
974
  with gr.Row():
@@ -1041,10 +1041,10 @@ def ui_full(launch_kwargs):
1041
  topp_a = gr.Number(label="Top-p", value=0, interactive=True)
1042
  temperature_a = gr.Number(label="Temperature", value=1.0, interactive=True)
1043
  cfg_coef_a = gr.Number(label="Classifier Free Guidance", value=3.0, interactive=True)
1044
- with gr.Row():
1045
- submit_a = gr.Button("Generate", variant="primary")
1046
- _ = gr.Button("Interrupt").click(fn=interrupt, queue=False)
1047
- with gr.Row():
1048
  with gr.Tab("Output"):
1049
  output_a = gr.Video(label="Generated Audio", scale=0)
1050
  with gr.Row():
@@ -1053,112 +1053,6 @@ def ui_full(launch_kwargs):
1053
  send_audio_a = gr.Button("Send to Input Audio")
1054
  seed_used_a = gr.Number(label='Seed used', value=-1, interactive=False)
1055
  download_a = gr.File(label="Generated Files", interactive=False)
1056
- with gr.Tab("MusicGen"):
1057
- gr.Markdown(
1058
- """
1059
- ### MusicGen
1060
- Check the "Wiki" to learn how to take the most out of TulipAI Soundscapes Music Generation Tool.
1061
- """
1062
- )
1063
- with gr.Tab("Generate Music"):
1064
- with gr.Row():
1065
- with gr.Column():
1066
- with gr.Tab("Generation"):
1067
- with gr.Accordion("Structure Prompts", open=False):
1068
- with gr.Column():
1069
- with gr.Row():
1070
- struc_prompts = gr.Checkbox(label="Enable", value=False, interactive=True, container=False)
1071
- bpm = gr.Number(label="BPM", value=120, interactive=True, scale=1, precision=0)
1072
- key = gr.Dropdown(["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "Bb", "B"], label="Key", value="C", interactive=True)
1073
- scale = gr.Dropdown(["Major", "Minor"], label="Scale", value="Major", interactive=True)
1074
- with gr.Row():
1075
- global_prompt = gr.Text(label="Global Prompt", interactive=True, scale=3)
1076
- with gr.Row():
1077
- s = gr.Slider(1, max_textboxes, value=1, step=1, label="Prompts:", interactive=True, scale=2)
1078
- #s_mode = gr.Radio(["segmentation", "batch"], value="segmentation", interactive=True, scale=1, label="Generation Mode")
1079
- with gr.Column():
1080
- textboxes = []
1081
- prompts = []
1082
- repeats = []
1083
- calcs = []
1084
- with gr.Row():
1085
- text0 = gr.Text(label="Input Text", interactive=True, scale=4)
1086
- prompts.append(text0)
1087
- drag0 = gr.Number(label="Repeat", value=1, interactive=True, scale=1)
1088
- repeats.append(drag0)
1089
- calc0 = gr.Text(interactive=False, value="00:00 - 00:00", scale=1, label="Time")
1090
- calcs.append(calc0)
1091
- for i in range(max_textboxes):
1092
- with gr.Row(visible=False) as t:
1093
- text = gr.Text(label="Input Text", interactive=True, scale=3)
1094
- repeat = gr.Number(label="Repeat", minimum=1, value=1, interactive=True, scale=1)
1095
- calc = gr.Text(interactive=False, value="00:00 - 00:00", scale=1, label="Time")
1096
- textboxes.append(t)
1097
- prompts.append(text)
1098
- repeats.append(repeat)
1099
- calcs.append(calc)
1100
- to_calc = gr.Button("Calculate Timings", variant="secondary")
1101
- with gr.Row():
1102
- duration = gr.Slider(minimum=1, maximum=300, value=10, step=1, label="Duration", interactive=True)
1103
- with gr.Row():
1104
- overlap = gr.Slider(minimum=1, maximum=29, value=12, step=1, label="Overlap", interactive=True)
1105
- with gr.Row():
1106
- seed = gr.Number(label="Seed", value=-1, scale=4, precision=0, interactive=True)
1107
- gr.Button('\U0001f3b2\ufe0f', scale=1).click(fn=lambda: -1, outputs=[seed], queue=False)
1108
- reuse_seed = gr.Button('\u267b\ufe0f', scale=1)
1109
-
1110
- with gr.Tab("Audio"):
1111
- with gr.Row():
1112
- with gr.Column():
1113
- input_type = gr.Radio(["file", "mic"], value="file", label="Input Type (optional)", interactive=True)
1114
- mode = gr.Radio(["melody", "sample"], label="Input Audio Mode (optional)", value="sample", interactive=True)
1115
- with gr.Row():
1116
- trim_start = gr.Number(label="Trim Start", value=0, interactive=True)
1117
- trim_end = gr.Number(label="Trim End", value=0, interactive=True)
1118
- audio = gr.Audio(source="upload", type="numpy", label="Input Audio (optional)", interactive=True)
1119
-
1120
- with gr.Tab("Customization"):
1121
- with gr.Row():
1122
- with gr.Column():
1123
- background = gr.ColorPicker(value="#0f0f0f", label="background color", interactive=True, scale=0)
1124
- bar1 = gr.ColorPicker(value="#84cc16", label="bar color start", interactive=True, scale=0)
1125
- bar2 = gr.ColorPicker(value="#10b981", label="bar color end", interactive=True, scale=0)
1126
- with gr.Column():
1127
- image = gr.Image(label="Background Image", type="filepath", interactive=True, scale=4)
1128
- with gr.Row():
1129
- height = gr.Number(label="Height", value=512, interactive=True)
1130
- width = gr.Number(label="Width", value=768, interactive=True)
1131
-
1132
- with gr.Tab("Settings"):
1133
- with gr.Row():
1134
- channel = gr.Radio(["mono", "stereo", "stereo effect"], label="Output Audio Channels", value="stereo", interactive=True, scale=1)
1135
- sr_select = gr.Dropdown(["11025", "16000", "22050", "24000", "32000", "44100", "48000"], label="Output Audio Sample Rate", value="48000", interactive=True)
1136
- with gr.Row():
1137
- model = gr.Radio(["melody", "small", "medium", "large", "custom"], label="Model", value="large", interactive=True, scale=1)
1138
- with gr.Column():
1139
- dropdown = gr.Dropdown(choices=get_available_models(), value=("No models found" if len(get_available_models()) < 1 else get_available_models()[0]), label='Custom Model (models folder)', elem_classes='slim-dropdown', interactive=True)
1140
- ui.create_refresh_button(dropdown, lambda: None, lambda: {'choices': get_available_models()}, 'refresh-button')
1141
- basemodel = gr.Radio(["small", "medium", "melody", "large"], label="Base Model", value="medium", interactive=True, scale=1)
1142
- with gr.Row():
1143
- decoder = gr.Radio(["Default", "MultiBand_Diffusion"], label="Decoder", value="Default", interactive=True)
1144
- with gr.Row():
1145
- topk = gr.Number(label="Top-k", value=250, interactive=True)
1146
- topp = gr.Number(label="Top-p", value=0, interactive=True)
1147
- temperature = gr.Number(label="Temperature", value=1.0, interactive=True)
1148
- cfg_coef = gr.Number(label="Classifier Free Guidance", value=3.0, interactive=True)
1149
- with gr.Row():
1150
- submit = gr.Button("Generate", variant="primary")
1151
- # Adapted from https://github.com/rkfg/audiocraft/blob/long/app.py, MIT license.
1152
- _ = gr.Button("Interrupt").click(fn=interrupt, queue=False)
1153
- with gr.Column() as c:
1154
- with gr.Tab("Output"):
1155
- output = gr.Video(label="Generated Music", scale=0)
1156
- with gr.Row():
1157
- audio_only = gr.Audio(type="numpy", label="Audio Only", interactive=False)
1158
- backup_only = gr.Audio(type="numpy", label="Backup Audio", interactive=False, visible=False)
1159
- send_audio = gr.Button("Send to Input Audio")
1160
- seed_used = gr.Number(label='Seed used', value=-1, interactive=False)
1161
- download = gr.File(label="Generated Files", interactive=False)
1162
  with gr.Tab("Wiki"):
1163
  gr.Markdown(
1164
  """
@@ -1285,6 +1179,327 @@ def ui_full(launch_kwargs):
1285
  refers to a technique used in some music generation models where a separate classifier network is trained to provide guidance or control over the generated music. This classifier is trained on labeled data to recognize specific musical characteristics or styles. During the generation process, the output of the generator model is evaluated by the classifier, and the generator is encouraged to produce music that aligns with the desired characteristics or style. This approach allows for more fine-grained control over the generated music, enabling users to specify certain attributes they want the model to capture.
1286
  """
1287
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1288
 
1289
  def variable_outputs(k):
1290
  k = int(k) - 1
@@ -1302,9 +1517,11 @@ def ui_full(launch_kwargs):
1302
  else:
1303
  return 512, 768
1304
 
 
1305
  image_a.change(get_size, image_a, outputs=[height_a, width_a])
 
1306
  s_a.change(variable_outputs, s_a, textboxes_a)
1307
- interface.queue().launch(**launch_kwargs)
1308
 
1309
 
1310
  def ui_batched(launch_kwargs):
 
968
  )
969
  with gr.Tab("Generate Sound Effects"):
970
  with gr.Row():
971
+ with gr.Column():
972
  with gr.Tab("Generation"):
973
  with gr.Accordion("Structure Prompts", open=False):
974
  with gr.Row():
 
1041
  topp_a = gr.Number(label="Top-p", value=0, interactive=True)
1042
  temperature_a = gr.Number(label="Temperature", value=1.0, interactive=True)
1043
  cfg_coef_a = gr.Number(label="Classifier Free Guidance", value=3.0, interactive=True)
1044
+ with gr.Row():
1045
+ submit_a = gr.Button("Generate", variant="primary")
1046
+ _ = gr.Button("Interrupt").click(fn=interrupt, queue=False)
1047
+ with gr.Column():
1048
  with gr.Tab("Output"):
1049
  output_a = gr.Video(label="Generated Audio", scale=0)
1050
  with gr.Row():
 
1053
  send_audio_a = gr.Button("Send to Input Audio")
1054
  seed_used_a = gr.Number(label='Seed used', value=-1, interactive=False)
1055
  download_a = gr.File(label="Generated Files", interactive=False)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1056
  with gr.Tab("Wiki"):
1057
  gr.Markdown(
1058
  """
 
1179
  refers to a technique used in some music generation models where a separate classifier network is trained to provide guidance or control over the generated music. This classifier is trained on labeled data to recognize specific musical characteristics or styles. During the generation process, the output of the generator model is evaluated by the classifier, and the generator is encouraged to produce music that aligns with the desired characteristics or style. This approach allows for more fine-grained control over the generated music, enabling users to specify certain attributes they want the model to capture.
1180
  """
1181
  )
1182
+ '''with gr.Tab("MusicGen"):
1183
+ gr.Markdown(
1184
+ """
1185
+ ### MusicGen
1186
+ Check the "Wiki" to learn how to take the most out of TulipAI Soundscapes Music Generation Tool.
1187
+ """
1188
+ )
1189
+ with gr.Tab("Generate Music"):
1190
+ with gr.Row():
1191
+ with gr.Column():
1192
+ with gr.Tab("Generation"):
1193
+ with gr.Accordion("Structure Prompts", open=False):
1194
+ with gr.Column():
1195
+ with gr.Row():
1196
+ struc_prompts = gr.Checkbox(label="Enable", value=False, interactive=True, container=False)
1197
+ bpm = gr.Number(label="BPM", value=120, interactive=True, scale=1, precision=0)
1198
+ key = gr.Dropdown(["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "Bb", "B"], label="Key", value="C", interactive=True)
1199
+ scale = gr.Dropdown(["Major", "Minor"], label="Scale", value="Major", interactive=True)
1200
+ with gr.Row():
1201
+ global_prompt = gr.Text(label="Global Prompt", interactive=True, scale=3)
1202
+ with gr.Row():
1203
+ s = gr.Slider(1, max_textboxes, value=1, step=1, label="Prompts:", interactive=True, scale=2)
1204
+ #s_mode = gr.Radio(["segmentation", "batch"], value="segmentation", interactive=True, scale=1, label="Generation Mode")
1205
+ with gr.Column():
1206
+ textboxes = []
1207
+ prompts = []
1208
+ repeats = []
1209
+ calcs = []
1210
+ with gr.Row():
1211
+ text0 = gr.Text(label="Input Text", interactive=True, scale=4)
1212
+ prompts.append(text0)
1213
+ drag0 = gr.Number(label="Repeat", value=1, interactive=True, scale=1)
1214
+ repeats.append(drag0)
1215
+ calc0 = gr.Text(interactive=False, value="00:00 - 00:00", scale=1, label="Time")
1216
+ calcs.append(calc0)
1217
+ for i in range(max_textboxes):
1218
+ with gr.Row(visible=False) as t:
1219
+ text = gr.Text(label="Input Text", interactive=True, scale=3)
1220
+ repeat = gr.Number(label="Repeat", minimum=1, value=1, interactive=True, scale=1)
1221
+ calc = gr.Text(interactive=False, value="00:00 - 00:00", scale=1, label="Time")
1222
+ textboxes.append(t)
1223
+ prompts.append(text)
1224
+ repeats.append(repeat)
1225
+ calcs.append(calc)
1226
+ to_calc = gr.Button("Calculate Timings", variant="secondary")
1227
+ with gr.Row():
1228
+ duration = gr.Slider(minimum=1, maximum=300, value=10, step=1, label="Duration", interactive=True)
1229
+ with gr.Row():
1230
+ overlap = gr.Slider(minimum=1, maximum=29, value=12, step=1, label="Overlap", interactive=True)
1231
+ with gr.Row():
1232
+ seed = gr.Number(label="Seed", value=-1, scale=4, precision=0, interactive=True)
1233
+ gr.Button('\U0001f3b2\ufe0f', scale=1).click(fn=lambda: -1, outputs=[seed], queue=False)
1234
+ reuse_seed = gr.Button('\u267b\ufe0f', scale=1)
1235
+
1236
+ with gr.Tab("Audio"):
1237
+ with gr.Row():
1238
+ with gr.Column():
1239
+ input_type = gr.Radio(["file", "mic"], value="file", label="Input Type (optional)", interactive=True)
1240
+ mode = gr.Radio(["melody", "sample"], label="Input Audio Mode (optional)", value="sample", interactive=True)
1241
+ with gr.Row():
1242
+ trim_start = gr.Number(label="Trim Start", value=0, interactive=True)
1243
+ trim_end = gr.Number(label="Trim End", value=0, interactive=True)
1244
+ audio = gr.Audio(source="upload", type="numpy", label="Input Audio (optional)", interactive=True)
1245
+
1246
+ with gr.Tab("Customization"):
1247
+ with gr.Row():
1248
+ with gr.Column():
1249
+ background = gr.ColorPicker(value="#0f0f0f", label="background color", interactive=True, scale=0)
1250
+ bar1 = gr.ColorPicker(value="#84cc16", label="bar color start", interactive=True, scale=0)
1251
+ bar2 = gr.ColorPicker(value="#10b981", label="bar color end", interactive=True, scale=0)
1252
+ with gr.Column():
1253
+ image = gr.Image(label="Background Image", type="filepath", interactive=True, scale=4)
1254
+ with gr.Row():
1255
+ height = gr.Number(label="Height", value=512, interactive=True)
1256
+ width = gr.Number(label="Width", value=768, interactive=True)
1257
+
1258
+ with gr.Tab("Settings"):
1259
+ with gr.Row():
1260
+ channel = gr.Radio(["mono", "stereo", "stereo effect"], label="Output Audio Channels", value="stereo", interactive=True, scale=1)
1261
+ sr_select = gr.Dropdown(["11025", "16000", "22050", "24000", "32000", "44100", "48000"], label="Output Audio Sample Rate", value="48000", interactive=True)
1262
+ with gr.Row():
1263
+ model = gr.Radio(["melody", "small", "medium", "large", "custom"], label="Model", value="large", interactive=True, scale=1)
1264
+ with gr.Column():
1265
+ dropdown = gr.Dropdown(choices=get_available_models(), value=("No models found" if len(get_available_models()) < 1 else get_available_models()[0]), label='Custom Model (models folder)', elem_classes='slim-dropdown', interactive=True)
1266
+ ui.create_refresh_button(dropdown, lambda: None, lambda: {'choices': get_available_models()}, 'refresh-button')
1267
+ basemodel = gr.Radio(["small", "medium", "melody", "large"], label="Base Model", value="medium", interactive=True, scale=1)
1268
+ with gr.Row():
1269
+ decoder = gr.Radio(["Default", "MultiBand_Diffusion"], label="Decoder", value="Default", interactive=True)
1270
+ with gr.Row():
1271
+ topk = gr.Number(label="Top-k", value=250, interactive=True)
1272
+ topp = gr.Number(label="Top-p", value=0, interactive=True)
1273
+ temperature = gr.Number(label="Temperature", value=1.0, interactive=True)
1274
+ cfg_coef = gr.Number(label="Classifier Free Guidance", value=3.0, interactive=True)
1275
+ with gr.Row():
1276
+ submit = gr.Button("Generate", variant="primary")
1277
+ # Adapted from https://github.com/rkfg/audiocraft/blob/long/app.py, MIT license.
1278
+ _ = gr.Button("Interrupt").click(fn=interrupt, queue=False)
1279
+ with gr.Column() as c:
1280
+ with gr.Tab("Output"):
1281
+ output = gr.Video(label="Generated Music", scale=0)
1282
+ with gr.Row():
1283
+ audio_only = gr.Audio(type="numpy", label="Audio Only", interactive=False)
1284
+ backup_only = gr.Audio(type="numpy", label="Backup Audio", interactive=False, visible=False)
1285
+ send_audio = gr.Button("Send to Input Audio")
1286
+ seed_used = gr.Number(label='Seed used', value=-1, interactive=False)
1287
+ download = gr.File(label="Generated Files", interactive=False)
1288
+ with gr.Tab("Wiki"):
1289
+ gr.Markdown(
1290
+ """
1291
+ - **[Generate (button)]:**
1292
+ Generates the music with the given settings and prompts.
1293
+
1294
+ - **[Interrupt (button)]:**
1295
+ Stops the music generation as soon as it can, providing an incomplete output.
1296
+
1297
+ ---
1298
+
1299
+ ### Generation Tab:
1300
+
1301
+ #### Structure Prompts:
1302
+
1303
+ This feature helps reduce repetetive prompts by allowing you to set global prompts
1304
+ that will be used for all prompt segments.
1305
+
1306
+ - **[Structure Prompts (checkbox)]:**
1307
+ Enable/Disable the structure prompts feature.
1308
+
1309
+ - **[BPM (number)]:**
1310
+ Beats per minute of the generated music.
1311
+
1312
+ - **[Key (dropdown)]:**
1313
+ The key of the generated music.
1314
+
1315
+ - **[Scale (dropdown)]:**
1316
+ The scale of the generated music.
1317
+
1318
+ - **[Global Prompt (text)]:**
1319
+ Here write the prompt that you wish to be used for all prompt segments.
1320
+
1321
+ #### Multi-Prompt:
1322
+
1323
+ This feature allows you to control the music, adding variation to different time segments.
1324
+ You have up to 10 prompt segments. the first prompt will always be 30s long
1325
+ the other prompts will be [30s - overlap].
1326
+ for example if the overlap is 10s, each prompt segment will be 20s.
1327
+
1328
+ - **[Prompt Segments (number)]:**
1329
+ Amount of unique prompt to generate throughout the music generation.
1330
+
1331
+ - **[Prompt/Input Text (prompt)]:**
1332
+ Here describe the music you wish the model to generate.
1333
+
1334
+ - **[Repeat (number)]:**
1335
+ Write how many times this prompt will repeat (instead of wasting another prompt segment on the same prompt).
1336
+
1337
+ - **[Time (text)]:**
1338
+ The time of the prompt segment.
1339
+
1340
+ - **[Calculate Timings (button)]:**
1341
+ Calculates the timings of the prompt segments.
1342
+
1343
+ - **[Duration (number)]:**
1344
+ How long you want the generated music to be (in seconds).
1345
+
1346
+ - **[Overlap (number)]:**
1347
+ How much each new segment will reference the previous segment (in seconds).
1348
+ For example, if you choose 20s: Each new segment after the first one will reference the previous segment 20s
1349
+ and will generate only 10s of new music. The model can only process 30s of music.
1350
+
1351
+ - **[Seed (number)]:**
1352
+ Your generated music id. If you wish to generate the exact same music,
1353
+ place the exact seed with the exact prompts
1354
+ (This way you can also extend specific song that was generated short).
1355
+
1356
+ - **[Random Seed (button)]:**
1357
+ Gives "-1" as a seed, which counts as a random seed.
1358
+
1359
+ - **[Copy Previous Seed (button)]:**
1360
+ Copies the seed from the output seed (if you don't feel like doing it manualy).
1361
+
1362
+ ---
1363
+
1364
+ ### Audio Tab:
1365
+
1366
+ - **[Input Type (selection)]:**
1367
+ `File` mode allows you to upload an audio file to use as input
1368
+ `Mic` mode allows you to use your microphone as input
1369
+
1370
+ - **[Input Audio Mode (selection)]:**
1371
+ `Melody` mode only works with the melody model: it conditions the music generation to reference the melody
1372
+ `Sample` mode works with any model: it gives a music sample to the model to generate its continuation.
1373
+
1374
+ - **[Trim Start and Trim End (numbers)]:**
1375
+ `Trim Start` set how much you'd like to trim the input audio from the start
1376
+ `Trim End` same as the above but from the end
1377
+
1378
+ - **[Input Audio (audio file)]:**
1379
+ Input here the audio you wish to use with "melody" or "sample" mode.
1380
+
1381
+ ---
1382
+
1383
+ ### Customization Tab:
1384
+
1385
+ - **[Background Color (color)]:**
1386
+ Works only if you don't upload image. Color of the background of the waveform.
1387
+
1388
+ - **[Bar Color Start (color)]:**
1389
+ First color of the waveform bars.
1390
+
1391
+ - **[Bar Color End (color)]:**
1392
+ Second color of the waveform bars.
1393
+
1394
+ - **[Background Image (image)]:**
1395
+ Background image that you wish to be attached to the generated video along with the waveform.
1396
+
1397
+ - **[Height and Width (numbers)]:**
1398
+ Output video resolution, only works with image.
1399
+ (minimum height and width is 256).
1400
+
1401
+ ---
1402
+
1403
+ ### Settings Tab:
1404
+
1405
+ - **[Output Audio Channels (selection)]:**
1406
+ With this you can select the amount of channels that you wish for your output audio.
1407
+ `mono` is a straightforward single channel audio
1408
+ `stereo` is a dual channel audio but it will sound more or less like mono
1409
+ `stereo effect` this one is also dual channel but uses tricks to simulate a stereo audio.
1410
+
1411
+ - **[Output Audio Sample Rate (dropdown)]:**
1412
+ The output audio sample rate, the model default is 32000.
1413
+
1414
+ - **[Model (selection)]:**
1415
+ Here you can choose which model you wish to use:
1416
+ `melody` model is based on the medium model with a unique feature that lets you use melody conditioning
1417
+ `small` model is trained on 300M parameters
1418
+ `medium` model is trained on 1.5B parameters
1419
+ `large` model is trained on 3.3B parameters
1420
+ `custom` model runs the custom model that you provided.
1421
+
1422
+ - **[Custom Model (selection)]:**
1423
+ This dropdown will show you models that are placed in the `models` folder
1424
+ you must select `custom` in the model options in order to use it.
1425
+
1426
+ - **[Refresh (button)]:**
1427
+ Refreshes the dropdown list for custom model.
1428
+
1429
+ - **[Base Model (selection)]:**
1430
+ Choose here the model that your custom model is based on.
1431
+
1432
+ - **[Decoder (selection)]:**
1433
+ Choose here the decoder that you wish to use:
1434
+ `Default` is the default decoder
1435
+ `MultiBand_Diffusion` is a decoder that uses diffusion to generate the audio.
1436
+
1437
+ - **[Top-k (number)]:**
1438
+ is a parameter used in text generation models, including music generation models. It determines the number of most likely next tokens to consider at each step of the generation process. The model ranks all possible tokens based on their predicted probabilities, and then selects the top-k tokens from the ranked list. The model then samples from this reduced set of tokens to determine the next token in the generated sequence. A smaller value of k results in a more focused and deterministic output, while a larger value of k allows for more diversity in the generated music.
1439
+
1440
+ - **[Top-p (number)]:**
1441
+ also known as nucleus sampling or probabilistic sampling, is another method used for token selection during text generation. Instead of specifying a fixed number like top-k, top-p considers the cumulative probability distribution of the ranked tokens. It selects the smallest possible set of tokens whose cumulative probability exceeds a certain threshold (usually denoted as p). The model then samples from this set to choose the next token. This approach ensures that the generated output maintains a balance between diversity and coherence, as it allows for a varying number of tokens to be considered based on their probabilities.
1442
+
1443
+ - **[Temperature (number)]:**
1444
+ is a parameter that controls the randomness of the generated output. It is applied during the sampling process, where a higher temperature value results in more random and diverse outputs, while a lower temperature value leads to more deterministic and focused outputs. In the context of music generation, a higher temperature can introduce more variability and creativity into the generated music, but it may also lead to less coherent or structured compositions. On the other hand, a lower temperature can produce more repetitive and predictable music.
1445
+
1446
+ - **[Classifier Free Guidance (number)]:**
1447
+ refers to a technique used in some music generation models where a separate classifier network is trained to provide guidance or control over the generated music. This classifier is trained on labeled data to recognize specific musical characteristics or styles. During the generation process, the output of the generator model is evaluated by the classifier, and the generator is encouraged to produce music that aligns with the desired characteristics or style. This approach allows for more fine-grained control over the generated music, enabling users to specify certain attributes they want the model to capture.
1448
+ """
1449
+ )
1450
+ with gr.Tab("Audio Info"):
1451
+ gr.Markdown(
1452
+ """
1453
+ ### Audio Info
1454
+ """
1455
+ )
1456
+ with gr.Row():
1457
+ with gr.Column():
1458
+ in_audio = gr.File(type="file", label="Input Any Audio", interactive=True)
1459
+ with gr.Row():
1460
+ send_gen = gr.Button("Send to MusicGen", variant="primary")
1461
+ send_gen_a = gr.Button("Send to AudioGen", variant="primary")
1462
+ with gr.Column():
1463
+ info = gr.Textbox(label="Audio Info", lines=10, interactive=False)
1464
+ with gr.Tab("About"):
1465
+ with gr.Row():
1466
+ with gr.Column():
1467
+ gen_type = gr.Text(value="music", interactive=False, visible=False)
1468
+ gen_type_a = gr.Text(value="audio", interactive=False, visible=False)
1469
+ gr.Markdown(
1470
+ """
1471
+ # Soundscapes by TulipAI
1472
+ Welcome to Soundscapes - TulipAI’s flagship Audio Storytelling Toolkit. Designed with modern content creators in mind, our AI-driven platform generates audio sound effects in just minutes tailored to your unique needs.
1473
+
1474
+ ## PERFECT FOR:
1475
+
1476
+ - Podcasters aiming to immerse their listeners.
1477
+ - Audiobooks sound engineers
1478
+ - Audio engineers seeking that elusive sound.
1479
+ - Producers wanting to enrich their auditory experience.
1480
+ - Sound designers craving innovative tools.
1481
+ - YouTubers desiring to elevate their content.
1482
+ """
1483
+ )
1484
+ with gr.Column():
1485
+ #gr.Image(shape=(5,5))
1486
+ gr.Image(shape=(5,5), value = "https://tulipai.co/assets/images/image01.png")
1487
+
1488
+ send_gen.click(info_to_params, inputs=[in_audio], outputs=[decoder, struc_prompts, global_prompt, bpm, key, scale, model, dropdown, basemodel, s, prompts[0], prompts[1], prompts[2], prompts[3], prompts[4], prompts[5], prompts[6], prompts[7], prompts[8], prompts[9], repeats[0], repeats[1], repeats[2], repeats[3], repeats[4], repeats[5], repeats[6], repeats[7], repeats[8], repeats[9], mode, duration, topk, topp, temperature, cfg_coef, seed, overlap, channel, sr_select], queue=False)
1489
+ reuse_seed.click(fn=lambda x: x, inputs=[seed_used], outputs=[seed], queue=False)
1490
+ send_audio.click(fn=lambda x: x, inputs=[backup_only], outputs=[audio], queue=False)
1491
+ submit.click(predict_full, inputs=[gen_type, model, decoder, dropdown, basemodel, s, struc_prompts, bpm, key, scale, global_prompt, prompts[0], prompts[1], prompts[2], prompts[3], prompts[4], prompts[5], prompts[6], prompts[7], prompts[8], prompts[9], repeats[0], repeats[1], repeats[2], repeats[3], repeats[4], repeats[5], repeats[6], repeats[7], repeats[8], repeats[9], audio, mode, trim_start, trim_end, duration, topk, topp, temperature, cfg_coef, seed, overlap, image, height, width, background, bar1, bar2, channel, sr_select], outputs=[output, audio_only, backup_only, download, seed_used])
1492
+ input_type.change(toggle_audio_src, input_type, [audio], queue=False, show_progress=False)
1493
+ to_calc.click(calc_time, inputs=[gen_type, s, duration, overlap, repeats[0], repeats[1], repeats[2], repeats[3], repeats[4], repeats[5], repeats[6], repeats[7], repeats[8], repeats[9]], outputs=[calcs[0], calcs[1], calcs[2], calcs[3], calcs[4], calcs[5], calcs[6], calcs[7], calcs[8], calcs[9]], queue=False)
1494
+
1495
+ send_gen_a.click(info_to_params_a, inputs=[in_audio], outputs=[decoder_a, struc_prompts_a, global_prompt_a, s_a, prompts_a[0], prompts_a[1], prompts_a[2], prompts_a[3], prompts_a[4], prompts_a[5], prompts_a[6], prompts_a[7], prompts_a[8], prompts_a[9], repeats_a[0], repeats_a[1], repeats_a[2], repeats_a[3], repeats_a[4], repeats_a[5], repeats_a[6], repeats_a[7], repeats_a[8], repeats_a[9], duration_a, topk_a, topp_a, temperature_a, cfg_coef_a, seed_a, overlap_a, channel_a, sr_select_a], queue=False)
1496
+ reuse_seed_a.click(fn=lambda x: x, inputs=[seed_used_a], outputs=[seed_a], queue=False)
1497
+ send_audio_a.click(fn=lambda x: x, inputs=[backup_only_a], outputs=[audio_a], queue=False)
1498
+ submit_a.click(predict_full, inputs=[gen_type_a, model_a, decoder_a, dropdown, basemodel, s_a, struc_prompts_a, bpm, key, scale, global_prompt_a, prompts_a[0], prompts_a[1], prompts_a[2], prompts_a[3], prompts_a[4], prompts_a[5], prompts_a[6], prompts_a[7], prompts_a[8], prompts_a[9], repeats_a[0], repeats_a[1], repeats_a[2], repeats_a[3], repeats_a[4], repeats_a[5], repeats_a[6], repeats_a[7], repeats_a[8], repeats_a[9], audio_a, mode_a, trim_start_a, trim_end_a, duration_a, topk_a, topp_a, temperature_a, cfg_coef_a, seed_a, overlap_a, image_a, height_a, width_a, background_a, bar1_a, bar2_a, channel_a, sr_select_a], outputs=[output_a, audio_only_a, backup_only_a, download_a, seed_used_a])
1499
+ input_type_a.change(toggle_audio_src, input_type_a, [audio_a], queue=False, show_progress=False)
1500
+ to_calc_a.click(calc_time, inputs=[gen_type_a, s_a, duration_a, overlap_a, repeats_a[0], repeats_a[1], repeats_a[2], repeats_a[3], repeats_a[4], repeats_a[5], repeats_a[6], repeats_a[7], repeats_a[8], repeats_a[9]], outputs=[calcs_a[0], calcs_a[1], calcs_a[2], calcs_a[3], calcs_a[4], calcs_a[5], calcs_a[6], calcs_a[7], calcs_a[8], calcs_a[9]], queue=False)
1501
+
1502
+ in_audio.change(get_audio_info, in_audio, outputs=[info])
1503
 
1504
  def variable_outputs(k):
1505
  k = int(k) - 1
 
1517
  else:
1518
  return 512, 768
1519
 
1520
+ image.change(get_size, image, outputs=[height, width])
1521
  image_a.change(get_size, image_a, outputs=[height_a, width_a])
1522
+ s.change(variable_outputs, s, textboxes)
1523
  s_a.change(variable_outputs, s_a, textboxes_a)
1524
+ interface.queue().launch(**launch_kwargs)'''
1525
 
1526
 
1527
  def ui_batched(launch_kwargs):