Buckets:

rtrm's picture
download
raw
12 kB
import{s as Me,n as Ee,o as Le}from"../chunks/scheduler.8c3d61f6.js";import{S as Pe,i as Be,g as o,s as a,r as l,A as ze,h as r,f as t,c as i,j as h,u as d,x as Q,k as g,y as _,a as n,v as m,d as f,t as u,w as c}from"../chunks/index.da70eac4.js";import{D as F}from"../chunks/Docstring.ee4b6913.js";import{H as R,E as Ie}from"../chunks/EditOnGithub.1e64e623.js";function Ne(be){let v,W,J,X,y,Y,w,ye='The <a href="https://hf.co/papers/2301.11093" rel="nofollow">U-ViT</a> model is a vision transformer (ViT) based UNet. This model incorporates elements from ViT (considers all inputs such as time, conditions and noisy image patches as tokens) and a UNet (long skip connections between the shallow and deep layers). The skip connection is important for predicting pixel-level features. An additional 3x3 convolutional block is applied prior to the final output to improve image quality.',Z,x,we="The abstract from the paper is:",ee,V,xe="<em>Currently, applying diffusion models in pixel space of high resolution images is difficult. Instead, existing approaches focus on diffusion in lower dimensional spaces (latent diffusion), or have multiple super-resolution levels of generation referred to as cascades. The downside is that these approaches add additional complexity to the diffusion framework. This paper aims to improve denoising diffusion for high resolution images while keeping the model as simple as possible. The paper is centered around the research question: How can one train a standard denoising diffusion models on high resolution images, and still obtain performance comparable to these alternate approaches? The four main findings are: 1) the noise schedule should be adjusted for high resolution images, 2) It is sufficient to scale only a particular part of the architecture, 3) dropout should be added at specific locations in the architecture, and 4) downsampling is an effective strategy to avoid high resolution feature maps. Combining these simple yet effective techniques, we achieve state-of-the-art on image generation among diffusion models without sampling modifiers on ImageNet.</em>",te,C,se,p,k,he,$,D,ge,j,Ve="Sets the attention processor to use to compute attention.",_e,b,U,$e,G,Ce="Disables custom attention processors and sets the default attention implementation.",ne,T,ae,M,E,ie,L,oe,P,B,re,z,le,I,N,de,H,me,A,q,fe,S,ue,K,ce;return y=new R({props:{title:"UVit2DModel",local:"uvit2dmodel",headingTag:"h1"}}),C=new R({props:{title:"UVit2DModel",local:"diffusers.UVit2DModel",headingTag:"h2"}}),k=new F({props:{name:"class diffusers.UVit2DModel",anchor:"diffusers.UVit2DModel",parameters:[{name:"hidden_size",val:": int = 1024"},{name:"use_bias",val:": bool = False"},{name:"hidden_dropout",val:": float = 0.0"},{name:"cond_embed_dim",val:": int = 768"},{name:"micro_cond_encode_dim",val:": int = 256"},{name:"micro_cond_embed_dim",val:": int = 1280"},{name:"encoder_hidden_size",val:": int = 768"},{name:"vocab_size",val:": int = 8256"},{name:"codebook_size",val:": int = 8192"},{name:"in_channels",val:": int = 768"},{name:"block_out_channels",val:": int = 768"},{name:"num_res_blocks",val:": int = 3"},{name:"downsample",val:": bool = False"},{name:"upsample",val:": bool = False"},{name:"block_num_heads",val:": int = 12"},{name:"num_hidden_layers",val:": int = 22"},{name:"num_attention_heads",val:": int = 16"},{name:"attention_dropout",val:": float = 0.0"},{name:"intermediate_size",val:": int = 2816"},{name:"layer_norm_eps",val:": float = 1e-06"},{name:"ln_elementwise_affine",val:": bool = True"},{name:"sample_size",val:": int = 64"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unets/uvit_2d.py#L39"}}),D=new F({props:{name:"set_attn_processor",anchor:"diffusers.UVit2DModel.set_attn_processor",parameters:[{name:"processor",val:": Union"}],parametersDescription:[{anchor:"diffusers.UVit2DModel.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/unets/uvit_2d.py#L241"}}),U=new F({props:{name:"set_default_attn_processor",anchor:"diffusers.UVit2DModel.set_default_attn_processor",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unets/uvit_2d.py#L276"}}),T=new R({props:{title:"UVit2DConvEmbed",local:"diffusers.models.unets.uvit_2d.UVit2DConvEmbed",headingTag:"h2"}}),E=new F({props:{name:"class diffusers.models.unets.uvit_2d.UVit2DConvEmbed",anchor:"diffusers.models.unets.uvit_2d.UVit2DConvEmbed",parameters:[{name:"in_channels",val:""},{name:"block_out_channels",val:""},{name:"vocab_size",val:""},{name:"elementwise_affine",val:""},{name:"eps",val:""},{name:"bias",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unets/uvit_2d.py#L292"}}),L=new R({props:{title:"UVitBlock",local:"diffusers.models.unets.uvit_2d.UVitBlock",headingTag:"h2"}}),B=new F({props:{name:"class diffusers.models.unets.uvit_2d.UVitBlock",anchor:"diffusers.models.unets.uvit_2d.UVitBlock",parameters:[{name:"channels",val:""},{name:"num_res_blocks",val:": int"},{name:"hidden_size",val:""},{name:"hidden_dropout",val:""},{name:"ln_elementwise_affine",val:""},{name:"layer_norm_eps",val:""},{name:"use_bias",val:""},{name:"block_num_heads",val:""},{name:"attention_dropout",val:""},{name:"downsample",val:": bool"},{name:"upsample",val:": bool"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unets/uvit_2d.py#L307"}}),z=new R({props:{title:"ConvNextBlock",local:"diffusers.models.unets.uvit_2d.ConvNextBlock",headingTag:"h2"}}),N=new F({props:{name:"class diffusers.models.unets.uvit_2d.ConvNextBlock",anchor:"diffusers.models.unets.uvit_2d.ConvNextBlock",parameters:[{name:"channels",val:""},{name:"layer_norm_eps",val:""},{name:"ln_elementwise_affine",val:""},{name:"use_bias",val:""},{name:"hidden_dropout",val:""},{name:"hidden_size",val:""},{name:"res_ffn_factor",val:" = 4"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unets/uvit_2d.py#L406"}}),H=new R({props:{title:"ConvMlmLayer",local:"diffusers.models.unets.uvit_2d.ConvMlmLayer",headingTag:"h2"}}),q=new F({props:{name:"class diffusers.models.unets.uvit_2d.ConvMlmLayer",anchor:"diffusers.models.unets.uvit_2d.ConvMlmLayer",parameters:[{name:"block_out_channels",val:": int"},{name:"in_channels",val:": int"},{name:"use_bias",val:": bool"},{name:"ln_elementwise_affine",val:": bool"},{name:"layer_norm_eps",val:": float"},{name:"codebook_size",val:": int"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unets/uvit_2d.py#L451"}}),S=new Ie({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/uvit2d.md"}}),{c(){v=o("meta"),W=a(),J=o("p"),X=a(),l(y.$$.fragment),Y=a(),w=o("p"),w.innerHTML=ye,Z=a(),x=o("p"),x.textContent=we,ee=a(),V=o("p"),V.innerHTML=xe,te=a(),l(C.$$.fragment),se=a(),p=o("div"),l(k.$$.fragment),he=a(),$=o("div"),l(D.$$.fragment),ge=a(),j=o("p"),j.textContent=Ve,_e=a(),b=o("div"),l(U.$$.fragment),$e=a(),G=o("p"),G.textContent=Ce,ne=a(),l(T.$$.fragment),ae=a(),M=o("div"),l(E.$$.fragment),ie=a(),l(L.$$.fragment),oe=a(),P=o("div"),l(B.$$.fragment),re=a(),l(z.$$.fragment),le=a(),I=o("div"),l(N.$$.fragment),de=a(),l(H.$$.fragment),me=a(),A=o("div"),l(q.$$.fragment),fe=a(),l(S.$$.fragment),ue=a(),K=o("p"),this.h()},l(e){const s=ze("svelte-u9bgzb",document.head);v=r(s,"META",{name:!0,content:!0}),s.forEach(t),W=i(e),J=r(e,"P",{}),h(J).forEach(t),X=i(e),d(y.$$.fragment,e),Y=i(e),w=r(e,"P",{"data-svelte-h":!0}),Q(w)!=="svelte-19vq224"&&(w.innerHTML=ye),Z=i(e),x=r(e,"P",{"data-svelte-h":!0}),Q(x)!=="svelte-1cwsb16"&&(x.textContent=we),ee=i(e),V=r(e,"P",{"data-svelte-h":!0}),Q(V)!=="svelte-1c98hxn"&&(V.innerHTML=xe),te=i(e),d(C.$$.fragment,e),se=i(e),p=r(e,"DIV",{class:!0});var O=h(p);d(k.$$.fragment,O),he=i(O),$=r(O,"DIV",{class:!0});var pe=h($);d(D.$$.fragment,pe),ge=i(pe),j=r(pe,"P",{"data-svelte-h":!0}),Q(j)!=="svelte-1o77hl2"&&(j.textContent=Ve),pe.forEach(t),_e=i(O),b=r(O,"DIV",{class:!0});var ve=h(b);d(U.$$.fragment,ve),$e=i(ve),G=r(ve,"P",{"data-svelte-h":!0}),Q(G)!=="svelte-1lxcwhv"&&(G.textContent=Ce),ve.forEach(t),O.forEach(t),ne=i(e),d(T.$$.fragment,e),ae=i(e),M=r(e,"DIV",{class:!0});var ke=h(M);d(E.$$.fragment,ke),ke.forEach(t),ie=i(e),d(L.$$.fragment,e),oe=i(e),P=r(e,"DIV",{class:!0});var De=h(P);d(B.$$.fragment,De),De.forEach(t),re=i(e),d(z.$$.fragment,e),le=i(e),I=r(e,"DIV",{class:!0});var Ue=h(I);d(N.$$.fragment,Ue),Ue.forEach(t),de=i(e),d(H.$$.fragment,e),me=i(e),A=r(e,"DIV",{class:!0});var Te=h(A);d(q.$$.fragment,Te),Te.forEach(t),fe=i(e),d(S.$$.fragment,e),ue=i(e),K=r(e,"P",{}),h(K).forEach(t),this.h()},h(){g(v,"name","hf:doc:metadata"),g(v,"content",He),g($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(A,"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,s){_(document.head,v),n(e,W,s),n(e,J,s),n(e,X,s),m(y,e,s),n(e,Y,s),n(e,w,s),n(e,Z,s),n(e,x,s),n(e,ee,s),n(e,V,s),n(e,te,s),m(C,e,s),n(e,se,s),n(e,p,s),m(k,p,null),_(p,he),_(p,$),m(D,$,null),_($,ge),_($,j),_(p,_e),_(p,b),m(U,b,null),_(b,$e),_(b,G),n(e,ne,s),m(T,e,s),n(e,ae,s),n(e,M,s),m(E,M,null),n(e,ie,s),m(L,e,s),n(e,oe,s),n(e,P,s),m(B,P,null),n(e,re,s),m(z,e,s),n(e,le,s),n(e,I,s),m(N,I,null),n(e,de,s),m(H,e,s),n(e,me,s),n(e,A,s),m(q,A,null),n(e,fe,s),m(S,e,s),n(e,ue,s),n(e,K,s),ce=!0},p:Ee,i(e){ce||(f(y.$$.fragment,e),f(C.$$.fragment,e),f(k.$$.fragment,e),f(D.$$.fragment,e),f(U.$$.fragment,e),f(T.$$.fragment,e),f(E.$$.fragment,e),f(L.$$.fragment,e),f(B.$$.fragment,e),f(z.$$.fragment,e),f(N.$$.fragment,e),f(H.$$.fragment,e),f(q.$$.fragment,e),f(S.$$.fragment,e),ce=!0)},o(e){u(y.$$.fragment,e),u(C.$$.fragment,e),u(k.$$.fragment,e),u(D.$$.fragment,e),u(U.$$.fragment,e),u(T.$$.fragment,e),u(E.$$.fragment,e),u(L.$$.fragment,e),u(B.$$.fragment,e),u(z.$$.fragment,e),u(N.$$.fragment,e),u(H.$$.fragment,e),u(q.$$.fragment,e),u(S.$$.fragment,e),ce=!1},d(e){e&&(t(W),t(J),t(X),t(Y),t(w),t(Z),t(x),t(ee),t(V),t(te),t(se),t(p),t(ne),t(ae),t(M),t(ie),t(oe),t(P),t(re),t(le),t(I),t(de),t(me),t(A),t(fe),t(ue),t(K)),t(v),c(y,e),c(C,e),c(k),c(D),c(U),c(T,e),c(E),c(L,e),c(B),c(z,e),c(N),c(H,e),c(q),c(S,e)}}}const He='{"title":"UVit2DModel","local":"uvit2dmodel","sections":[{"title":"UVit2DModel","local":"diffusers.UVit2DModel","sections":[],"depth":2},{"title":"UVit2DConvEmbed","local":"diffusers.models.unets.uvit_2d.UVit2DConvEmbed","sections":[],"depth":2},{"title":"UVitBlock","local":"diffusers.models.unets.uvit_2d.UVitBlock","sections":[],"depth":2},{"title":"ConvNextBlock","local":"diffusers.models.unets.uvit_2d.ConvNextBlock","sections":[],"depth":2},{"title":"ConvMlmLayer","local":"diffusers.models.unets.uvit_2d.ConvMlmLayer","sections":[],"depth":2}],"depth":1}';function Ae(be){return Le(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ge extends Pe{constructor(v){super(),Be(this,v,Ae,Ne,Me,{})}}export{Ge as component};

Xet Storage Details

Size:
12 kB
·
Xet hash:
a8b870e1e1804678b4ebfb770cde42912c8a618afe46d691c3fbf53d96862540

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