import{s as Se,n as He,o as Je}from"../chunks/scheduler.53228c21.js";import{S as Fe,i as Be,e as i,s as r,c as u,h as Ye,a as d,d as t,b as s,f as _,g as c,j as I,k as $,l as o,m as l,n as p,t as f,o as g,p as h}from"../chunks/index.100fac89.js";import{C as Xe}from"../chunks/CopyLLMTxtMenu.20a72e0e.js";import{D as x}from"../chunks/Docstring.49101787.js";import{C as et}from"../chunks/CodeBlock.d30a6509.js";import{H as we,E as tt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.4d82655d.js";function nt(ke){let v,ne,ee,oe,A,re,D,se,K,Ve="The model can be loaded with the following code snippet.",ae,C,ie,Q,de,a,O,xe,W,qe="A VAE model with KL loss for encoding videos into latents and decoding latent representations into videos.",ye,N,Pe=`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).`,Le,R,E,Te,S,M,Ie,y,k,Ae,H,Ue=`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.`,De,J,V,Ke,L,q,Ce,F,Ge="Decode a batch of images using a tiled decoder.",Qe,T,P,Oe,B,Ze="Encode a batch of images using a tiled encoder.",le,U,me,b,G,Ee,Y,ze="Output of AutoencoderKL encoding method.",ue,Z,ce,w,z,Me,X,je="Output of decoding method.",pe,j,fe,te,ge;return A=new Xe({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),D=new we({props:{title:"AutoencoderKLQwenImage",local:"autoencoderklqwenimage",headingTag:"h1"}}),C=new et({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}}),Q=new we({props:{title:"AutoencoderKLQwenImage",local:"diffusers.AutoencoderKLQwenImage",headingTag:"h2"}}),O=new x({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#L666"}}),E=new x({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"}}),M=new x({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"}}),k=new x({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#L736"}}),V=new x({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#L1028"}}),q=new x({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#L965",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>
`}}),P=new x({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#L899",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>
`}}),U=new we({props:{title:"AutoencoderKLOutput",local:"diffusers.models.modeling_outputs.AutoencoderKLOutput",headingTag:"h2"}}),G=new x({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"}}),Z=new we({props:{title:"DecoderOutput",local:"diffusers.models.autoencoders.vae.DecoderOutput",headingTag:"h2"}}),z=new x({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"}}),j=new tt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoderkl_qwenimage.md"}}),{c(){v=i("meta"),ne=r(),ee=i("p"),oe=r(),u(A.$$.fragment),re=r(),u(D.$$.fragment),se=r(),K=i("p"),K.textContent=Ve,ae=r(),u(C.$$.fragment),ie=r(),u(Q.$$.fragment),de=r(),a=i("div"),u(O.$$.fragment),xe=r(),W=i("p"),W.textContent=qe,ye=r(),N=i("p"),N.innerHTML=Pe,Le=r(),R=i("div"),u(E.$$.fragment),Te=r(),S=i("div"),u(M.$$.fragment),Ie=r(),y=i("div"),u(k.$$.fragment),Ae=r(),H=i("p"),H.textContent=Ue,De=r(),J=i("div"),u(V.$$.fragment),Ke=r(),L=i("div"),u(q.$$.fragment),Ce=r(),F=i("p"),F.textContent=Ge,Qe=r(),T=i("div"),u(P.$$.fragment),Oe=r(),B=i("p"),B.textContent=Ze,le=r(),u(U.$$.fragment),me=r(),b=i("div"),u(G.$$.fragment),Ee=r(),Y=i("p"),Y.textContent=ze,ue=r(),u(Z.$$.fragment),ce=r(),w=i("div"),u(z.$$.fragment),Me=r(),X=i("p"),X.textContent=je,pe=r(),u(j.$$.fragment),fe=r(),te=i("p"),this.h()},l(e){const n=Ye("svelte-u9bgzb",document.head);v=d(n,"META",{name:!0,content:!0}),n.forEach(t),ne=s(e),ee=d(e,"P",{}),_(ee).forEach(t),oe=s(e),c(A.$$.fragment,e),re=s(e),c(D.$$.fragment,e),se=s(e),K=d(e,"P",{"data-svelte-h":!0}),I(K)!=="svelte-1vuni30"&&(K.textContent=Ve),ae=s(e),c(C.$$.fragment,e),ie=s(e),c(Q.$$.fragment,e),de=s(e),a=d(e,"DIV",{class:!0});var m=_(a);c(O.$$.fragment,m),xe=s(m),W=d(m,"P",{"data-svelte-h":!0}),I(W)!=="svelte-bm840b"&&(W.textContent=qe),ye=s(m),N=d(m,"P",{"data-svelte-h":!0}),I(N)!=="svelte-1hyu2ru"&&(N.innerHTML=Pe),Le=s(m),R=d(m,"DIV",{class:!0});var We=_(R);c(E.$$.fragment,We),We.forEach(t),Te=s(m),S=d(m,"DIV",{class:!0});var Ne=_(S);c(M.$$.fragment,Ne),Ne.forEach(t),Ie=s(m),y=d(m,"DIV",{class:!0});var he=_(y);c(k.$$.fragment,he),Ae=s(he),H=d(he,"P",{"data-svelte-h":!0}),I(H)!=="svelte-1xwrf7t"&&(H.textContent=Ue),he.forEach(t),De=s(m),J=d(m,"DIV",{class:!0});var Re=_(J);c(V.$$.fragment,Re),Re.forEach(t),Ke=s(m),L=d(m,"DIV",{class:!0});var _e=_(L);c(q.$$.fragment,_e),Ce=s(_e),F=d(_e,"P",{"data-svelte-h":!0}),I(F)!=="svelte-1vrxp2b"&&(F.textContent=Ge),_e.forEach(t),Qe=s(m),T=d(m,"DIV",{class:!0});var $e=_(T);c(P.$$.fragment,$e),Oe=s($e),B=d($e,"P",{"data-svelte-h":!0}),I(B)!=="svelte-1un5fcn"&&(B.textContent=Ze),$e.forEach(t),m.forEach(t),le=s(e),c(U.$$.fragment,e),me=s(e),b=d(e,"DIV",{class:!0});var ve=_(b);c(G.$$.fragment,ve),Ee=s(ve),Y=d(ve,"P",{"data-svelte-h":!0}),I(Y)!=="svelte-1vsc7ag"&&(Y.textContent=ze),ve.forEach(t),ue=s(e),c(Z.$$.fragment,e),ce=s(e),w=d(e,"DIV",{class:!0});var be=_(w);c(z.$$.fragment,be),Me=s(be),X=d(be,"P",{"data-svelte-h":!0}),I(X)!=="svelte-18u8upa"&&(X.textContent=je),be.forEach(t),pe=s(e),c(j.$$.fragment,e),fe=s(e),te=d(e,"P",{}),_(te).forEach(t),this.h()},h(){$(v,"name","hf:doc:metadata"),$(v,"content",ot),$(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,n){o(document.head,v),l(e,ne,n),l(e,ee,n),l(e,oe,n),p(A,e,n),l(e,re,n),p(D,e,n),l(e,se,n),l(e,K,n),l(e,ae,n),p(C,e,n),l(e,ie,n),p(Q,e,n),l(e,de,n),l(e,a,n),p(O,a,null),o(a,xe),o(a,W),o(a,ye),o(a,N),o(a,Le),o(a,R),p(E,R,null),o(a,Te),o(a,S),p(M,S,null),o(a,Ie),o(a,y),p(k,y,null),o(y,Ae),o(y,H),o(a,De),o(a,J),p(V,J,null),o(a,Ke),o(a,L),p(q,L,null),o(L,Ce),o(L,F),o(a,Qe),o(a,T),p(P,T,null),o(T,Oe),o(T,B),l(e,le,n),p(U,e,n),l(e,me,n),l(e,b,n),p(G,b,null),o(b,Ee),o(b,Y),l(e,ue,n),p(Z,e,n),l(e,ce,n),l(e,w,n),p(z,w,null),o(w,Me),o(w,X),l(e,pe,n),p(j,e,n),l(e,fe,n),l(e,te,n),ge=!0},p:He,i(e){ge||(f(A.$$.fragment,e),f(D.$$.fragment,e),f(C.$$.fragment,e),f(Q.$$.fragment,e),f(O.$$.fragment,e),f(E.$$.fragment,e),f(M.$$.fragment,e),f(k.$$.fragment,e),f(V.$$.fragment,e),f(q.$$.fragment,e),f(P.$$.fragment,e),f(U.$$.fragment,e),f(G.$$.fragment,e),f(Z.$$.fragment,e),f(z.$$.fragment,e),f(j.$$.fragment,e),ge=!0)},o(e){g(A.$$.fragment,e),g(D.$$.fragment,e),g(C.$$.fragment,e),g(Q.$$.fragment,e),g(O.$$.fragment,e),g(E.$$.fragment,e),g(M.$$.fragment,e),g(k.$$.fragment,e),g(V.$$.fragment,e),g(q.$$.fragment,e),g(P.$$.fragment,e),g(U.$$.fragment,e),g(G.$$.fragment,e),g(Z.$$.fragment,e),g(z.$$.fragment,e),g(j.$$.fragment,e),ge=!1},d(e){e&&(t(ne),t(ee),t(oe),t(re),t(se),t(K),t(ae),t(ie),t(de),t(a),t(le),t(me),t(b),t(ue),t(ce),t(w),t(pe),t(fe),t(te)),t(v),h(A,e),h(D,e),h(C,e),h(Q,e),h(O),h(E),h(M),h(k),h(V),h(q),h(P),h(U,e),h(G),h(Z,e),h(z),h(j,e)}}}const ot='{"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 rt(ke){return Je(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ut extends Fe{constructor(v){super(),Be(this,v,rt,nt,Se,{})}}export{ut as component};
