import{S as Oi,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 Io,h as n,b as i,N as un,G as e,g as c,y as Ao,L as Ci,q as Ro,o as Oo,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 Ri}from"../../chunks/CodeBlock-hf-doc-builder.js";function Pi(pn){let P,No,q,U,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,x,pr,ut,gr,vr,mt,_r,Er,pt,yr,br,gt,xr,wr,Po,k,g,vt,Tr,kr,_t,Dr,Ir,Et,Ar,Rr,yt,Or,$r,ie,Nr,Sr,bt,Cr,Gr,fe,Pr,qr,Lr,be,xt,Mr,Ur,Wr,Z,wt,Zr,Br,Tt,Fr,Hr,Jr,B,kt,jr,zr,Dt,Vr,Yr,qo,v,Qr,It,Xr,Kr,At,ea,ta,Rt,oa,ra,Ot,aa,la,de,na,sa,he,ia,fa,Lo,xe,da,Mo,u,$t,we,ha,ca,Nt,Te,ua,ma,St,ke,pa,ga,Ct,De,va,_a,Gt,Ie,Ea,ya,Pt,Ae,ba,xa,qt,Re,wa,Ta,Lt,Oe,ka,Uo,F,Da,$e,Ia,Aa,Wo,H,Mt,D,Ut,Ra,Oa,Wt,$a,Na,Ne,Sa,Ca,Se,Ga,Pa,p,I,Zt,Ce,Bt,qa,La,Ft,Ma,Ua,Ge,Wa,Za,Pe,ce,qe,gn,Ba,A,Ht,Le,Jt,Fa,Ha,jt,Ja,ja,Me,za,Va,zt,Ya,R,Vt,Ue,Yt,Qa,Xa,Qt,Ka,el,We,tl,ol,Ze,ue,Be,vn,rl,O,Xt,Fe,Kt,al,ll,eo,nl,sl,He,il,fl,Je,me,je,_n,dl,$,to,ze,oo,hl,cl,ro,ul,ml,Ve,pl,gl,Ye,vl,_l,N,ao,Qe,lo,El,yl,no,bl,xl,Xe,wl,Tl,Ke,kl,Dl,S,so,et,io,Il,Al,fo,Rl,Ol,tt,$l,Nl,ot,Sl,Cl,C,ho,rt,co,Gl,Pl,uo,ql,Ll,at,Ml,Ul,lt,Wl,Zo,L,J,mo,pe,Zl,po,Bl,Bo,m,Fl,go,Hl,Jl,vo,jl,zl,_o,Vl,Yl,ge,Ql,Xl,Eo,Kl,en,ve,tn,on,yo,rn,an,Fo,M,j,bo,_e,ln,xo,nn,Ho,z,sn,wo,fn,dn,Jo,Ee,jo,nt,hn,zo,ye,Vo;return ne=new mn({}),pe=new mn({}),_e=new mn({}),Ee=new Ri({props:{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZodWdnaW5nZmFjZSUyRmRpZmZ1c2VycyUwQWNkJTIwZGlmZnVzZXJzJTBBcGlwJTIwaW5zdGFsbCUyMC4=",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 Ri({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1yJTIwcmVxdWlyZW1lbnRzLnR4dA==",highlighted:"pip install -r requirements.txt"}}),{c(){P=o("meta"),No=f(),q=o("h1"),U=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(),x=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"),br=l(" and for "),gt=o("strong"),xr=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"),Ir=l(" file. Example scripts shall "),Et=o("strong"),Ar=l("not"),Rr=l(" depend on any local files. This means that one can simply download an example script, "),yt=o("em"),Or=l("e.g."),$r=f(),ie=o("a"),Nr=l("train_unconditional.py"),Sr=l(", install the required dependencies, "),bt=o("em"),Cr=l("e.g."),Gr=f(),fe=o("a"),Pr=l("requirements.txt"),qr=l(" and execute the example script."),Lr=f(),be=o("li"),xt=o("strong"),Mr=l("Easy-to-tweak"),Ur=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(),Z=o("li"),wt=o("strong"),Zr=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"),Hr=l(" library. We often purposefully leave out certain state-of-the-art methods if we consider them too complex for beginners."),Jr=f(),B=o("li"),kt=o("strong"),jr=l("One-purpose-only"),zr=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"),Vr=l("e.g."),Yr=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"),Qr=l("We provide "),It=o("strong"),Xr=l("official"),Kr=l(` examples that cover the most popular tasks of diffusion models.
`),At=o("em"),ea=l("Official"),ta=l(" examples are "),Rt=o("strong"),oa=l("actively"),ra=l(" maintained by the "),Ot=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(),xe=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"),Ie=o("a"),Ea=l("LoRA Support"),ya=f(),Pt=o("li"),Ae=o("a"),ba=l("ControlNet"),xa=f(),qt=o("li"),Re=o("a"),wa=l("InstructPix2Pix"),Ta=f(),Lt=o("li"),Oe=o("a"),ka=l("Custom Diffusion"),Uo=f(),F=o("p"),Da=l("If possible, please "),$e=o("a"),Ia=l("install xFormers"),Aa=l(" for memory efficient attention. This could help make your training faster and less memory intensive."),Wo=f(),H=o("table"),Mt=o("thead"),D=o("tr"),Ut=o("th"),Ra=l("Task"),Oa=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"),I=o("tr"),Zt=o("td"),Ce=o("a"),Bt=o("strong"),qa=l("Unconditional Image Generation"),La=f(),Ft=o("td"),Ma=l("\u2705"),Ua=f(),Ge=o("td"),Wa=l("\u2705"),Za=f(),Pe=o("td"),ce=o("a"),qe=o("img"),Ba=f(),A=o("tr"),Ht=o("td"),Le=o("a"),Jt=o("strong"),Fa=l("Text-to-Image fine-tuning"),Ha=f(),jt=o("td"),Ja=l("\u2705"),ja=f(),Me=o("td"),za=l("\u2705"),Va=f(),zt=o("td"),Ya=f(),R=o("tr"),Vt=o("td"),Ue=o("a"),Yt=o("strong"),Qa=l("Textual Inversion"),Xa=f(),Qt=o("td"),Ka=l("\u2705"),el=f(),We=o("td"),tl=l("-"),ol=f(),Ze=o("td"),ue=o("a"),Be=o("img"),rl=f(),O=o("tr"),Xt=o("td"),Fe=o("a"),Kt=o("strong"),al=l("Dreambooth"),ll=f(),eo=o("td"),nl=l("\u2705"),sl=f(),He=o("td"),il=l("-"),fl=f(),Je=o("td"),me=o("a"),je=o("img"),dl=f(),$=o("tr"),to=o("td"),ze=o("a"),oo=o("strong"),hl=l("Training with LoRA"),cl=f(),ro=o("td"),ul=l("\u2705"),ml=f(),Ve=o("td"),pl=l("-"),gl=f(),Ye=o("td"),vl=l("-"),_l=f(),N=o("tr"),ao=o("td"),Qe=o("a"),lo=o("strong"),El=l("ControlNet"),yl=f(),no=o("td"),bl=l("\u2705"),xl=f(),Xe=o("td"),wl=l("\u2705"),Tl=f(),Ke=o("td"),kl=l("-"),Dl=f(),S=o("tr"),so=o("td"),et=o("a"),io=o("strong"),Il=l("InstructPix2Pix"),Al=f(),fo=o("td"),Rl=l("\u2705"),Ol=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"),Ul=f(),lt=o("td"),Wl=l("-"),Zo=f(),L=o("h2"),J=o("a"),mo=o("span"),Do(pe.$$.fragment),Zl=f(),po=o("span"),Bl=l("Community"),Bo=f(),m=o("p"),Fl=l("In addition, we provide "),go=o("strong"),Hl=l("community"),Jl=l(` examples, which are examples added and maintained by our community.
Community examples can consist of both `),vo=o("em"),jl=l("training"),zl=l(" examples or "),_o=o("em"),Vl=l("inference"),Yl=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"),Ql=l("community examples"),Xl=l(` folder. The community folder therefore includes training examples and inference pipelines.
`),Eo=o("strong"),Kl=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"),bo=o("span"),Do(_e.$$.fragment),ln=f(),xo=o("span"),nn=l("Important note"),Ho=f(),z=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:"),Jo=f(),Do(Ee.$$.fragment),jo=f(),nt=o("p"),hn=l("Then cd in the example folder of your choice and run"),zo=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 Yo=a(q);U=r(Yo,"A",{id:!0,class:!0,href:!0});var En=a(U);st=r(En,"SPAN",{});var yn=a(st);Io(ne.$$.fragment,yn),yn.forEach(t),En.forEach(t),rr=d(Yo),it=r(Yo,"SPAN",{});var bn=a(it);ar=n(bn,"\u{1F9E8} Diffusers Training Examples"),bn.forEach(t),Yo.forEach(t),So=d(s),W=r(s,"P",{});var Qo=a(W);lr=n(Qo,"Diffusers training examples are a collection of scripts to demonstrate how to effectively use the "),ft=r(Qo,"CODE",{});var xn=a(ft);nr=n(xn,"diffusers"),xn.forEach(t),sr=n(Qo,` library
for a variety of use cases.`),Qo.forEach(t),Co=d(s),T=r(s,"P",{});var V=a(T);dt=r(V,"STRONG",{});var wn=a(dt);ir=n(wn,"Note"),wn.forEach(t),fr=n(V,": If you are looking for "),ht=r(V,"STRONG",{});var Tn=a(ht);dr=n(Tn,"official"),Tn.forEach(t),hr=n(V," examples on how to use "),ct=r(V,"CODE",{});var kn=a(ct);cr=n(kn,"diffusers"),kn.forEach(t),ur=n(V,` for inference,
please have a look at `),se=r(V,"A",{href:!0,rel:!0});var Dn=a(se);mr=n(Dn,"src/diffusers/pipelines"),Dn.forEach(t),V.forEach(t),Go=d(s),x=r(s,"P",{});var G=a(x);pr=n(G,"Our examples aspire to be "),ut=r(G,"STRONG",{});var In=a(ut);gr=n(In,"self-contained"),In.forEach(t),vr=n(G,", "),mt=r(G,"STRONG",{});var An=a(mt);_r=n(An,"easy-to-tweak"),An.forEach(t),Er=n(G,", "),pt=r(G,"STRONG",{});var Rn=a(pt);yr=n(Rn,"beginner-friendly"),Rn.forEach(t),br=n(G," and for "),gt=r(G,"STRONG",{});var On=a(gt);xr=n(On,"one-purpose-only"),On.forEach(t),wr=n(G,`.
More specifically, this means:`),G.forEach(t),Po=d(s),k=r(s,"UL",{});var Y=a(k);g=r(Y,"LI",{});var b=a(g);vt=r(b,"STRONG",{});var $n=a(vt);Tr=n($n,"Self-contained"),$n.forEach(t),kr=n(b,": An example script shall only depend on \u201Cpip-install-able\u201D Python packages that can be found in a "),_t=r(b,"CODE",{});var Nn=a(_t);Dr=n(Nn,"requirements.txt"),Nn.forEach(t),Ir=n(b," file. Example scripts shall "),Et=r(b,"STRONG",{});var Sn=a(Et);Ar=n(Sn,"not"),Sn.forEach(t),Rr=n(b," depend on any local files. This means that one can simply download an example script, "),yt=r(b,"EM",{});var Cn=a(yt);Or=n(Cn,"e.g."),Cn.forEach(t),$r=d(b),ie=r(b,"A",{href:!0,rel:!0});var Gn=a(ie);Nr=n(Gn,"train_unconditional.py"),Gn.forEach(t),Sr=n(b,", install the required dependencies, "),bt=r(b,"EM",{});var Pn=a(bt);Cr=n(Pn,"e.g."),Pn.forEach(t),Gr=d(b),fe=r(b,"A",{href:!0,rel:!0});var qn=a(fe);Pr=n(qn,"requirements.txt"),qn.forEach(t),qr=n(b," and execute the example script."),b.forEach(t),Lr=d(Y),be=r(Y,"LI",{});var cn=a(be);xt=r(cn,"STRONG",{});var Ln=a(xt);Mr=n(Ln,"Easy-to-tweak"),Ln.forEach(t),Ur=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(Y),Z=r(Y,"LI",{});var To=a(Z);wt=r(To,"STRONG",{});var Mn=a(wt);Zr=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 Un=a(Tt);Fr=n(Un,"diffusers"),Un.forEach(t),Hr=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),Jr=d(Y),B=r(Y,"LI",{});var ko=a(B);kt=r(ko,"STRONG",{});var Wn=a(kt);jr=n(Wn,"One-purpose-only"),Wn.forEach(t),zr=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 Zn=a(Dt);Vr=n(Zn,"e.g."),Zn.forEach(t),Yr=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),Y.forEach(t),qo=d(s),v=r(s,"P",{});var w=a(v);Qr=n(w,"We provide "),It=r(w,"STRONG",{});var Bn=a(It);Xr=n(Bn,"official"),Bn.forEach(t),Kr=n(w,` examples that cover the most popular tasks of diffusion models.
`),At=r(w,"EM",{});var Fn=a(At);ea=n(Fn,"Official"),Fn.forEach(t),ta=n(w," examples are "),Rt=r(w,"STRONG",{});var Hn=a(Rt);oa=n(Hn,"actively"),Hn.forEach(t),ra=n(w," maintained by the "),Ot=r(w,"CODE",{});var Jn=a(Ot);aa=n(Jn,"diffusers"),Jn.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 zn=a(he);ia=n(zn,"Pull Request"),zn.forEach(t),fa=n(w," from you!"),w.forEach(t),Lo=d(s),xe=r(s,"P",{});var Vn=a(xe);da=n(Vn,"Training examples show how to pretrain or fine-tune diffusion models for a variety of tasks. Currently we support:"),Vn.forEach(t),Mo=d(s),u=r(s,"UL",{});var _=a(u);$t=r(_,"LI",{});var Yn=a($t);we=r(Yn,"A",{href:!0});var Qn=a(we);ha=n(Qn,"Unconditional Training"),Qn.forEach(t),Yn.forEach(t),ca=d(_),Nt=r(_,"LI",{});var Xn=a(Nt);Te=r(Xn,"A",{href:!0});var Kn=a(Te);ua=n(Kn,"Text-to-Image Training"),Kn.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);Ie=r(as,"A",{href:!0});var ls=a(Ie);Ea=n(ls,"LoRA Support"),ls.forEach(t),as.forEach(t),ya=d(_),Pt=r(_,"LI",{});var ns=a(Pt);Ae=r(ns,"A",{href:!0});var ss=a(Ae);ba=n(ss,"ControlNet"),ss.forEach(t),ns.forEach(t),xa=d(_),qt=r(_,"LI",{});var is=a(qt);Re=r(is,"A",{href:!0});var fs=a(Re);wa=n(fs,"InstructPix2Pix"),fs.forEach(t),is.forEach(t),Ta=d(_),Lt=r(_,"LI",{});var ds=a(Lt);Oe=r(ds,"A",{href:!0});var hs=a(Oe);ka=n(hs,"Custom Diffusion"),hs.forEach(t),ds.forEach(t),_.forEach(t),Uo=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);Ia=n(cs,"install xFormers"),cs.forEach(t),Aa=n(Xo," for memory efficient attention. This could help make your training faster and less memory intensive."),Xo.forEach(t),Wo=d(s),H=r(s,"TABLE",{});var Ko=a(H);Mt=r(Ko,"THEAD",{});var us=a(Mt);D=r(us,"TR",{});var Q=a(D);Ut=r(Q,"TH",{});var ms=a(Ut);Ra=n(ms,"Task"),ms.forEach(t),Oa=d(Q),Wt=r(Q,"TH",{});var ps=a(Wt);$a=n(ps,"\u{1F917} Accelerate"),ps.forEach(t),Na=d(Q),Ne=r(Q,"TH",{align:!0});var gs=a(Ne);Sa=n(gs,"\u{1F917} Datasets"),gs.forEach(t),Ca=d(Q),Se=r(Q,"TH",{align:!0});var vs=a(Se);Ga=n(vs,"Colab"),vs.forEach(t),Q.forEach(t),us.forEach(t),Pa=d(Ko),p=r(Ko,"TBODY",{});var E=a(p);I=r(E,"TR",{});var X=a(I);Zt=r(X,"TD",{});var _s=a(Zt);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 bs=a(Ft);Ma=n(bs,"\u2705"),bs.forEach(t),Ua=d(X),Ge=r(X,"TD",{align:!0});var xs=a(Ge);Wa=n(xs,"\u2705"),xs.forEach(t),Za=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),A=r(E,"TR",{});var K=a(A);Ht=r(K,"TD",{});var ks=a(Ht);Le=r(ks,"A",{href:!0});var Ds=a(Le);Jt=r(Ds,"STRONG",{});var Is=a(Jt);Fa=n(Is,"Text-to-Image fine-tuning"),Is.forEach(t),Ds.forEach(t),ks.forEach(t),Ha=d(K),jt=r(K,"TD",{});var As=a(jt);Ja=n(As,"\u2705"),As.forEach(t),ja=d(K),Me=r(K,"TD",{align:!0});var Rs=a(Me);za=n(Rs,"\u2705"),Rs.forEach(t),Va=d(K),zt=r(K,"TD",{align:!0}),a(zt).forEach(t),K.forEach(t),Ya=d(E),R=r(E,"TR",{});var ee=a(R);Vt=r(ee,"TD",{});var Os=a(Vt);Ue=r(Os,"A",{href:!0});var $s=a(Ue);Yt=r($s,"STRONG",{});var Ns=a(Yt);Qa=n(Ns,"Textual Inversion"),Ns.forEach(t),$s.forEach(t),Os.forEach(t),Xa=d(ee),Qt=r(ee,"TD",{});var Ss=a(Qt);Ka=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),Ze=r(ee,"TD",{align:!0});var Gs=a(Ze);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),O=r(E,"TR",{});var te=a(O);Xt=r(te,"TD",{});var qs=a(Xt);Fe=r(qs,"A",{href:!0});var Ls=a(Fe);Kt=r(Ls,"STRONG",{});var Ms=a(Kt);al=n(Ms,"Dreambooth"),Ms.forEach(t),Ls.forEach(t),qs.forEach(t),ll=d(te),eo=r(te,"TD",{});var Us=a(eo);nl=n(Us,"\u2705"),Us.forEach(t),sl=d(te),He=r(te,"TD",{align:!0});var Ws=a(He);il=n(Ws,"-"),Ws.forEach(t),fl=d(te),Je=r(te,"TD",{align:!0});var Zs=a(Je);me=r(Zs,"A",{href:!0,rel:!0});var Bs=a(me);je=r(Bs,"IMG",{src:!0,alt:!0}),Bs.forEach(t),Zs.forEach(t),te.forEach(t),dl=d(E),$=r(E,"TR",{});var oe=a($);to=r(oe,"TD",{});var Fs=a(to);ze=r(Fs,"A",{href:!0});var Hs=a(ze);oo=r(Hs,"STRONG",{});var Js=a(oo);hl=n(Js,"Training with LoRA"),Js.forEach(t),Hs.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),Ve=r(oe,"TD",{align:!0});var zs=a(Ve);pl=n(zs,"-"),zs.forEach(t),gl=d(oe),Ye=r(oe,"TD",{align:!0});var Vs=a(Ye);vl=n(Vs,"-"),Vs.forEach(t),oe.forEach(t),_l=d(E),N=r(E,"TR",{});var re=a(N);ao=r(re,"TD",{});var Ys=a(ao);Qe=r(Ys,"A",{href:!0});var Qs=a(Qe);lo=r(Qs,"STRONG",{});var Xs=a(lo);El=n(Xs,"ControlNet"),Xs.forEach(t),Qs.forEach(t),Ys.forEach(t),yl=d(re),no=r(re,"TD",{});var Ks=a(no);bl=n(Ks,"\u2705"),Ks.forEach(t),xl=d(re),Xe=r(re,"TD",{align:!0});var ei=a(Xe);wl=n(ei,"\u2705"),ei.forEach(t),Tl=d(re),Ke=r(re,"TD",{align:!0});var ti=a(Ke);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);Il=n(ai,"InstructPix2Pix"),ai.forEach(t),ri.forEach(t),oi.forEach(t),Al=d(ae),fo=r(ae,"TD",{});var li=a(fo);Rl=n(li,"\u2705"),li.forEach(t),Ol=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),Ul=d(le),lt=r(le,"TD",{align:!0});var ui=a(lt);Wl=n(ui,"-"),ui.forEach(t),le.forEach(t),E.forEach(t),Ko.forEach(t),Zo=d(s),L=r(s,"H2",{class:!0});var er=a(L);J=r(er,"A",{id:!0,class:!0,href:!0});var mi=a(J);mo=r(mi,"SPAN",{});var pi=a(mo);Io(pe.$$.fragment,pi),pi.forEach(t),mi.forEach(t),Zl=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);Hl=n(vi,"community"),vi.forEach(t),Jl=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),zl=n(y," examples or "),_o=r(y,"EM",{});var Ei=a(_o);Vl=n(Ei,"inference"),Ei.forEach(t),Yl=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);Ql=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 bi=a(Eo);Kl=n(bi,"Note"),bi.forEach(t),en=n(y,": Community examples can be a "),ve=r(y,"A",{href:!0,rel:!0});var xi=a(ve);tn=n(xi,"great first contribution"),xi.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);bo=r(Ti,"SPAN",{});var ki=a(bo);Io(_e.$$.fragment,ki),ki.forEach(t),Ti.forEach(t),ln=d(tr),xo=r(tr,"SPAN",{});var Di=a(xo);nn=n(Di,"Important note"),Di.forEach(t),tr.forEach(t),Ho=d(s),z=r(s,"P",{});var or=a(z);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 Ii=a(wo);fn=n(Ii,"install the library from source"),Ii.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),Jo=d(s),Io(Ee.$$.fragment,s),jo=d(s),nt=r(s,"P",{});var Ai=a(nt);hn=n(Ai,"Then cd in the example folder of your choice and run"),Ai.forEach(t),zo=d(s),Io(ye.$$.fragment,s),this.h()},h(){i(P,"name","hf:doc:metadata"),i(P,"content",JSON.stringify(qi)),i(U,"id","diffusers-training-examples"),i(U,"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(U,"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(Ie,"href","./lora"),i(Ae,"href","./controlnet"),i(Re,"href","./instructpix2pix"),i(Oe,"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(zt,"align","center"),i(Ue,"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(Ze,"align","center"),i(Fe,"href","./dreambooth"),i(He,"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(Je,"align","center"),i(ze,"href","./lora"),i(Ve,"align","center"),i(Ye,"align","center"),i(Qe,"href","./controlnet"),i(Xe,"align","center"),i(Ke,"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(J,"id","community"),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","#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,U),e(U,st),Ao(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,x,h),e(x,pr),e(x,ut),e(ut,gr),e(x,vr),e(x,mt),e(mt,_r),e(x,Er),e(x,pt),e(pt,yr),e(x,br),e(x,gt),e(gt,xr),e(x,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,Ir),e(g,Et),e(Et,Ar),e(g,Rr),e(g,yt),e(yt,Or),e(g,$r),e(g,ie),e(ie,Nr),e(g,Sr),e(g,bt),e(bt,Cr),e(g,Gr),e(g,fe),e(fe,Pr),e(g,qr),e(k,Lr),e(k,be),e(be,xt),e(xt,Mr),e(be,Ur),e(k,Wr),e(k,Z),e(Z,wt),e(wt,Zr),e(Z,Br),e(Z,Tt),e(Tt,Fr),e(Z,Hr),e(k,Jr),e(k,B),e(B,kt),e(kt,jr),e(B,zr),e(B,Dt),e(Dt,Vr),e(B,Yr),c(s,qo,h),c(s,v,h),e(v,Qr),e(v,It),e(It,Xr),e(v,Kr),e(v,At),e(At,ea),e(v,ta),e(v,Rt),e(Rt,oa),e(v,ra),e(v,Ot),e(Ot,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,xe,h),e(xe,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,Ie),e(Ie,Ea),e(u,ya),e(u,Pt),e(Pt,Ae),e(Ae,ba),e(u,xa),e(u,qt),e(qt,Re),e(Re,wa),e(u,Ta),e(u,Lt),e(Lt,Oe),e(Oe,ka),c(s,Uo,h),c(s,F,h),e(F,Da),e(F,$e),e($e,Ia),e(F,Aa),c(s,Wo,h),c(s,H,h),e(H,Mt),e(Mt,D),e(D,Ut),e(Ut,Ra),e(D,Oa),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(H,Pa),e(H,p),e(p,I),e(I,Zt),e(Zt,Ce),e(Ce,Bt),e(Bt,qa),e(I,La),e(I,Ft),e(Ft,Ma),e(I,Ua),e(I,Ge),e(Ge,Wa),e(I,Za),e(I,Pe),e(Pe,ce),e(ce,qe),e(p,Ba),e(p,A),e(A,Ht),e(Ht,Le),e(Le,Jt),e(Jt,Fa),e(A,Ha),e(A,jt),e(jt,Ja),e(A,ja),e(A,Me),e(Me,za),e(A,Va),e(A,zt),e(p,Ya),e(p,R),e(R,Vt),e(Vt,Ue),e(Ue,Yt),e(Yt,Qa),e(R,Xa),e(R,Qt),e(Qt,Ka),e(R,el),e(R,We),e(We,tl),e(R,ol),e(R,Ze),e(Ze,ue),e(ue,Be),e(p,rl),e(p,O),e(O,Xt),e(Xt,Fe),e(Fe,Kt),e(Kt,al),e(O,ll),e(O,eo),e(eo,nl),e(O,sl),e(O,He),e(He,il),e(O,fl),e(O,Je),e(Je,me),e(me,je),e(p,dl),e(p,$),e($,to),e(to,ze),e(ze,oo),e(oo,hl),e($,cl),e($,ro),e(ro,ul),e($,ml),e($,Ve),e(Ve,pl),e($,gl),e($,Ye),e(Ye,vl),e(p,_l),e(p,N),e(N,ao),e(ao,Qe),e(Qe,lo),e(lo,El),e(N,yl),e(N,no),e(no,bl),e(N,xl),e(N,Xe),e(Xe,wl),e(N,Tl),e(N,Ke),e(Ke,kl),e(p,Dl),e(p,S),e(S,so),e(so,et),e(et,io),e(io,Il),e(S,Al),e(S,fo),e(fo,Rl),e(S,Ol),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,Ul),e(C,lt),e(lt,Wl),c(s,Zo,h),c(s,L,h),e(L,J),e(J,mo),Ao(pe,mo,null),e(L,Zl),e(L,po),e(po,Bl),c(s,Bo,h),c(s,m,h),e(m,Fl),e(m,go),e(go,Hl),e(m,Jl),e(m,vo),e(vo,jl),e(m,zl),e(m,_o),e(_o,Vl),e(m,Yl),e(m,ge),e(ge,Ql),e(m,Xl),e(m,Eo),e(Eo,Kl),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,bo),Ao(_e,bo,null),e(M,ln),e(M,xo),e(xo,nn),c(s,Ho,h),c(s,z,h),e(z,sn),e(z,wo),e(wo,fn),e(z,dn),c(s,Jo,h),Ao(Ee,s,h),c(s,jo,h),c(s,nt,h),e(nt,hn),c(s,zo,h),Ao(ye,s,h),Vo=!0},p:Ci,i(s){Vo||(Ro(ne.$$.fragment,s),Ro(pe.$$.fragment,s),Ro(_e.$$.fragment,s),Ro(Ee.$$.fragment,s),Ro(ye.$$.fragment,s),Vo=!0)},o(s){Oo(ne.$$.fragment,s),Oo(pe.$$.fragment,s),Oo(_e.$$.fragment,s),Oo(Ee.$$.fragment,s),Oo(ye.$$.fragment,s),Vo=!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(x),s&&t(Po),s&&t(k),s&&t(qo),s&&t(v),s&&t(Lo),s&&t(xe),s&&t(Mo),s&&t(u),s&&t(Uo),s&&t(F),s&&t(Wo),s&&t(H),s&&t(Zo),s&&t(L),$o(pe),s&&t(Bo),s&&t(m),s&&t(Fo),s&&t(M),$o(_e),s&&t(Ho),s&&t(z),s&&t(Jo),$o(Ee,s),s&&t(jo),s&&t(nt),s&&t(zo),$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 Zi extends Oi{constructor(P){super();$i(this,P,Li,Pi,Ni,{})}}export{Zi as default,qi as metadata};
