---
title: stable_audio
---

<div class="python-reference">
<a id="fastvideo.configs.pipelines.stable_audio-classes"></a>
<a id="fastvideo.configs.pipelines.stable_audio"></a>
<p><code>PipelineConfig</code> for Stable Audio Open 1.0.</p>
<h2 id="fastvideo.configs.pipelines.stable_audio.DiTConfig"><code>fastvideo.configs.pipelines.stable_audio.DiTConfig</code></h2>
<pre class="doc-signature"><code>DiTConfig(arch_config: DiTArchConfig = DiTArchConfig(), prefix: str = &#x27;&#x27;, quant_config: QuantizationConfig | None = None, *, _resolved_attention_backend: AttentionBackendEnum | None = None)</code></pre>


<h3 id="fastvideo.configs.pipelines.stable_audio.DiTConfig.add_cli_args"><code>fastvideo.configs.pipelines.stable_audio.DiTConfig.add_cli_args</code></h3>
<pre class="doc-signature"><code>add_cli_args(parser: Any, prefix: str = &#x27;dit-config&#x27;) -&gt; Any</code></pre>
<p>Add CLI arguments for DiTConfig fields</p>
<h2 id="fastvideo.configs.pipelines.stable_audio.VAEConfig"><code>fastvideo.configs.pipelines.stable_audio.VAEConfig</code></h2>
<pre class="doc-signature"><code>VAEConfig(arch_config: VAEArchConfig = VAEArchConfig(), load_encoder: bool = True, load_decoder: bool = True, tile_sample_min_height: int = 256, tile_sample_min_width: int = 256, tile_sample_min_num_frames: int = 16, tile_sample_stride_height: int = 192, tile_sample_stride_width: int = 192, tile_sample_stride_num_frames: int = 12, blend_num_frames: int = 0, use_tiling: bool = True, use_temporal_tiling: bool = True, use_parallel_tiling: bool = True, use_temporal_scaling_frames: bool = True, *, _resolved_attention_backend: AttentionBackendEnum | None = None)</code></pre>


<h3 id="fastvideo.configs.pipelines.stable_audio.VAEConfig.add_cli_args"><code>fastvideo.configs.pipelines.stable_audio.VAEConfig.add_cli_args</code></h3>
<pre class="doc-signature"><code>add_cli_args(parser: Any, prefix: str = &#x27;vae-config&#x27;) -&gt; Any</code></pre>
<p>Add CLI arguments for VAEConfig fields</p>
<h3 id="fastvideo.configs.pipelines.stable_audio.VAEConfig.from_cli_args"><code>fastvideo.configs.pipelines.stable_audio.VAEConfig.from_cli_args</code></h3>
<pre class="doc-signature"><code>from_cli_args(args: argparse.Namespace) -&gt; VAEConfig</code></pre>

<h2 id="fastvideo.configs.pipelines.stable_audio.StableAudioConfig"><code>fastvideo.configs.pipelines.stable_audio.StableAudioConfig</code></h2>
<pre class="doc-signature"><code>StableAudioConfig(arch_config: DiTArchConfig = StableAudioArchConfig(), prefix: str = &#x27;StableAudio&#x27;, quant_config: QuantizationConfig | None = None, *, _resolved_attention_backend: AttentionBackendEnum | None = None)</code></pre>


<h2 id="fastvideo.configs.pipelines.stable_audio.OobleckVAEConfig"><code>fastvideo.configs.pipelines.stable_audio.OobleckVAEConfig</code></h2>
<pre class="doc-signature"><code>OobleckVAEConfig(arch_config: VAEArchConfig = OobleckVAEArchConfig(), load_encoder: bool = True, load_decoder: bool = True, tile_sample_min_height: int = 256, tile_sample_min_width: int = 256, tile_sample_min_num_frames: int = 16, tile_sample_stride_height: int = 192, tile_sample_stride_width: int = 192, tile_sample_stride_num_frames: int = 12, blend_num_frames: int = 0, use_tiling: bool = False, use_temporal_tiling: bool = False, use_parallel_tiling: bool = False, use_temporal_scaling_frames: bool = True, pretrained_path: str = &#x27;stabilityai/stable-audio-open-1.0&#x27;, pretrained_subfolder: str = &#x27;vae&#x27;, pretrained_dtype: str = &#x27;float16&#x27;, *, _resolved_attention_backend: AttentionBackendEnum | None = None)</code></pre>
<p>FastVideo VAE config wrapping the Oobleck arch.</p>
<p>Audio VAEs don't use the temporal/spatial tiling defaults that the
base VAEConfig is shaped for (those exist for video VAEs); they are
retained but irrelevant for audio.</p>

<h2 id="fastvideo.configs.pipelines.stable_audio.PipelineConfig"><code>fastvideo.configs.pipelines.stable_audio.PipelineConfig</code></h2>
<pre class="doc-signature"><code>PipelineConfig(model_path: str = &#x27;&#x27;, pipeline_config_path: str | None = None, embedded_cfg_scale: float = 6.0, flow_shift: float | None = None, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = False, is_causal: bool = False, dit_config: DiTConfig = DiTConfig(), dit_precision: str = &#x27;bf16&#x27;, upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = &#x27;fp32&#x27;, vae_config: VAEConfig = VAEConfig(), vae_precision: str = &#x27;fp32&#x27;, vae_decode_precision: str | None = None, vae_tiling: bool = True, vae_sp: bool = True, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = &#x27;fp32&#x27;, image_encoder_configs: tuple&#91;EncoderConfig, ...&#93; | None = None, image_encoder_precisions: tuple&#91;str, ...&#93; | None = None, text_encoder_configs: tuple&#91;EncoderConfig, ...&#93; = (lambda: (EncoderConfig(),))(), text_encoder_precisions: tuple&#91;str, ...&#93; = (lambda: (&#x27;fp32&#x27;,))(), preprocess_text_funcs: tuple&#91;Callable&#91;&#91;str&#93;, str&#93;, ...&#93; = (lambda: (preprocess_text,))(), postprocess_text_funcs: tuple&#91;Callable&#91;&#91;BaseEncoderOutput&#93;, torch.tensor&#93;, ...&#93; = (lambda: (postprocess_text,))(), dmd_denoising_steps: list&#91;int&#93; | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None)</code></pre>
<p>Base configuration for all pipeline architectures.</p>

<h3 id="fastvideo.configs.pipelines.stable_audio.PipelineConfig.add_cli_args"><code>fastvideo.configs.pipelines.stable_audio.PipelineConfig.add_cli_args</code></h3>
<pre class="doc-signature"><code>add_cli_args(parser: FlexibleArgumentParser, prefix: str = &#x27;&#x27;) -&gt; FlexibleArgumentParser</code></pre>

<h3 id="fastvideo.configs.pipelines.stable_audio.PipelineConfig.update_config_from_dict"><code>fastvideo.configs.pipelines.stable_audio.PipelineConfig.update_config_from_dict</code></h3>
<pre class="doc-signature"><code>update_config_from_dict(args: dict&#91;str, Any&#93;, prefix: str = &#x27;&#x27;) -&gt; None</code></pre>

<h3 id="fastvideo.configs.pipelines.stable_audio.PipelineConfig.from_pretrained"><code>fastvideo.configs.pipelines.stable_audio.PipelineConfig.from_pretrained</code></h3>
<pre class="doc-signature"><code>from_pretrained(model_path: str) -&gt; PipelineConfig</code></pre>
<p>use the pipeline class setting from model_path to match the pipeline config</p>
<h3 id="fastvideo.configs.pipelines.stable_audio.PipelineConfig.from_kwargs"><code>fastvideo.configs.pipelines.stable_audio.PipelineConfig.from_kwargs</code></h3>
<pre class="doc-signature"><code>from_kwargs(kwargs: dict&#91;str, Any&#93;, config_cli_prefix: str = &#x27;&#x27;) -&gt; PipelineConfig</code></pre>
<p>Load PipelineConfig from kwargs Dictionary.
kwargs: dictionary of kwargs
config_cli_prefix: prefix of CLI arguments for this PipelineConfig instance</p>
<h3 id="fastvideo.configs.pipelines.stable_audio.PipelineConfig.check_pipeline_config"><code>fastvideo.configs.pipelines.stable_audio.PipelineConfig.check_pipeline_config</code></h3>
<pre class="doc-signature"><code>check_pipeline_config() -&gt; None</code></pre>

<h3 id="fastvideo.configs.pipelines.stable_audio.PipelineConfig.resolve_checkpoint_settings"><code>fastvideo.configs.pipelines.stable_audio.PipelineConfig.resolve_checkpoint_settings</code></h3>
<pre class="doc-signature"><code>resolve_checkpoint_settings(fastvideo_args: FastVideoArgs) -&gt; None</code></pre>
<p>Apply the run settings that the checkpoint at <code>fastvideo_args.model_path</code> fixes.</p>
<p><code>FastVideoArgs.__post_init__</code> calls this once in the main process, before
argument validation and before any weights load. Most checkpoints fix no
run settings, so the base implementation does nothing.</p>
<h3 id="fastvideo.configs.pipelines.stable_audio.PipelineConfig.apply_request_constraints"><code>fastvideo.configs.pipelines.stable_audio.PipelineConfig.apply_request_constraints</code></h3>
<pre class="doc-signature"><code>apply_request_constraints(request: GenerationRequest, sampling_param: SamplingParam) -&gt; SamplingParam</code></pre>
<p>Apply this model's constraints on a generation request to its sampling parameters.</p>
<p><code>sampling_param</code> holds the preset defaults with the request's explicit
fields applied. A model sets the values it fixes when the request leaves
them unset, and raises when the request sets a value it does not accept.
The base PipelineConfig accepts every request unchanged.</p>
<h3 id="fastvideo.configs.pipelines.stable_audio.PipelineConfig.dump_to_json"><code>fastvideo.configs.pipelines.stable_audio.PipelineConfig.dump_to_json</code></h3>
<pre class="doc-signature"><code>dump_to_json(file_path: str)</code></pre>

<h3 id="fastvideo.configs.pipelines.stable_audio.PipelineConfig.load_from_json"><code>fastvideo.configs.pipelines.stable_audio.PipelineConfig.load_from_json</code></h3>
<pre class="doc-signature"><code>load_from_json(file_path: str)</code></pre>

<h3 id="fastvideo.configs.pipelines.stable_audio.PipelineConfig.update_pipeline_config"><code>fastvideo.configs.pipelines.stable_audio.PipelineConfig.update_pipeline_config</code></h3>
<pre class="doc-signature"><code>update_pipeline_config(source_pipeline_dict: dict&#91;str, Any&#93;) -&gt; None</code></pre>

<h2 id="fastvideo.configs.pipelines.stable_audio.StableAudioT2AConfig"><code>fastvideo.configs.pipelines.stable_audio.StableAudioT2AConfig</code></h2>
<pre class="doc-signature"><code>StableAudioT2AConfig(model_path: str = &#x27;&#x27;, pipeline_config_path: str | None = None, embedded_cfg_scale: float = 6.0, flow_shift: float | None = None, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = False, is_causal: bool = False, dit_config: DiTConfig = StableAudioConfig(), dit_precision: str = &#x27;fp16&#x27;, upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = &#x27;fp32&#x27;, vae_config: VAEConfig = OobleckVAEConfig(), vae_precision: str = &#x27;fp16&#x27;, vae_decode_precision: str | None = None, vae_tiling: bool = False, vae_sp: bool = False, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = &#x27;fp32&#x27;, image_encoder_configs: tuple&#91;EncoderConfig, ...&#93; | None = None, image_encoder_precisions: tuple&#91;str, ...&#93; | None = None, text_encoder_configs: tuple = tuple(), text_encoder_precisions: tuple&#91;str, ...&#93; = tuple(), preprocess_text_funcs: tuple = tuple(), postprocess_text_funcs: tuple = tuple(), dmd_denoising_steps: list&#91;int&#93; | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None, num_inference_steps: int = 100, guidance_scale: float = 7.0, audio_end_in_s: float = 10.0, audio_start_in_s: float = 0.0, sampling_rate: int = 44100, audio_channels: int = 2, sample_size: int = 2097152, max_audio_duration_s: float = 2097152 / 44100, precision: str = &#x27;fp16&#x27;)</code></pre>
<p>Stable Audio Open 1.0 pipeline config.</p>

<details><summary>Source</summary><pre><code>@dataclass
class StableAudioT2AConfig(PipelineConfig):
    &quot;&quot;&quot;Stable Audio Open 1.0 pipeline config.&quot;&quot;&quot;

    dit_config: DiTConfig = field(default_factory=StableAudioConfig)
    # Standard `TransformerLoader` reads `dit_precision`; default in
    # `PipelineConfig` is bf16, but we want fp16 to match official.
    dit_precision: str = &quot;fp16&quot;

    vae_config: VAEConfig = field(default_factory=OobleckVAEConfig)
    vae_tiling: bool = False
    vae_sp: bool = False

    # `StableAudioMultiConditioner` owns its own T5; zero out the
    # parent&#x27;s text-encoder slots so the length-equality validator passes.
    text_encoder_configs: tuple = field(default_factory=tuple)
    preprocess_text_funcs: tuple = field(default_factory=tuple)
    postprocess_text_funcs: tuple = field(default_factory=tuple)

    num_inference_steps: int = 100
    guidance_scale: float = 7.0
    audio_end_in_s: float = 10.0  # short-clip default
    audio_start_in_s: float = 0.0
    sampling_rate: int = 44100
    audio_channels: int = 2
    # Stable Audio Open 1.0 was trained at a fixed 2,097,152-sample
    # window (= 2097152 / 44100 ≈ 47.55s). Anything past this is
    # silently truncated by the post-decode slice — validate up-front.
    sample_size: int = 2097152
    max_audio_duration_s: float = 2097152 / 44100

    # Match the official `stable_audio_tools` defaults (`model_half=True`
    # in `run_gradio.py`), which loads the DiT, VAE, and T5 in fp16 and
    # wraps T5 forward in `autocast(fp16)`. fp16 is also a hard
    # requirement for FlashAttention-2 / FA-3.
    precision: str = &quot;fp16&quot;
    vae_precision: str = &quot;fp16&quot;
    text_encoder_precisions: tuple&#91;str, ...&#93; = field(default_factory=tuple)

    def __post_init__(self) -&gt; None:
        # A2A needs encode; load both halves for either path.
        self.vae_config.load_encoder = True
        self.vae_config.load_decoder = True</code></pre></details>
<h2 id="fastvideo.configs.pipelines.stable_audio.StableAudioOpenSmallConfig"><code>fastvideo.configs.pipelines.stable_audio.StableAudioOpenSmallConfig</code></h2>
<pre class="doc-signature"><code>StableAudioOpenSmallConfig(model_path: str = &#x27;&#x27;, pipeline_config_path: str | None = None, embedded_cfg_scale: float = 6.0, flow_shift: float | None = None, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = False, is_causal: bool = False, dit_config: DiTConfig = StableAudioConfig(), dit_precision: str = &#x27;fp16&#x27;, upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = &#x27;fp32&#x27;, vae_config: VAEConfig = OobleckVAEConfig(), vae_precision: str = &#x27;fp16&#x27;, vae_decode_precision: str | None = None, vae_tiling: bool = False, vae_sp: bool = False, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = &#x27;fp32&#x27;, image_encoder_configs: tuple&#91;EncoderConfig, ...&#93; | None = None, image_encoder_precisions: tuple&#91;str, ...&#93; | None = None, text_encoder_configs: tuple = tuple(), text_encoder_precisions: tuple&#91;str, ...&#93; = tuple(), preprocess_text_funcs: tuple = tuple(), postprocess_text_funcs: tuple = tuple(), dmd_denoising_steps: list&#91;int&#93; | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None, num_inference_steps: int = 100, guidance_scale: float = 7.0, audio_end_in_s: float = 6.0, audio_start_in_s: float = 0.0, sampling_rate: int = 44100, audio_channels: int = 2, sample_size: int = 524288, max_audio_duration_s: float = 524288 / 44100, precision: str = &#x27;fp16&#x27;)</code></pre>
<p><code>stable-audio-open-small</code> overrides: shorter training window
(524288 samples ≈ 11.89s @ 44.1 kHz) and a faster default sampler
config carried by the small preset.</p>

<details><summary>Source</summary><pre><code>@dataclass
class StableAudioOpenSmallConfig(StableAudioT2AConfig):
    &quot;&quot;&quot;`stable-audio-open-small` overrides: shorter training window
    (524288 samples ≈ 11.89s @ 44.1 kHz) and a faster default sampler
    config carried by the small preset.
    &quot;&quot;&quot;

    sample_size: int = 524288
    max_audio_duration_s: float = 524288 / 44100
    audio_end_in_s: float = 6.0  # short-clip default suitable for the small window</code></pre></details>
</div>
