import{s as ut,n as pt,o as gt}from"../chunks/scheduler.8c3d61f6.js";import{S as ft,i as ht,g as i,s as o,r as m,A as _t,h as d,f as n,c as r,j as _,u as c,x as v,k as b,y as t,a as u,v as p,d as g,t as f,w as h}from"../chunks/index.da70eac4.js";import{D as $}from"../chunks/Docstring.367be9ed.js";import{C as bt}from"../chunks/CodeBlock.a9c4becf.js";import{H as Ee,E as $t}from"../chunks/getInferenceSnippets.cb466318.js";function vt(Be){let w,me,de,ce,C,ue,E,Ye="The model can be loaded with the following code snippet.",pe,Q,ge,O,fe,s,k,Qe,J,Xe="A VAE model with KL loss for encoding videos into latents and decoding latent representations into videos.",Oe,F,et=`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).`,ke,B,M,Me,Y,V,Ve,L,q,qe,X,tt=`Disable sliced VAE decoding. If <code>enable_slicing</code> was previously enabled, this method will go back to computing
decoding in one step.`,Pe,I,P,Ue,ee,nt=`Disable tiled VAE decoding. If <code>enable_tiling</code> was previously enabled, this method will go back to computing
decoding in one step.`,Ge,A,U,He,te,ot=`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.`,Ze,T,G,ze,ne,rt=`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.`,We,oe,H,je,D,Z,Ne,re,st="Decode a batch of images using a tiled decoder.",Re,K,z,Se,se,at="Encode a batch of images using a tiled encoder.",he,W,_e,x,j,Je,ae,it="Output of AutoencoderKL encoding method.",be,N,$e,y,R,Fe,ie,dt="Output of decoding method.",ve,S,we,le,xe;return C=new Ee({props:{title:"AutoencoderKLQwenImage",local:"autoencoderklqwenimage",headingTag:"h1"}}),Q=new bt({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9lbmNvZGVyS0xRd2VuSW1hZ2UlMEElMEF2YWUlMjAlM0QlMjBBdXRvZW5jb2RlcktMUXdlbkltYWdlLmZyb21fcHJldHJhaW5lZCglMjJRd2VuJTJGUXdlbkltYWdlLTIwQiUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnZhZSUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoencoderKLQwenImage

vae = AutoencoderKLQwenImage.from_pretrained(<span class="hljs-string">&quot;Qwen/QwenImage-20B&quot;</span>, subfolder=<span class="hljs-string">&quot;vae&quot;</span>)`,wrap:!1}}),O=new Ee({props:{title:"AutoencoderKLQwenImage",local:"diffusers.AutoencoderKLQwenImage",headingTag:"h2"}}),k=new $({props:{name:"class diffusers.AutoencoderKLQwenImage",anchor:"diffusers.AutoencoderKLQwenImage",parameters:[{name:"base_dim",val:": int = 96"},{name:"z_dim",val:": int = 16"},{name:"dim_mult",val:": typing.Tuple[int] = [1, 2, 4, 4]"},{name:"num_res_blocks",val:": int = 2"},{name:"attn_scales",val:": typing.List[float] = []"},{name:"temperal_downsample",val:": typing.List[bool] = [False, True, True]"},{name:"dropout",val:": float = 0.0"},{name:"latents_mean",val:": typing.List[float] = [-0.7571, -0.7089, -0.9113, 0.1075, -0.1745, 0.9653, -0.1517, 1.5508, 0.4134, -0.0715, 0.5517, -0.3632, -0.1922, -0.9497, 0.2503, -0.2921]"},{name:"latents_std",val:": typing.List[float] = [2.8184, 1.4541, 2.3275, 2.6558, 1.2196, 1.7708, 2.6052, 2.0743, 3.2687, 2.1526, 2.8652, 1.5579, 1.6382, 1.1253, 2.8251, 1.916]"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L667"}}),M=new $({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLQwenImage.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/accelerate_utils.py#L43"}}),V=new $({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLQwenImage.encode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/accelerate_utils.py#L43"}}),q=new $({props:{name:"disable_slicing",anchor:"diffusers.AutoencoderKLQwenImage.disable_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L781"}}),P=new $({props:{name:"disable_tiling",anchor:"diffusers.AutoencoderKLQwenImage.disable_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L767"}}),U=new $({props:{name:"enable_slicing",anchor:"diffusers.AutoencoderKLQwenImage.enable_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L774"}}),G=new $({props:{name:"enable_tiling",anchor:"diffusers.AutoencoderKLQwenImage.enable_tiling",parameters:[{name:"tile_sample_min_height",val:": typing.Optional[int] = None"},{name:"tile_sample_min_width",val:": typing.Optional[int] = None"},{name:"tile_sample_stride_height",val:": typing.Optional[float] = None"},{name:"tile_sample_stride_width",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLQwenImage.enable_tiling.tile_sample_min_height",description:`<strong>tile_sample_min_height</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The minimum height required for a sample to be separated into tiles across the height dimension.`,name:"tile_sample_min_height"},{anchor:"diffusers.AutoencoderKLQwenImage.enable_tiling.tile_sample_min_width",description:`<strong>tile_sample_min_width</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The minimum width required for a sample to be separated into tiles across the width dimension.`,name:"tile_sample_min_width"},{anchor:"diffusers.AutoencoderKLQwenImage.enable_tiling.tile_sample_stride_height",description:`<strong>tile_sample_stride_height</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The minimum amount of overlap between two consecutive vertical tiles. This is to ensure that there are
no tiling artifacts produced across the height dimension.`,name:"tile_sample_stride_height"},{anchor:"diffusers.AutoencoderKLQwenImage.enable_tiling.tile_sample_stride_width",description:`<strong>tile_sample_stride_width</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The stride between two consecutive horizontal tiles. This is to ensure that there are no tiling
artifacts produced across the width dimension.`,name:"tile_sample_stride_width"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L737"}}),H=new $({props:{name:"forward",anchor:"diffusers.AutoencoderKLQwenImage.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.AutoencoderKLQwenImage.forward.sample",description:"<strong>sample</strong> (<code>torch.Tensor</code>) &#x2014; Input sample.",name:"sample"},{anchor:"diffusers.AutoencoderKLQwenImage.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_qwenimage.py#L1050"}}),Z=new $({props:{name:"tiled_decode",anchor:"diffusers.AutoencoderKLQwenImage.tiled_decode",parameters:[{name:"z",val:": Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLQwenImage.tiled_decode.z",description:"<strong>z</strong> (<code>torch.Tensor</code>) &#x2014; Input batch of latent vectors.",name:"z"},{anchor:"diffusers.AutoencoderKLQwenImage.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_qwenimage.py#L987",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>
`}}),z=new $({props:{name:"tiled_encode",anchor:"diffusers.AutoencoderKLQwenImage.tiled_encode",parameters:[{name:"x",val:": Tensor"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLQwenImage.tiled_encode.x",description:"<strong>x</strong> (<code>torch.Tensor</code>) &#x2014; Input batch of videos.",name:"x"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L921",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The latent representation of the encoded videos.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>torch.Tensor</code></p>
`}}),W=new Ee({props:{title:"AutoencoderKLOutput",local:"diffusers.models.modeling_outputs.AutoencoderKLOutput",headingTag:"h2"}}),j=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"}}),N=new Ee({props:{title:"DecoderOutput",local:"diffusers.models.autoencoders.vae.DecoderOutput",headingTag:"h2"}}),R=new $({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"}}),S=new $t({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoderkl_qwenimage.md"}}),{c(){w=i("meta"),me=o(),de=i("p"),ce=o(),m(C.$$.fragment),ue=o(),E=i("p"),E.textContent=Ye,pe=o(),m(Q.$$.fragment),ge=o(),m(O.$$.fragment),fe=o(),s=i("div"),m(k.$$.fragment),Qe=o(),J=i("p"),J.textContent=Xe,Oe=o(),F=i("p"),F.innerHTML=et,ke=o(),B=i("div"),m(M.$$.fragment),Me=o(),Y=i("div"),m(V.$$.fragment),Ve=o(),L=i("div"),m(q.$$.fragment),qe=o(),X=i("p"),X.innerHTML=tt,Pe=o(),I=i("div"),m(P.$$.fragment),Ue=o(),ee=i("p"),ee.innerHTML=nt,Ge=o(),A=i("div"),m(U.$$.fragment),He=o(),te=i("p"),te.textContent=ot,Ze=o(),T=i("div"),m(G.$$.fragment),ze=o(),ne=i("p"),ne.textContent=rt,We=o(),oe=i("div"),m(H.$$.fragment),je=o(),D=i("div"),m(Z.$$.fragment),Ne=o(),re=i("p"),re.textContent=st,Re=o(),K=i("div"),m(z.$$.fragment),Se=o(),se=i("p"),se.textContent=at,he=o(),m(W.$$.fragment),_e=o(),x=i("div"),m(j.$$.fragment),Je=o(),ae=i("p"),ae.textContent=it,be=o(),m(N.$$.fragment),$e=o(),y=i("div"),m(R.$$.fragment),Fe=o(),ie=i("p"),ie.textContent=dt,ve=o(),m(S.$$.fragment),we=o(),le=i("p"),this.h()},l(e){const a=_t("svelte-u9bgzb",document.head);w=d(a,"META",{name:!0,content:!0}),a.forEach(n),me=r(e),de=d(e,"P",{}),_(de).forEach(n),ce=r(e),c(C.$$.fragment,e),ue=r(e),E=d(e,"P",{"data-svelte-h":!0}),v(E)!=="svelte-1vuni30"&&(E.textContent=Ye),pe=r(e),c(Q.$$.fragment,e),ge=r(e),c(O.$$.fragment,e),fe=r(e),s=d(e,"DIV",{class:!0});var l=_(s);c(k.$$.fragment,l),Qe=r(l),J=d(l,"P",{"data-svelte-h":!0}),v(J)!=="svelte-bm840b"&&(J.textContent=Xe),Oe=r(l),F=d(l,"P",{"data-svelte-h":!0}),v(F)!=="svelte-1hyu2ru"&&(F.innerHTML=et),ke=r(l),B=d(l,"DIV",{class:!0});var lt=_(B);c(M.$$.fragment,lt),lt.forEach(n),Me=r(l),Y=d(l,"DIV",{class:!0});var mt=_(Y);c(V.$$.fragment,mt),mt.forEach(n),Ve=r(l),L=d(l,"DIV",{class:!0});var ye=_(L);c(q.$$.fragment,ye),qe=r(ye),X=d(ye,"P",{"data-svelte-h":!0}),v(X)!=="svelte-189cc7b"&&(X.innerHTML=tt),ye.forEach(n),Pe=r(l),I=d(l,"DIV",{class:!0});var Le=_(I);c(P.$$.fragment,Le),Ue=r(Le),ee=d(Le,"P",{"data-svelte-h":!0}),v(ee)!=="svelte-1f366pl"&&(ee.innerHTML=nt),Le.forEach(n),Ge=r(l),A=d(l,"DIV",{class:!0});var Ie=_(A);c(U.$$.fragment,Ie),He=r(Ie),te=d(Ie,"P",{"data-svelte-h":!0}),v(te)!=="svelte-14bnrb6"&&(te.textContent=ot),Ie.forEach(n),Ze=r(l),T=d(l,"DIV",{class:!0});var Ae=_(T);c(G.$$.fragment,Ae),ze=r(Ae),ne=d(Ae,"P",{"data-svelte-h":!0}),v(ne)!=="svelte-1xwrf7t"&&(ne.textContent=rt),Ae.forEach(n),We=r(l),oe=d(l,"DIV",{class:!0});var ct=_(oe);c(H.$$.fragment,ct),ct.forEach(n),je=r(l),D=d(l,"DIV",{class:!0});var Te=_(D);c(Z.$$.fragment,Te),Ne=r(Te),re=d(Te,"P",{"data-svelte-h":!0}),v(re)!=="svelte-1vrxp2b"&&(re.textContent=st),Te.forEach(n),Re=r(l),K=d(l,"DIV",{class:!0});var De=_(K);c(z.$$.fragment,De),Se=r(De),se=d(De,"P",{"data-svelte-h":!0}),v(se)!=="svelte-1un5fcn"&&(se.textContent=at),De.forEach(n),l.forEach(n),he=r(e),c(W.$$.fragment,e),_e=r(e),x=d(e,"DIV",{class:!0});var Ke=_(x);c(j.$$.fragment,Ke),Je=r(Ke),ae=d(Ke,"P",{"data-svelte-h":!0}),v(ae)!=="svelte-1vsc7ag"&&(ae.textContent=it),Ke.forEach(n),be=r(e),c(N.$$.fragment,e),$e=r(e),y=d(e,"DIV",{class:!0});var Ce=_(y);c(R.$$.fragment,Ce),Fe=r(Ce),ie=d(Ce,"P",{"data-svelte-h":!0}),v(ie)!=="svelte-18u8upa"&&(ie.textContent=dt),Ce.forEach(n),ve=r(e),c(S.$$.fragment,e),we=r(e),le=d(e,"P",{}),_(le).forEach(n),this.h()},h(){b(w,"name","hf:doc:metadata"),b(w,"content",wt),b(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(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(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(I,"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(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(oe,"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(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(s,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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")},m(e,a){t(document.head,w),u(e,me,a),u(e,de,a),u(e,ce,a),p(C,e,a),u(e,ue,a),u(e,E,a),u(e,pe,a),p(Q,e,a),u(e,ge,a),p(O,e,a),u(e,fe,a),u(e,s,a),p(k,s,null),t(s,Qe),t(s,J),t(s,Oe),t(s,F),t(s,ke),t(s,B),p(M,B,null),t(s,Me),t(s,Y),p(V,Y,null),t(s,Ve),t(s,L),p(q,L,null),t(L,qe),t(L,X),t(s,Pe),t(s,I),p(P,I,null),t(I,Ue),t(I,ee),t(s,Ge),t(s,A),p(U,A,null),t(A,He),t(A,te),t(s,Ze),t(s,T),p(G,T,null),t(T,ze),t(T,ne),t(s,We),t(s,oe),p(H,oe,null),t(s,je),t(s,D),p(Z,D,null),t(D,Ne),t(D,re),t(s,Re),t(s,K),p(z,K,null),t(K,Se),t(K,se),u(e,he,a),p(W,e,a),u(e,_e,a),u(e,x,a),p(j,x,null),t(x,Je),t(x,ae),u(e,be,a),p(N,e,a),u(e,$e,a),u(e,y,a),p(R,y,null),t(y,Fe),t(y,ie),u(e,ve,a),p(S,e,a),u(e,we,a),u(e,le,a),xe=!0},p:pt,i(e){xe||(g(C.$$.fragment,e),g(Q.$$.fragment,e),g(O.$$.fragment,e),g(k.$$.fragment,e),g(M.$$.fragment,e),g(V.$$.fragment,e),g(q.$$.fragment,e),g(P.$$.fragment,e),g(U.$$.fragment,e),g(G.$$.fragment,e),g(H.$$.fragment,e),g(Z.$$.fragment,e),g(z.$$.fragment,e),g(W.$$.fragment,e),g(j.$$.fragment,e),g(N.$$.fragment,e),g(R.$$.fragment,e),g(S.$$.fragment,e),xe=!0)},o(e){f(C.$$.fragment,e),f(Q.$$.fragment,e),f(O.$$.fragment,e),f(k.$$.fragment,e),f(M.$$.fragment,e),f(V.$$.fragment,e),f(q.$$.fragment,e),f(P.$$.fragment,e),f(U.$$.fragment,e),f(G.$$.fragment,e),f(H.$$.fragment,e),f(Z.$$.fragment,e),f(z.$$.fragment,e),f(W.$$.fragment,e),f(j.$$.fragment,e),f(N.$$.fragment,e),f(R.$$.fragment,e),f(S.$$.fragment,e),xe=!1},d(e){e&&(n(me),n(de),n(ce),n(ue),n(E),n(pe),n(ge),n(fe),n(s),n(he),n(_e),n(x),n(be),n($e),n(y),n(ve),n(we),n(le)),n(w),h(C,e),h(Q,e),h(O,e),h(k),h(M),h(V),h(q),h(P),h(U),h(G),h(H),h(Z),h(z),h(W,e),h(j),h(N,e),h(R),h(S,e)}}}const wt='{"title":"AutoencoderKLQwenImage","local":"autoencoderklqwenimage","sections":[{"title":"AutoencoderKLQwenImage","local":"diffusers.AutoencoderKLQwenImage","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 xt(Be){return gt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Dt extends ft{constructor(w){super(),ht(this,w,xt,vt,ut,{})}}export{Dt as component};
