arioso.platforms.stable_audio.adapter#
Stable Audio Open adapter using HuggingFace Diffusers.
Runs on arioso._util.torch_device() (CUDA, else Apple MPS, else CPU), in
float16 on CUDA only. The Stability AI repositories are gated: accept the
licence on the model’s Hugging Face page and log in before the first load.
Module Attributes
Seeds are drawn below this bound when none is given, so every take records one. |
Functions
|
|
|
A |
Classes
|
Stable Audio Open adapter with lazy model loading. |
- class arioso.platforms.stable_audio.adapter.Adapter(config, *, load_pipeline=<function load_pipeline>, make_generator=<function make_torch_generator>)[source]#
Bases:
objectStable Audio Open adapter with lazy model loading.
Uses
diffusers.StableAudioPipelinefor local inference.load_pipeline(model id -> pipeline) andmake_generator((device, seed) -> generator) are the seams that keep tests free of torch, diffusers and the gated weights.- generate(prompt, *, negative_prompt=None, duration=10.0, num_steps=200, guidance=7.0, seed=None, batch_size=1, sampler='dpmpp-3m-sde', audio_input=None, audio_input_strength=None, model='stabilityai/stable-audio-open-1.0', **kwargs)[source]#
Generate audio from a text prompt, optionally conditioned on input audio.
- Parameters:
prompt (
str) – Text description of desired audio.negative_prompt (
str) – Text description of undesired characteristics.duration (
float) – Length in seconds.num_steps (
int) – Number of diffusion inference steps.guidance (
float) – Classifier-free guidance scale.seed (
int) – Random seed for reproducibility. When omitted, one is drawn and recorded inmetadata['seed'], so every take can be redone.batch_size (
int) – Number of waveforms to generate.sampler (
str) – Sampler type for the diffusion process.audio_input – Optional input audio to condition on (audio-to-audio): a Song/AudioResult/bytes/path/(array, sample_rate)/NumPy waveform. Passed to the pipeline as
initial_audio_waveforms– i.e. the model continues/initializes from this audio.audio_input_strength (
float) – Accepted for API symmetry but ignored – the diffusersStableAudioPipelineexposes no denoise/strength control (that is a stable-audio-tools/ComfyUI feature). A warning is emitted if a value is passed alongsideaudio_input.model (
str) – Hugging Face id of a Stable Audio checkpoint thatStableAudioPipelineloads.
- Return type:
- Returns:
A Song with audio_array populated.
- arioso.platforms.stable_audio.adapter.SEED_BOUND = 2147483648#
Seeds are drawn below this bound when none is given, so every take records one.