tintwotin commited on
Commit
e9a44cb
·
verified ·
1 Parent(s): 6b2dbf7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +34 -1
README.md CHANGED
@@ -655,4 +655,37 @@ Its goal is to let users explore sound in new ways while retaining precise contr
655
  - how it feels sonically
656
  - how it fits into a production workflow
657
 
658
- That combination of **musical structure**, **instrument identity**, **timbral control**, and **loop fidelity** is what defines the model.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
655
  - how it feels sonically
656
  - how it fits into a production workflow
657
 
658
+ That combination of **musical structure**, **instrument identity**, **timbral control**, and **loop fidelity** is what defines the model.
659
+
660
+ Code for running the weight in Diffusers
661
+ ```
662
+ import scipy
663
+ import torch
664
+ import soundfile as sf
665
+ from diffusers import StableAudioPipeline
666
+
667
+ repo_id = "tintwotin/Foundation-1-Diffusers"
668
+ pipe = StableAudioPipeline.from_pretrained(repo_id, torch_dtype=torch.float16)
669
+ pipe = pipe.to("cuda")
670
+
671
+ # define the prompts
672
+ prompt = "Bass, FM Bass, Medium Delay, Medium Reverb, Low Distortion, Phaser, Sub Bass, Bass, Upper Mids, Acid, Gritty, Wide, Dubstep, Thick, Silky, Warm, Rich, Overdriven, Crisp, Deep, Clean, Pitch Bend, 303, 8 Bars, 140 BPM, E minor"
673
+ negative_prompt = "Low quality."
674
+
675
+ # set the seed for generator
676
+ generator = torch.Generator("cuda").manual_seed(0)
677
+
678
+ # run the generation
679
+ audio = pipe(
680
+ prompt,
681
+ negative_prompt=negative_prompt,
682
+ num_inference_steps=200,
683
+ audio_end_in_s=10.0,
684
+ num_waveforms_per_prompt=1,
685
+ generator=generator,
686
+ ).audios
687
+
688
+ output = audio[0].T.float().cpu().numpy()
689
+ sf.write("./foundation_loop.wav", output, pipe.vae.sampling_rate)
690
+
691
+ ```