Buckets:

download
raw
16.8 kB
import{s as Se,n as He,o as Fe}from"../chunks/scheduler.53228c21.js";import{S as Je,i as Be,e as i,s as r,c,h as Ye,a as d,d as t,b as s,f as _,g as u,j as A,k as $,l as o,m as l,n as p,t as f,o as g,p as h}from"../chunks/index.cac5d66a.js";import{C as Xe}from"../chunks/CopyLLMTxtMenu.0ef49226.js";import{D as x}from"../chunks/Docstring.9de32ff4.js";import{C as et}from"../chunks/CodeBlock.606cbaf4.js";import{H as we,E as tt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.48d5cb47.js";function nt(ke){let v,ne,ee,oe,D,re,T,se,K,Ge="The model can be loaded with the following code snippet.",ae,C,ie,Q,de,a,E,xe,z,Ve="A VAE model with KL loss for encoding videos into latents and decoding latent representations into videos.",Le,W,qe=`This model inherits from <a href="/docs/diffusers/pr_13921/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).`,ye,R,M,Ie,S,O,Ae,L,k,De,H,Ne=`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.`,Te,F,G,Ke,y,V,Ce,J,Pe="Decode a batch of images using a tiled decoder.",Qe,I,q,Ee,B,Ue="Encode a batch of images using a tiled encoder.",le,N,me,b,P,Me,Y,Ze="Output of AutoencoderKL encoding method.",ce,U,ue,w,Z,Oe,X,je="Output of decoding method.",pe,j,fe,te,ge;return D=new Xe({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),T=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>)`,lang:"python",wrap:!1}}),Q=new we({props:{title:"AutoencoderKLQwenImage",local:"diffusers.AutoencoderKLQwenImage",headingTag:"h2"}}),E=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:": list = [1, 2, 4, 4]"},{name:"num_res_blocks",val:": int = 2"},{name:"attn_scales",val:": list = []"},{name:"temperal_downsample",val:": list = [False, True, True]"},{name:"dropout",val:": float = 0.0"},{name:"input_channels",val:": int = 3"},{name:"latents_mean",val:": list = [-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:": list = [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/vr_13921/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L673"}}),M=new x({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLQwenImage.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_13921/src/diffusers/utils/accelerate_utils.py#L43"}}),O=new x({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLQwenImage.encode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_13921/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:": int | None = None"},{name:"tile_sample_min_width",val:": int | None = None"},{name:"tile_sample_stride_height",val:": float | None = None"},{name:"tile_sample_stride_width",val:": float | None = 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/vr_13921/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L744"}}),G=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:": torch._C.Generator | None = None"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLQwenImage.forward.sample",description:"<strong>sample</strong> (<code>torch.Tensor</code>) &#x2014; Input sample.",name:"sample"},{anchor:"diffusers.AutoencoderKLQwenImage.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.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"},{anchor:"diffusers.AutoencoderKLQwenImage.forward.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make sampling
deterministic.`,name:"generator"}],source:"https://github.com/huggingface/diffusers/blob/vr_13921/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L1036",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>If <code>return_dict</code> 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>
`}}),V=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/vr_13921/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L973",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>
`}}),q=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/vr_13921/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L907",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>
`}}),N=new we({props:{title:"AutoencoderKLOutput",local:"diffusers.models.modeling_outputs.AutoencoderKLOutput",headingTag:"h2"}}),P=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/vr_13921/src/diffusers/models/modeling_outputs.py#L7"}}),U=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:": torch.FloatTensor | None = 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/vr_13921/src/diffusers/models/autoencoders/vae.py#L46"}}),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(),c(D.$$.fragment),re=r(),c(T.$$.fragment),se=r(),K=i("p"),K.textContent=Ge,ae=r(),c(C.$$.fragment),ie=r(),c(Q.$$.fragment),de=r(),a=i("div"),c(E.$$.fragment),xe=r(),z=i("p"),z.textContent=Ve,Le=r(),W=i("p"),W.innerHTML=qe,ye=r(),R=i("div"),c(M.$$.fragment),Ie=r(),S=i("div"),c(O.$$.fragment),Ae=r(),L=i("div"),c(k.$$.fragment),De=r(),H=i("p"),H.textContent=Ne,Te=r(),F=i("div"),c(G.$$.fragment),Ke=r(),y=i("div"),c(V.$$.fragment),Ce=r(),J=i("p"),J.textContent=Pe,Qe=r(),I=i("div"),c(q.$$.fragment),Ee=r(),B=i("p"),B.textContent=Ue,le=r(),c(N.$$.fragment),me=r(),b=i("div"),c(P.$$.fragment),Me=r(),Y=i("p"),Y.textContent=Ze,ce=r(),c(U.$$.fragment),ue=r(),w=i("div"),c(Z.$$.fragment),Oe=r(),X=i("p"),X.textContent=je,pe=r(),c(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),u(D.$$.fragment,e),re=s(e),u(T.$$.fragment,e),se=s(e),K=d(e,"P",{"data-svelte-h":!0}),A(K)!=="svelte-1vuni30"&&(K.textContent=Ge),ae=s(e),u(C.$$.fragment,e),ie=s(e),u(Q.$$.fragment,e),de=s(e),a=d(e,"DIV",{class:!0});var m=_(a);u(E.$$.fragment,m),xe=s(m),z=d(m,"P",{"data-svelte-h":!0}),A(z)!=="svelte-bm840b"&&(z.textContent=Ve),Le=s(m),W=d(m,"P",{"data-svelte-h":!0}),A(W)!=="svelte-j24tt4"&&(W.innerHTML=qe),ye=s(m),R=d(m,"DIV",{class:!0});var ze=_(R);u(M.$$.fragment,ze),ze.forEach(t),Ie=s(m),S=d(m,"DIV",{class:!0});var We=_(S);u(O.$$.fragment,We),We.forEach(t),Ae=s(m),L=d(m,"DIV",{class:!0});var he=_(L);u(k.$$.fragment,he),De=s(he),H=d(he,"P",{"data-svelte-h":!0}),A(H)!=="svelte-1xwrf7t"&&(H.textContent=Ne),he.forEach(t),Te=s(m),F=d(m,"DIV",{class:!0});var Re=_(F);u(G.$$.fragment,Re),Re.forEach(t),Ke=s(m),y=d(m,"DIV",{class:!0});var _e=_(y);u(V.$$.fragment,_e),Ce=s(_e),J=d(_e,"P",{"data-svelte-h":!0}),A(J)!=="svelte-1vrxp2b"&&(J.textContent=Pe),_e.forEach(t),Qe=s(m),I=d(m,"DIV",{class:!0});var $e=_(I);u(q.$$.fragment,$e),Ee=s($e),B=d($e,"P",{"data-svelte-h":!0}),A(B)!=="svelte-1un5fcn"&&(B.textContent=Ue),$e.forEach(t),m.forEach(t),le=s(e),u(N.$$.fragment,e),me=s(e),b=d(e,"DIV",{class:!0});var ve=_(b);u(P.$$.fragment,ve),Me=s(ve),Y=d(ve,"P",{"data-svelte-h":!0}),A(Y)!=="svelte-1vsc7ag"&&(Y.textContent=Ze),ve.forEach(t),ce=s(e),u(U.$$.fragment,e),ue=s(e),w=d(e,"DIV",{class:!0});var be=_(w);u(Z.$$.fragment,be),Oe=s(be),X=d(be,"P",{"data-svelte-h":!0}),A(X)!=="svelte-18u8upa"&&(X.textContent=je),be.forEach(t),pe=s(e),u(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"),$(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(F,"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"),$(I,"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(D,e,n),l(e,re,n),p(T,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(E,a,null),o(a,xe),o(a,z),o(a,Le),o(a,W),o(a,ye),o(a,R),p(M,R,null),o(a,Ie),o(a,S),p(O,S,null),o(a,Ae),o(a,L),p(k,L,null),o(L,De),o(L,H),o(a,Te),o(a,F),p(G,F,null),o(a,Ke),o(a,y),p(V,y,null),o(y,Ce),o(y,J),o(a,Qe),o(a,I),p(q,I,null),o(I,Ee),o(I,B),l(e,le,n),p(N,e,n),l(e,me,n),l(e,b,n),p(P,b,null),o(b,Me),o(b,Y),l(e,ce,n),p(U,e,n),l(e,ue,n),l(e,w,n),p(Z,w,null),o(w,Oe),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(D.$$.fragment,e),f(T.$$.fragment,e),f(C.$$.fragment,e),f(Q.$$.fragment,e),f(E.$$.fragment,e),f(M.$$.fragment,e),f(O.$$.fragment,e),f(k.$$.fragment,e),f(G.$$.fragment,e),f(V.$$.fragment,e),f(q.$$.fragment,e),f(N.$$.fragment,e),f(P.$$.fragment,e),f(U.$$.fragment,e),f(Z.$$.fragment,e),f(j.$$.fragment,e),ge=!0)},o(e){g(D.$$.fragment,e),g(T.$$.fragment,e),g(C.$$.fragment,e),g(Q.$$.fragment,e),g(E.$$.fragment,e),g(M.$$.fragment,e),g(O.$$.fragment,e),g(k.$$.fragment,e),g(G.$$.fragment,e),g(V.$$.fragment,e),g(q.$$.fragment,e),g(N.$$.fragment,e),g(P.$$.fragment,e),g(U.$$.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(ce),t(ue),t(w),t(pe),t(fe),t(te)),t(v),h(D,e),h(T,e),h(C,e),h(Q,e),h(E),h(M),h(O),h(k),h(G),h(V),h(q),h(N,e),h(P),h(U,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 Fe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ct extends Je{constructor(v){super(),Be(this,v,rt,nt,Se,{})}}export{ct as component};

Xet Storage Details

Size:
16.8 kB
·
Xet hash:
99625db593273b8bc51ea809ff7b7c7569762cc12211a4c9650e88834bd19dd9

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.