Instructions to use stabilityai/stable-audio-open-1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Stable Audio Tools
How to use stabilityai/stable-audio-open-1.0 with Stable Audio Tools:
import torch import torchaudio from einops import rearrange from stable_audio_tools import get_pretrained_model from stable_audio_tools.inference.generation import generate_diffusion_cond device = "cuda" if torch.cuda.is_available() else "cpu" # Download model model, model_config = get_pretrained_model("stabilityai/stable-audio-open-1.0") sample_rate = model_config["sample_rate"] sample_size = model_config["sample_size"] model = model.to(device) # Set up text and timing conditioning conditioning = [{ "prompt": "128 BPM tech house drum loop", }] # Generate stereo audio output = generate_diffusion_cond( model, conditioning=conditioning, sample_size=sample_size, device=device ) # Rearrange audio batch to a single sequence output = rearrange(output, "b d n -> d (b n)") # Peak normalize, clip, convert to int16, and save to file output = output.to(torch.float32).div(torch.max(torch.abs(output))).clamp(-1, 1).mul(32767).to(torch.int16).cpu() torchaudio.save("output.wav", output, sample_rate) - Notebooks
- Google Colab
- Kaggle
A Clear step by step local Installation Method would be nice.
The Readme.md is a little cryptic and could be clearer about setting this up locally and getting it to run.
In the interests of making this technology more widely available to non-coders can StabilityAi please do a step by step install video with a Gradio or ComfyUi interface.
I have git cloned stable_audio_tools-0.0.16
I have downloaded model and .cfg
- Where does the model get put?
- Does it need to be re-named?
- How exactly does one go about getting the Hugging Face token?
I don't want to sound ungrateful, but given the brain-power that must exist within StabilityAi surely accessibility of your work to your market would be a priority.
I appreciate this all takes time and effort and I want to thank StabilityAi for their desire to keep Ai as Open as possible.
I added some more documentation for the Gradio interface to the stable-audio-tools README, easiest way to get it going in the repo root is to run python3 ./run_gradio.py --pretrained-name stabilityai/stable-audio-open-1.0. That will pull down the weights from Hugging Face and start the demo automatically.
You'll want to run huggingface-cli login on the command line first to add your API key for Hugging Face
Thanks for your reply Fauno15.
Saganaki22 has created a one click installer, which has made things a lot easier for me.
https://github.com/Saganaki22/StableAudioWebUI/releases/tag/latest