import{s as Co,n as Fo,o as Po}from"../chunks/scheduler.182ea377.js";import{S as Mo,i as Oo,g as r,s as o,r as c,A as Eo,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 p,d as m,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,Je,He,Ue,j,Se,W,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,H,no="The abstract from the paper is:",Ne,R,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,J,Be,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:`,Xe,S,qe,G,Ye,d,N,At,ge,ao="A VAE model with KL loss for encoding images into latents and decoding latent representations into images.",yt,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,B,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,X,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,Y,Mt,M,Q,Ot,Ae,po="Sets the attention processor to use to compute attention.",Et,O,ee,Vt,ye,mo="Disables custom attention processors and sets the default attention implementation.",zt,E,te,It,we,go="Decode a batch of images using a tiled decoder.",jt,L,oe,Wt,Le,ho="Encode a batch of images using a tiled encoder.",Ht,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,Rt,De,bo="Output of AutoencoderKL encoding method.",tt,re,ot,k,ae,Jt,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.",St,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,Ao=`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,yo="Inherent JAX features such as the following are supported:",Zt,Me,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,y,ce,Bt,Oe,Lo="Output of AutoencoderKL encoding method.",Xt,V,ue,qt,Ee,To="“Returns a new object replacing the specified fields with new values.",it,fe,lt,w,pe,Yt,Ve,Do="Output of decoding method.",Qt,z,me,eo,ze,ko="“Returns a new object replacing the specified fields with new values.",dt,Re,ct;return j=new I({props:{title:"AutoencoderKL",local:"autoencoderkl",headingTag:"h1"}}),J=new I({props:{title:"Loading from the original format",local:"loading-from-the-original-format",headingTag:"h2"}}),S=new Vo({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9lbmNvZGVyS0wlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGc3RhYmlsaXR5YWklMkZzZC12YWUtZnQtbXNlLW9yaWdpbmFsJTJGYmxvYiUyRm1haW4lMkZ2YWUtZnQtbXNlLTg0MDAwMC1lbWEtcHJ1bmVkLnNhZmV0ZW5zb3JzJTIyJTIwJTIwJTIzJTIwY2FuJTIwYWxzbyUyMGJlJTIwbG9jYWwlMjBmaWxlJTBBbW9kZWwlMjAlM0QlMjBBdXRvZW5jb2RlcktMLmZyb21fc2luZ2xlX2ZpbGUodXJsKQ==",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 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#L49"}}),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#L166"}}),B=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#L152"}}),X=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#L159"}}),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#L144"}}),Y=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#L439"}}),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#L199"}}),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#L236"}}),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/autoencoderkl#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#L391",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If return_dict is True, a <a
  href="/docs/diffusers/main/en/api/models/autoencoderkl#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/autoencoderkl#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/autoencoderkl#diffusers.models.autoencoder_kl.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#L337",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If return_dict is True, a <a
  href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.models.autoencoder_kl.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/autoencoderkl#diffusers.models.autoencoder_kl.AutoencoderKLOutput"
>AutoencoderKLOutput</a> or <code>tuple</code></p>
`}}),ne=new I({props:{title:"AutoencoderKLOutput",local:"diffusers.models.autoencoder_kl.AutoencoderKLOutput",headingTag:"h2"}}),se=new $({props:{name:"class diffusers.models.autoencoder_kl.AutoencoderKLOutput",anchor:"diffusers.models.autoencoder_kl.AutoencoderKLOutput",parameters:[{name:"latent_dist",val:": DiagonalGaussianDistribution"}],parametersDescription:[{anchor:"diffusers.models.autoencoder_kl.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/autoencoder_kl.py#L36"}}),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#L29"}}),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 0x7fa8ecfd8eb0>"},{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#L721"}}),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"}}),pe=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"}}),me=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"),Je=o(),He=r("p"),Ue=o(),c(j.$$.fragment),Se=o(),W=r("p"),W.innerHTML=oo,Ge=o(),H=r("p"),H.textContent=no,Ne=o(),R=r("p"),R.innerHTML=so,Ze=o(),c(J.$$.fragment),Be=o(),U=r("p"),U.innerHTML=ro,Xe=o(),c(S.$$.fragment),qe=o(),c(G.$$.fragment),Ye=o(),d=r("div"),c(N.$$.fragment),At=o(),ge=r("p"),ge.textContent=ao,yt=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(B.$$.fragment),Dt=o(),be=r("p"),be.innerHTML=co,kt=o(),F=r("div"),c(X.$$.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(Y.$$.fragment),Mt=o(),M=r("div"),c(Q.$$.fragment),Ot=o(),Ae=r("p"),Ae.textContent=po,Et=o(),O=r("div"),c(ee.$$.fragment),Vt=o(),ye=r("p"),ye.textContent=mo,zt=o(),E=r("div"),c(te.$$.fragment),It=o(),we=r("p"),we.textContent=go,jt=o(),L=r("div"),c(oe.$$.fragment),Wt=o(),Le=r("p"),Le.textContent=ho,Ht=o(),Te=r("p"),Te.textContent=_o,Qe=o(),c(ne.$$.fragment),et=o(),D=r("div"),c(se.$$.fragment),Rt=o(),De=r("p"),De.textContent=bo,tt=o(),c(re.$$.fragment),ot=o(),k=r("div"),c(ae.$$.fragment),Jt=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,St=o(),Ce=r("p"),Ce.innerHTML=$o,Gt=o(),Fe=r("p"),Fe.innerHTML=Ao,Nt=o(),Pe=r("p"),Pe.textContent=yo,Zt=o(),Me=r("ul"),Me.innerHTML=wo,rt=o(),c(de.$$.fragment),at=o(),y=r("div"),c(ce.$$.fragment),Bt=o(),Oe=r("p"),Oe.textContent=Lo,Xt=o(),V=r("div"),c(ue.$$.fragment),qt=o(),Ee=r("p"),Ee.textContent=To,it=o(),c(fe.$$.fragment),lt=o(),w=r("div"),c(pe.$$.fragment),Yt=o(),Ve=r("p"),Ve.textContent=Do,Qt=o(),z=r("div"),c(me.$$.fragment),eo=o(),ze=r("p"),ze.textContent=ko,dt=o(),Re=r("p"),this.h()},l(e){const i=Eo("svelte-u9bgzb",document.head);T=a(i,"META",{name:!0,content:!0}),i.forEach(n),Je=s(e),He=a(e,"P",{}),b(He).forEach(n),Ue=s(e),u(j.$$.fragment,e),Se=s(e),W=a(e,"P",{"data-svelte-h":!0}),f(W)!=="svelte-rb5qpx"&&(W.innerHTML=oo),Ge=s(e),H=a(e,"P",{"data-svelte-h":!0}),f(H)!=="svelte-1cwsb16"&&(H.textContent=no),Ne=s(e),R=a(e,"P",{"data-svelte-h":!0}),f(R)!=="svelte-1e786c4"&&(R.innerHTML=so),Ze=s(e),u(J.$$.fragment,e),Be=s(e),U=a(e,"P",{"data-svelte-h":!0}),f(U)!=="svelte-1vtmdxd"&&(U.innerHTML=ro),Xe=s(e),u(S.$$.fragment,e),qe=s(e),u(G.$$.fragment,e),Ye=s(e),d=a(e,"DIV",{class:!0});var _=b(d);u(N.$$.fragment,_),At=s(_),ge=a(_,"P",{"data-svelte-h":!0}),f(ge)!=="svelte-1nia2sn"&&(ge.textContent=ao),yt=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(B.$$.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 pt=b(F);u(X.$$.fragment,pt),Kt=s(pt),ve=a(pt,"P",{"data-svelte-h":!0}),f(ve)!=="svelte-14bnrb6"&&(ve.textContent=uo),pt.forEach(n),Ct=s(_),P=a(_,"DIV",{class:!0});var mt=b(P);u(q.$$.fragment,mt),Ft=s(mt),xe=a(mt,"P",{"data-svelte-h":!0}),f(xe)!=="svelte-1xwrf7t"&&(xe.textContent=fo),mt.forEach(n),Pt=s(_),$e=a(_,"DIV",{class:!0});var Ko=b($e);u(Y.$$.fragment,Ko),Ko.forEach(n),Mt=s(_),M=a(_,"DIV",{class:!0});var gt=b(M);u(Q.$$.fragment,gt),Ot=s(gt),Ae=a(gt,"P",{"data-svelte-h":!0}),f(Ae)!=="svelte-1o77hl2"&&(Ae.textContent=po),gt.forEach(n),Et=s(_),O=a(_,"DIV",{class:!0});var ht=b(O);u(ee.$$.fragment,ht),Vt=s(ht),ye=a(ht,"P",{"data-svelte-h":!0}),f(ye)!=="svelte-1lxcwhv"&&(ye.textContent=mo),ht.forEach(n),zt=s(_),E=a(_,"DIV",{class:!0});var _t=b(E);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),Wt=s(Ie),Le=a(Ie,"P",{"data-svelte-h":!0}),f(Le)!=="svelte-1un5fcn"&&(Le.textContent=ho),Ht=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),Rt=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),Jt=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 A=b(x);u(le.$$.fragment,A),Ut=s(A),Ke=a(A,"P",{"data-svelte-h":!0}),f(Ke)!=="svelte-184pm5e"&&(Ke.textContent=xo),St=s(A),Ce=a(A,"P",{"data-svelte-h":!0}),f(Ce)!=="svelte-sibkts"&&(Ce.innerHTML=$o),Gt=s(A),Fe=a(A,"P",{"data-svelte-h":!0}),f(Fe)!=="svelte-1dpnydg"&&(Fe.innerHTML=Ao),Nt=s(A),Pe=a(A,"P",{"data-svelte-h":!0}),f(Pe)!=="svelte-ngiliw"&&(Pe.textContent=yo),Zt=s(A),Me=a(A,"UL",{"data-svelte-h":!0}),f(Me)!=="svelte-1w7z84m"&&(Me.innerHTML=wo),A.forEach(n),rt=s(e),u(de.$$.fragment,e),at=s(e),y=a(e,"DIV",{class:!0});var je=b(y);u(ce.$$.fragment,je),Bt=s(je),Oe=a(je,"P",{"data-svelte-h":!0}),f(Oe)!=="svelte-1vsc7ag"&&(Oe.textContent=Lo),Xt=s(je),V=a(je,"DIV",{class:!0});var xt=b(V);u(ue.$$.fragment,xt),qt=s(xt),Ee=a(xt,"P",{"data-svelte-h":!0}),f(Ee)!=="svelte-5ihtpa"&&(Ee.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 We=b(w);u(pe.$$.fragment,We),Yt=s(We),Ve=a(We,"P",{"data-svelte-h":!0}),f(Ve)!=="svelte-18u8upa"&&(Ve.textContent=Do),Qt=s(We),z=a(We,"DIV",{class:!0});var $t=b(z);u(me.$$.fragment,$t),eo=s($t),ze=a($t,"P",{"data-svelte-h":!0}),f(ze)!=="svelte-5ihtpa"&&(ze.textContent=ko),$t.forEach(n),We.forEach(n),dt=s(e),Re=a(e,"P",{}),b(Re).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(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(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(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(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(y,"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,Je,i),l(e,He,i),l(e,Ue,i),p(j,e,i),l(e,Se,i),l(e,W,i),l(e,Ge,i),l(e,H,i),l(e,Ne,i),l(e,R,i),l(e,Ze,i),p(J,e,i),l(e,Be,i),l(e,U,i),l(e,Xe,i),p(S,e,i),l(e,qe,i),p(G,e,i),l(e,Ye,i),l(e,d,i),p(N,d,null),t(d,At),t(d,ge),t(d,yt),t(d,he),t(d,wt),t(d,K),p(Z,K,null),t(K,Lt),t(K,_e),t(d,Tt),t(d,C),p(B,C,null),t(C,Dt),t(C,be),t(d,kt),t(d,F),p(X,F,null),t(F,Kt),t(F,ve),t(d,Ct),t(d,P),p(q,P,null),t(P,Ft),t(P,xe),t(d,Pt),t(d,$e),p(Y,$e,null),t(d,Mt),t(d,M),p(Q,M,null),t(M,Ot),t(M,Ae),t(d,Et),t(d,O),p(ee,O,null),t(O,Vt),t(O,ye),t(d,zt),t(d,E),p(te,E,null),t(E,It),t(E,we),t(d,jt),t(d,L),p(oe,L,null),t(L,Wt),t(L,Le),t(L,Ht),t(L,Te),l(e,Qe,i),p(ne,e,i),l(e,et,i),l(e,D,i),p(se,D,null),t(D,Rt),t(D,De),l(e,tt,i),p(re,e,i),l(e,ot,i),l(e,k,i),p(ae,k,null),t(k,Jt),t(k,ke),l(e,nt,i),p(ie,e,i),l(e,st,i),l(e,x,i),p(le,x,null),t(x,Ut),t(x,Ke),t(x,St),t(x,Ce),t(x,Gt),t(x,Fe),t(x,Nt),t(x,Pe),t(x,Zt),t(x,Me),l(e,rt,i),p(de,e,i),l(e,at,i),l(e,y,i),p(ce,y,null),t(y,Bt),t(y,Oe),t(y,Xt),t(y,V),p(ue,V,null),t(V,qt),t(V,Ee),l(e,it,i),p(fe,e,i),l(e,lt,i),l(e,w,i),p(pe,w,null),t(w,Yt),t(w,Ve),t(w,Qt),t(w,z),p(me,z,null),t(z,eo),t(z,ze),l(e,dt,i),l(e,Re,i),ct=!0},p:Fo,i(e){ct||(m(j.$$.fragment,e),m(J.$$.fragment,e),m(S.$$.fragment,e),m(G.$$.fragment,e),m(N.$$.fragment,e),m(Z.$$.fragment,e),m(B.$$.fragment,e),m(X.$$.fragment,e),m(q.$$.fragment,e),m(Y.$$.fragment,e),m(Q.$$.fragment,e),m(ee.$$.fragment,e),m(te.$$.fragment,e),m(oe.$$.fragment,e),m(ne.$$.fragment,e),m(se.$$.fragment,e),m(re.$$.fragment,e),m(ae.$$.fragment,e),m(ie.$$.fragment,e),m(le.$$.fragment,e),m(de.$$.fragment,e),m(ce.$$.fragment,e),m(ue.$$.fragment,e),m(fe.$$.fragment,e),m(pe.$$.fragment,e),m(me.$$.fragment,e),ct=!0)},o(e){g(j.$$.fragment,e),g(J.$$.fragment,e),g(S.$$.fragment,e),g(G.$$.fragment,e),g(N.$$.fragment,e),g(Z.$$.fragment,e),g(B.$$.fragment,e),g(X.$$.fragment,e),g(q.$$.fragment,e),g(Y.$$.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(pe.$$.fragment,e),g(me.$$.fragment,e),ct=!1},d(e){e&&(n(Je),n(He),n(Ue),n(Se),n(W),n(Ge),n(H),n(Ne),n(R),n(Ze),n(Be),n(U),n(Xe),n(qe),n(Ye),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(y),n(it),n(lt),n(w),n(dt),n(Re)),n(T),h(j,e),h(J,e),h(S,e),h(G,e),h(N),h(Z),h(B),h(X),h(q),h(Y),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(pe),h(me)}}}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.autoencoder_kl.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 So extends Mo{constructor(T){super(),Oo(this,T,jo,zo,Co,{})}}export{So as component};
