---
title: stable_audio
---

<div class="python-reference">
<a id="fastvideo.configs.models.dits.stable_audio-classes"></a>
<a id="fastvideo.configs.models.dits.stable_audio"></a>
<p>Config for the Stable Audio Open 1.0 DiT.</p>
<p>Note: the SA pipeline bypasses the standard <code>ComposedPipelineBase</code>
component loader because the published HF repo ships a single monolithic
<code>model.safetensors</code> (no Diffusers-style <code>model_index.json</code> or
per-subfolder layout). The arch fields and <code>param_names_mapping</code> here
document the architecture and key remap so the same conventions used by
the rest of the DiT family apply (FSDP shard conditions, supported
attention backends, future loader integrations) — they are not currently
consumed by <code>fastvideo/models/loader/fsdp_load.py</code> for SA.</p>
<h2 id="fastvideo.configs.models.dits.stable_audio.DiTArchConfig"><code>fastvideo.configs.models.dits.stable_audio.DiTArchConfig</code></h2>
<pre class="doc-signature"><code>DiTArchConfig(stacked_params_mapping: list&#91;tuple&#91;str, str, str&#93;&#93; = list(), _fsdp_shard_conditions: list = list(), _compile_conditions: list = list(), param_names_mapping: dict = dict(), reverse_param_names_mapping: dict = dict(), lora_param_names_mapping: dict = dict(), cast_prompt_embeds_to_dit_dtype: bool = False, _supported_attention_backends: tuple&#91;AttentionBackendEnum, ...&#93; = (AttentionBackendEnum.SAGE_ATTN, AttentionBackendEnum.FLASH_ATTN, AttentionBackendEnum.TORCH_SDPA, AttentionBackendEnum.VIDEO_SPARSE_ATTN, AttentionBackendEnum.VMOBA_ATTN, AttentionBackendEnum.SAGE_ATTN_THREE, AttentionBackendEnum.ATTN_QAT_INFER, AttentionBackendEnum.ATTN_QAT_TRAIN, AttentionBackendEnum.SLA_ATTN, AttentionBackendEnum.SAGE_SLA_ATTN), hidden_size: int = 0, num_attention_heads: int = 0, num_channels_latents: int = 0, in_channels: int = 0, out_channels: int = 0, exclude_lora_layers: list&#91;str&#93; = list(), boundary_ratio: float | None = None)</code></pre>


<h2 id="fastvideo.configs.models.dits.stable_audio.DiTConfig"><code>fastvideo.configs.models.dits.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.models.dits.stable_audio.DiTConfig.add_cli_args"><code>fastvideo.configs.models.dits.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.models.dits.stable_audio.AttentionBackendEnum"><code>fastvideo.configs.models.dits.stable_audio.AttentionBackendEnum</code></h2>
<pre class="doc-signature"><code>AttentionBackendEnum()</code></pre>

<h2 id="fastvideo.configs.models.dits.stable_audio.StableAudioArchConfig"><code>fastvideo.configs.models.dits.stable_audio.StableAudioArchConfig</code></h2>
<pre class="doc-signature"><code>StableAudioArchConfig(stacked_params_mapping: list&#91;tuple&#91;str, str, str&#93;&#93; = list(), _fsdp_shard_conditions: list = (lambda: &#91;_is_transformer_layer&#93;)(), _compile_conditions: list = list(), param_names_mapping: dict = (lambda: &#123;&#x27;^model\\.model\\.(.*?)\\.gamma$&#x27;: &#x27;\\1.weight&#x27;, &#x27;^model\\.model\\.(.*?)\\.beta$&#x27;: &#x27;\\1.bias&#x27;, &#x27;^model\\.model\\.(.*)$&#x27;: &#x27;\\1&#x27;&#125;)(), reverse_param_names_mapping: dict = dict(), lora_param_names_mapping: dict = dict(), cast_prompt_embeds_to_dit_dtype: bool = False, _supported_attention_backends: tuple&#91;AttentionBackendEnum, ...&#93; = (AttentionBackendEnum.FLASH_ATTN, AttentionBackendEnum.TORCH_SDPA), hidden_size: int = 0, num_attention_heads: int = 24, num_channels_latents: int = 0, in_channels: int = 0, out_channels: int = 0, exclude_lora_layers: list&#91;str&#93; = list(), boundary_ratio: float | None = None, io_channels: int = 64, embed_dim: int = 1536, depth: int = 24, cond_token_dim: int = 768, global_cond_dim: int = 1536, project_cond_tokens: bool = False, project_global_cond: bool = True, qk_norm: str | None = None)</code></pre>


<details><summary>Source</summary><pre><code>@dataclass
class StableAudioArchConfig(DiTArchConfig):
    _fsdp_shard_conditions: list = field(default_factory=lambda: &#91;_is_transformer_layer&#93;)

    # SA&#x27;s checkpoint is `stable_audio_tools` raw format (not Diffusers),
    # so the only remaps are: strip the `model.model.` host-pipeline
    # prefix, and rename `nn.LayerNorm`&#x27;s `gamma`/`beta` to torch&#x27;s
    # canonical `weight`/`bias`. Linear / cross-attention naming already
    # matches FastVideo&#x27;s conventions, so no further remap is needed.
    param_names_mapping: dict = field(
        default_factory=lambda: &#123;
            r&quot;^model\.model\.(.*?)\.gamma$&quot;: r&quot;\1.weight&quot;,
            r&quot;^model\.model\.(.*?)\.beta$&quot;: r&quot;\1.bias&quot;,
            r&quot;^model\.model\.(.*)$&quot;: r&quot;\1&quot;,
        &#125;)

    # SA only supports backends compatible with single-GPU LocalAttention.
    _supported_attention_backends: tuple&#91;AttentionBackendEnum, ...&#93; = (
        AttentionBackendEnum.FLASH_ATTN,
        AttentionBackendEnum.TORCH_SDPA,
    )

    # Architecture constants (from the published `model_config.json` for
    # `stabilityai/stable-audio-open-1.0`).
    io_channels: int = 64
    embed_dim: int = 1536
    depth: int = 24
    num_attention_heads: int = 24
    cond_token_dim: int = 768
    global_cond_dim: int = 1536
    project_cond_tokens: bool = False
    project_global_cond: bool = True
    # Set to &quot;ln&quot; to wrap attention Q/K in LayerNorm (used by
    # `stable-audio-open-small`; absent in the 1.0 base).
    qk_norm: str | None = None

    def __post_init__(self) -&gt; None:
        super().__post_init__()
        self.hidden_size = self.embed_dim
        self.in_channels = self.io_channels
        self.out_channels = self.io_channels
        self.num_channels_latents = self.io_channels
        self.attention_head_dim = self.embed_dim // self.num_attention_heads</code></pre></details>
<h2 id="fastvideo.configs.models.dits.stable_audio.StableAudioConfig"><code>fastvideo.configs.models.dits.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>


<details><summary>Source</summary><pre><code>@dataclass
class StableAudioConfig(DiTConfig):
    arch_config: DiTArchConfig = field(default_factory=StableAudioArchConfig)

    prefix: str = &quot;StableAudio&quot;</code></pre></details>
</div>
