arioso.platforms.stable_audio_3.adapter#
Stable Audio 3 adapter: Stability’s pure-MLX build, run as one process per take.
The MLX build is a script in the Stability-AI/stable-audio-3 checkout with its own
virtualenv (see the config’s runtime), so each call runs scripts/sa3_mlx.py there
(the small model loads in about a second, so a persistent worker would buy little) and
reads back the wav it wrote. A seed is always passed and recorded (a fresh one when none
is given). runner= is the process seam.
Module Attributes
Noise level for audio-to-audio when none is given; inpainting starts from pure noise (1.0). |
Classes
|
Local Stable Audio 3 (MLX) adapter. |
- class arioso.platforms.stable_audio_3.adapter.Adapter(config=None, *, runner=<function run_process>, is_supported=<function is_apple_silicon>)[source]#
Bases:
objectLocal Stable Audio 3 (MLX) adapter.
- generate(prompt, *, duration=10.0, model='sm-music', num_steps=8, guidance=1.0, seed=None, negative_prompt=None, audio_input=None, audio_input_strength=None, inpaint_range=None, timeout=None, **kwargs)[source]#
Generate
durationseconds forprompt.- Parameters:
prompt (
str) – Text description (tempo and key only through the text, e.g. “100 BPM”).duration (
float) – Seconds of audio (trimmed exactly).model (
str) –"sm-music"(fast),"sm-sfx"(sound effects) or"medium".num_steps (
int) – Sampler steps (the models are distilled for 8).guidance (
float) – CFG scale; 1.0 (the default) runs no unconditional branch, so anegative_promptacts only above 1.seed (
int) – Seed; a fresh one is drawn and recorded when None.negative_prompt (
str) – What to steer away from (needsguidanceabove 1).audio_input – Audio to vary (audio-to-audio) or, with
inpaint_range, to inpaint.audio_input_strength (
float) – How muchaudio_inputshapes the output, 0-1 (1 = follow it closely, 0 = ignore it), as for every platform. It is sent as the native noise level1 - audio_input_strength. When not given, the noise level is 0.7 for a variation and 1.0 for inpainting (which starts from noise).inpaint_range –
(start, end)seconds ofaudio_inputto regenerate.timeout (
float) – Seconds before the process is killed.
- Returns:
A complete Song (wav bytes, array when soundfile is installed, metadata).
- arioso.platforms.stable_audio_3.adapter.DFLT_A2A_NOISE = 0.7#
Noise level for audio-to-audio when none is given; inpainting starts from pure noise (1.0).