Instructions to use sammoran-phd/cara-native-stable-audio with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Stable Audio Tools
How to use sammoran-phd/cara-native-stable-audio 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("sammoran-phd/cara-native-stable-audio") 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
File size: 1,541 Bytes
80ac38b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | {
"status": "completed",
"run_id": "run_000002",
"started_at": "2026-05-21T11:51:50.241886+00:00",
"finished_at": "2026-05-21T11:52:17.350325+00:00",
"updated_at": "2026-05-21T11:52:17.350325+00:00",
"current_phase": "completed",
"current_asset": null,
"current_asset_title": null,
"current_pool_id": null,
"processed_assets": 25000,
"total_assets": 25000,
"percent_complete": 100.0,
"counts": {
"review_required": 727,
"new_pool_created": 98,
"assigned": 24175,
"duplicate_found": 0,
"rejected": 0,
"unresolved": 0
},
"options": {
"subset_role": "music_train_candidate",
"only_downloaded": true,
"limit": null,
"allow_relaxed_metadata": true,
"start_fresh": true
},
"activity_log": [
{
"ts": "2026-05-21T11:51:50.241979+00:00",
"phase": "planning",
"level": "info",
"asset_id": null,
"source_key": null,
"pool_id": null,
"message": "v2 planning run started for 25000 candidate assets"
},
{
"ts": "2026-05-21T11:52:13.536231+00:00",
"phase": "planning",
"level": "info",
"asset_id": null,
"source_key": null,
"pool_id": null,
"message": "v2 normalized 25000 assets; building broad pool map"
},
{
"ts": "2026-05-21T11:53:07.604214+00:00",
"phase": "completed",
"level": "info",
"asset_id": null,
"source_key": null,
"pool_id": null,
"message": "v2 completed: 24273 training rows across 98 registered pools"
}
]
} |