{"id":24650,"library":"stable-audio-tools","title":"Stable Audio Tools","description":"A Python library by Stability AI for training and inference with generative audio models, including Stable Audio and Dance Diffusion. Current version 0.0.19. Active development with frequent updates.","status":"active","version":"0.0.19","language":"python","source_language":"en","source_url":"https://github.com/Stability-AI/stable-audio-tools","tags":["audio","generative-ai","stable-audio","diffusion","stability-ai","music-generation"],"install":[{"cmd":"pip install stable-audio-tools","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core deep learning framework required for model loading and inference.","package":"torch","optional":false},{"reason":"Used for tensor operations.","package":"einops","optional":false},{"reason":"Required for T5 text encoder and other model components.","package":"transformers","optional":false}],"imports":[{"note":"Primary function to list available pretrained models.","symbol":"get_models","correct":"from stable_audio_tools import get_models"},{"note":"Used to instantiate a model from a config or pretrained name.","symbol":"create_model_from_config","correct":"from stable_audio_tools.interface import create_model_from_config"},{"note":"Config dataclass for specifying model parameters.","symbol":"ModelConfig","correct":"from stable_audio_tools.interface import ModelConfig"},{"note":"Loads a pretrained model and its configuration.","symbol":"get_pretrained_model_and_config","correct":"from stable_audio_tools.interface import get_pretrained_model_and_config"}],"quickstart":{"code":"import torch\nimport soundfile as sf\nfrom stable_audio_tools import get_models\nfrom stable_audio_tools.interface import get_pretrained_model_and_config\n\n# List available models\nmodels = get_models()\nprint(\"Available models:\", list(models.keys()))\n\n# Use a stable audio model (replace with actual model name from list)\nmodel_name = \"stable-audio-open-1.0\"  # example, check get_models()\nmodel, config = get_pretrained_model_and_config(model_name)\n\n# Generate audio: text-to-audio (simplified, requires proper sampling setup)\n# Create a random latent and decode (demo only)\ndevice = \"cuda\" if torch.cuda.is_available() else \"cpu\"\nmodel = model.to(device)\n# Note: Full generation requires T5 text encoder and diffusion loop\nprint(\"Model loaded successfully. Refer to official docs for full inference.\")","lang":"python","description":"Quickstart to list models and load a pretrained model. Full text-to-audio generation requires additional steps (text encoder, diffusion loop)."},"warnings":[{"fix":"Install with `pip install stable-audio-tools==0.0.19` and watch GitHub for updates.","message":"The library is in early development (v0.0.19). APIs may change without notice. Always pin your dependency version.","severity":"gotcha","affected_versions":"<1.0.0"},{"fix":"Use `from stable_audio_tools import get_models`.","message":"The old import path `from stable_audio_tools.models import get_models` is deprecated in favor of `from stable_audio_tools import get_models`.","severity":"deprecated","affected_versions":">=0.0.15"},{"fix":"Always inspect the list returned by `get_models()` to get exact names.","message":"Model names supplied to `get_pretrained_model_and_config` must match exactly the keys from `get_models()`. Case and hyphen sensitive.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install stable-audio-tools` in the correct Python environment.","cause":"Library not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'stable_audio_tools'"},{"fix":"Check available models with `get_models()` and use the exact key string.","cause":"Model name does not exist or misspelled.","error":"KeyError: 'stable-audio-open-1.0'"},{"fix":"Ensure model and all inputs are moved to the same device with `.to(device)`.","cause":"Model and input tensors on different devices (CPU/GPU).","error":"RuntimeError: Expected all tensors to be on the same device, but found at least two devices"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}