Buckets:
| import"../chunks/DsnmJJEf.js";import{i as S,h as A,C as y,H as p,D as n,E as x,s as k}from"../chunks/BtE7mKSK.js";import{p as w,o as z,s as e,f as L,a as h,b as j,c as a,d as g,n as s,r as i}from"../chunks/jDjavuwI.js";const q='{"title":"StableAudioDiTModel","local":"stableaudioditmodel","sections":[{"title":"StableAudioDiTModel","local":"diffusers.StableAudioDiTModel","sections":[],"depth":2}],"depth":1}';var F=g('<meta name="hf:doc:metadata"/>'),N=g('<p></p> <!> <!> <p>A Transformer model for audio waveforms from <a href="https://huggingface.co/papers/2407.14358" rel="nofollow">Stable Audio Open</a>.</p> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>The Diffusion Transformer model introduced in Stable Audio.</p> <p>Reference: <a href="https://github.com/Stability-AI/stable-audio-tools" rel="nofollow">https://github.com/Stability-AI/stable-audio-tools</a></p> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>The <a href="/docs/diffusers/pr_13966/en/api/models/stable_audio_transformer#diffusers.StableAudioDiTModel">StableAudioDiTModel</a> forward method.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Disables custom attention processors and sets the default attention implementation.</p></div></div> <!> <p></p>',1);function P(b,T){w(T,!1),z(()=>{new URLSearchParams(window.location.search).get("fw")}),S();var r=N();A("1mw3xvh",_=>{var f=F();k(f,"content",q),h(_,f)});var d=e(L(r),2);y(d,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var l=e(d,2);p(l,{title:"StableAudioDiTModel",local:"stableaudioditmodel",headingTag:"h1"});var c=e(l,4);p(c,{title:"StableAudioDiTModel",local:"diffusers.StableAudioDiTModel",headingTag:"h2"});var t=e(c,2),m=a(t);n(m,{name:"class diffusers.StableAudioDiTModel",anchor:"diffusers.StableAudioDiTModel",source:"https://github.com/huggingface/diffusers/blob/vr_13966/src/diffusers/models/transformers/stable_audio_transformer.py#L183",parameters:[{name:"sample_size",val:": int = 1024"},{name:"in_channels",val:": int = 64"},{name:"num_layers",val:": int = 24"},{name:"attention_head_dim",val:": int = 64"},{name:"num_attention_heads",val:": int = 24"},{name:"num_key_value_attention_heads",val:": int = 12"},{name:"out_channels",val:": int = 64"},{name:"cross_attention_dim",val:": int = 768"},{name:"time_proj_dim",val:": int = 256"},{name:"global_states_input_dim",val:": int = 1536"},{name:"cross_attention_input_dim",val:": int = 768"}],parametersDescription:[{anchor:"diffusers.StableAudioDiTModel.sample_size",description:"<strong>sample_size</strong> ( <code>int</code>, <em>optional</em>, defaults to 1024) — The size of the input sample.",name:"sample_size"},{anchor:"diffusers.StableAudioDiTModel.in_channels",description:"<strong>in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 64) — The number of channels in the input.",name:"in_channels"},{anchor:"diffusers.StableAudioDiTModel.num_layers",description:"<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 24) — The number of layers of Transformer blocks to use.",name:"num_layers"},{anchor:"diffusers.StableAudioDiTModel.attention_head_dim",description:"<strong>attention_head_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 64) — The number of channels in each head.",name:"attention_head_dim"},{anchor:"diffusers.StableAudioDiTModel.num_attention_heads",description:"<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 24) — The number of heads to use for the query states.",name:"num_attention_heads"},{anchor:"diffusers.StableAudioDiTModel.num_key_value_attention_heads",description:`<strong>num_key_value_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) — | |
| The number of heads to use for the key and value states.`,name:"num_key_value_attention_heads"},{anchor:"diffusers.StableAudioDiTModel.out_channels",description:"<strong>out_channels</strong> (<code>int</code>, defaults to 64) — Number of output channels.",name:"out_channels"},{anchor:"diffusers.StableAudioDiTModel.cross_attention_dim",description:"<strong>cross_attention_dim</strong> ( <code>int</code>, <em>optional</em>, defaults to 768) — Dimension of the cross-attention projection.",name:"cross_attention_dim"},{anchor:"diffusers.StableAudioDiTModel.time_proj_dim",description:"<strong>time_proj_dim</strong> ( <code>int</code>, <em>optional</em>, defaults to 256) — Dimension of the timestep inner projection.",name:"time_proj_dim"},{anchor:"diffusers.StableAudioDiTModel.global_states_input_dim",description:`<strong>global_states_input_dim</strong> ( <code>int</code>, <em>optional</em>, defaults to 1536) — | |
| Input dimension of the global hidden states projection.`,name:"global_states_input_dim"},{anchor:"diffusers.StableAudioDiTModel.cross_attention_input_dim",description:`<strong>cross_attention_input_dim</strong> ( <code>int</code>, <em>optional</em>, defaults to 768) — | |
| Input dimension of the cross-attention projection`,name:"cross_attention_input_dim"}]});var o=e(m,6),v=a(o);n(v,{name:"forward",anchor:"diffusers.StableAudioDiTModel.forward",source:"https://github.com/huggingface/diffusers/blob/vr_13966/src/diffusers/models/transformers/stable_audio_transformer.py#L282",parameters:[{name:"hidden_states",val:": FloatTensor"},{name:"timestep",val:": LongTensor = None"},{name:"encoder_hidden_states",val:": FloatTensor = None"},{name:"global_hidden_states",val:": FloatTensor = None"},{name:"rotary_embedding",val:": FloatTensor = None"},{name:"return_dict",val:": bool = True"},{name:"attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"diffusers.StableAudioDiTModel.forward.hidden_states",description:`<strong>hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch size, in_channels, sequence_len)</code>) — | |
| Input <code>hidden_states</code>.`,name:"hidden_states"},{anchor:"diffusers.StableAudioDiTModel.forward.timestep",description:`<strong>timestep</strong> ( <code>torch.LongTensor</code>) — | |
| Used to indicate denoising step.`,name:"timestep"},{anchor:"diffusers.StableAudioDiTModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch size, encoder_sequence_len, cross_attention_input_dim)</code>) — | |
| Conditional embeddings (embeddings computed from the input conditions such as prompts) to use.`,name:"encoder_hidden_states"},{anchor:"diffusers.StableAudioDiTModel.forward.global_hidden_states",description:`<strong>global_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch size, global_sequence_len, global_states_input_dim)</code>) — | |
| Global embeddings that will be prepended to the hidden states.`,name:"global_hidden_states"},{anchor:"diffusers.StableAudioDiTModel.forward.rotary_embedding",description:`<strong>rotary_embedding</strong> (<code>torch.Tensor</code>) — | |
| The rotary embeddings to apply on query and key tensors during attention calculation.`,name:"rotary_embedding"},{anchor:"diffusers.StableAudioDiTModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <code>~models.transformer_2d.Transformer2DModelOutput</code> instead of a plain | |
| tuple.`,name:"return_dict"},{anchor:"diffusers.StableAudioDiTModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_len)</code>, <em>optional</em>) — | |
| Mask to avoid performing attention on padding token indices, formed by concatenating the attention | |
| masks | |
| for the two text encoders together. Mask values selected in <code>[0, 1]</code>:</p> | |
| <ul> | |
| <li>1 for tokens that are <strong>not masked</strong>,</li> | |
| <li>0 for tokens that are <strong>masked</strong>.</li> | |
| </ul>`,name:"attention_mask"},{anchor:"diffusers.StableAudioDiTModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_len)</code>, <em>optional</em>) — | |
| Mask to avoid performing attention on padding token cross-attention indices, formed by concatenating | |
| the attention masks | |
| for the two text encoders together. Mask values selected in <code>[0, 1]</code>:</p> | |
| <ul> | |
| <li>1 for tokens that are <strong>not masked</strong>,</li> | |
| <li>0 for tokens that are <strong>masked</strong>.</li> | |
| </ul>`,name:"encoder_attention_mask"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>If <code>return_dict</code> is True, an <code>~models.transformer_2d.Transformer2DModelOutput</code> is returned, otherwise a | |
| <code>tuple</code> where the first element is the sample tensor.</p> | |
| `}),s(2),i(o);var u=e(o,2),D=a(u);n(D,{name:"set_default_attn_processor",anchor:"diffusers.StableAudioDiTModel.set_default_attn_processor",source:"https://github.com/huggingface/diffusers/blob/vr_13966/src/diffusers/models/transformers/stable_audio_transformer.py#L276",parameters:[]}),s(2),i(u),i(t);var M=e(t,2);x(M,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/stable_audio_transformer.md"}),s(2),h(b,r),j()}export{P as component}; | |
Xet Storage Details
- Size:
- 9.67 kB
- Xet hash:
- 2134f9bf9821c445e9360d053101023e89dd7ca46ca07f230e2eff79a5799c77
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.