Buckets:

rtrm's picture
download
raw
15.8 kB
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 T,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.67e413d2.js";import{D as x}from"../chunks/Docstring.60584164.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.debde53c.js";function nt(Oe){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,E,xe,j,qe="A VAE model with KL loss for encoding videos into latents and decoding latent representations into videos.",Le,W,Ne=`This model inherits from <a href="/docs/diffusers/pr_13331/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,k,Te,L,O,Ae,H,Pe=`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,y,q,Ce,F,Ue="Decode a batch of images using a tiled decoder.",Qe,I,N,Ee,B,Ge="Encode a batch of images using a tiled encoder.",le,P,me,b,U,Me,Y,ze="Output of AutoencoderKL encoding method.",ue,G,ce,w,z,ke,X,Ze="Output of decoding method.",pe,Z,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"}}),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_13331/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_13331/src/diffusers/utils/accelerate_utils.py#L43"}}),k=new x({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLQwenImage.encode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/utils/accelerate_utils.py#L43"}}),O=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_13331/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L744"}}),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:": 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.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/vr_13331/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L1036"}}),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/vr_13331/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>
`}}),N=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_13331/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>
`}}),P=new we({props:{title:"AutoencoderKLOutput",local:"diffusers.models.modeling_outputs.AutoencoderKLOutput",headingTag:"h2"}}),U=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_13331/src/diffusers/models/modeling_outputs.py#L7"}}),G=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_13331/src/diffusers/models/autoencoders/vae.py#L46"}}),Z=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(E.$$.fragment),xe=r(),j=i("p"),j.textContent=qe,Le=r(),W=i("p"),W.innerHTML=Ne,ye=r(),R=i("div"),u(M.$$.fragment),Ie=r(),S=i("div"),u(k.$$.fragment),Te=r(),L=i("div"),u(O.$$.fragment),Ae=r(),H=i("p"),H.textContent=Pe,De=r(),J=i("div"),u(V.$$.fragment),Ke=r(),y=i("div"),u(q.$$.fragment),Ce=r(),F=i("p"),F.textContent=Ue,Qe=r(),I=i("div"),u(N.$$.fragment),Ee=r(),B=i("p"),B.textContent=Ge,le=r(),u(P.$$.fragment),me=r(),b=i("div"),u(U.$$.fragment),Me=r(),Y=i("p"),Y.textContent=ze,ue=r(),u(G.$$.fragment),ce=r(),w=i("div"),u(z.$$.fragment),ke=r(),X=i("p"),X.textContent=Ze,pe=r(),u(Z.$$.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}),T(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(E.$$.fragment,m),xe=s(m),j=d(m,"P",{"data-svelte-h":!0}),T(j)!=="svelte-bm840b"&&(j.textContent=qe),Le=s(m),W=d(m,"P",{"data-svelte-h":!0}),T(W)!=="svelte-szgy71"&&(W.innerHTML=Ne),ye=s(m),R=d(m,"DIV",{class:!0});var je=_(R);c(M.$$.fragment,je),je.forEach(t),Ie=s(m),S=d(m,"DIV",{class:!0});var We=_(S);c(k.$$.fragment,We),We.forEach(t),Te=s(m),L=d(m,"DIV",{class:!0});var he=_(L);c(O.$$.fragment,he),Ae=s(he),H=d(he,"P",{"data-svelte-h":!0}),T(H)!=="svelte-1xwrf7t"&&(H.textContent=Pe),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),y=d(m,"DIV",{class:!0});var _e=_(y);c(q.$$.fragment,_e),Ce=s(_e),F=d(_e,"P",{"data-svelte-h":!0}),T(F)!=="svelte-1vrxp2b"&&(F.textContent=Ue),_e.forEach(t),Qe=s(m),I=d(m,"DIV",{class:!0});var $e=_(I);c(N.$$.fragment,$e),Ee=s($e),B=d($e,"P",{"data-svelte-h":!0}),T(B)!=="svelte-1un5fcn"&&(B.textContent=Ge),$e.forEach(t),m.forEach(t),le=s(e),c(P.$$.fragment,e),me=s(e),b=d(e,"DIV",{class:!0});var ve=_(b);c(U.$$.fragment,ve),Me=s(ve),Y=d(ve,"P",{"data-svelte-h":!0}),T(Y)!=="svelte-1vsc7ag"&&(Y.textContent=ze),ve.forEach(t),ue=s(e),c(G.$$.fragment,e),ce=s(e),w=d(e,"DIV",{class:!0});var be=_(w);c(z.$$.fragment,be),ke=s(be),X=d(be,"P",{"data-svelte-h":!0}),T(X)!=="svelte-18u8upa"&&(X.textContent=Ze),be.forEach(t),pe=s(e),c(Z.$$.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"),$(J,"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(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(E,a,null),o(a,xe),o(a,j),o(a,Le),o(a,W),o(a,ye),o(a,R),p(M,R,null),o(a,Ie),o(a,S),p(k,S,null),o(a,Te),o(a,L),p(O,L,null),o(L,Ae),o(L,H),o(a,De),o(a,J),p(V,J,null),o(a,Ke),o(a,y),p(q,y,null),o(y,Ce),o(y,F),o(a,Qe),o(a,I),p(N,I,null),o(I,Ee),o(I,B),l(e,le,n),p(P,e,n),l(e,me,n),l(e,b,n),p(U,b,null),o(b,Me),o(b,Y),l(e,ue,n),p(G,e,n),l(e,ce,n),l(e,w,n),p(z,w,null),o(w,ke),o(w,X),l(e,pe,n),p(Z,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(E.$$.fragment,e),f(M.$$.fragment,e),f(k.$$.fragment,e),f(O.$$.fragment,e),f(V.$$.fragment,e),f(q.$$.fragment,e),f(N.$$.fragment,e),f(P.$$.fragment,e),f(U.$$.fragment,e),f(G.$$.fragment,e),f(z.$$.fragment,e),f(Z.$$.fragment,e),ge=!0)},o(e){g(A.$$.fragment,e),g(D.$$.fragment,e),g(C.$$.fragment,e),g(Q.$$.fragment,e),g(E.$$.fragment,e),g(M.$$.fragment,e),g(k.$$.fragment,e),g(O.$$.fragment,e),g(V.$$.fragment,e),g(q.$$.fragment,e),g(N.$$.fragment,e),g(P.$$.fragment,e),g(U.$$.fragment,e),g(G.$$.fragment,e),g(z.$$.fragment,e),g(Z.$$.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(E),h(M),h(k),h(O),h(V),h(q),h(N),h(P,e),h(U),h(G,e),h(z),h(Z,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(Oe){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};

Xet Storage Details

Size:
15.8 kB
·
Xet hash:
3fb46fa332bf3d71ac8840e680672435b204e7f86bfa0828952ad0fcb9b176b2

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