import{s as Co,n as Fo,o as Po}from"../chunks/scheduler.182ea377.js";import{S as Eo,i as Oo,g as r,s as o,r as c,A as Mo,h as a,f as n,c as s,j as b,u,x as f,k as v,y as t,a as l,v as m,d as p,t as g,w as h}from"../chunks/index.abf12888.js";import{D as $}from"../chunks/Docstring.93f6f462.js";import{C as Vo}from"../chunks/CodeBlock.57fe6e13.js";import{H as I}from"../chunks/Heading.16916d63.js";function zo(to){let T,Se,Je,Ue,j,Re,H,oo='The variational autoencoder (VAE) model with KL loss was introduced in <a href="https://arxiv.org/abs/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.',Ge,J,no="The abstract from the paper is:",Ne,W,so="<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>",Ze,S,Xe,U,ro=`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>FromOriginalVAEMixin.from_single_file</code> as follows:`,Ye,R,qe,G,Be,d,N,yt,ge,ao="A VAE model with KL loss for encoding images into latents and decoding latent representations into images.",At,he,io=`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).`,wt,k,Z,Lt,_e,lo=`Disable sliced VAE decoding. If <code>enable_slicing</code> was previously enabled, this method will go back to computing
decoding in one step.`,Tt,C,X,Dt,be,co=`Disable tiled VAE decoding. If <code>enable_tiling</code> was previously enabled, this method will go back to computing
decoding in one step.`,Kt,F,Y,kt,ve,uo=`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.`,Ct,P,q,Ft,xe,fo=`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.`,Pt,$e,B,Et,E,Q,Ot,ye,mo="Sets the attention processor to use to compute attention.",Mt,O,ee,Vt,Ae,po="Disables custom attention processors and sets the default attention implementation.",zt,M,te,It,we,go="Decode a batch of images using a tiled decoder.",jt,L,oe,Ht,Le,ho="Encode a batch of images using a tiled encoder.",Jt,Te,_o=`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.`,Qe,ne,et,D,se,Wt,De,bo="Output of AutoencoderKL encoding method.",tt,re,ot,K,ae,St,Ke,vo="Output of decoding method.",nt,ie,st,x,le,Ut,ke,xo="Flax implementation of a VAE model with KL loss for decoding latent representations.",Rt,Ce,$o=`This model inherits from <a href="/docs/diffusers/main/en/api/models/overview#diffusers.FlaxModelMixin">FlaxModelMixin</a>. Check the superclass documentation for it’s generic methods
implemented for all models (such as downloading or saving).`,Gt,Fe,yo=`This model is a Flax Linen <a href="https://flax.readthedocs.io/en/latest/flax.linen.html#module" rel="nofollow">flax.linen.Module</a>
subclass. Use it as a regular Flax Linen module and refer to the Flax documentation for all matter related to its
general usage and behavior.`,Nt,Pe,Ao="Inherent JAX features such as the following are supported:",Zt,Ee,wo='<li><a href="https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit" rel="nofollow">Just-In-Time (JIT) compilation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation" rel="nofollow">Automatic Differentiation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap" rel="nofollow">Vectorization</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap" rel="nofollow">Parallelization</a></li>',rt,de,at,A,ce,Xt,Oe,Lo="Output of AutoencoderKL encoding method.",Yt,V,ue,qt,Me,To="“Returns a new object replacing the specified fields with new values.",it,fe,lt,w,me,Bt,Ve,Do="Output of decoding method.",Qt,z,pe,eo,ze,Ko="“Returns a new object replacing the specified fields with new values.",dt,We,ct;return j=new I({props:{title:"AutoencoderKL",local:"autoencoderkl",headingTag:"h1"}}),S=new I({props:{title:"Loading from the original format",local:"loading-from-the-original-format",headingTag:"h2"}}),R=new Vo({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}}),G=new I({props:{title:"AutoencoderKL",local:"diffusers.AutoencoderKL",headingTag:"h2"}}),N=new $({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:"force_upcast",val:": float = 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://arxiv.org/abs/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 loosing 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"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoder_kl.py#L34"}}),Z=new $({props:{name:"disable_slicing",anchor:"diffusers.AutoencoderKL.disable_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoder_kl.py#L151"}}),X=new $({props:{name:"disable_tiling",anchor:"diffusers.AutoencoderKL.disable_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoder_kl.py#L137"}}),Y=new $({props:{name:"enable_slicing",anchor:"diffusers.AutoencoderKL.enable_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoder_kl.py#L144"}}),q=new $({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/autoencoder_kl.py#L129"}}),B=new $({props:{name:"forward",anchor:"diffusers.AutoencoderKL.forward",parameters:[{name:"sample",val:": FloatTensor"},{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.FloatTensor</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/autoencoder_kl.py#L424"}}),Q=new $({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.AttnProcessor2_0, diffusers.models.attention_processor.XFormersAttnProcessor, diffusers.models.attention_processor.SlicedAttnProcessor, diffusers.models.attention_processor.AttnAddedKVProcessor, diffusers.models.attention_processor.SlicedAttnAddedKVProcessor, diffusers.models.attention_processor.AttnAddedKVProcessor2_0, diffusers.models.attention_processor.XFormersAttnAddedKVProcessor, diffusers.models.attention_processor.CustomDiffusionAttnProcessor, diffusers.models.attention_processor.CustomDiffusionXFormersAttnProcessor, diffusers.models.attention_processor.CustomDiffusionAttnProcessor2_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.AttnProcessor2_0, diffusers.models.attention_processor.XFormersAttnProcessor, diffusers.models.attention_processor.SlicedAttnProcessor, diffusers.models.attention_processor.AttnAddedKVProcessor, diffusers.models.attention_processor.SlicedAttnAddedKVProcessor, diffusers.models.attention_processor.AttnAddedKVProcessor2_0, diffusers.models.attention_processor.XFormersAttnAddedKVProcessor, diffusers.models.attention_processor.CustomDiffusionAttnProcessor, diffusers.models.attention_processor.CustomDiffusionXFormersAttnProcessor, diffusers.models.attention_processor.CustomDiffusionAttnProcessor2_0, diffusers.models.attention_processor.LoRAAttnProcessor, diffusers.models.attention_processor.LoRAAttnProcessor2_0, diffusers.models.attention_processor.LoRAXFormersAttnProcessor, diffusers.models.attention_processor.LoRAAttnAddedKVProcessor]]]"},{name:"_remove_lora",val:" = False"}],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/autoencoder_kl.py#L184"}}),ee=new $({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/autoencoder_kl.py#L221"}}),te=new $({props:{name:"tiled_decode",anchor:"diffusers.AutoencoderKL.tiled_decode",parameters:[{name:"z",val:": FloatTensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AutoencoderKL.tiled_decode.z",description:"<strong>z</strong> (<code>torch.FloatTensor</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 <a href="/docs/diffusers/main/en/api/models/asymmetricautoencoderkl#diffusers.models.vae.DecoderOutput">DecoderOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoder_kl.py#L376",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If return_dict is True, a <a
  href="/docs/diffusers/main/en/api/models/asymmetricautoencoderkl#diffusers.models.vae.DecoderOutput"
>DecoderOutput</a> is returned, otherwise a plain <code>tuple</code> is
returned.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/diffusers/main/en/api/models/asymmetricautoencoderkl#diffusers.models.vae.DecoderOutput"
>DecoderOutput</a> or <code>tuple</code></p>
`}}),oe=new $({props:{name:"tiled_encode",anchor:"diffusers.AutoencoderKL.tiled_encode",parameters:[{name:"x",val:": FloatTensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AutoencoderKL.tiled_encode.x",description:"<strong>x</strong> (<code>torch.FloatTensor</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 <a href="/docs/diffusers/main/en/api/models/asymmetricautoencoderkl#diffusers.models.modeling_outputs.AutoencoderKLOutput">AutoencoderKLOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoder_kl.py#L322",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If return_dict is True, a <a
  href="/docs/diffusers/main/en/api/models/asymmetricautoencoderkl#diffusers.models.modeling_outputs.AutoencoderKLOutput"
>AutoencoderKLOutput</a> is returned, otherwise a plain
<code>tuple</code> is returned.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/diffusers/main/en/api/models/asymmetricautoencoderkl#diffusers.models.modeling_outputs.AutoencoderKLOutput"
>AutoencoderKLOutput</a> or <code>tuple</code></p>
`}}),ne=new I({props:{title:"AutoencoderKLOutput",local:"diffusers.models.modeling_outputs.AutoencoderKLOutput",headingTag:"h2"}}),se=new $({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"}}),re=new I({props:{title:"DecoderOutput",local:"diffusers.models.vae.DecoderOutput",headingTag:"h2"}}),ae=new $({props:{name:"class diffusers.models.vae.DecoderOutput",anchor:"diffusers.models.vae.DecoderOutput",parameters:[{name:"sample",val:": FloatTensor"}],parametersDescription:[{anchor:"diffusers.models.vae.DecoderOutput.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</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/vae.py#L34"}}),ie=new I({props:{title:"FlaxAutoencoderKL",local:"diffusers.FlaxAutoencoderKL",headingTag:"h2"}}),le=new $({props:{name:"class diffusers.FlaxAutoencoderKL",anchor:"diffusers.FlaxAutoencoderKL",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:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"parent",val:": typing.Union[typing.Type[flax.linen.module.Module], typing.Type[flax.core.scope.Scope], typing.Type[flax.linen.module._Sentinel], NoneType] = <flax.linen.module._Sentinel object at 0x7fb1ec715b80>"},{name:"name",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"diffusers.FlaxAutoencoderKL.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of channels in the input image.`,name:"in_channels"},{anchor:"diffusers.FlaxAutoencoderKL.out_channels",description:`<strong>out_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of channels in the output.`,name:"out_channels"},{anchor:"diffusers.FlaxAutoencoderKL.down_block_types",description:`<strong>down_block_types</strong> (<code>Tuple[str]</code>, <em>optional</em>, defaults to <code>(DownEncoderBlock2D)</code>) &#x2014;
Tuple of downsample block types.`,name:"down_block_types"},{anchor:"diffusers.FlaxAutoencoderKL.up_block_types",description:`<strong>up_block_types</strong> (<code>Tuple[str]</code>, <em>optional</em>, defaults to <code>(UpDecoderBlock2D)</code>) &#x2014;
Tuple of upsample block types.`,name:"up_block_types"},{anchor:"diffusers.FlaxAutoencoderKL.block_out_channels",description:`<strong>block_out_channels</strong> (<code>Tuple[str]</code>, <em>optional</em>, defaults to <code>(64,)</code>) &#x2014;
Tuple of block output channels.`,name:"block_out_channels"},{anchor:"diffusers.FlaxAutoencoderKL.layers_per_block",description:`<strong>layers_per_block</strong> (<code>int</code>, <em>optional</em>, defaults to <code>2</code>) &#x2014;
Number of ResNet layer for each block.`,name:"layers_per_block"},{anchor:"diffusers.FlaxAutoencoderKL.act_fn",description:`<strong>act_fn</strong> (<code>str</code>, <em>optional</em>, defaults to <code>silu</code>) &#x2014;
The activation function to use.`,name:"act_fn"},{anchor:"diffusers.FlaxAutoencoderKL.latent_channels",description:`<strong>latent_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>4</code>) &#x2014;
Number of channels in the latent space.`,name:"latent_channels"},{anchor:"diffusers.FlaxAutoencoderKL.norm_num_groups",description:`<strong>norm_num_groups</strong> (<code>int</code>, <em>optional</em>, defaults to <code>32</code>) &#x2014;
The number of groups for normalization.`,name:"norm_num_groups"},{anchor:"diffusers.FlaxAutoencoderKL.sample_size",description:`<strong>sample_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Sample input size.`,name:"sample_size"},{anchor:"diffusers.FlaxAutoencoderKL.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://arxiv.org/abs/2112.10752" rel="nofollow">High-Resolution Image
Synthesis with Latent Diffusion Models</a> paper.`,name:"scaling_factor"},{anchor:"diffusers.FlaxAutoencoderKL.dtype",description:`<strong>dtype</strong> (<code>jnp.dtype</code>, <em>optional</em>, defaults to <code>jnp.float32</code>) &#x2014;
The <code>dtype</code> of the parameters.`,name:"dtype"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/vae_flax.py#L727"}}),de=new I({props:{title:"FlaxAutoencoderKLOutput",local:"diffusers.models.vae_flax.FlaxAutoencoderKLOutput",headingTag:"h2"}}),ce=new $({props:{name:"class diffusers.models.vae_flax.FlaxAutoencoderKLOutput",anchor:"diffusers.models.vae_flax.FlaxAutoencoderKLOutput",parameters:[{name:"latent_dist",val:": FlaxDiagonalGaussianDistribution"}],parametersDescription:[{anchor:"diffusers.models.vae_flax.FlaxAutoencoderKLOutput.latent_dist",description:`<strong>latent_dist</strong> (<code>FlaxDiagonalGaussianDistribution</code>) &#x2014;
Encoded outputs of <code>Encoder</code> represented as the mean and logvar of <code>FlaxDiagonalGaussianDistribution</code>.
<code>FlaxDiagonalGaussianDistribution</code> allows for sampling latents from the distribution.`,name:"latent_dist"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/vae_flax.py#L48"}}),ue=new $({props:{name:"replace",anchor:"diffusers.models.vae_flax.FlaxAutoencoderKLOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/flax/struct.py#L111"}}),fe=new I({props:{title:"FlaxDecoderOutput",local:"diffusers.models.vae_flax.FlaxDecoderOutput",headingTag:"h2"}}),me=new $({props:{name:"class diffusers.models.vae_flax.FlaxDecoderOutput",anchor:"diffusers.models.vae_flax.FlaxDecoderOutput",parameters:[{name:"sample",val:": Array"}],parametersDescription:[{anchor:"diffusers.models.vae_flax.FlaxDecoderOutput.sample",description:`<strong>sample</strong> (<code>jnp.ndarray</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"},{anchor:"diffusers.models.vae_flax.FlaxDecoderOutput.dtype",description:`<strong>dtype</strong> (<code>jnp.dtype</code>, <em>optional</em>, defaults to <code>jnp.float32</code>) &#x2014;
The <code>dtype</code> of the parameters.`,name:"dtype"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/vae_flax.py#L33"}}),pe=new $({props:{name:"replace",anchor:"diffusers.models.vae_flax.FlaxDecoderOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/flax/struct.py#L111"}}),{c(){T=r("meta"),Se=o(),Je=r("p"),Ue=o(),c(j.$$.fragment),Re=o(),H=r("p"),H.innerHTML=oo,Ge=o(),J=r("p"),J.textContent=no,Ne=o(),W=r("p"),W.innerHTML=so,Ze=o(),c(S.$$.fragment),Xe=o(),U=r("p"),U.innerHTML=ro,Ye=o(),c(R.$$.fragment),qe=o(),c(G.$$.fragment),Be=o(),d=r("div"),c(N.$$.fragment),yt=o(),ge=r("p"),ge.textContent=ao,At=o(),he=r("p"),he.innerHTML=io,wt=o(),k=r("div"),c(Z.$$.fragment),Lt=o(),_e=r("p"),_e.innerHTML=lo,Tt=o(),C=r("div"),c(X.$$.fragment),Dt=o(),be=r("p"),be.innerHTML=co,Kt=o(),F=r("div"),c(Y.$$.fragment),kt=o(),ve=r("p"),ve.textContent=uo,Ct=o(),P=r("div"),c(q.$$.fragment),Ft=o(),xe=r("p"),xe.textContent=fo,Pt=o(),$e=r("div"),c(B.$$.fragment),Et=o(),E=r("div"),c(Q.$$.fragment),Ot=o(),ye=r("p"),ye.textContent=mo,Mt=o(),O=r("div"),c(ee.$$.fragment),Vt=o(),Ae=r("p"),Ae.textContent=po,zt=o(),M=r("div"),c(te.$$.fragment),It=o(),we=r("p"),we.textContent=go,jt=o(),L=r("div"),c(oe.$$.fragment),Ht=o(),Le=r("p"),Le.textContent=ho,Jt=o(),Te=r("p"),Te.textContent=_o,Qe=o(),c(ne.$$.fragment),et=o(),D=r("div"),c(se.$$.fragment),Wt=o(),De=r("p"),De.textContent=bo,tt=o(),c(re.$$.fragment),ot=o(),K=r("div"),c(ae.$$.fragment),St=o(),Ke=r("p"),Ke.textContent=vo,nt=o(),c(ie.$$.fragment),st=o(),x=r("div"),c(le.$$.fragment),Ut=o(),ke=r("p"),ke.textContent=xo,Rt=o(),Ce=r("p"),Ce.innerHTML=$o,Gt=o(),Fe=r("p"),Fe.innerHTML=yo,Nt=o(),Pe=r("p"),Pe.textContent=Ao,Zt=o(),Ee=r("ul"),Ee.innerHTML=wo,rt=o(),c(de.$$.fragment),at=o(),A=r("div"),c(ce.$$.fragment),Xt=o(),Oe=r("p"),Oe.textContent=Lo,Yt=o(),V=r("div"),c(ue.$$.fragment),qt=o(),Me=r("p"),Me.textContent=To,it=o(),c(fe.$$.fragment),lt=o(),w=r("div"),c(me.$$.fragment),Bt=o(),Ve=r("p"),Ve.textContent=Do,Qt=o(),z=r("div"),c(pe.$$.fragment),eo=o(),ze=r("p"),ze.textContent=Ko,dt=o(),We=r("p"),this.h()},l(e){const i=Mo("svelte-u9bgzb",document.head);T=a(i,"META",{name:!0,content:!0}),i.forEach(n),Se=s(e),Je=a(e,"P",{}),b(Je).forEach(n),Ue=s(e),u(j.$$.fragment,e),Re=s(e),H=a(e,"P",{"data-svelte-h":!0}),f(H)!=="svelte-rb5qpx"&&(H.innerHTML=oo),Ge=s(e),J=a(e,"P",{"data-svelte-h":!0}),f(J)!=="svelte-1cwsb16"&&(J.textContent=no),Ne=s(e),W=a(e,"P",{"data-svelte-h":!0}),f(W)!=="svelte-1e786c4"&&(W.innerHTML=so),Ze=s(e),u(S.$$.fragment,e),Xe=s(e),U=a(e,"P",{"data-svelte-h":!0}),f(U)!=="svelte-1vtmdxd"&&(U.innerHTML=ro),Ye=s(e),u(R.$$.fragment,e),qe=s(e),u(G.$$.fragment,e),Be=s(e),d=a(e,"DIV",{class:!0});var _=b(d);u(N.$$.fragment,_),yt=s(_),ge=a(_,"P",{"data-svelte-h":!0}),f(ge)!=="svelte-1nia2sn"&&(ge.textContent=ao),At=s(_),he=a(_,"P",{"data-svelte-h":!0}),f(he)!=="svelte-1hyu2ru"&&(he.innerHTML=io),wt=s(_),k=a(_,"DIV",{class:!0});var ut=b(k);u(Z.$$.fragment,ut),Lt=s(ut),_e=a(ut,"P",{"data-svelte-h":!0}),f(_e)!=="svelte-189cc7b"&&(_e.innerHTML=lo),ut.forEach(n),Tt=s(_),C=a(_,"DIV",{class:!0});var ft=b(C);u(X.$$.fragment,ft),Dt=s(ft),be=a(ft,"P",{"data-svelte-h":!0}),f(be)!=="svelte-1f366pl"&&(be.innerHTML=co),ft.forEach(n),Kt=s(_),F=a(_,"DIV",{class:!0});var mt=b(F);u(Y.$$.fragment,mt),kt=s(mt),ve=a(mt,"P",{"data-svelte-h":!0}),f(ve)!=="svelte-14bnrb6"&&(ve.textContent=uo),mt.forEach(n),Ct=s(_),P=a(_,"DIV",{class:!0});var pt=b(P);u(q.$$.fragment,pt),Ft=s(pt),xe=a(pt,"P",{"data-svelte-h":!0}),f(xe)!=="svelte-1xwrf7t"&&(xe.textContent=fo),pt.forEach(n),Pt=s(_),$e=a(_,"DIV",{class:!0});var ko=b($e);u(B.$$.fragment,ko),ko.forEach(n),Et=s(_),E=a(_,"DIV",{class:!0});var gt=b(E);u(Q.$$.fragment,gt),Ot=s(gt),ye=a(gt,"P",{"data-svelte-h":!0}),f(ye)!=="svelte-1o77hl2"&&(ye.textContent=mo),gt.forEach(n),Mt=s(_),O=a(_,"DIV",{class:!0});var ht=b(O);u(ee.$$.fragment,ht),Vt=s(ht),Ae=a(ht,"P",{"data-svelte-h":!0}),f(Ae)!=="svelte-1lxcwhv"&&(Ae.textContent=po),ht.forEach(n),zt=s(_),M=a(_,"DIV",{class:!0});var _t=b(M);u(te.$$.fragment,_t),It=s(_t),we=a(_t,"P",{"data-svelte-h":!0}),f(we)!=="svelte-1vrxp2b"&&(we.textContent=go),_t.forEach(n),jt=s(_),L=a(_,"DIV",{class:!0});var Ie=b(L);u(oe.$$.fragment,Ie),Ht=s(Ie),Le=a(Ie,"P",{"data-svelte-h":!0}),f(Le)!=="svelte-1un5fcn"&&(Le.textContent=ho),Jt=s(Ie),Te=a(Ie,"P",{"data-svelte-h":!0}),f(Te)!=="svelte-lbfkqr"&&(Te.textContent=_o),Ie.forEach(n),_.forEach(n),Qe=s(e),u(ne.$$.fragment,e),et=s(e),D=a(e,"DIV",{class:!0});var bt=b(D);u(se.$$.fragment,bt),Wt=s(bt),De=a(bt,"P",{"data-svelte-h":!0}),f(De)!=="svelte-1vsc7ag"&&(De.textContent=bo),bt.forEach(n),tt=s(e),u(re.$$.fragment,e),ot=s(e),K=a(e,"DIV",{class:!0});var vt=b(K);u(ae.$$.fragment,vt),St=s(vt),Ke=a(vt,"P",{"data-svelte-h":!0}),f(Ke)!=="svelte-18u8upa"&&(Ke.textContent=vo),vt.forEach(n),nt=s(e),u(ie.$$.fragment,e),st=s(e),x=a(e,"DIV",{class:!0});var y=b(x);u(le.$$.fragment,y),Ut=s(y),ke=a(y,"P",{"data-svelte-h":!0}),f(ke)!=="svelte-184pm5e"&&(ke.textContent=xo),Rt=s(y),Ce=a(y,"P",{"data-svelte-h":!0}),f(Ce)!=="svelte-sibkts"&&(Ce.innerHTML=$o),Gt=s(y),Fe=a(y,"P",{"data-svelte-h":!0}),f(Fe)!=="svelte-1dpnydg"&&(Fe.innerHTML=yo),Nt=s(y),Pe=a(y,"P",{"data-svelte-h":!0}),f(Pe)!=="svelte-ngiliw"&&(Pe.textContent=Ao),Zt=s(y),Ee=a(y,"UL",{"data-svelte-h":!0}),f(Ee)!=="svelte-1w7z84m"&&(Ee.innerHTML=wo),y.forEach(n),rt=s(e),u(de.$$.fragment,e),at=s(e),A=a(e,"DIV",{class:!0});var je=b(A);u(ce.$$.fragment,je),Xt=s(je),Oe=a(je,"P",{"data-svelte-h":!0}),f(Oe)!=="svelte-1vsc7ag"&&(Oe.textContent=Lo),Yt=s(je),V=a(je,"DIV",{class:!0});var xt=b(V);u(ue.$$.fragment,xt),qt=s(xt),Me=a(xt,"P",{"data-svelte-h":!0}),f(Me)!=="svelte-5ihtpa"&&(Me.textContent=To),xt.forEach(n),je.forEach(n),it=s(e),u(fe.$$.fragment,e),lt=s(e),w=a(e,"DIV",{class:!0});var He=b(w);u(me.$$.fragment,He),Bt=s(He),Ve=a(He,"P",{"data-svelte-h":!0}),f(Ve)!=="svelte-18u8upa"&&(Ve.textContent=Do),Qt=s(He),z=a(He,"DIV",{class:!0});var $t=b(z);u(pe.$$.fragment,$t),eo=s($t),ze=a($t,"P",{"data-svelte-h":!0}),f(ze)!=="svelte-5ihtpa"&&(ze.textContent=Ko),$t.forEach(n),He.forEach(n),dt=s(e),We=a(e,"P",{}),b(We).forEach(n),this.h()},h(){v(T,"name","hf:doc:metadata"),v(T,"content",Io),v(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(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(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(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,i){t(document.head,T),l(e,Se,i),l(e,Je,i),l(e,Ue,i),m(j,e,i),l(e,Re,i),l(e,H,i),l(e,Ge,i),l(e,J,i),l(e,Ne,i),l(e,W,i),l(e,Ze,i),m(S,e,i),l(e,Xe,i),l(e,U,i),l(e,Ye,i),m(R,e,i),l(e,qe,i),m(G,e,i),l(e,Be,i),l(e,d,i),m(N,d,null),t(d,yt),t(d,ge),t(d,At),t(d,he),t(d,wt),t(d,k),m(Z,k,null),t(k,Lt),t(k,_e),t(d,Tt),t(d,C),m(X,C,null),t(C,Dt),t(C,be),t(d,Kt),t(d,F),m(Y,F,null),t(F,kt),t(F,ve),t(d,Ct),t(d,P),m(q,P,null),t(P,Ft),t(P,xe),t(d,Pt),t(d,$e),m(B,$e,null),t(d,Et),t(d,E),m(Q,E,null),t(E,Ot),t(E,ye),t(d,Mt),t(d,O),m(ee,O,null),t(O,Vt),t(O,Ae),t(d,zt),t(d,M),m(te,M,null),t(M,It),t(M,we),t(d,jt),t(d,L),m(oe,L,null),t(L,Ht),t(L,Le),t(L,Jt),t(L,Te),l(e,Qe,i),m(ne,e,i),l(e,et,i),l(e,D,i),m(se,D,null),t(D,Wt),t(D,De),l(e,tt,i),m(re,e,i),l(e,ot,i),l(e,K,i),m(ae,K,null),t(K,St),t(K,Ke),l(e,nt,i),m(ie,e,i),l(e,st,i),l(e,x,i),m(le,x,null),t(x,Ut),t(x,ke),t(x,Rt),t(x,Ce),t(x,Gt),t(x,Fe),t(x,Nt),t(x,Pe),t(x,Zt),t(x,Ee),l(e,rt,i),m(de,e,i),l(e,at,i),l(e,A,i),m(ce,A,null),t(A,Xt),t(A,Oe),t(A,Yt),t(A,V),m(ue,V,null),t(V,qt),t(V,Me),l(e,it,i),m(fe,e,i),l(e,lt,i),l(e,w,i),m(me,w,null),t(w,Bt),t(w,Ve),t(w,Qt),t(w,z),m(pe,z,null),t(z,eo),t(z,ze),l(e,dt,i),l(e,We,i),ct=!0},p:Fo,i(e){ct||(p(j.$$.fragment,e),p(S.$$.fragment,e),p(R.$$.fragment,e),p(G.$$.fragment,e),p(N.$$.fragment,e),p(Z.$$.fragment,e),p(X.$$.fragment,e),p(Y.$$.fragment,e),p(q.$$.fragment,e),p(B.$$.fragment,e),p(Q.$$.fragment,e),p(ee.$$.fragment,e),p(te.$$.fragment,e),p(oe.$$.fragment,e),p(ne.$$.fragment,e),p(se.$$.fragment,e),p(re.$$.fragment,e),p(ae.$$.fragment,e),p(ie.$$.fragment,e),p(le.$$.fragment,e),p(de.$$.fragment,e),p(ce.$$.fragment,e),p(ue.$$.fragment,e),p(fe.$$.fragment,e),p(me.$$.fragment,e),p(pe.$$.fragment,e),ct=!0)},o(e){g(j.$$.fragment,e),g(S.$$.fragment,e),g(R.$$.fragment,e),g(G.$$.fragment,e),g(N.$$.fragment,e),g(Z.$$.fragment,e),g(X.$$.fragment,e),g(Y.$$.fragment,e),g(q.$$.fragment,e),g(B.$$.fragment,e),g(Q.$$.fragment,e),g(ee.$$.fragment,e),g(te.$$.fragment,e),g(oe.$$.fragment,e),g(ne.$$.fragment,e),g(se.$$.fragment,e),g(re.$$.fragment,e),g(ae.$$.fragment,e),g(ie.$$.fragment,e),g(le.$$.fragment,e),g(de.$$.fragment,e),g(ce.$$.fragment,e),g(ue.$$.fragment,e),g(fe.$$.fragment,e),g(me.$$.fragment,e),g(pe.$$.fragment,e),ct=!1},d(e){e&&(n(Se),n(Je),n(Ue),n(Re),n(H),n(Ge),n(J),n(Ne),n(W),n(Ze),n(Xe),n(U),n(Ye),n(qe),n(Be),n(d),n(Qe),n(et),n(D),n(tt),n(ot),n(K),n(nt),n(st),n(x),n(rt),n(at),n(A),n(it),n(lt),n(w),n(dt),n(We)),n(T),h(j,e),h(S,e),h(R,e),h(G,e),h(N),h(Z),h(X),h(Y),h(q),h(B),h(Q),h(ee),h(te),h(oe),h(ne,e),h(se),h(re,e),h(ae),h(ie,e),h(le),h(de,e),h(ce),h(ue),h(fe,e),h(me),h(pe)}}}const Io='{"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.vae.DecoderOutput","sections":[],"depth":2},{"title":"FlaxAutoencoderKL","local":"diffusers.FlaxAutoencoderKL","sections":[],"depth":2},{"title":"FlaxAutoencoderKLOutput","local":"diffusers.models.vae_flax.FlaxAutoencoderKLOutput","sections":[],"depth":2},{"title":"FlaxDecoderOutput","local":"diffusers.models.vae_flax.FlaxDecoderOutput","sections":[],"depth":2}],"depth":1}';function jo(to){return Po(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ro extends Eo{constructor(T){super(),Oo(this,T,jo,zo,Co,{})}}export{Ro as component};
