Buckets:

download
raw
25.3 kB
import"../chunks/DsnmJJEf.js";import{i as U,h as F,C as B,H as t,a as K,D as o,E as O,s as P}from"../chunks/BLbO27j4.js";import{p as C,o as q,s as e,f as X,a as S,b as Y,c as r,d as R,n as s,r as n}from"../chunks/jDjavuwI.js";const H='{"title":"Kandinsky 6 VAEs","local":"kandinsky-6-vaes","sections":[{"title":"Kandinsky6SRVAE","local":"diffusers.Kandinsky6SRVAE","sections":[],"depth":2},{"title":"MMAudioVAE","local":"diffusers.MMAudioVAE","sections":[],"depth":2},{"title":"MMAudioVocoder","local":"diffusers.MMAudioVocoder","sections":[],"depth":2}],"depth":1}';var Q=R('<meta name="hf:doc:metadata"/>'),$=R(`<p></p> <!> <!> <p>Kandinsky 6 uses a causal 3D K-VAE for video super-resolution and the MMAudio mel-spectrogram VAE, paired with a
separate BigVGAN <a href="/docs/diffusers/pr_14521/en/api/models/kandinsky6_vae#diffusers.MMAudioVocoder">MMAudioVocoder</a>, for synchronized audio generation.</p> <!> <p>The causal 3D K-VAE used by <a href="/docs/diffusers/pr_14521/en/api/pipelines/kandinsky6#diffusers.Kandinsky6SRPipeline">Kandinsky6SRPipeline</a>. It processes arbitrarily long videos in bounded-memory
segments while reproducing the exact output of a single, non-segmented pass.</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>Causal 3D K-VAE used by <a href="/docs/diffusers/pr_14521/en/api/pipelines/kandinsky6#diffusers.Kandinsky6SRPipeline">Kandinsky6SRPipeline</a> to encode and decode video.</p> <p>Videos are processed in temporal segments of 16 pixel frames (plus the leading frame). The causal convolutions
carry their padding state between segments, so the segmentation only bounds peak memory and does not change the
result.</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>Encode a video into its latent distribution.</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>Decode latents into a video.</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"><!></div></div> <!> <p>The mel-spectrogram VAE used by <a href="/docs/diffusers/pr_14521/en/api/pipelines/kandinsky6#diffusers.Kandinsky6TI2VAPipeline">Kandinsky6TI2VAPipeline</a> when <code>sample_audio=True</code>. Its <code>decode</code> output is a mel
spectrogram; pass it through <a href="/docs/diffusers/pr_14521/en/api/models/kandinsky6_vae#diffusers.MMAudioVocoder">MMAudioVocoder</a> to get a waveform.</p> <p>The reference implementation can be found at <a href="https://github.com/hkchengrex/MMAudio" rel="nofollow">hkchengrex/MMAudio</a> (MIT
license).</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>Audio VAE of <a href="/docs/diffusers/pr_14521/en/api/pipelines/kandinsky6#diffusers.Kandinsky6TI2VAPipeline">Kandinsky6TI2VAPipeline</a>: a magnitude-preserving autoencoder over log-mel spectrograms (MMAudio, <a href="https://arxiv.org/abs/2412.15322" rel="nofollow">https://arxiv.org/abs/2412.15322</a>).</p> <p><code>encode</code> turns a waveform into a latent distribution; <code>decode</code> turns latents back into a mel spectrogram, which <a href="/docs/diffusers/pr_14521/en/api/models/kandinsky6_vae#diffusers.MMAudioVocoder">MMAudioVocoder</a> then turns into a waveform. One latent frame covers <code>hop_length * 2</code> samples.</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>Encode a waveform into its latent distribution.</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>Decode latents into a mel spectrogram.</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"><!></div></div> <!> <p>Adapted from the BigVGAN-v2 vocoder MMAudio bundles, itself from <a href="https://github.com/NVIDIA/BigVGAN" rel="nofollow">NVIDIA/BigVGAN</a> (MIT license), with the anti-aliased Snake activations of <a href="https://github.com/junjun3518/alias-free-torch" rel="nofollow">alias-free-torch</a> (Apache License 2.0).</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>BigVGAN-v2 vocoder (<a href="https://github.com/NVIDIA/BigVGAN" rel="nofollow">https://github.com/NVIDIA/BigVGAN</a>, MIT license) with the anti-aliased Snake activations of <a href="https://github.com/junjun3518/alias-free-torch" rel="nofollow">https://github.com/junjun3518/alias-free-torch</a> (Apache 2.0), turning the mel spectrograms <a href="/docs/diffusers/pr_14521/en/api/models/kandinsky6_vae#diffusers.MMAudioVAE">MMAudioVAE</a> decodes
into waveforms for <a href="/docs/diffusers/pr_14521/en/api/pipelines/kandinsky6#diffusers.Kandinsky6TI2VAPipeline">Kandinsky6TI2VAPipeline</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"><!></div></div> <!> <p></p>`,1);function ne(z,I){C(I,!1),q(()=>{new URLSearchParams(window.location.search).get("fw")}),U();var f=$();F("18u55ck",E=>{var T=Q();P(T,"content",H),S(E,T)});var m=e(X(f),2);B(m,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var h=e(m,2);t(h,{title:"Kandinsky 6 VAEs",local:"kandinsky-6-vaes",headingTag:"h1"});var _=e(h,4);t(_,{title:"Kandinsky6SRVAE",local:"diffusers.Kandinsky6SRVAE",headingTag:"h2"});var g=e(_,4);K(g,{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwS2FuZGluc2t5NlNSVkFFJTBBJTBBdmFlJTIwJTNEJTIwS2FuZGluc2t5NlNSVkFFLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJrYW5kaW5za3lsYWIlMkZLYW5kaW5za3ktNi4wLVZTUi01cy1EaWZmdXNlcnMlMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ2YWUlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTBBKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> Kandinsky6SRVAE
vae = Kandinsky6SRVAE.from_pretrained(
<span class="hljs-string">&quot;kandinskylab/Kandinsky-6.0-VSR-5s-Diffusers&quot;</span>, subfolder=<span class="hljs-string">&quot;vae&quot;</span>, torch_dtype=torch.bfloat16
)`,lang:"python",wrap:!1});var a=e(g,2),b=r(a);o(b,{name:"class diffusers.Kandinsky6SRVAE",anchor:"diffusers.Kandinsky6SRVAE",source:"https://github.com/huggingface/diffusers/blob/vr_14521/src/diffusers/models/autoencoders/autoencoder_kandinsky6_sr.py#L516",parameters:[{name:"in_channels",val:": int = 3"},{name:"out_channels",val:": int = 3"},{name:"latent_channels",val:": int = 64"},{name:"encoder_block_out_channels",val:": tuple[int, ...] = (16, 128, 256, 512, 1024)"},{name:"decoder_block_out_channels",val:": tuple[int, ...] = (16, 256, 512, 1024, 2048)"},{name:"layers_per_block",val:": int = 2"},{name:"temporal_compression_ratio",val:": int = 4"},{name:"temporal_compression_start_level",val:": int = 1"},{name:"scaling_factor",val:": float = 0.910344004631042"}],parametersDescription:[{anchor:"diffusers.Kandinsky6SRVAE.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, defaults to <code>3</code>) &#x2014;
Number of pixel channels.`,name:"in_channels"},{anchor:"diffusers.Kandinsky6SRVAE.out_channels",description:`<strong>out_channels</strong> (<code>int</code>, defaults to <code>3</code>) &#x2014;
Number of reconstructed pixel channels.`,name:"out_channels"},{anchor:"diffusers.Kandinsky6SRVAE.latent_channels",description:`<strong>latent_channels</strong> (<code>int</code>, defaults to <code>64</code>) &#x2014;
Number of latent channels.`,name:"latent_channels"},{anchor:"diffusers.Kandinsky6SRVAE.encoder_block_out_channels",description:`<strong>encoder_block_out_channels</strong> (<code>tuple[int, ...]</code>, defaults to <code>(16, 128, 256, 512, 1024)</code>) &#x2014;
Output width of the residual blocks at each encoder level; every level but the last halves the spatial size
and doubles the width on the way to the next level.`,name:"encoder_block_out_channels"},{anchor:"diffusers.Kandinsky6SRVAE.decoder_block_out_channels",description:`<strong>decoder_block_out_channels</strong> (<code>tuple[int, ...]</code>, defaults to <code>(16, 256, 512, 1024, 2048)</code>) &#x2014;
Output width of the residual blocks at each decoder level.`,name:"decoder_block_out_channels"},{anchor:"diffusers.Kandinsky6SRVAE.layers_per_block",description:`<strong>layers_per_block</strong> (<code>int</code>, defaults to <code>2</code>) &#x2014;
Number of residual blocks per encoder level; the decoder uses one more per level.`,name:"layers_per_block"},{anchor:"diffusers.Kandinsky6SRVAE.temporal_compression_ratio",description:`<strong>temporal_compression_ratio</strong> (<code>int</code>, defaults to <code>4</code>) &#x2014;
Temporal compression factor; <code>log2</code> of it consecutive levels also compress time.`,name:"temporal_compression_ratio"},{anchor:"diffusers.Kandinsky6SRVAE.temporal_compression_start_level",description:`<strong>temporal_compression_start_level</strong> (<code>int</code>, defaults to <code>1</code>) &#x2014;
First level that compresses time.`,name:"temporal_compression_start_level"},{anchor:"diffusers.Kandinsky6SRVAE.scaling_factor",description:`<strong>scaling_factor</strong> (<code>float</code>, defaults to <code>0.910344</code>) &#x2014;
Scale applied to the latents before they enter the diffusion transformer.`,name:"scaling_factor"}]});var d=e(b,6),J=r(d);o(J,{name:"encode",anchor:"diffusers.Kandinsky6SRVAE.encode",source:"https://github.com/huggingface/diffusers/blob/vr_14521/src/diffusers/models/autoencoders/autoencoder_kandinsky6_sr.py#L585",parameters:[{name:"x",val:": torch.Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.Kandinsky6SRVAE.encode.x",description:`<strong>x</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, channels, num_frames, height, width)</code>) &#x2014;
Pixel video in <code>[-1, 1]</code>. <code>num_frames</code> should be <code>1 + k * temporal_compression_ratio</code>.`,name:"x"},{anchor:"diffusers.Kandinsky6SRVAE.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to return an <a href="/docs/diffusers/pr_14521/en/api/models/autoencoderkl_qwenimage21#diffusers.models.modeling_outputs.AutoencoderKLOutput">AutoencoderKLOutput</a> instead of a plain tuple.`,name:"return_dict"}]}),s(2),n(d);var i=e(d,2),D=r(i);o(D,{name:"decode",anchor:"diffusers.Kandinsky6SRVAE.decode",source:"https://github.com/huggingface/diffusers/blob/vr_14521/src/diffusers/models/autoencoders/autoencoder_kandinsky6_sr.py#L611",parameters:[{name:"z",val:": torch.Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.Kandinsky6SRVAE.decode.z",description:`<strong>z</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, latent_channels, num_latent_frames, height, width)</code>) &#x2014;
Latents, already divided by <code>scaling_factor</code>.`,name:"z"},{anchor:"diffusers.Kandinsky6SRVAE.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to return a <code>~models.autoencoder_kl.DecoderOutput</code> instead of a plain tuple.`,name:"return_dict"}]}),s(2),n(i);var v=e(i,2),N=r(v);o(N,{name:"forward",anchor:"diffusers.Kandinsky6SRVAE.forward",source:"https://github.com/huggingface/diffusers/blob/vr_14521/src/diffusers/models/autoencoders/autoencoder_kandinsky6_sr.py#L642",parameters:[{name:"sample",val:": torch.Tensor"},{name:"sample_posterior",val:": bool = False"},{name:"return_dict",val:": bool = True"},{name:"generator",val:": torch.Generator | None = None"}],parametersDescription:[{anchor:"diffusers.Kandinsky6SRVAE.forward.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, channels, num_frames, height, width)</code>) &#x2014;
Pixel video in <code>[-1, 1]</code>. <code>num_frames</code> should be <code>1 + k * temporal_compression_ratio</code>.`,name:"sample"},{anchor:"diffusers.Kandinsky6SRVAE.forward.sample_posterior",description:`<strong>sample_posterior</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to sample from the latent posterior instead of using its mode.`,name:"sample_posterior"},{anchor:"diffusers.Kandinsky6SRVAE.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to return a <code>~models.autoencoder_kl.DecoderOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.Kandinsky6SRVAE.forward.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make sampling
deterministic.`,name:"generator"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>If <code>return_dict</code> is True, a <code>~models.autoencoder_kl.DecoderOutput</code> is returned, otherwise a plain
<code>tuple</code> is returned. Its <code>sample</code> is the reconstructed video.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>~models.autoencoder_kl.DecoderOutput</code> or <code>tuple</code></p>
`}),n(v),n(a);var k=e(a,2);t(k,{title:"MMAudioVAE",local:"diffusers.MMAudioVAE",headingTag:"h2"});var M=e(k,6);K(M,{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTU1BdWRpb1ZBRSUwQSUwQWF1ZGlvX3ZhZSUyMCUzRCUyME1NQXVkaW9WQUUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreWxhYiUyRkthbmRpbnNreS02LjAtUHJvLWRpc3RpbGwtNXMtRGlmZnVzZXJzJTIyJTJDJTIwc3ViZm9sZGVyJTNEJTIyYXVkaW9fdmFlJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiUwQSk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> MMAudioVAE
audio_vae = MMAudioVAE.from_pretrained(
<span class="hljs-string">&quot;kandinskylab/Kandinsky-6.0-Pro-distill-5s-Diffusers&quot;</span>, subfolder=<span class="hljs-string">&quot;audio_vae&quot;</span>, torch_dtype=torch.bfloat16
)`,lang:"python",wrap:!1});var c=e(M,2),A=r(c);o(A,{name:"class diffusers.MMAudioVAE",anchor:"diffusers.MMAudioVAE",source:"https://github.com/huggingface/diffusers/blob/vr_14521/src/diffusers/models/autoencoders/autoencoder_mmaudio.py#L350",parameters:[{name:"mel_bins",val:": int = 128"},{name:"latent_channels",val:": int = 40"},{name:"hidden_channels",val:": int = 512"},{name:"channel_multipliers",val:": tuple[int, ...] = (1, 2, 4)"},{name:"layers_per_block",val:": int = 2"},{name:"sample_rate",val:": int = 44100"},{name:"n_fft",val:": int = 2048"},{name:"hop_length",val:": int = 512"},{name:"scaling_factor",val:": float = 0.417"}],parametersDescription:[{anchor:"diffusers.MMAudioVAE.mel_bins",description:`<strong>mel_bins</strong> (<code>int</code>, defaults to <code>128</code>) &#x2014;
Number of mel bins.`,name:"mel_bins"},{anchor:"diffusers.MMAudioVAE.latent_channels",description:`<strong>latent_channels</strong> (<code>int</code>, defaults to <code>40</code>) &#x2014;
Number of latent channels.`,name:"latent_channels"},{anchor:"diffusers.MMAudioVAE.hidden_channels",description:`<strong>hidden_channels</strong> (<code>int</code>, defaults to <code>512</code>) &#x2014;
Base width of the autoencoder.`,name:"hidden_channels"},{anchor:"diffusers.MMAudioVAE.channel_multipliers",description:`<strong>channel_multipliers</strong> (<code>tuple[int, ...]</code>, defaults to <code>(1, 2, 4)</code>) &#x2014;
Width multipliers of the autoencoder levels.`,name:"channel_multipliers"},{anchor:"diffusers.MMAudioVAE.layers_per_block",description:`<strong>layers_per_block</strong> (<code>int</code>, defaults to <code>2</code>) &#x2014;
Residual blocks per encoder level; the decoder uses one more per level.`,name:"layers_per_block"},{anchor:"diffusers.MMAudioVAE.sample_rate",description:`<strong>sample_rate</strong> (<code>int</code>, defaults to <code>44100</code>) &#x2014;
Waveform sample rate.`,name:"sample_rate"},{anchor:"diffusers.MMAudioVAE.n_fft",description:`<strong>n_fft</strong> (<code>int</code>, defaults to <code>2048</code>) &#x2014;
FFT size of the mel front end.`,name:"n_fft"},{anchor:"diffusers.MMAudioVAE.hop_length",description:`<strong>hop_length</strong> (<code>int</code>, defaults to <code>512</code>) &#x2014;
Hop length of the mel front end. Must match the total upsampling factor of the <a href="/docs/diffusers/pr_14521/en/api/models/kandinsky6_vae#diffusers.MMAudioVocoder">MMAudioVocoder</a> this VAE
is paired with.`,name:"hop_length"},{anchor:"diffusers.MMAudioVAE.scaling_factor",description:`<strong>scaling_factor</strong> (<code>float</code>, defaults to <code>0.417</code>) &#x2014;
Scale applied to the latents before they enter the diffusion transformer.`,name:"scaling_factor"}]});var l=e(A,6),W=r(l);o(W,{name:"encode",anchor:"diffusers.MMAudioVAE.encode",source:"https://github.com/huggingface/diffusers/blob/vr_14521/src/diffusers/models/autoencoders/autoencoder_mmaudio.py#L403",parameters:[{name:"audio",val:": torch.Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.MMAudioVAE.encode.audio",description:`<strong>audio</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_samples)</code>) &#x2014;
Mono waveform in <code>[-1, 1]</code> at <code>sample_rate</code>.`,name:"audio"},{anchor:"diffusers.MMAudioVAE.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to return an <a href="/docs/diffusers/pr_14521/en/api/models/autoencoderkl_qwenimage21#diffusers.models.modeling_outputs.AutoencoderKLOutput">AutoencoderKLOutput</a> instead of a plain tuple.`,name:"return_dict"}]}),s(2),n(l);var u=e(l,2),j=r(u);o(j,{name:"decode",anchor:"diffusers.MMAudioVAE.decode",source:"https://github.com/huggingface/diffusers/blob/vr_14521/src/diffusers/models/autoencoders/autoencoder_mmaudio.py#L420",parameters:[{name:"z",val:": torch.Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.MMAudioVAE.decode.z",description:`<strong>z</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, latent_channels, num_latent_frames)</code>) &#x2014;
Latents, already divided by <code>scaling_factor</code>.`,name:"z"},{anchor:"diffusers.MMAudioVAE.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to return a <code>~models.autoencoder_kl.DecoderOutput</code> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>The mel spectrogram of shape <code>(batch_size, mel_bins, num_mel_frames)</code>, ready for <a
href="/docs/diffusers/pr_14521/en/api/models/kandinsky6_vae#diffusers.MMAudioVocoder"
>MMAudioVocoder</a>.</p>
`}),s(2),n(u);var y=e(u,2),G=r(y);o(G,{name:"forward",anchor:"diffusers.MMAudioVAE.forward",source:"https://github.com/huggingface/diffusers/blob/vr_14521/src/diffusers/models/autoencoders/autoencoder_mmaudio.py#L439",parameters:[{name:"sample",val:": torch.Tensor"},{name:"sample_posterior",val:": bool = False"},{name:"return_dict",val:": bool = True"},{name:"generator",val:": torch.Generator | None = None"}],parametersDescription:[{anchor:"diffusers.MMAudioVAE.forward.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_samples)</code>) &#x2014;
Mono waveform in <code>[-1, 1]</code> at <code>sample_rate</code> to encode and reconstruct as a mel spectrogram.`,name:"sample"},{anchor:"diffusers.MMAudioVAE.forward.sample_posterior",description:`<strong>sample_posterior</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to sample from the latent posterior instead of using its mode.`,name:"sample_posterior"},{anchor:"diffusers.MMAudioVAE.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to return a <code>~models.autoencoder_kl.DecoderOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.MMAudioVAE.forward.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make sampling
deterministic.`,name:"generator"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>If <code>return_dict</code> is True, a <code>~models.autoencoder_kl.DecoderOutput</code> is returned, otherwise a plain
<code>tuple</code> is returned. Its <code>sample</code> is the reconstructed mel spectrogram of shape <code>(batch_size, mel_bins, num_mel_frames)</code>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>~models.autoencoder_kl.DecoderOutput</code> or <code>tuple</code></p>
`}),n(y),n(c);var V=e(c,2);t(V,{title:"MMAudioVocoder",local:"diffusers.MMAudioVocoder",headingTag:"h2"});var p=e(V,4),x=r(p);o(x,{name:"class diffusers.MMAudioVocoder",anchor:"diffusers.MMAudioVocoder",source:"https://github.com/huggingface/diffusers/blob/vr_14521/src/diffusers/models/autoencoders/mmaudio_vocoder.py#L154",parameters:[{name:"num_mels",val:": int = 128"},{name:"upsample_initial_channel",val:": int = 1536"},{name:"upsample_rates",val:": tuple[int, ...] = (8, 4, 2, 2, 2, 2)"},{name:"upsample_kernel_sizes",val:": tuple[int, ...] = (16, 8, 4, 4, 4, 4)"},{name:"resblock_kernel_sizes",val:": tuple[int, ...] = (3, 7, 11)"},{name:"resblock_dilation_sizes",val:": tuple[tuple[int, ...], ...] = ((1, 3, 5), (1, 3, 5), (1, 3, 5))"}],parametersDescription:[{anchor:"diffusers.MMAudioVocoder.num_mels",description:`<strong>num_mels</strong> (<code>int</code>, defaults to <code>128</code>) &#x2014;
Number of mel bins of the input spectrogram. Must match the paired <a href="/docs/diffusers/pr_14521/en/api/models/kandinsky6_vae#diffusers.MMAudioVAE">MMAudioVAE</a>&#x2019;s <code>mel_bins</code>.`,name:"num_mels"},{anchor:"diffusers.MMAudioVocoder.upsample_initial_channel",description:`<strong>upsample_initial_channel</strong> (<code>int</code>, defaults to <code>1536</code>) &#x2014;
Width of the first layer.`,name:"upsample_initial_channel"},{anchor:"diffusers.MMAudioVocoder.upsample_rates",description:`<strong>upsample_rates</strong> (<code>tuple[int, ...]</code>, defaults to <code>(8, 4, 2, 2, 2, 2)</code>) &#x2014;
Upsampling factors of the vocoder stages. Their product is the total upsampling factor and must match the
paired <a href="/docs/diffusers/pr_14521/en/api/models/kandinsky6_vae#diffusers.MMAudioVAE">MMAudioVAE</a>&#x2019;s <code>hop_length</code>.`,name:"upsample_rates"},{anchor:"diffusers.MMAudioVocoder.upsample_kernel_sizes",description:`<strong>upsample_kernel_sizes</strong> (<code>tuple[int, ...]</code>, defaults to <code>(16, 8, 4, 4, 4, 4)</code>) &#x2014;
Transposed-convolution kernel sizes of the vocoder stages.`,name:"upsample_kernel_sizes"},{anchor:"diffusers.MMAudioVocoder.resblock_kernel_sizes",description:`<strong>resblock_kernel_sizes</strong> (<code>tuple[int, ...]</code>, defaults to <code>(3, 7, 11)</code>) &#x2014;
Kernel sizes of the residual blocks.`,name:"resblock_kernel_sizes"},{anchor:"diffusers.MMAudioVocoder.resblock_dilation_sizes",description:`<strong>resblock_dilation_sizes</strong> (<code>tuple[tuple[int, ...], ...]</code>, defaults to <code>((1, 3, 5), (1, 3, 5), (1, 3, 5))</code>) &#x2014;
Dilations of the residual blocks.`,name:"resblock_dilation_sizes"}]});var w=e(x,4),L=r(w);o(L,{name:"forward",anchor:"diffusers.MMAudioVocoder.forward",source:"https://github.com/huggingface/diffusers/blob/vr_14521/src/diffusers/models/autoencoders/mmaudio_vocoder.py#L213",parameters:[{name:"mel",val:": torch.Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.MMAudioVocoder.forward.mel",description:`<strong>mel</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_mels, num_mel_frames)</code>) &#x2014;
Mel spectrogram, as decoded by <a href="/docs/diffusers/pr_14521/en/api/models/kandinsky6_vae#diffusers.MMAudioVAE">MMAudioVAE</a>.`,name:"mel"},{anchor:"diffusers.MMAudioVocoder.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to return a <code>~models.autoencoder_kl.DecoderOutput</code> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>The waveform of shape <code>(batch_size, 1, num_samples)</code> in <code>[-1, 1]</code>.</p>
`}),n(w),n(p);var Z=e(p,2);O(Z,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/kandinsky6_vae.md"}),s(2),S(z,f),Y()}export{ne as component};

Xet Storage Details

Size:
25.3 kB
·
Xet hash:
22f9b02f857b1ebc1daf8ae98defc860a4ea6b3732aa0ed6c4c3dd8724a11928

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.