import{s as It,n as Vt,o as Gt}from"../chunks/scheduler.53228c21.js";import{S as Et,i as St,e as a,s,c as u,h as Ot,a as i,d as o,b as r,f as b,g as f,j as h,k as A,l as t,m as l,n as m,t as p,o as _,p as g}from"../chunks/index.100fac89.js";import{C as Jt}from"../chunks/CopyLLMTxtMenu.fb2ec027.js";import{D as v}from"../chunks/Docstring.86a664ae.js";import{C as Ht}from"../chunks/CodeBlock.d30a6509.js";import{H as $e,E as zt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.09d4dba9.js";function Ut(mt){let x,Pe,be,ye,D,xe,K,Le,F,pt='The variational autoencoder (VAE) model with KL loss was introduced in <a href="https://huggingface.co/papers/1312.6114v11" rel="nofollow">Auto-Encoding Variational Bayes</a> by Diederik P. Kingma and Max Welling. The model is used in 🤗 Diffusers to encode images into latents and to decode latent representations into images.',we,M,_t="The abstract from the paper is:",Te,I,gt="<em>How can we perform efficient inference and learning in directed probabilistic models, in the presence of continuous latent variables with intractable posterior distributions, and large datasets? We introduce a stochastic variational inference and learning algorithm that scales to large datasets and, under some mild differentiability conditions, even works in the intractable case. Our contributions are two-fold. First, we show that a reparameterization of the variational lower bound yields a lower bound estimator that can be straightforwardly optimized using standard stochastic gradient methods. Second, we show that for i.i.d. datasets with continuous latent variables per datapoint, posterior inference can be made especially efficient by fitting an approximate inference model (also called a recognition model) to the intractable posterior using the proposed lower bound estimator. Theoretical advantages are reflected in experimental results.</em>",ke,V,Ce,G,ht=`By default the <a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a> should be loaded with <a href="/docs/diffusers/main/en/api/models/overview#diffusers.ModelMixin.from_pretrained">from_pretrained()</a>, but it can also be loaded
from the original format using <code>FromOriginalModelMixin.from_single_file</code> as follows:`,De,E,Ke,S,Fe,d,O,Ne,oe,At="A VAE model with KL loss for encoding images into latents and decoding latent representations into images.",qe,se,bt=`This model inherits from <a href="/docs/diffusers/main/en/api/models/overview#diffusers.ModelMixin">ModelMixin</a>. Check the superclass documentation for it’s generic methods implemented
for all models (such as downloading or saving).`,We,re,J,je,ne,H,Re,ae,z,Ze,$,U,Ye,ie,vt=`Enables fused QKV projections. For self-attention modules, all projection matrices (i.e., query, key, value)
are fused. For cross-attention modules, key and value projection matrices are fused.`,Qe,X,$t="<p>&gt; This API is 🧪 experimental.</p>",Be,T,N,et,de,Pt="Sets the attention processor to use to compute attention.",tt,k,q,ot,le,yt="Disables custom attention processors and sets the default attention implementation.",st,C,W,rt,ce,xt="Decode a batch of images using a tiled decoder.",nt,P,j,at,ue,Lt="Encode a batch of images using a tiled encoder.",it,fe,wt=`When this option is enabled, the VAE will split the input tensor into tiles to compute encoding in several
steps. This is useful to keep memory use constant regardless of image size. The end result of tiled encoding is
different from non-tiled encoding because each tile uses a different encoder. To avoid tiling artifacts, the
tiles overlap and are blended together to form a smooth output. You may still see tile-sized changes in the
output, but they should be much less noticeable.`,dt,y,R,lt,me,Tt="Disables the fused QKV projection if enabled.",ct,Z,kt="<p>&gt; This API is 🧪 experimental.</p>",Me,Y,Ie,L,Q,ut,pe,Ct="Output of AutoencoderKL encoding method.",Ve,B,Ge,w,ee,ft,_e,Dt="Output of decoding method.",Ee,te,Se,ve,Oe;return D=new Jt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),K=new $e({props:{title:"AutoencoderKL",local:"autoencoderkl",headingTag:"h1"}}),V=new $e({props:{title:"Loading from the original format",local:"loading-from-the-original-format",headingTag:"h2"}}),E=new Ht({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9lbmNvZGVyS0wlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGc3RhYmlsaXR5YWklMkZzZC12YWUtZnQtbXNlLW9yaWdpbmFsJTJGYmxvYiUyRm1haW4lMkZ2YWUtZnQtbXNlLTg0MDAwMC1lbWEtcHJ1bmVkLnNhZmV0ZW5zb3JzJTIyJTIwJTIwJTIzJTIwY2FuJTIwYWxzbyUyMGJlJTIwYSUyMGxvY2FsJTIwZmlsZSUwQW1vZGVsJTIwJTNEJTIwQXV0b2VuY29kZXJLTC5mcm9tX3NpbmdsZV9maWxlKHVybCk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoencoderKL

url = <span class="hljs-string">&quot;https://huggingface.co/stabilityai/sd-vae-ft-mse-original/blob/main/vae-ft-mse-840000-ema-pruned.safetensors&quot;</span>  <span class="hljs-comment"># can also be a local file</span>
model = AutoencoderKL.from_single_file(url)`,wrap:!1}}),S=new $e({props:{title:"AutoencoderKL",local:"diffusers.AutoencoderKL",headingTag:"h2"}}),O=new v({props:{name:"class diffusers.AutoencoderKL",anchor:"diffusers.AutoencoderKL",parameters:[{name:"in_channels",val:": int = 3"},{name:"out_channels",val:": int = 3"},{name:"down_block_types",val:": typing.Tuple[str, ...] = ('DownEncoderBlock2D',)"},{name:"up_block_types",val:": typing.Tuple[str, ...] = ('UpDecoderBlock2D',)"},{name:"block_out_channels",val:": typing.Tuple[int, ...] = (64,)"},{name:"layers_per_block",val:": int = 1"},{name:"act_fn",val:": str = 'silu'"},{name:"latent_channels",val:": int = 4"},{name:"norm_num_groups",val:": int = 32"},{name:"sample_size",val:": int = 32"},{name:"scaling_factor",val:": float = 0.18215"},{name:"shift_factor",val:": typing.Optional[float] = None"},{name:"latents_mean",val:": typing.Optional[typing.Tuple[float]] = None"},{name:"latents_std",val:": typing.Optional[typing.Tuple[float]] = None"},{name:"force_upcast",val:": bool = True"},{name:"use_quant_conv",val:": bool = True"},{name:"use_post_quant_conv",val:": bool = True"},{name:"mid_block_add_attention",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AutoencoderKL.in_channels",description:"<strong>in_channels</strong> (int, <em>optional</em>, defaults to 3) &#x2014; Number of channels in the input image.",name:"in_channels"},{anchor:"diffusers.AutoencoderKL.out_channels",description:"<strong>out_channels</strong> (int,  <em>optional</em>, defaults to 3) &#x2014; Number of channels in the output.",name:"out_channels"},{anchor:"diffusers.AutoencoderKL.down_block_types",description:`<strong>down_block_types</strong> (<code>Tuple[str]</code>, <em>optional</em>, defaults to <code>(&quot;DownEncoderBlock2D&quot;,)</code>) &#x2014;
Tuple of downsample block types.`,name:"down_block_types"},{anchor:"diffusers.AutoencoderKL.up_block_types",description:`<strong>up_block_types</strong> (<code>Tuple[str]</code>, <em>optional</em>, defaults to <code>(&quot;UpDecoderBlock2D&quot;,)</code>) &#x2014;
Tuple of upsample block types.`,name:"up_block_types"},{anchor:"diffusers.AutoencoderKL.block_out_channels",description:`<strong>block_out_channels</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>(64,)</code>) &#x2014;
Tuple of block output channels.`,name:"block_out_channels"},{anchor:"diffusers.AutoencoderKL.act_fn",description:"<strong>act_fn</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014; The activation function to use.",name:"act_fn"},{anchor:"diffusers.AutoencoderKL.latent_channels",description:"<strong>latent_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014; Number of channels in the latent space.",name:"latent_channels"},{anchor:"diffusers.AutoencoderKL.sample_size",description:"<strong>sample_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>32</code>) &#x2014; Sample input size.",name:"sample_size"},{anchor:"diffusers.AutoencoderKL.scaling_factor",description:`<strong>scaling_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 0.18215) &#x2014;
The component-wise standard deviation of the trained latent space computed using the first batch of the
training set. This is used to scale the latent space to have unit variance when training the diffusion
model. The latents are scaled with the formula <code>z = z * scaling_factor</code> before being passed to the
diffusion model. When decoding, the latents are scaled back to the original scale with the formula: <code>z = 1 / scaling_factor * z</code>. For more details, refer to sections 4.3.2 and D.1 of the <a href="https://huggingface.co/papers/2112.10752" rel="nofollow">High-Resolution Image
Synthesis with Latent Diffusion Models</a> paper.`,name:"scaling_factor"},{anchor:"diffusers.AutoencoderKL.force_upcast",description:`<strong>force_upcast</strong> (<code>bool</code>, <em>optional</em>, default to <code>True</code>) &#x2014;
If enabled it will force the VAE to run in float32 for high image resolution pipelines, such as SD-XL. VAE
can be fine-tuned / trained to a lower range without losing too much precision in which case <code>force_upcast</code>
can be set to <code>False</code> - see: <a href="https://huggingface.co/madebyollin/sdxl-vae-fp16-fix" rel="nofollow">https://huggingface.co/madebyollin/sdxl-vae-fp16-fix</a>`,name:"force_upcast"},{anchor:"diffusers.AutoencoderKL.mid_block_add_attention",description:`<strong>mid_block_add_attention</strong> (<code>bool</code>, <em>optional</em>, default to <code>True</code>) &#x2014;
If enabled, the mid_block of the Encoder and Decoder will have attention blocks. If set to false, the
mid_block will only have resnet blocks`,name:"mid_block_add_attention"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl.py#L38"}}),J=new v({props:{name:"wrapper",anchor:"diffusers.AutoencoderKL.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/accelerate_utils.py#L43"}}),H=new v({props:{name:"wrapper",anchor:"diffusers.AutoencoderKL.encode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/accelerate_utils.py#L43"}}),z=new v({props:{name:"forward",anchor:"diffusers.AutoencoderKL.forward",parameters:[{name:"sample",val:": Tensor"},{name:"sample_posterior",val:": bool = False"},{name:"return_dict",val:": bool = True"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"}],parametersDescription:[{anchor:"diffusers.AutoencoderKL.forward.sample",description:"<strong>sample</strong> (<code>torch.Tensor</code>) &#x2014; Input sample.",name:"sample"},{anchor:"diffusers.AutoencoderKL.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 posterior.`,name:"sample_posterior"},{anchor:"diffusers.AutoencoderKL.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>DecoderOutput</code> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl.py#L472"}}),U=new v({props:{name:"fuse_qkv_projections",anchor:"diffusers.AutoencoderKL.fuse_qkv_projections",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl.py#L501"}}),N=new v({props:{name:"set_attn_processor",anchor:"diffusers.AutoencoderKL.set_attn_processor",parameters:[{name:"processor",val:": typing.Union[diffusers.models.attention_processor.AttnProcessor, diffusers.models.attention_processor.CustomDiffusionAttnProcessor, diffusers.models.attention_processor.AttnAddedKVProcessor, diffusers.models.attention_processor.AttnAddedKVProcessor2_0, diffusers.models.attention_processor.JointAttnProcessor2_0, diffusers.models.attention_processor.PAGJointAttnProcessor2_0, diffusers.models.attention_processor.PAGCFGJointAttnProcessor2_0, diffusers.models.attention_processor.FusedJointAttnProcessor2_0, diffusers.models.attention_processor.AllegroAttnProcessor2_0, diffusers.models.attention_processor.AuraFlowAttnProcessor2_0, diffusers.models.attention_processor.FusedAuraFlowAttnProcessor2_0, diffusers.models.attention_processor.FluxAttnProcessor2_0, diffusers.models.attention_processor.FluxAttnProcessor2_0_NPU, diffusers.models.attention_processor.FusedFluxAttnProcessor2_0, diffusers.models.attention_processor.FusedFluxAttnProcessor2_0_NPU, diffusers.models.attention_processor.CogVideoXAttnProcessor2_0, diffusers.models.attention_processor.FusedCogVideoXAttnProcessor2_0, diffusers.models.attention_processor.XFormersAttnAddedKVProcessor, diffusers.models.attention_processor.XFormersAttnProcessor, diffusers.models.attention_processor.XLAFlashAttnProcessor2_0, diffusers.models.attention_processor.AttnProcessorNPU, diffusers.models.attention_processor.AttnProcessor2_0, diffusers.models.attention_processor.MochiVaeAttnProcessor2_0, diffusers.models.attention_processor.MochiAttnProcessor2_0, diffusers.models.attention_processor.StableAudioAttnProcessor2_0, diffusers.models.attention_processor.HunyuanAttnProcessor2_0, diffusers.models.attention_processor.FusedHunyuanAttnProcessor2_0, diffusers.models.attention_processor.PAGHunyuanAttnProcessor2_0, diffusers.models.attention_processor.PAGCFGHunyuanAttnProcessor2_0, diffusers.models.attention_processor.LuminaAttnProcessor2_0, diffusers.models.attention_processor.FusedAttnProcessor2_0, diffusers.models.attention_processor.CustomDiffusionXFormersAttnProcessor, diffusers.models.attention_processor.CustomDiffusionAttnProcessor2_0, diffusers.models.attention_processor.SlicedAttnProcessor, diffusers.models.attention_processor.SlicedAttnAddedKVProcessor, diffusers.models.attention_processor.SanaLinearAttnProcessor2_0, diffusers.models.attention_processor.PAGCFGSanaLinearAttnProcessor2_0, diffusers.models.attention_processor.PAGIdentitySanaLinearAttnProcessor2_0, diffusers.models.attention_processor.SanaMultiscaleLinearAttention, diffusers.models.attention_processor.SanaMultiscaleAttnProcessor2_0, diffusers.models.attention_processor.SanaMultiscaleAttentionProjection, diffusers.models.attention_processor.IPAdapterAttnProcessor, diffusers.models.attention_processor.IPAdapterAttnProcessor2_0, diffusers.models.attention_processor.IPAdapterXFormersAttnProcessor, diffusers.models.attention_processor.SD3IPAdapterJointAttnProcessor2_0, diffusers.models.attention_processor.PAGIdentitySelfAttnProcessor2_0, diffusers.models.attention_processor.PAGCFGIdentitySelfAttnProcessor2_0, diffusers.models.attention_processor.LoRAAttnProcessor, diffusers.models.attention_processor.LoRAAttnProcessor2_0, diffusers.models.attention_processor.LoRAXFormersAttnProcessor, diffusers.models.attention_processor.LoRAAttnAddedKVProcessor, typing.Dict[str, typing.Union[diffusers.models.attention_processor.AttnProcessor, diffusers.models.attention_processor.CustomDiffusionAttnProcessor, diffusers.models.attention_processor.AttnAddedKVProcessor, diffusers.models.attention_processor.AttnAddedKVProcessor2_0, diffusers.models.attention_processor.JointAttnProcessor2_0, diffusers.models.attention_processor.PAGJointAttnProcessor2_0, diffusers.models.attention_processor.PAGCFGJointAttnProcessor2_0, diffusers.models.attention_processor.FusedJointAttnProcessor2_0, diffusers.models.attention_processor.AllegroAttnProcessor2_0, diffusers.models.attention_processor.AuraFlowAttnProcessor2_0, diffusers.models.attention_processor.FusedAuraFlowAttnProcessor2_0, diffusers.models.attention_processor.FluxAttnProcessor2_0, diffusers.models.attention_processor.FluxAttnProcessor2_0_NPU, diffusers.models.attention_processor.FusedFluxAttnProcessor2_0, diffusers.models.attention_processor.FusedFluxAttnProcessor2_0_NPU, diffusers.models.attention_processor.CogVideoXAttnProcessor2_0, diffusers.models.attention_processor.FusedCogVideoXAttnProcessor2_0, diffusers.models.attention_processor.XFormersAttnAddedKVProcessor, diffusers.models.attention_processor.XFormersAttnProcessor, diffusers.models.attention_processor.XLAFlashAttnProcessor2_0, diffusers.models.attention_processor.AttnProcessorNPU, diffusers.models.attention_processor.AttnProcessor2_0, diffusers.models.attention_processor.MochiVaeAttnProcessor2_0, diffusers.models.attention_processor.MochiAttnProcessor2_0, diffusers.models.attention_processor.StableAudioAttnProcessor2_0, diffusers.models.attention_processor.HunyuanAttnProcessor2_0, diffusers.models.attention_processor.FusedHunyuanAttnProcessor2_0, diffusers.models.attention_processor.PAGHunyuanAttnProcessor2_0, diffusers.models.attention_processor.PAGCFGHunyuanAttnProcessor2_0, diffusers.models.attention_processor.LuminaAttnProcessor2_0, diffusers.models.attention_processor.FusedAttnProcessor2_0, diffusers.models.attention_processor.CustomDiffusionXFormersAttnProcessor, diffusers.models.attention_processor.CustomDiffusionAttnProcessor2_0, diffusers.models.attention_processor.SlicedAttnProcessor, diffusers.models.attention_processor.SlicedAttnAddedKVProcessor, diffusers.models.attention_processor.SanaLinearAttnProcessor2_0, diffusers.models.attention_processor.PAGCFGSanaLinearAttnProcessor2_0, diffusers.models.attention_processor.PAGIdentitySanaLinearAttnProcessor2_0, diffusers.models.attention_processor.SanaMultiscaleLinearAttention, diffusers.models.attention_processor.SanaMultiscaleAttnProcessor2_0, diffusers.models.attention_processor.SanaMultiscaleAttentionProjection, diffusers.models.attention_processor.IPAdapterAttnProcessor, diffusers.models.attention_processor.IPAdapterAttnProcessor2_0, diffusers.models.attention_processor.IPAdapterXFormersAttnProcessor, diffusers.models.attention_processor.SD3IPAdapterJointAttnProcessor2_0, diffusers.models.attention_processor.PAGIdentitySelfAttnProcessor2_0, diffusers.models.attention_processor.PAGCFGIdentitySelfAttnProcessor2_0, diffusers.models.attention_processor.LoRAAttnProcessor, diffusers.models.attention_processor.LoRAAttnProcessor2_0, diffusers.models.attention_processor.LoRAXFormersAttnProcessor, diffusers.models.attention_processor.LoRAAttnAddedKVProcessor]]]"}],parametersDescription:[{anchor:"diffusers.AutoencoderKL.set_attn_processor.processor",description:`<strong>processor</strong> (<code>dict</code> of <code>AttentionProcessor</code> or only <code>AttentionProcessor</code>) &#x2014;
The instantiated processor class or a dictionary of processor classes that will be set as the processor
for <strong>all</strong> <code>Attention</code> layers.</p>
<p>If <code>processor</code> is a dict, the key needs to define the path to the corresponding cross attention
processor. This is strongly recommended when setting trainable attention processors.`,name:"processor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl.py#L167"}}),q=new v({props:{name:"set_default_attn_processor",anchor:"diffusers.AutoencoderKL.set_default_attn_processor",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl.py#L202"}}),W=new v({props:{name:"tiled_decode",anchor:"diffusers.AutoencoderKL.tiled_decode",parameters:[{name:"z",val:": Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AutoencoderKL.tiled_decode.z",description:"<strong>z</strong> (<code>torch.Tensor</code>) &#x2014; Input batch of latent vectors.",name:"z"},{anchor:"diffusers.AutoencoderKL.tiled_decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>~models.vae.DecoderOutput</code> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl.py#L423",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If return_dict is True, a <code>~models.vae.DecoderOutput</code> is returned, otherwise a plain <code>tuple</code> is
returned.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>~models.vae.DecoderOutput</code> or <code>tuple</code></p>
`}}),j=new v({props:{name:"tiled_encode",anchor:"diffusers.AutoencoderKL.tiled_encode",parameters:[{name:"x",val:": Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AutoencoderKL.tiled_encode.x",description:"<strong>x</strong> (<code>torch.Tensor</code>) &#x2014; Input batch of images.",name:"x"},{anchor:"diffusers.AutoencoderKL.tiled_encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>~models.autoencoder_kl.AutoencoderKLOutput</code> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl.py#L361",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If return_dict is True, a <code>~models.autoencoder_kl.AutoencoderKLOutput</code> is returned, otherwise a plain
<code>tuple</code> is returned.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>~models.autoencoder_kl.AutoencoderKLOutput</code> or <code>tuple</code></p>
`}}),R=new v({props:{name:"unfuse_qkv_projections",anchor:"diffusers.AutoencoderKL.unfuse_qkv_projections",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl.py#L523"}}),Y=new $e({props:{title:"AutoencoderKLOutput",local:"diffusers.models.modeling_outputs.AutoencoderKLOutput",headingTag:"h2"}}),Q=new v({props:{name:"class diffusers.models.modeling_outputs.AutoencoderKLOutput",anchor:"diffusers.models.modeling_outputs.AutoencoderKLOutput",parameters:[{name:"latent_dist",val:": DiagonalGaussianDistribution"}],parametersDescription:[{anchor:"diffusers.models.modeling_outputs.AutoencoderKLOutput.latent_dist",description:`<strong>latent_dist</strong> (<code>DiagonalGaussianDistribution</code>) &#x2014;
Encoded outputs of <code>Encoder</code> represented as the mean and logvar of <code>DiagonalGaussianDistribution</code>.
<code>DiagonalGaussianDistribution</code> allows for sampling latents from the distribution.`,name:"latent_dist"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_outputs.py#L7"}}),B=new $e({props:{title:"DecoderOutput",local:"diffusers.models.autoencoders.vae.DecoderOutput",headingTag:"h2"}}),ee=new v({props:{name:"class diffusers.models.autoencoders.vae.DecoderOutput",anchor:"diffusers.models.autoencoders.vae.DecoderOutput",parameters:[{name:"sample",val:": Tensor"},{name:"commit_loss",val:": typing.Optional[torch.FloatTensor] = None"}],parametersDescription:[{anchor:"diffusers.models.autoencoders.vae.DecoderOutput.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
The decoded output sample from the last layer of the model.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/vae.py#L47"}}),te=new zt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoderkl.md"}}),{c(){x=a("meta"),Pe=s(),be=a("p"),ye=s(),u(D.$$.fragment),xe=s(),u(K.$$.fragment),Le=s(),F=a("p"),F.innerHTML=pt,we=s(),M=a("p"),M.textContent=_t,Te=s(),I=a("p"),I.innerHTML=gt,ke=s(),u(V.$$.fragment),Ce=s(),G=a("p"),G.innerHTML=ht,De=s(),u(E.$$.fragment),Ke=s(),u(S.$$.fragment),Fe=s(),d=a("div"),u(O.$$.fragment),Ne=s(),oe=a("p"),oe.textContent=At,qe=s(),se=a("p"),se.innerHTML=bt,We=s(),re=a("div"),u(J.$$.fragment),je=s(),ne=a("div"),u(H.$$.fragment),Re=s(),ae=a("div"),u(z.$$.fragment),Ze=s(),$=a("div"),u(U.$$.fragment),Ye=s(),ie=a("p"),ie.textContent=vt,Qe=s(),X=a("blockquote"),X.innerHTML=$t,Be=s(),T=a("div"),u(N.$$.fragment),et=s(),de=a("p"),de.textContent=Pt,tt=s(),k=a("div"),u(q.$$.fragment),ot=s(),le=a("p"),le.textContent=yt,st=s(),C=a("div"),u(W.$$.fragment),rt=s(),ce=a("p"),ce.textContent=xt,nt=s(),P=a("div"),u(j.$$.fragment),at=s(),ue=a("p"),ue.textContent=Lt,it=s(),fe=a("p"),fe.textContent=wt,dt=s(),y=a("div"),u(R.$$.fragment),lt=s(),me=a("p"),me.textContent=Tt,ct=s(),Z=a("blockquote"),Z.innerHTML=kt,Me=s(),u(Y.$$.fragment),Ie=s(),L=a("div"),u(Q.$$.fragment),ut=s(),pe=a("p"),pe.textContent=Ct,Ve=s(),u(B.$$.fragment),Ge=s(),w=a("div"),u(ee.$$.fragment),ft=s(),_e=a("p"),_e.textContent=Dt,Ee=s(),u(te.$$.fragment),Se=s(),ve=a("p"),this.h()},l(e){const n=Ot("svelte-u9bgzb",document.head);x=i(n,"META",{name:!0,content:!0}),n.forEach(o),Pe=r(e),be=i(e,"P",{}),b(be).forEach(o),ye=r(e),f(D.$$.fragment,e),xe=r(e),f(K.$$.fragment,e),Le=r(e),F=i(e,"P",{"data-svelte-h":!0}),h(F)!=="svelte-wvy0bs"&&(F.innerHTML=pt),we=r(e),M=i(e,"P",{"data-svelte-h":!0}),h(M)!=="svelte-1cwsb16"&&(M.textContent=_t),Te=r(e),I=i(e,"P",{"data-svelte-h":!0}),h(I)!=="svelte-1e786c4"&&(I.innerHTML=gt),ke=r(e),f(V.$$.fragment,e),Ce=r(e),G=i(e,"P",{"data-svelte-h":!0}),h(G)!=="svelte-11w0rji"&&(G.innerHTML=ht),De=r(e),f(E.$$.fragment,e),Ke=r(e),f(S.$$.fragment,e),Fe=r(e),d=i(e,"DIV",{class:!0});var c=b(d);f(O.$$.fragment,c),Ne=r(c),oe=i(c,"P",{"data-svelte-h":!0}),h(oe)!=="svelte-1nia2sn"&&(oe.textContent=At),qe=r(c),se=i(c,"P",{"data-svelte-h":!0}),h(se)!=="svelte-1hyu2ru"&&(se.innerHTML=bt),We=r(c),re=i(c,"DIV",{class:!0});var Kt=b(re);f(J.$$.fragment,Kt),Kt.forEach(o),je=r(c),ne=i(c,"DIV",{class:!0});var Ft=b(ne);f(H.$$.fragment,Ft),Ft.forEach(o),Re=r(c),ae=i(c,"DIV",{class:!0});var Mt=b(ae);f(z.$$.fragment,Mt),Mt.forEach(o),Ze=r(c),$=i(c,"DIV",{class:!0});var ge=b($);f(U.$$.fragment,ge),Ye=r(ge),ie=i(ge,"P",{"data-svelte-h":!0}),h(ie)!=="svelte-1254b9i"&&(ie.textContent=vt),Qe=r(ge),X=i(ge,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),h(X)!=="svelte-6y4o4y"&&(X.innerHTML=$t),ge.forEach(o),Be=r(c),T=i(c,"DIV",{class:!0});var Je=b(T);f(N.$$.fragment,Je),et=r(Je),de=i(Je,"P",{"data-svelte-h":!0}),h(de)!=="svelte-1o77hl2"&&(de.textContent=Pt),Je.forEach(o),tt=r(c),k=i(c,"DIV",{class:!0});var He=b(k);f(q.$$.fragment,He),ot=r(He),le=i(He,"P",{"data-svelte-h":!0}),h(le)!=="svelte-1lxcwhv"&&(le.textContent=yt),He.forEach(o),st=r(c),C=i(c,"DIV",{class:!0});var ze=b(C);f(W.$$.fragment,ze),rt=r(ze),ce=i(ze,"P",{"data-svelte-h":!0}),h(ce)!=="svelte-1vrxp2b"&&(ce.textContent=xt),ze.forEach(o),nt=r(c),P=i(c,"DIV",{class:!0});var he=b(P);f(j.$$.fragment,he),at=r(he),ue=i(he,"P",{"data-svelte-h":!0}),h(ue)!=="svelte-1un5fcn"&&(ue.textContent=Lt),it=r(he),fe=i(he,"P",{"data-svelte-h":!0}),h(fe)!=="svelte-lbfkqr"&&(fe.textContent=wt),he.forEach(o),dt=r(c),y=i(c,"DIV",{class:!0});var Ae=b(y);f(R.$$.fragment,Ae),lt=r(Ae),me=i(Ae,"P",{"data-svelte-h":!0}),h(me)!=="svelte-1vhtc74"&&(me.textContent=Tt),ct=r(Ae),Z=i(Ae,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),h(Z)!=="svelte-6y4o4y"&&(Z.innerHTML=kt),Ae.forEach(o),c.forEach(o),Me=r(e),f(Y.$$.fragment,e),Ie=r(e),L=i(e,"DIV",{class:!0});var Ue=b(L);f(Q.$$.fragment,Ue),ut=r(Ue),pe=i(Ue,"P",{"data-svelte-h":!0}),h(pe)!=="svelte-1vsc7ag"&&(pe.textContent=Ct),Ue.forEach(o),Ve=r(e),f(B.$$.fragment,e),Ge=r(e),w=i(e,"DIV",{class:!0});var Xe=b(w);f(ee.$$.fragment,Xe),ft=r(Xe),_e=i(Xe,"P",{"data-svelte-h":!0}),h(_e)!=="svelte-18u8upa"&&(_e.textContent=Dt),Xe.forEach(o),Ee=r(e),f(te.$$.fragment,e),Se=r(e),ve=i(e,"P",{}),b(ve).forEach(o),this.h()},h(){A(x,"name","hf:doc:metadata"),A(x,"content",Xt),A(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(X,"class","warning"),A($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(Z,"class","warning"),A(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,n){t(document.head,x),l(e,Pe,n),l(e,be,n),l(e,ye,n),m(D,e,n),l(e,xe,n),m(K,e,n),l(e,Le,n),l(e,F,n),l(e,we,n),l(e,M,n),l(e,Te,n),l(e,I,n),l(e,ke,n),m(V,e,n),l(e,Ce,n),l(e,G,n),l(e,De,n),m(E,e,n),l(e,Ke,n),m(S,e,n),l(e,Fe,n),l(e,d,n),m(O,d,null),t(d,Ne),t(d,oe),t(d,qe),t(d,se),t(d,We),t(d,re),m(J,re,null),t(d,je),t(d,ne),m(H,ne,null),t(d,Re),t(d,ae),m(z,ae,null),t(d,Ze),t(d,$),m(U,$,null),t($,Ye),t($,ie),t($,Qe),t($,X),t(d,Be),t(d,T),m(N,T,null),t(T,et),t(T,de),t(d,tt),t(d,k),m(q,k,null),t(k,ot),t(k,le),t(d,st),t(d,C),m(W,C,null),t(C,rt),t(C,ce),t(d,nt),t(d,P),m(j,P,null),t(P,at),t(P,ue),t(P,it),t(P,fe),t(d,dt),t(d,y),m(R,y,null),t(y,lt),t(y,me),t(y,ct),t(y,Z),l(e,Me,n),m(Y,e,n),l(e,Ie,n),l(e,L,n),m(Q,L,null),t(L,ut),t(L,pe),l(e,Ve,n),m(B,e,n),l(e,Ge,n),l(e,w,n),m(ee,w,null),t(w,ft),t(w,_e),l(e,Ee,n),m(te,e,n),l(e,Se,n),l(e,ve,n),Oe=!0},p:Vt,i(e){Oe||(p(D.$$.fragment,e),p(K.$$.fragment,e),p(V.$$.fragment,e),p(E.$$.fragment,e),p(S.$$.fragment,e),p(O.$$.fragment,e),p(J.$$.fragment,e),p(H.$$.fragment,e),p(z.$$.fragment,e),p(U.$$.fragment,e),p(N.$$.fragment,e),p(q.$$.fragment,e),p(W.$$.fragment,e),p(j.$$.fragment,e),p(R.$$.fragment,e),p(Y.$$.fragment,e),p(Q.$$.fragment,e),p(B.$$.fragment,e),p(ee.$$.fragment,e),p(te.$$.fragment,e),Oe=!0)},o(e){_(D.$$.fragment,e),_(K.$$.fragment,e),_(V.$$.fragment,e),_(E.$$.fragment,e),_(S.$$.fragment,e),_(O.$$.fragment,e),_(J.$$.fragment,e),_(H.$$.fragment,e),_(z.$$.fragment,e),_(U.$$.fragment,e),_(N.$$.fragment,e),_(q.$$.fragment,e),_(W.$$.fragment,e),_(j.$$.fragment,e),_(R.$$.fragment,e),_(Y.$$.fragment,e),_(Q.$$.fragment,e),_(B.$$.fragment,e),_(ee.$$.fragment,e),_(te.$$.fragment,e),Oe=!1},d(e){e&&(o(Pe),o(be),o(ye),o(xe),o(Le),o(F),o(we),o(M),o(Te),o(I),o(ke),o(Ce),o(G),o(De),o(Ke),o(Fe),o(d),o(Me),o(Ie),o(L),o(Ve),o(Ge),o(w),o(Ee),o(Se),o(ve)),o(x),g(D,e),g(K,e),g(V,e),g(E,e),g(S,e),g(O),g(J),g(H),g(z),g(U),g(N),g(q),g(W),g(j),g(R),g(Y,e),g(Q),g(B,e),g(ee),g(te,e)}}}const Xt='{"title":"AutoencoderKL","local":"autoencoderkl","sections":[{"title":"Loading from the original format","local":"loading-from-the-original-format","sections":[],"depth":2},{"title":"AutoencoderKL","local":"diffusers.AutoencoderKL","sections":[],"depth":2},{"title":"AutoencoderKLOutput","local":"diffusers.models.modeling_outputs.AutoencoderKLOutput","sections":[],"depth":2},{"title":"DecoderOutput","local":"diffusers.models.autoencoders.vae.DecoderOutput","sections":[],"depth":2}],"depth":1}';function Nt(mt){return Gt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Qt extends Et{constructor(x){super(),St(this,x,Nt,Ut,It,{})}}export{Qt as component};
