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