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
Did prompt use the same Stable Audio structure?
#7
by liptodrera - opened
Shall I always use "|" in order to separate prompt elements?
Separating with commas should work fine, that's what we used here for most of the prompts.
Fauno15 changed discussion status to closed
Just one more question, I've tried with pipe and commas, but the prompt is very "sensible" to anything.
i.e.
drums, rock, simple, steady, 120
Now, considering to maintain the same seed as the previous prompt If I'm moving just one keyword (steady) next to the previous comma like:
drums, rock, simple,steady, 120
The output would be different.
Is that by design?