WeixuanYuan commited on
Commit
cee471a
·
verified ·
1 Parent(s): 769d692

Update webUI/natural_language_guided_4/README.py

Browse files
webUI/natural_language_guided_4/README.py CHANGED
@@ -1,53 +1,41 @@
1
- import gradio as gr
2
-
3
- readme_content = """## Stable Diffusion for Sound Generation
4
-
5
- This project applies stable diffusion[1] to sound generation. Inspired by the work of AUTOMATIC1111, 2022[2], we have implemented a preliminary version of text2sound, sound2sound, inpaint, as well as an additional interpolation feature, all accessible through a web UI.
6
-
7
- ### Neural Network Training Data:
8
- The neural network is trained using the filtered NSynth dataset[3], which is a large-scale and high-quality collection of annotated musical notes, comprising 305,979 musical notes. However, for this project, only samples with a pitch set to E3 were used, resulting in an actual training sample size of 4,096, making it a low-resource project.
9
-
10
- The training took place on an NVIDIA Tesla T4 GPU and spanned approximately 10 hours.
11
-
12
- ### Natural Language Guidance:
13
- Natural language guidance is derived from the multi-label annotations of the NSynth dataset. The labels included in the training are:
14
-
15
- - **Instrument Families**: bass, brass, flute, guitar, keyboard, mallet, organ, reed, string, synth lead, vocal.
16
-
17
- - **Instrument Sources**: acoustic, electronic, synthetic.
18
-
19
- - **Note Qualities**: bright, dark, distortion, fast decay, long release, multiphonic, nonlinear env, percussive, reverb, tempo-synced.
20
-
21
- ### Usage Hints:
22
-
23
- 1. **Prompt Format**: It's recommended to use the format “label1, label2, label3“, e.g., ”organ, dark, long release“.
24
-
25
- 2. **Unique Sounds**: If you keep generating the same sound, try setting a different seed!
26
-
27
- 3. **Sample Indexing**: Drag the "Sample index slider" to view other samples within the generated batch.
28
-
29
- 4. **Running on CPU**: Be cautious with the settings for 'batchsize' and 'sample_steps' when running on CPU to avoid timeouts. Recommended settings are batchsize ≤ 4 and sample_steps = 15.
30
-
31
- 5. **Editing Sounds**: Generated audio can be downloaded and then re-uploaded for further editing at the sound2sound/inpaint sections.
32
-
33
- 6. **Guidance Scale**: A higher 'guidance_scale' intensifies the influence of natural language conditioning on the generation[4]. It's recommended to set it between 3 and 10.
34
-
35
- 7. **Noising Strength**: A smaller 'noising_strength' value makes the generated sound closer to the input sound.
36
-
37
- References:
38
-
39
- [1] Rombach, R., Blattmann, A., Lorenz, D., Esser, P., & Ommer, B. (2022). High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition (pp. 10684-10695).
40
-
41
- [2] AUTOMATIC1111. (2022). Stable Diffusion Web UI [Computer software]. Retrieved from https://github.com/AUTOMATIC1111/stable-diffusion-webui
42
-
43
- [3] Engel, J., Resnick, C., Roberts, A., Dieleman, S., Eck, D., Simonyan, K., & Norouzi, M. (2017). Neural Audio Synthesis of Musical Notes with WaveNet Autoencoders.
44
-
45
- [4] Ho, J., & Salimans, T. (2022). Classifier-free diffusion guidance. arXiv preprint arXiv:2207.12598.
46
- """
47
-
48
- def get_readme_module():
49
-
50
- with gr.Tab("README"):
51
- # gr.Markdown("Use interpolation to generate a gradient sound sequence.")
52
- with gr.Column(scale=3):
53
  readme_textbox = gr.Textbox(label="readme", lines=40, value=readme_content, interactive=False)
 
1
+ import gradio as gr
2
+
3
+ readme_content = """## Assisting Musicians with Generation of Musical Notes using a Text-Guided Diffusion Model
4
+
5
+
6
+ ### Training Data:
7
+ The neural network is trained on the filtered NSynth dataset [3], which comes with the following labels:
8
+
9
+ Instrument Families: bass, brass, flute, guitar, keyboard, mallet, organ, reed, string, synth lead, vocal.
10
+ Instrument Sources: acoustic, electronic, synthetic.
11
+ Note Qualities: bright, dark, distortion, fast decay, long release, multiphonic, nonlinear env, percussive, reverb, tempo-synced.
12
+
13
+ YOU ARE NOT LIMITED TO THE ABOVE TERMS; THE MODEL CAN UNDERSTAND A WIDE RANGE OF VOCABULARY AND ACCEPTS NATURAL LANGUAGE INPUT!
14
+
15
+ ### Usage Hints:
16
+
17
+ 1. **Unique Sounds**: Start generating your unique sound in Text2Sound!
18
+
19
+ 2. **Sample Indexing**: Drag the "Sample index slider" to view other samples within the generated batch.
20
+
21
+ 3. **Editing Sounds**: Generated audio can be downloaded and re-uploaded for further editing in the Sound2Sound/Inpaint sections. YOU CAN ALSO UPLOAD OR RECORD AUDIO FROM OTHER SOURCES.
22
+
23
+ 4. **Arrangement** Once you have achieved a satisfactory timbre in the Text2Sound, Sound2Sound, or Inpaint module, you can name and save it in the bottom-right corner. Then, you can upload your MIDI file in the Arrangement module, assign the saved timbre to each track, and start playing!
24
+
25
+ References:
26
+
27
+ [1] Rombach, R., Blattmann, A., Lorenz, D., Esser, P., & Ommer, B. (2022). High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition (pp. 10684-10695).
28
+
29
+ [2] AUTOMATIC1111. (2022). Stable Diffusion Web UI [Computer software]. Retrieved from https://github.com/AUTOMATIC1111/stable-diffusion-webui
30
+
31
+ [3] Engel, J., Resnick, C., Roberts, A., Dieleman, S., Eck, D., Simonyan, K., & Norouzi, M. (2017). Neural Audio Synthesis of Musical Notes with WaveNet Autoencoders.
32
+
33
+ [4] Ho, J., & Salimans, T. (2022). Classifier-free diffusion guidance. arXiv preprint arXiv:2207.12598.
34
+ """
35
+
36
+ def get_readme_module():
37
+
38
+ with gr.Tab("README"):
39
+ # gr.Markdown("Use interpolation to generate a gradient sound sequence.")
40
+ with gr.Column(scale=3):
 
 
 
 
 
 
 
 
 
 
 
 
41
  readme_textbox = gr.Textbox(label="readme", lines=40, value=readme_content, interactive=False)