import{S as Ri,i as $i,s as Ni,e as o,k as f,w as Do,t as l,M as Si,c as r,d as t,m as d,a,x as Ao,h as n,b as i,N as un,G as e,g as c,y as Io,L as Ci,q as Oo,o as Ro,B as $o,v as Gi}from"../../chunks/vendor-hf-doc-builder.js";import{I as mn}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as Oi}from"../../chunks/CodeBlock-hf-doc-builder.js";function Pi(pn){let P,No,q,H,st,ne,rr,it,ar,So,W,lr,ft,nr,sr,Co,T,dt,ir,fr,ht,dr,hr,ct,cr,ur,se,mr,Go,b,pr,ut,gr,vr,mt,_r,Er,pt,yr,xr,gt,br,wr,Po,k,g,vt,Tr,kr,_t,Dr,Ar,Et,Ir,Or,yt,Rr,$r,ie,Nr,Sr,xt,Cr,Gr,fe,Pr,qr,Lr,xe,bt,Mr,Hr,Wr,U,wt,Ur,Br,Tt,Fr,jr,zr,B,kt,Jr,Yr,Dt,Kr,Qr,qo,v,Vr,At,Xr,Zr,It,ea,ta,Ot,oa,ra,Rt,aa,la,de,na,sa,he,ia,fa,Lo,be,da,Mo,u,$t,we,ha,ca,Nt,Te,ua,ma,St,ke,pa,ga,Ct,De,va,_a,Gt,Ae,Ea,ya,Pt,Ie,xa,ba,qt,Oe,wa,Ta,Lt,Re,ka,Ho,F,Da,$e,Aa,Ia,Wo,j,Mt,D,Ht,Oa,Ra,Wt,$a,Na,Ne,Sa,Ca,Se,Ga,Pa,p,A,Ut,Ce,Bt,qa,La,Ft,Ma,Ha,Ge,Wa,Ua,Pe,ce,qe,gn,Ba,I,jt,Le,zt,Fa,ja,Jt,za,Ja,Me,Ya,Ka,Yt,Qa,O,Kt,He,Qt,Va,Xa,Vt,Za,el,We,tl,ol,Ue,ue,Be,vn,rl,R,Xt,Fe,Zt,al,ll,eo,nl,sl,je,il,fl,ze,me,Je,_n,dl,$,to,Ye,oo,hl,cl,ro,ul,ml,Ke,pl,gl,Qe,vl,_l,N,ao,Ve,lo,El,yl,no,xl,bl,Xe,wl,Tl,Ze,kl,Dl,S,so,et,io,Al,Il,fo,Ol,Rl,tt,$l,Nl,ot,Sl,Cl,C,ho,rt,co,Gl,Pl,uo,ql,Ll,at,Ml,Hl,lt,Wl,Uo,L,z,mo,pe,Ul,po,Bl,Bo,m,Fl,go,jl,zl,vo,Jl,Yl,_o,Kl,Ql,ge,Vl,Xl,Eo,Zl,en,ve,tn,on,yo,rn,an,Fo,M,J,xo,_e,ln,bo,nn,jo,Y,sn,wo,fn,dn,zo,Ee,Jo,nt,hn,Yo,ye,Ko;return ne=new mn({}),pe=new mn({}),_e=new mn({}),Ee=new Oi({props:{code:`git clone https://github.com/huggingface/diffusers
cd diffusers
pip install .`,highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/huggingface/diffusers
<span class="hljs-built_in">cd</span> diffusers
pip install .`}}),ye=new Oi({props:{code:"pip install -r requirements.txt",highlighted:"pip install -r requirements.txt"}}),{c(){P=o("meta"),No=f(),q=o("h1"),H=o("a"),st=o("span"),Do(ne.$$.fragment),rr=f(),it=o("span"),ar=l("\u{1F9E8} Diffusers Training Examples"),So=f(),W=o("p"),lr=l("Diffusers training examples are a collection of scripts to demonstrate how to effectively use the "),ft=o("code"),nr=l("diffusers"),sr=l(` library
for a variety of use cases.`),Co=f(),T=o("p"),dt=o("strong"),ir=l("Note"),fr=l(": If you are looking for "),ht=o("strong"),dr=l("official"),hr=l(" examples on how to use "),ct=o("code"),cr=l("diffusers"),ur=l(` for inference,
please have a look at `),se=o("a"),mr=l("src/diffusers/pipelines"),Go=f(),b=o("p"),pr=l("Our examples aspire to be "),ut=o("strong"),gr=l("self-contained"),vr=l(", "),mt=o("strong"),_r=l("easy-to-tweak"),Er=l(", "),pt=o("strong"),yr=l("beginner-friendly"),xr=l(" and for "),gt=o("strong"),br=l("one-purpose-only"),wr=l(`.
More specifically, this means:`),Po=f(),k=o("ul"),g=o("li"),vt=o("strong"),Tr=l("Self-contained"),kr=l(": An example script shall only depend on \u201Cpip-install-able\u201D Python packages that can be found in a "),_t=o("code"),Dr=l("requirements.txt"),Ar=l(" file. Example scripts shall "),Et=o("strong"),Ir=l("not"),Or=l(" depend on any local files. This means that one can simply download an example script, "),yt=o("em"),Rr=l("e.g."),$r=f(),ie=o("a"),Nr=l("train_unconditional.py"),Sr=l(", install the required dependencies, "),xt=o("em"),Cr=l("e.g."),Gr=f(),fe=o("a"),Pr=l("requirements.txt"),qr=l(" and execute the example script."),Lr=f(),xe=o("li"),bt=o("strong"),Mr=l("Easy-to-tweak"),Hr=l(": While we strive to present as many use cases as possible, the example scripts are just that - examples. It is expected that they won\u2019t work out-of-the box on your specific problem and that you will be required to change a few lines of code to adapt them to your needs. To help you with that, most of the examples fully expose the preprocessing of the data and the training loop to allow you to tweak and edit them as required."),Wr=f(),U=o("li"),wt=o("strong"),Ur=l("Beginner-friendly"),Br=l(": We do not aim for providing state-of-the-art training scripts for the newest models, but rather examples that can be used as a way to better understand diffusion models and how to use them with the "),Tt=o("code"),Fr=l("diffusers"),jr=l(" library. We often purposefully leave out certain state-of-the-art methods if we consider them too complex for beginners."),zr=f(),B=o("li"),kt=o("strong"),Jr=l("One-purpose-only"),Yr=l(`: Examples should show one task and one task only. Even if a task is from a modeling
point of view very similar, `),Dt=o("em"),Kr=l("e.g."),Qr=l(" image super-resolution and image modification tend to use the same model and training method, we want examples to showcase only one task to keep them as readable and easy-to-understand as possible."),qo=f(),v=o("p"),Vr=l("We provide "),At=o("strong"),Xr=l("official"),Zr=l(` examples that cover the most popular tasks of diffusion models.
`),It=o("em"),ea=l("Official"),ta=l(" examples are "),Ot=o("strong"),oa=l("actively"),ra=l(" maintained by the "),Rt=o("code"),aa=l("diffusers"),la=l(` maintainers and we try to rigorously follow our example philosophy as defined above.
If you feel like another important example should exist, we are more than happy to welcome a `),de=o("a"),na=l("Feature Request"),sa=l(" or directly a "),he=o("a"),ia=l("Pull Request"),fa=l(" from you!"),Lo=f(),be=o("p"),da=l("Training examples show how to pretrain or fine-tune diffusion models for a variety of tasks. Currently we support:"),Mo=f(),u=o("ul"),$t=o("li"),we=o("a"),ha=l("Unconditional Training"),ca=f(),Nt=o("li"),Te=o("a"),ua=l("Text-to-Image Training"),ma=f(),St=o("li"),ke=o("a"),pa=l("Text Inversion"),ga=f(),Ct=o("li"),De=o("a"),va=l("Dreambooth"),_a=f(),Gt=o("li"),Ae=o("a"),Ea=l("LoRA Support"),ya=f(),Pt=o("li"),Ie=o("a"),xa=l("ControlNet"),ba=f(),qt=o("li"),Oe=o("a"),wa=l("InstructPix2Pix"),Ta=f(),Lt=o("li"),Re=o("a"),ka=l("Custom Diffusion"),Ho=f(),F=o("p"),Da=l("If possible, please "),$e=o("a"),Aa=l("install xFormers"),Ia=l(" for memory efficient attention. This could help make your training faster and less memory intensive."),Wo=f(),j=o("table"),Mt=o("thead"),D=o("tr"),Ht=o("th"),Oa=l("Task"),Ra=f(),Wt=o("th"),$a=l("\u{1F917} Accelerate"),Na=f(),Ne=o("th"),Sa=l("\u{1F917} Datasets"),Ca=f(),Se=o("th"),Ga=l("Colab"),Pa=f(),p=o("tbody"),A=o("tr"),Ut=o("td"),Ce=o("a"),Bt=o("strong"),qa=l("Unconditional Image Generation"),La=f(),Ft=o("td"),Ma=l("\u2705"),Ha=f(),Ge=o("td"),Wa=l("\u2705"),Ua=f(),Pe=o("td"),ce=o("a"),qe=o("img"),Ba=f(),I=o("tr"),jt=o("td"),Le=o("a"),zt=o("strong"),Fa=l("Text-to-Image fine-tuning"),ja=f(),Jt=o("td"),za=l("\u2705"),Ja=f(),Me=o("td"),Ya=l("\u2705"),Ka=f(),Yt=o("td"),Qa=f(),O=o("tr"),Kt=o("td"),He=o("a"),Qt=o("strong"),Va=l("Textual Inversion"),Xa=f(),Vt=o("td"),Za=l("\u2705"),el=f(),We=o("td"),tl=l("-"),ol=f(),Ue=o("td"),ue=o("a"),Be=o("img"),rl=f(),R=o("tr"),Xt=o("td"),Fe=o("a"),Zt=o("strong"),al=l("Dreambooth"),ll=f(),eo=o("td"),nl=l("\u2705"),sl=f(),je=o("td"),il=l("-"),fl=f(),ze=o("td"),me=o("a"),Je=o("img"),dl=f(),$=o("tr"),to=o("td"),Ye=o("a"),oo=o("strong"),hl=l("Training with LoRA"),cl=f(),ro=o("td"),ul=l("\u2705"),ml=f(),Ke=o("td"),pl=l("-"),gl=f(),Qe=o("td"),vl=l("-"),_l=f(),N=o("tr"),ao=o("td"),Ve=o("a"),lo=o("strong"),El=l("ControlNet"),yl=f(),no=o("td"),xl=l("\u2705"),bl=f(),Xe=o("td"),wl=l("\u2705"),Tl=f(),Ze=o("td"),kl=l("-"),Dl=f(),S=o("tr"),so=o("td"),et=o("a"),io=o("strong"),Al=l("InstructPix2Pix"),Il=f(),fo=o("td"),Ol=l("\u2705"),Rl=f(),tt=o("td"),$l=l("\u2705"),Nl=f(),ot=o("td"),Sl=l("-"),Cl=f(),C=o("tr"),ho=o("td"),rt=o("a"),co=o("strong"),Gl=l("Custom Diffusion"),Pl=f(),uo=o("td"),ql=l("\u2705"),Ll=f(),at=o("td"),Ml=l("\u2705"),Hl=f(),lt=o("td"),Wl=l("-"),Uo=f(),L=o("h2"),z=o("a"),mo=o("span"),Do(pe.$$.fragment),Ul=f(),po=o("span"),Bl=l("Community"),Bo=f(),m=o("p"),Fl=l("In addition, we provide "),go=o("strong"),jl=l("community"),zl=l(` examples, which are examples added and maintained by our community.
Community examples can consist of both `),vo=o("em"),Jl=l("training"),Yl=l(" examples or "),_o=o("em"),Kl=l("inference"),Ql=l(` pipelines.
For such examples, we are more lenient regarding the philosophy defined above and also cannot guarantee to provide maintenance for every issue.
Examples that are useful for the community, but are either not yet deemed popular or not yet following our above philosophy should go into the `),ge=o("a"),Vl=l("community examples"),Xl=l(` folder. The community folder therefore includes training examples and inference pipelines.
`),Eo=o("strong"),Zl=l("Note"),en=l(": Community examples can be a "),ve=o("a"),tn=l("great first contribution"),on=l(" to show to the community how you like to use "),yo=o("code"),rn=l("diffusers"),an=l(" \u{1FA84}."),Fo=f(),M=o("h2"),J=o("a"),xo=o("span"),Do(_e.$$.fragment),ln=f(),bo=o("span"),nn=l("Important note"),jo=f(),Y=o("p"),sn=l("To make sure you can successfully run the latest versions of the example scripts, you have to "),wo=o("strong"),fn=l("install the library from source"),dn=l(" and install some example-specific requirements. To do this, execute the following steps in a new virtual environment:"),zo=f(),Do(Ee.$$.fragment),Jo=f(),nt=o("p"),hn=l("Then cd in the example folder of your choice and run"),Yo=f(),Do(ye.$$.fragment),this.h()},l(s){const h=Si('[data-svelte="svelte-1phssyn"]',document.head);P=r(h,"META",{name:!0,content:!0}),h.forEach(t),No=d(s),q=r(s,"H1",{class:!0});var Qo=a(q);H=r(Qo,"A",{id:!0,class:!0,href:!0});var En=a(H);st=r(En,"SPAN",{});var yn=a(st);Ao(ne.$$.fragment,yn),yn.forEach(t),En.forEach(t),rr=d(Qo),it=r(Qo,"SPAN",{});var xn=a(it);ar=n(xn,"\u{1F9E8} Diffusers Training Examples"),xn.forEach(t),Qo.forEach(t),So=d(s),W=r(s,"P",{});var Vo=a(W);lr=n(Vo,"Diffusers training examples are a collection of scripts to demonstrate how to effectively use the "),ft=r(Vo,"CODE",{});var bn=a(ft);nr=n(bn,"diffusers"),bn.forEach(t),sr=n(Vo,` library
for a variety of use cases.`),Vo.forEach(t),Co=d(s),T=r(s,"P",{});var K=a(T);dt=r(K,"STRONG",{});var wn=a(dt);ir=n(wn,"Note"),wn.forEach(t),fr=n(K,": If you are looking for "),ht=r(K,"STRONG",{});var Tn=a(ht);dr=n(Tn,"official"),Tn.forEach(t),hr=n(K," examples on how to use "),ct=r(K,"CODE",{});var kn=a(ct);cr=n(kn,"diffusers"),kn.forEach(t),ur=n(K,` for inference,
please have a look at `),se=r(K,"A",{href:!0,rel:!0});var Dn=a(se);mr=n(Dn,"src/diffusers/pipelines"),Dn.forEach(t),K.forEach(t),Go=d(s),b=r(s,"P",{});var G=a(b);pr=n(G,"Our examples aspire to be "),ut=r(G,"STRONG",{});var An=a(ut);gr=n(An,"self-contained"),An.forEach(t),vr=n(G,", "),mt=r(G,"STRONG",{});var In=a(mt);_r=n(In,"easy-to-tweak"),In.forEach(t),Er=n(G,", "),pt=r(G,"STRONG",{});var On=a(pt);yr=n(On,"beginner-friendly"),On.forEach(t),xr=n(G," and for "),gt=r(G,"STRONG",{});var Rn=a(gt);br=n(Rn,"one-purpose-only"),Rn.forEach(t),wr=n(G,`.
More specifically, this means:`),G.forEach(t),Po=d(s),k=r(s,"UL",{});var Q=a(k);g=r(Q,"LI",{});var x=a(g);vt=r(x,"STRONG",{});var $n=a(vt);Tr=n($n,"Self-contained"),$n.forEach(t),kr=n(x,": An example script shall only depend on \u201Cpip-install-able\u201D Python packages that can be found in a "),_t=r(x,"CODE",{});var Nn=a(_t);Dr=n(Nn,"requirements.txt"),Nn.forEach(t),Ar=n(x," file. Example scripts shall "),Et=r(x,"STRONG",{});var Sn=a(Et);Ir=n(Sn,"not"),Sn.forEach(t),Or=n(x," depend on any local files. This means that one can simply download an example script, "),yt=r(x,"EM",{});var Cn=a(yt);Rr=n(Cn,"e.g."),Cn.forEach(t),$r=d(x),ie=r(x,"A",{href:!0,rel:!0});var Gn=a(ie);Nr=n(Gn,"train_unconditional.py"),Gn.forEach(t),Sr=n(x,", install the required dependencies, "),xt=r(x,"EM",{});var Pn=a(xt);Cr=n(Pn,"e.g."),Pn.forEach(t),Gr=d(x),fe=r(x,"A",{href:!0,rel:!0});var qn=a(fe);Pr=n(qn,"requirements.txt"),qn.forEach(t),qr=n(x," and execute the example script."),x.forEach(t),Lr=d(Q),xe=r(Q,"LI",{});var cn=a(xe);bt=r(cn,"STRONG",{});var Ln=a(bt);Mr=n(Ln,"Easy-to-tweak"),Ln.forEach(t),Hr=n(cn,": While we strive to present as many use cases as possible, the example scripts are just that - examples. It is expected that they won\u2019t work out-of-the box on your specific problem and that you will be required to change a few lines of code to adapt them to your needs. To help you with that, most of the examples fully expose the preprocessing of the data and the training loop to allow you to tweak and edit them as required."),cn.forEach(t),Wr=d(Q),U=r(Q,"LI",{});var To=a(U);wt=r(To,"STRONG",{});var Mn=a(wt);Ur=n(Mn,"Beginner-friendly"),Mn.forEach(t),Br=n(To,": We do not aim for providing state-of-the-art training scripts for the newest models, but rather examples that can be used as a way to better understand diffusion models and how to use them with the "),Tt=r(To,"CODE",{});var Hn=a(Tt);Fr=n(Hn,"diffusers"),Hn.forEach(t),jr=n(To," library. We often purposefully leave out certain state-of-the-art methods if we consider them too complex for beginners."),To.forEach(t),zr=d(Q),B=r(Q,"LI",{});var ko=a(B);kt=r(ko,"STRONG",{});var Wn=a(kt);Jr=n(Wn,"One-purpose-only"),Wn.forEach(t),Yr=n(ko,`: Examples should show one task and one task only. Even if a task is from a modeling
point of view very similar, `),Dt=r(ko,"EM",{});var Un=a(Dt);Kr=n(Un,"e.g."),Un.forEach(t),Qr=n(ko," image super-resolution and image modification tend to use the same model and training method, we want examples to showcase only one task to keep them as readable and easy-to-understand as possible."),ko.forEach(t),Q.forEach(t),qo=d(s),v=r(s,"P",{});var w=a(v);Vr=n(w,"We provide "),At=r(w,"STRONG",{});var Bn=a(At);Xr=n(Bn,"official"),Bn.forEach(t),Zr=n(w,` examples that cover the most popular tasks of diffusion models.
`),It=r(w,"EM",{});var Fn=a(It);ea=n(Fn,"Official"),Fn.forEach(t),ta=n(w," examples are "),Ot=r(w,"STRONG",{});var jn=a(Ot);oa=n(jn,"actively"),jn.forEach(t),ra=n(w," maintained by the "),Rt=r(w,"CODE",{});var zn=a(Rt);aa=n(zn,"diffusers"),zn.forEach(t),la=n(w,` maintainers and we try to rigorously follow our example philosophy as defined above.
If you feel like another important example should exist, we are more than happy to welcome a `),de=r(w,"A",{href:!0,rel:!0});var Jn=a(de);na=n(Jn,"Feature Request"),Jn.forEach(t),sa=n(w," or directly a "),he=r(w,"A",{href:!0,rel:!0});var Yn=a(he);ia=n(Yn,"Pull Request"),Yn.forEach(t),fa=n(w," from you!"),w.forEach(t),Lo=d(s),be=r(s,"P",{});var Kn=a(be);da=n(Kn,"Training examples show how to pretrain or fine-tune diffusion models for a variety of tasks. Currently we support:"),Kn.forEach(t),Mo=d(s),u=r(s,"UL",{});var _=a(u);$t=r(_,"LI",{});var Qn=a($t);we=r(Qn,"A",{href:!0});var Vn=a(we);ha=n(Vn,"Unconditional Training"),Vn.forEach(t),Qn.forEach(t),ca=d(_),Nt=r(_,"LI",{});var Xn=a(Nt);Te=r(Xn,"A",{href:!0});var Zn=a(Te);ua=n(Zn,"Text-to-Image Training"),Zn.forEach(t),Xn.forEach(t),ma=d(_),St=r(_,"LI",{});var es=a(St);ke=r(es,"A",{href:!0});var ts=a(ke);pa=n(ts,"Text Inversion"),ts.forEach(t),es.forEach(t),ga=d(_),Ct=r(_,"LI",{});var os=a(Ct);De=r(os,"A",{href:!0});var rs=a(De);va=n(rs,"Dreambooth"),rs.forEach(t),os.forEach(t),_a=d(_),Gt=r(_,"LI",{});var as=a(Gt);Ae=r(as,"A",{href:!0});var ls=a(Ae);Ea=n(ls,"LoRA Support"),ls.forEach(t),as.forEach(t),ya=d(_),Pt=r(_,"LI",{});var ns=a(Pt);Ie=r(ns,"A",{href:!0});var ss=a(Ie);xa=n(ss,"ControlNet"),ss.forEach(t),ns.forEach(t),ba=d(_),qt=r(_,"LI",{});var is=a(qt);Oe=r(is,"A",{href:!0});var fs=a(Oe);wa=n(fs,"InstructPix2Pix"),fs.forEach(t),is.forEach(t),Ta=d(_),Lt=r(_,"LI",{});var ds=a(Lt);Re=r(ds,"A",{href:!0});var hs=a(Re);ka=n(hs,"Custom Diffusion"),hs.forEach(t),ds.forEach(t),_.forEach(t),Ho=d(s),F=r(s,"P",{});var Xo=a(F);Da=n(Xo,"If possible, please "),$e=r(Xo,"A",{href:!0});var cs=a($e);Aa=n(cs,"install xFormers"),cs.forEach(t),Ia=n(Xo," for memory efficient attention. This could help make your training faster and less memory intensive."),Xo.forEach(t),Wo=d(s),j=r(s,"TABLE",{});var Zo=a(j);Mt=r(Zo,"THEAD",{});var us=a(Mt);D=r(us,"TR",{});var V=a(D);Ht=r(V,"TH",{});var ms=a(Ht);Oa=n(ms,"Task"),ms.forEach(t),Ra=d(V),Wt=r(V,"TH",{});var ps=a(Wt);$a=n(ps,"\u{1F917} Accelerate"),ps.forEach(t),Na=d(V),Ne=r(V,"TH",{align:!0});var gs=a(Ne);Sa=n(gs,"\u{1F917} Datasets"),gs.forEach(t),Ca=d(V),Se=r(V,"TH",{align:!0});var vs=a(Se);Ga=n(vs,"Colab"),vs.forEach(t),V.forEach(t),us.forEach(t),Pa=d(Zo),p=r(Zo,"TBODY",{});var E=a(p);A=r(E,"TR",{});var X=a(A);Ut=r(X,"TD",{});var _s=a(Ut);Ce=r(_s,"A",{href:!0});var Es=a(Ce);Bt=r(Es,"STRONG",{});var ys=a(Bt);qa=n(ys,"Unconditional Image Generation"),ys.forEach(t),Es.forEach(t),_s.forEach(t),La=d(X),Ft=r(X,"TD",{});var xs=a(Ft);Ma=n(xs,"\u2705"),xs.forEach(t),Ha=d(X),Ge=r(X,"TD",{align:!0});var bs=a(Ge);Wa=n(bs,"\u2705"),bs.forEach(t),Ua=d(X),Pe=r(X,"TD",{align:!0});var ws=a(Pe);ce=r(ws,"A",{href:!0,rel:!0});var Ts=a(ce);qe=r(Ts,"IMG",{src:!0,alt:!0}),Ts.forEach(t),ws.forEach(t),X.forEach(t),Ba=d(E),I=r(E,"TR",{});var Z=a(I);jt=r(Z,"TD",{});var ks=a(jt);Le=r(ks,"A",{href:!0});var Ds=a(Le);zt=r(Ds,"STRONG",{});var As=a(zt);Fa=n(As,"Text-to-Image fine-tuning"),As.forEach(t),Ds.forEach(t),ks.forEach(t),ja=d(Z),Jt=r(Z,"TD",{});var Is=a(Jt);za=n(Is,"\u2705"),Is.forEach(t),Ja=d(Z),Me=r(Z,"TD",{align:!0});var Os=a(Me);Ya=n(Os,"\u2705"),Os.forEach(t),Ka=d(Z),Yt=r(Z,"TD",{align:!0}),a(Yt).forEach(t),Z.forEach(t),Qa=d(E),O=r(E,"TR",{});var ee=a(O);Kt=r(ee,"TD",{});var Rs=a(Kt);He=r(Rs,"A",{href:!0});var $s=a(He);Qt=r($s,"STRONG",{});var Ns=a(Qt);Va=n(Ns,"Textual Inversion"),Ns.forEach(t),$s.forEach(t),Rs.forEach(t),Xa=d(ee),Vt=r(ee,"TD",{});var Ss=a(Vt);Za=n(Ss,"\u2705"),Ss.forEach(t),el=d(ee),We=r(ee,"TD",{align:!0});var Cs=a(We);tl=n(Cs,"-"),Cs.forEach(t),ol=d(ee),Ue=r(ee,"TD",{align:!0});var Gs=a(Ue);ue=r(Gs,"A",{href:!0,rel:!0});var Ps=a(ue);Be=r(Ps,"IMG",{src:!0,alt:!0}),Ps.forEach(t),Gs.forEach(t),ee.forEach(t),rl=d(E),R=r(E,"TR",{});var te=a(R);Xt=r(te,"TD",{});var qs=a(Xt);Fe=r(qs,"A",{href:!0});var Ls=a(Fe);Zt=r(Ls,"STRONG",{});var Ms=a(Zt);al=n(Ms,"Dreambooth"),Ms.forEach(t),Ls.forEach(t),qs.forEach(t),ll=d(te),eo=r(te,"TD",{});var Hs=a(eo);nl=n(Hs,"\u2705"),Hs.forEach(t),sl=d(te),je=r(te,"TD",{align:!0});var Ws=a(je);il=n(Ws,"-"),Ws.forEach(t),fl=d(te),ze=r(te,"TD",{align:!0});var Us=a(ze);me=r(Us,"A",{href:!0,rel:!0});var Bs=a(me);Je=r(Bs,"IMG",{src:!0,alt:!0}),Bs.forEach(t),Us.forEach(t),te.forEach(t),dl=d(E),$=r(E,"TR",{});var oe=a($);to=r(oe,"TD",{});var Fs=a(to);Ye=r(Fs,"A",{href:!0});var js=a(Ye);oo=r(js,"STRONG",{});var zs=a(oo);hl=n(zs,"Training with LoRA"),zs.forEach(t),js.forEach(t),Fs.forEach(t),cl=d(oe),ro=r(oe,"TD",{});var Js=a(ro);ul=n(Js,"\u2705"),Js.forEach(t),ml=d(oe),Ke=r(oe,"TD",{align:!0});var Ys=a(Ke);pl=n(Ys,"-"),Ys.forEach(t),gl=d(oe),Qe=r(oe,"TD",{align:!0});var Ks=a(Qe);vl=n(Ks,"-"),Ks.forEach(t),oe.forEach(t),_l=d(E),N=r(E,"TR",{});var re=a(N);ao=r(re,"TD",{});var Qs=a(ao);Ve=r(Qs,"A",{href:!0});var Vs=a(Ve);lo=r(Vs,"STRONG",{});var Xs=a(lo);El=n(Xs,"ControlNet"),Xs.forEach(t),Vs.forEach(t),Qs.forEach(t),yl=d(re),no=r(re,"TD",{});var Zs=a(no);xl=n(Zs,"\u2705"),Zs.forEach(t),bl=d(re),Xe=r(re,"TD",{align:!0});var ei=a(Xe);wl=n(ei,"\u2705"),ei.forEach(t),Tl=d(re),Ze=r(re,"TD",{align:!0});var ti=a(Ze);kl=n(ti,"-"),ti.forEach(t),re.forEach(t),Dl=d(E),S=r(E,"TR",{});var ae=a(S);so=r(ae,"TD",{});var oi=a(so);et=r(oi,"A",{href:!0});var ri=a(et);io=r(ri,"STRONG",{});var ai=a(io);Al=n(ai,"InstructPix2Pix"),ai.forEach(t),ri.forEach(t),oi.forEach(t),Il=d(ae),fo=r(ae,"TD",{});var li=a(fo);Ol=n(li,"\u2705"),li.forEach(t),Rl=d(ae),tt=r(ae,"TD",{align:!0});var ni=a(tt);$l=n(ni,"\u2705"),ni.forEach(t),Nl=d(ae),ot=r(ae,"TD",{align:!0});var si=a(ot);Sl=n(si,"-"),si.forEach(t),ae.forEach(t),Cl=d(E),C=r(E,"TR",{});var le=a(C);ho=r(le,"TD",{});var ii=a(ho);rt=r(ii,"A",{href:!0});var fi=a(rt);co=r(fi,"STRONG",{});var di=a(co);Gl=n(di,"Custom Diffusion"),di.forEach(t),fi.forEach(t),ii.forEach(t),Pl=d(le),uo=r(le,"TD",{});var hi=a(uo);ql=n(hi,"\u2705"),hi.forEach(t),Ll=d(le),at=r(le,"TD",{align:!0});var ci=a(at);Ml=n(ci,"\u2705"),ci.forEach(t),Hl=d(le),lt=r(le,"TD",{align:!0});var ui=a(lt);Wl=n(ui,"-"),ui.forEach(t),le.forEach(t),E.forEach(t),Zo.forEach(t),Uo=d(s),L=r(s,"H2",{class:!0});var er=a(L);z=r(er,"A",{id:!0,class:!0,href:!0});var mi=a(z);mo=r(mi,"SPAN",{});var pi=a(mo);Ao(pe.$$.fragment,pi),pi.forEach(t),mi.forEach(t),Ul=d(er),po=r(er,"SPAN",{});var gi=a(po);Bl=n(gi,"Community"),gi.forEach(t),er.forEach(t),Bo=d(s),m=r(s,"P",{});var y=a(m);Fl=n(y,"In addition, we provide "),go=r(y,"STRONG",{});var vi=a(go);jl=n(vi,"community"),vi.forEach(t),zl=n(y,` examples, which are examples added and maintained by our community.
Community examples can consist of both `),vo=r(y,"EM",{});var _i=a(vo);Jl=n(_i,"training"),_i.forEach(t),Yl=n(y," examples or "),_o=r(y,"EM",{});var Ei=a(_o);Kl=n(Ei,"inference"),Ei.forEach(t),Ql=n(y,` pipelines.
For such examples, we are more lenient regarding the philosophy defined above and also cannot guarantee to provide maintenance for every issue.
Examples that are useful for the community, but are either not yet deemed popular or not yet following our above philosophy should go into the `),ge=r(y,"A",{href:!0,rel:!0});var yi=a(ge);Vl=n(yi,"community examples"),yi.forEach(t),Xl=n(y,` folder. The community folder therefore includes training examples and inference pipelines.
`),Eo=r(y,"STRONG",{});var xi=a(Eo);Zl=n(xi,"Note"),xi.forEach(t),en=n(y,": Community examples can be a "),ve=r(y,"A",{href:!0,rel:!0});var bi=a(ve);tn=n(bi,"great first contribution"),bi.forEach(t),on=n(y," to show to the community how you like to use "),yo=r(y,"CODE",{});var wi=a(yo);rn=n(wi,"diffusers"),wi.forEach(t),an=n(y," \u{1FA84}."),y.forEach(t),Fo=d(s),M=r(s,"H2",{class:!0});var tr=a(M);J=r(tr,"A",{id:!0,class:!0,href:!0});var Ti=a(J);xo=r(Ti,"SPAN",{});var ki=a(xo);Ao(_e.$$.fragment,ki),ki.forEach(t),Ti.forEach(t),ln=d(tr),bo=r(tr,"SPAN",{});var Di=a(bo);nn=n(Di,"Important note"),Di.forEach(t),tr.forEach(t),jo=d(s),Y=r(s,"P",{});var or=a(Y);sn=n(or,"To make sure you can successfully run the latest versions of the example scripts, you have to "),wo=r(or,"STRONG",{});var Ai=a(wo);fn=n(Ai,"install the library from source"),Ai.forEach(t),dn=n(or," and install some example-specific requirements. To do this, execute the following steps in a new virtual environment:"),or.forEach(t),zo=d(s),Ao(Ee.$$.fragment,s),Jo=d(s),nt=r(s,"P",{});var Ii=a(nt);hn=n(Ii,"Then cd in the example folder of your choice and run"),Ii.forEach(t),Yo=d(s),Ao(ye.$$.fragment,s),this.h()},h(){i(P,"name","hf:doc:metadata"),i(P,"content",JSON.stringify(qi)),i(H,"id","diffusers-training-examples"),i(H,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(H,"href","#diffusers-training-examples"),i(q,"class","relative group"),i(se,"href","https://github.com/huggingface/diffusers/tree/main/src/diffusers/pipelines"),i(se,"rel","nofollow"),i(ie,"href","https://github.com/huggingface/diffusers/blob/main/examples/unconditional_image_generation/train_unconditional.py"),i(ie,"rel","nofollow"),i(fe,"href","https://github.com/huggingface/diffusers/blob/main/examples/unconditional_image_generation/requirements.txt"),i(fe,"rel","nofollow"),i(de,"href","https://github.com/huggingface/diffusers/issues/new?assignees=&labels=&template=feature_request.md&title="),i(de,"rel","nofollow"),i(he,"href","https://github.com/huggingface/diffusers/compare"),i(he,"rel","nofollow"),i(we,"href","./unconditional_training"),i(Te,"href","./text2image"),i(ke,"href","./text_inversion"),i(De,"href","./dreambooth"),i(Ae,"href","./lora"),i(Ie,"href","./controlnet"),i(Oe,"href","./instructpix2pix"),i(Re,"href","./custom_diffusion"),i($e,"href","../optimization/xformers"),i(Ne,"align","center"),i(Se,"align","center"),i(Ce,"href","./unconditional_training"),i(Ge,"align","center"),un(qe.src,gn="https://colab.research.google.com/assets/colab-badge.svg")||i(qe,"src",gn),i(qe,"alt","Open In Colab"),i(ce,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/training_example.ipynb"),i(ce,"rel","nofollow"),i(Pe,"align","center"),i(Le,"href","./text2image"),i(Me,"align","center"),i(Yt,"align","center"),i(He,"href","./text_inversion"),i(We,"align","center"),un(Be.src,vn="https://colab.research.google.com/assets/colab-badge.svg")||i(Be,"src",vn),i(Be,"alt","Open In Colab"),i(ue,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/sd_textual_inversion_training.ipynb"),i(ue,"rel","nofollow"),i(Ue,"align","center"),i(Fe,"href","./dreambooth"),i(je,"align","center"),un(Je.src,_n="https://colab.research.google.com/assets/colab-badge.svg")||i(Je,"src",_n),i(Je,"alt","Open In Colab"),i(me,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/sd_dreambooth_training.ipynb"),i(me,"rel","nofollow"),i(ze,"align","center"),i(Ye,"href","./lora"),i(Ke,"align","center"),i(Qe,"align","center"),i(Ve,"href","./controlnet"),i(Xe,"align","center"),i(Ze,"align","center"),i(et,"href","./instructpix2pix"),i(tt,"align","center"),i(ot,"align","center"),i(rt,"href","./custom_diffusion"),i(at,"align","center"),i(lt,"align","center"),i(z,"id","community"),i(z,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(z,"href","#community"),i(L,"class","relative group"),i(ge,"href","https://github.com/huggingface/diffusers/tree/main/examples/community"),i(ge,"rel","nofollow"),i(ve,"href","https://github.com/huggingface/diffusers/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22"),i(ve,"rel","nofollow"),i(J,"id","important-note"),i(J,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(J,"href","#important-note"),i(M,"class","relative group")},m(s,h){e(document.head,P),c(s,No,h),c(s,q,h),e(q,H),e(H,st),Io(ne,st,null),e(q,rr),e(q,it),e(it,ar),c(s,So,h),c(s,W,h),e(W,lr),e(W,ft),e(ft,nr),e(W,sr),c(s,Co,h),c(s,T,h),e(T,dt),e(dt,ir),e(T,fr),e(T,ht),e(ht,dr),e(T,hr),e(T,ct),e(ct,cr),e(T,ur),e(T,se),e(se,mr),c(s,Go,h),c(s,b,h),e(b,pr),e(b,ut),e(ut,gr),e(b,vr),e(b,mt),e(mt,_r),e(b,Er),e(b,pt),e(pt,yr),e(b,xr),e(b,gt),e(gt,br),e(b,wr),c(s,Po,h),c(s,k,h),e(k,g),e(g,vt),e(vt,Tr),e(g,kr),e(g,_t),e(_t,Dr),e(g,Ar),e(g,Et),e(Et,Ir),e(g,Or),e(g,yt),e(yt,Rr),e(g,$r),e(g,ie),e(ie,Nr),e(g,Sr),e(g,xt),e(xt,Cr),e(g,Gr),e(g,fe),e(fe,Pr),e(g,qr),e(k,Lr),e(k,xe),e(xe,bt),e(bt,Mr),e(xe,Hr),e(k,Wr),e(k,U),e(U,wt),e(wt,Ur),e(U,Br),e(U,Tt),e(Tt,Fr),e(U,jr),e(k,zr),e(k,B),e(B,kt),e(kt,Jr),e(B,Yr),e(B,Dt),e(Dt,Kr),e(B,Qr),c(s,qo,h),c(s,v,h),e(v,Vr),e(v,At),e(At,Xr),e(v,Zr),e(v,It),e(It,ea),e(v,ta),e(v,Ot),e(Ot,oa),e(v,ra),e(v,Rt),e(Rt,aa),e(v,la),e(v,de),e(de,na),e(v,sa),e(v,he),e(he,ia),e(v,fa),c(s,Lo,h),c(s,be,h),e(be,da),c(s,Mo,h),c(s,u,h),e(u,$t),e($t,we),e(we,ha),e(u,ca),e(u,Nt),e(Nt,Te),e(Te,ua),e(u,ma),e(u,St),e(St,ke),e(ke,pa),e(u,ga),e(u,Ct),e(Ct,De),e(De,va),e(u,_a),e(u,Gt),e(Gt,Ae),e(Ae,Ea),e(u,ya),e(u,Pt),e(Pt,Ie),e(Ie,xa),e(u,ba),e(u,qt),e(qt,Oe),e(Oe,wa),e(u,Ta),e(u,Lt),e(Lt,Re),e(Re,ka),c(s,Ho,h),c(s,F,h),e(F,Da),e(F,$e),e($e,Aa),e(F,Ia),c(s,Wo,h),c(s,j,h),e(j,Mt),e(Mt,D),e(D,Ht),e(Ht,Oa),e(D,Ra),e(D,Wt),e(Wt,$a),e(D,Na),e(D,Ne),e(Ne,Sa),e(D,Ca),e(D,Se),e(Se,Ga),e(j,Pa),e(j,p),e(p,A),e(A,Ut),e(Ut,Ce),e(Ce,Bt),e(Bt,qa),e(A,La),e(A,Ft),e(Ft,Ma),e(A,Ha),e(A,Ge),e(Ge,Wa),e(A,Ua),e(A,Pe),e(Pe,ce),e(ce,qe),e(p,Ba),e(p,I),e(I,jt),e(jt,Le),e(Le,zt),e(zt,Fa),e(I,ja),e(I,Jt),e(Jt,za),e(I,Ja),e(I,Me),e(Me,Ya),e(I,Ka),e(I,Yt),e(p,Qa),e(p,O),e(O,Kt),e(Kt,He),e(He,Qt),e(Qt,Va),e(O,Xa),e(O,Vt),e(Vt,Za),e(O,el),e(O,We),e(We,tl),e(O,ol),e(O,Ue),e(Ue,ue),e(ue,Be),e(p,rl),e(p,R),e(R,Xt),e(Xt,Fe),e(Fe,Zt),e(Zt,al),e(R,ll),e(R,eo),e(eo,nl),e(R,sl),e(R,je),e(je,il),e(R,fl),e(R,ze),e(ze,me),e(me,Je),e(p,dl),e(p,$),e($,to),e(to,Ye),e(Ye,oo),e(oo,hl),e($,cl),e($,ro),e(ro,ul),e($,ml),e($,Ke),e(Ke,pl),e($,gl),e($,Qe),e(Qe,vl),e(p,_l),e(p,N),e(N,ao),e(ao,Ve),e(Ve,lo),e(lo,El),e(N,yl),e(N,no),e(no,xl),e(N,bl),e(N,Xe),e(Xe,wl),e(N,Tl),e(N,Ze),e(Ze,kl),e(p,Dl),e(p,S),e(S,so),e(so,et),e(et,io),e(io,Al),e(S,Il),e(S,fo),e(fo,Ol),e(S,Rl),e(S,tt),e(tt,$l),e(S,Nl),e(S,ot),e(ot,Sl),e(p,Cl),e(p,C),e(C,ho),e(ho,rt),e(rt,co),e(co,Gl),e(C,Pl),e(C,uo),e(uo,ql),e(C,Ll),e(C,at),e(at,Ml),e(C,Hl),e(C,lt),e(lt,Wl),c(s,Uo,h),c(s,L,h),e(L,z),e(z,mo),Io(pe,mo,null),e(L,Ul),e(L,po),e(po,Bl),c(s,Bo,h),c(s,m,h),e(m,Fl),e(m,go),e(go,jl),e(m,zl),e(m,vo),e(vo,Jl),e(m,Yl),e(m,_o),e(_o,Kl),e(m,Ql),e(m,ge),e(ge,Vl),e(m,Xl),e(m,Eo),e(Eo,Zl),e(m,en),e(m,ve),e(ve,tn),e(m,on),e(m,yo),e(yo,rn),e(m,an),c(s,Fo,h),c(s,M,h),e(M,J),e(J,xo),Io(_e,xo,null),e(M,ln),e(M,bo),e(bo,nn),c(s,jo,h),c(s,Y,h),e(Y,sn),e(Y,wo),e(wo,fn),e(Y,dn),c(s,zo,h),Io(Ee,s,h),c(s,Jo,h),c(s,nt,h),e(nt,hn),c(s,Yo,h),Io(ye,s,h),Ko=!0},p:Ci,i(s){Ko||(Oo(ne.$$.fragment,s),Oo(pe.$$.fragment,s),Oo(_e.$$.fragment,s),Oo(Ee.$$.fragment,s),Oo(ye.$$.fragment,s),Ko=!0)},o(s){Ro(ne.$$.fragment,s),Ro(pe.$$.fragment,s),Ro(_e.$$.fragment,s),Ro(Ee.$$.fragment,s),Ro(ye.$$.fragment,s),Ko=!1},d(s){t(P),s&&t(No),s&&t(q),$o(ne),s&&t(So),s&&t(W),s&&t(Co),s&&t(T),s&&t(Go),s&&t(b),s&&t(Po),s&&t(k),s&&t(qo),s&&t(v),s&&t(Lo),s&&t(be),s&&t(Mo),s&&t(u),s&&t(Ho),s&&t(F),s&&t(Wo),s&&t(j),s&&t(Uo),s&&t(L),$o(pe),s&&t(Bo),s&&t(m),s&&t(Fo),s&&t(M),$o(_e),s&&t(jo),s&&t(Y),s&&t(zo),$o(Ee,s),s&&t(Jo),s&&t(nt),s&&t(Yo),$o(ye,s)}}}const qi={local:"diffusers-training-examples",sections:[{local:"community",title:"Community"},{local:"important-note",title:"Important note"}],title:"\u{1F9E8} Diffusers Training Examples"};function Li(pn){return Gi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ui extends Ri{constructor(P){super();$i(this,P,Li,Pi,Ni,{})}}export{Ui as default,qi as metadata};
