import{s as ao,o as io,n as no}from"../chunks/scheduler.8c3d61f6.js";import{S as lo,i as co,g as a,s,r as f,A as uo,h as i,f as o,c as r,j as A,u as m,x as b,k as $,y as t,a as c,v as p,d as g,t as _,w as h}from"../chunks/index.da70eac4.js";import{T as ro}from"../chunks/Tip.6f698f24.js";import{D as P}from"../chunks/Docstring.367be9ed.js";import{C as fo}from"../chunks/CodeBlock.a9c4becf.js";import{H as Me,E as mo}from"../chunks/getInferenceSnippets.cb466318.js";function po(fe){let u,x="This API is 🧪 experimental.";return{c(){u=a("p"),u.textContent=x},l(v){u=i(v,"P",{"data-svelte-h":!0}),b(u)!=="svelte-89q1io"&&(u.textContent=x)},m(v,k){c(v,u,k)},p:no,d(v){v&&o(u)}}}function go(fe){let u,x="This API is 🧪 experimental.";return{c(){u=a("p"),u.textContent=x},l(v){u=i(v,"P",{"data-svelte-h":!0}),b(u)!=="svelte-89q1io"&&(u.textContent=x)},m(v,k){c(v,u,k)},p:no,d(v){v&&o(u)}}}function _o(fe){let u,x,v,k,J,Ge,O,Gt='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.',Se,H,St="The abstract from the paper is:",Je,z,Jt="<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>",Oe,U,He,X,Ot=`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:`,ze,N,Ue,W,Xe,d,j,it,me,Ht="A VAE model with KL loss for encoding images into latents and decoding latent representations into images.",dt,pe,zt=`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).`,lt,ge,q,ct,_e,R,ut,D,Z,ft,he,Ut=`Disable sliced VAE decoding. If <code>enable_slicing</code> was previously enabled, this method will go back to computing
decoding in one step.`,mt,K,Y,pt,be,Xt=`Disable tiled VAE decoding. If <code>enable_tiling</code> was previously enabled, this method will go back to computing
decoding in one step.`,gt,F,Q,_t,Ae,Nt=`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`,ht,V,B,bt,$e,Wt=`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`,At,ve,ee,$t,w,te,vt,Pe,jt=`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.`,Pt,I,xt,E,oe,wt,xe,qt="Sets the attention processor to use to compute attention.",yt,M,se,Lt,we,Rt="Disables custom attention processors and sets the default attention implementation.",Tt,G,re,Ct,ye,Zt="Decode a batch of images using a tiled decoder.",kt,y,ne,Dt,Le,Yt="Encode a batch of images using a tiled encoder.",Kt,Te,Qt=`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.`,Ft,L,ae,Vt,Ce,Bt="Disables the fused QKV projection if enabled.",It,S,Ne,ie,We,T,de,Et,ke,eo="Output of AutoencoderKL encoding method.",je,le,qe,C,ce,Mt,De,to="Output of decoding method.",Re,ue,Ze,Ie,Ye;return J=new Me({props:{title:"AutoencoderKL",local:"autoencoderkl",headingTag:"h1"}}),U=new Me({props:{title:"Loading from the original format",local:"loading-from-the-original-format",headingTag:"h2"}}),N=new fo({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}}),W=new Me({props:{title:"AutoencoderKL",local:"diffusers.AutoencoderKL",headingTag:"h2"}}),j=new P({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"}}),q=new P({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"}}),R=new P({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 P({props:{name:"disable_slicing",anchor:"diffusers.AutoencoderKL.disable_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl.py#L163"}}),Y=new P({props:{name:"disable_tiling",anchor:"diffusers.AutoencoderKL.disable_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl.py#L149"}}),Q=new P({props:{name:"enable_slicing",anchor:"diffusers.AutoencoderKL.enable_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl.py#L156"}}),B=new P({props:{name:"enable_tiling",anchor:"diffusers.AutoencoderKL.enable_tiling",parameters:[{name:"use_tiling",val:": bool = True"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl.py#L141"}}),ee=new P({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#L501"}}),te=new P({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#L530"}}),I=new ro({props:{warning:!0,$$slots:{default:[po]},$$scope:{ctx:fe}}}),oe=new P({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#L196"}}),se=new P({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#L231"}}),re=new P({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#L452",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>
`}}),ne=new P({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#L390",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>
`}}),ae=new P({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#L556"}}),S=new ro({props:{warning:!0,$$slots:{default:[go]},$$scope:{ctx:fe}}}),ie=new Me({props:{title:"AutoencoderKLOutput",local:"diffusers.models.modeling_outputs.AutoencoderKLOutput",headingTag:"h2"}}),de=new P({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"}}),le=new Me({props:{title:"DecoderOutput",local:"diffusers.models.autoencoders.vae.DecoderOutput",headingTag:"h2"}}),ce=new P({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"}}),ue=new mo({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoderkl.md"}}),{c(){u=a("meta"),x=s(),v=a("p"),k=s(),f(J.$$.fragment),Ge=s(),O=a("p"),O.innerHTML=Gt,Se=s(),H=a("p"),H.textContent=St,Je=s(),z=a("p"),z.innerHTML=Jt,Oe=s(),f(U.$$.fragment),He=s(),X=a("p"),X.innerHTML=Ot,ze=s(),f(N.$$.fragment),Ue=s(),f(W.$$.fragment),Xe=s(),d=a("div"),f(j.$$.fragment),it=s(),me=a("p"),me.textContent=Ht,dt=s(),pe=a("p"),pe.innerHTML=zt,lt=s(),ge=a("div"),f(q.$$.fragment),ct=s(),_e=a("div"),f(R.$$.fragment),ut=s(),D=a("div"),f(Z.$$.fragment),ft=s(),he=a("p"),he.innerHTML=Ut,mt=s(),K=a("div"),f(Y.$$.fragment),pt=s(),be=a("p"),be.innerHTML=Xt,gt=s(),F=a("div"),f(Q.$$.fragment),_t=s(),Ae=a("p"),Ae.textContent=Nt,ht=s(),V=a("div"),f(B.$$.fragment),bt=s(),$e=a("p"),$e.textContent=Wt,At=s(),ve=a("div"),f(ee.$$.fragment),$t=s(),w=a("div"),f(te.$$.fragment),vt=s(),Pe=a("p"),Pe.textContent=jt,Pt=s(),f(I.$$.fragment),xt=s(),E=a("div"),f(oe.$$.fragment),wt=s(),xe=a("p"),xe.textContent=qt,yt=s(),M=a("div"),f(se.$$.fragment),Lt=s(),we=a("p"),we.textContent=Rt,Tt=s(),G=a("div"),f(re.$$.fragment),Ct=s(),ye=a("p"),ye.textContent=Zt,kt=s(),y=a("div"),f(ne.$$.fragment),Dt=s(),Le=a("p"),Le.textContent=Yt,Kt=s(),Te=a("p"),Te.textContent=Qt,Ft=s(),L=a("div"),f(ae.$$.fragment),Vt=s(),Ce=a("p"),Ce.textContent=Bt,It=s(),f(S.$$.fragment),Ne=s(),f(ie.$$.fragment),We=s(),T=a("div"),f(de.$$.fragment),Et=s(),ke=a("p"),ke.textContent=eo,je=s(),f(le.$$.fragment),qe=s(),C=a("div"),f(ce.$$.fragment),Mt=s(),De=a("p"),De.textContent=to,Re=s(),f(ue.$$.fragment),Ze=s(),Ie=a("p"),this.h()},l(e){const n=uo("svelte-u9bgzb",document.head);u=i(n,"META",{name:!0,content:!0}),n.forEach(o),x=r(e),v=i(e,"P",{}),A(v).forEach(o),k=r(e),m(J.$$.fragment,e),Ge=r(e),O=i(e,"P",{"data-svelte-h":!0}),b(O)!=="svelte-wvy0bs"&&(O.innerHTML=Gt),Se=r(e),H=i(e,"P",{"data-svelte-h":!0}),b(H)!=="svelte-1cwsb16"&&(H.textContent=St),Je=r(e),z=i(e,"P",{"data-svelte-h":!0}),b(z)!=="svelte-1e786c4"&&(z.innerHTML=Jt),Oe=r(e),m(U.$$.fragment,e),He=r(e),X=i(e,"P",{"data-svelte-h":!0}),b(X)!=="svelte-11w0rji"&&(X.innerHTML=Ot),ze=r(e),m(N.$$.fragment,e),Ue=r(e),m(W.$$.fragment,e),Xe=r(e),d=i(e,"DIV",{class:!0});var l=A(d);m(j.$$.fragment,l),it=r(l),me=i(l,"P",{"data-svelte-h":!0}),b(me)!=="svelte-1nia2sn"&&(me.textContent=Ht),dt=r(l),pe=i(l,"P",{"data-svelte-h":!0}),b(pe)!=="svelte-1hyu2ru"&&(pe.innerHTML=zt),lt=r(l),ge=i(l,"DIV",{class:!0});var Ee=A(ge);m(q.$$.fragment,Ee),Ee.forEach(o),ct=r(l),_e=i(l,"DIV",{class:!0});var oo=A(_e);m(R.$$.fragment,oo),oo.forEach(o),ut=r(l),D=i(l,"DIV",{class:!0});var Qe=A(D);m(Z.$$.fragment,Qe),ft=r(Qe),he=i(Qe,"P",{"data-svelte-h":!0}),b(he)!=="svelte-189cc7b"&&(he.innerHTML=Ut),Qe.forEach(o),mt=r(l),K=i(l,"DIV",{class:!0});var Be=A(K);m(Y.$$.fragment,Be),pt=r(Be),be=i(Be,"P",{"data-svelte-h":!0}),b(be)!=="svelte-1f366pl"&&(be.innerHTML=Xt),Be.forEach(o),gt=r(l),F=i(l,"DIV",{class:!0});var et=A(F);m(Q.$$.fragment,et),_t=r(et),Ae=i(et,"P",{"data-svelte-h":!0}),b(Ae)!=="svelte-14bnrb6"&&(Ae.textContent=Nt),et.forEach(o),ht=r(l),V=i(l,"DIV",{class:!0});var tt=A(V);m(B.$$.fragment,tt),bt=r(tt),$e=i(tt,"P",{"data-svelte-h":!0}),b($e)!=="svelte-1xwrf7t"&&($e.textContent=Wt),tt.forEach(o),At=r(l),ve=i(l,"DIV",{class:!0});var so=A(ve);m(ee.$$.fragment,so),so.forEach(o),$t=r(l),w=i(l,"DIV",{class:!0});var Ke=A(w);m(te.$$.fragment,Ke),vt=r(Ke),Pe=i(Ke,"P",{"data-svelte-h":!0}),b(Pe)!=="svelte-1254b9i"&&(Pe.textContent=jt),Pt=r(Ke),m(I.$$.fragment,Ke),Ke.forEach(o),xt=r(l),E=i(l,"DIV",{class:!0});var ot=A(E);m(oe.$$.fragment,ot),wt=r(ot),xe=i(ot,"P",{"data-svelte-h":!0}),b(xe)!=="svelte-1o77hl2"&&(xe.textContent=qt),ot.forEach(o),yt=r(l),M=i(l,"DIV",{class:!0});var st=A(M);m(se.$$.fragment,st),Lt=r(st),we=i(st,"P",{"data-svelte-h":!0}),b(we)!=="svelte-1lxcwhv"&&(we.textContent=Rt),st.forEach(o),Tt=r(l),G=i(l,"DIV",{class:!0});var rt=A(G);m(re.$$.fragment,rt),Ct=r(rt),ye=i(rt,"P",{"data-svelte-h":!0}),b(ye)!=="svelte-1vrxp2b"&&(ye.textContent=Zt),rt.forEach(o),kt=r(l),y=i(l,"DIV",{class:!0});var Fe=A(y);m(ne.$$.fragment,Fe),Dt=r(Fe),Le=i(Fe,"P",{"data-svelte-h":!0}),b(Le)!=="svelte-1un5fcn"&&(Le.textContent=Yt),Kt=r(Fe),Te=i(Fe,"P",{"data-svelte-h":!0}),b(Te)!=="svelte-lbfkqr"&&(Te.textContent=Qt),Fe.forEach(o),Ft=r(l),L=i(l,"DIV",{class:!0});var Ve=A(L);m(ae.$$.fragment,Ve),Vt=r(Ve),Ce=i(Ve,"P",{"data-svelte-h":!0}),b(Ce)!=="svelte-1vhtc74"&&(Ce.textContent=Bt),It=r(Ve),m(S.$$.fragment,Ve),Ve.forEach(o),l.forEach(o),Ne=r(e),m(ie.$$.fragment,e),We=r(e),T=i(e,"DIV",{class:!0});var nt=A(T);m(de.$$.fragment,nt),Et=r(nt),ke=i(nt,"P",{"data-svelte-h":!0}),b(ke)!=="svelte-1vsc7ag"&&(ke.textContent=eo),nt.forEach(o),je=r(e),m(le.$$.fragment,e),qe=r(e),C=i(e,"DIV",{class:!0});var at=A(C);m(ce.$$.fragment,at),Mt=r(at),De=i(at,"P",{"data-svelte-h":!0}),b(De)!=="svelte-18u8upa"&&(De.textContent=to),at.forEach(o),Re=r(e),m(ue.$$.fragment,e),Ze=r(e),Ie=i(e,"P",{}),A(Ie).forEach(o),this.h()},h(){$(u,"name","hf:doc:metadata"),$(u,"content",ho),$(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(C,"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,u),c(e,x,n),c(e,v,n),c(e,k,n),p(J,e,n),c(e,Ge,n),c(e,O,n),c(e,Se,n),c(e,H,n),c(e,Je,n),c(e,z,n),c(e,Oe,n),p(U,e,n),c(e,He,n),c(e,X,n),c(e,ze,n),p(N,e,n),c(e,Ue,n),p(W,e,n),c(e,Xe,n),c(e,d,n),p(j,d,null),t(d,it),t(d,me),t(d,dt),t(d,pe),t(d,lt),t(d,ge),p(q,ge,null),t(d,ct),t(d,_e),p(R,_e,null),t(d,ut),t(d,D),p(Z,D,null),t(D,ft),t(D,he),t(d,mt),t(d,K),p(Y,K,null),t(K,pt),t(K,be),t(d,gt),t(d,F),p(Q,F,null),t(F,_t),t(F,Ae),t(d,ht),t(d,V),p(B,V,null),t(V,bt),t(V,$e),t(d,At),t(d,ve),p(ee,ve,null),t(d,$t),t(d,w),p(te,w,null),t(w,vt),t(w,Pe),t(w,Pt),p(I,w,null),t(d,xt),t(d,E),p(oe,E,null),t(E,wt),t(E,xe),t(d,yt),t(d,M),p(se,M,null),t(M,Lt),t(M,we),t(d,Tt),t(d,G),p(re,G,null),t(G,Ct),t(G,ye),t(d,kt),t(d,y),p(ne,y,null),t(y,Dt),t(y,Le),t(y,Kt),t(y,Te),t(d,Ft),t(d,L),p(ae,L,null),t(L,Vt),t(L,Ce),t(L,It),p(S,L,null),c(e,Ne,n),p(ie,e,n),c(e,We,n),c(e,T,n),p(de,T,null),t(T,Et),t(T,ke),c(e,je,n),p(le,e,n),c(e,qe,n),c(e,C,n),p(ce,C,null),t(C,Mt),t(C,De),c(e,Re,n),p(ue,e,n),c(e,Ze,n),c(e,Ie,n),Ye=!0},p(e,[n]){const l={};n&2&&(l.$$scope={dirty:n,ctx:e}),I.$set(l);const Ee={};n&2&&(Ee.$$scope={dirty:n,ctx:e}),S.$set(Ee)},i(e){Ye||(g(J.$$.fragment,e),g(U.$$.fragment,e),g(N.$$.fragment,e),g(W.$$.fragment,e),g(j.$$.fragment,e),g(q.$$.fragment,e),g(R.$$.fragment,e),g(Z.$$.fragment,e),g(Y.$$.fragment,e),g(Q.$$.fragment,e),g(B.$$.fragment,e),g(ee.$$.fragment,e),g(te.$$.fragment,e),g(I.$$.fragment,e),g(oe.$$.fragment,e),g(se.$$.fragment,e),g(re.$$.fragment,e),g(ne.$$.fragment,e),g(ae.$$.fragment,e),g(S.$$.fragment,e),g(ie.$$.fragment,e),g(de.$$.fragment,e),g(le.$$.fragment,e),g(ce.$$.fragment,e),g(ue.$$.fragment,e),Ye=!0)},o(e){_(J.$$.fragment,e),_(U.$$.fragment,e),_(N.$$.fragment,e),_(W.$$.fragment,e),_(j.$$.fragment,e),_(q.$$.fragment,e),_(R.$$.fragment,e),_(Z.$$.fragment,e),_(Y.$$.fragment,e),_(Q.$$.fragment,e),_(B.$$.fragment,e),_(ee.$$.fragment,e),_(te.$$.fragment,e),_(I.$$.fragment,e),_(oe.$$.fragment,e),_(se.$$.fragment,e),_(re.$$.fragment,e),_(ne.$$.fragment,e),_(ae.$$.fragment,e),_(S.$$.fragment,e),_(ie.$$.fragment,e),_(de.$$.fragment,e),_(le.$$.fragment,e),_(ce.$$.fragment,e),_(ue.$$.fragment,e),Ye=!1},d(e){e&&(o(x),o(v),o(k),o(Ge),o(O),o(Se),o(H),o(Je),o(z),o(Oe),o(He),o(X),o(ze),o(Ue),o(Xe),o(d),o(Ne),o(We),o(T),o(je),o(qe),o(C),o(Re),o(Ze),o(Ie)),o(u),h(J,e),h(U,e),h(N,e),h(W,e),h(j),h(q),h(R),h(Z),h(Y),h(Q),h(B),h(ee),h(te),h(I),h(oe),h(se),h(re),h(ne),h(ae),h(S),h(ie,e),h(de),h(le,e),h(ce),h(ue,e)}}}const ho='{"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 bo(fe){return io(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class yo extends lo{constructor(u){super(),co(this,u,bo,_o,ao,{})}}export{yo as component};
