import{S as Ol,i as jl,s as Yl,e as o,k as p,w as $,t as n,M as Hl,c as s,d as t,m as u,a,x as b,h as r,b as h,G as l,g as f,y as _,q as E,o as g,B as k,v as Ll}from"../chunks/vendor-hf-doc-builder.js";import{T as Fl}from"../chunks/Tip-hf-doc-builder.js";import{I as at}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as ue}from"../chunks/CodeBlock-hf-doc-builder.js";function Ul(Ae){let m,N,d,w,A;return{c(){m=o("p"),N=n("You must keep the "),d=o("code"),w=n("diffusers"),A=n(" folder if you want to keep using the library.")},l(y){m=s(y,"P",{});var P=a(m);N=r(P,"You must keep the "),d=s(P,"CODE",{});var T=a(d);w=r(T,"diffusers"),T.forEach(t),A=r(P," folder if you want to keep using the library."),P.forEach(t)},m(y,P){f(y,m,P),l(m,N),l(m,d),l(d,w),l(m,A)},d(y){y&&t(m)}}}function ql(Ae){let m,N,d,w,A,y,P,T,nt,xe,ee,rt,Ce,te,ft,Se,x,O,he,U,pt,me,ut,Ne,D,ht,q,mt,ct,M,dt,vt,Te,le,yt,Oe,B,je,ie,wt,Ye,W,He,oe,$t,Le,G,Fe,C,j,ce,J,bt,de,_t,Ue,se,Et,qe,R,Me,c,gt,ve,kt,Pt,ye,Dt,It,we,At,xt,$e,Ct,St,be,Nt,Tt,z,Ot,jt,Be,S,Y,_e,K,Yt,Ee,Ht,We,ae,Lt,Ge,H,Q,Ft,ge,Ut,qt,Mt,ke,Bt,Je,ne,Wt,Re,V,ze,I,Gt,Pe,Jt,Rt,De,zt,Kt,Ke,L,Qe,re,Qt,Ve,X,Xe,F,Vt,Ie,Xt,Zt,Ze;return y=new at({}),U=new at({}),B=new ue({props:{code:"python -m venv .env",highlighted:'python -m venv .<span class="hljs-built_in">env</span>'}}),W=new ue({props:{code:"source .env/bin/activate",highlighted:'<span class="hljs-built_in">source</span> .<span class="hljs-built_in">env</span>/bin/activate'}}),G=new ue({props:{code:"pip install diffusers",highlighted:"pip install diffusers"}}),J=new at({}),R=new ue({props:{code:"pip install git+https://github.com/huggingface/diffusers",highlighted:"pip install git+https://github.com/huggingface/diffusers"}}),K=new at({}),V=new ue({props:{code:`git clone https://github.com/huggingface/diffusers.git
cd diffusers
pip install -e .`,highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/huggingface/diffusers.git
<span class="hljs-built_in">cd</span> diffusers
pip install -e .`}}),L=new Fl({props:{warning:!0,$$slots:{default:[Ul]},$$scope:{ctx:Ae}}}),X=new ue({props:{code:`cd ~/diffusers/
git pull`,highlighted:`<span class="hljs-built_in">cd</span> ~/diffusers/
git pull`}}),{c(){m=o("meta"),N=p(),d=o("h1"),w=o("a"),A=o("span"),$(y.$$.fragment),P=p(),T=o("span"),nt=n("Installation"),xe=p(),ee=o("p"),rt=n("Install Diffusers for with PyTorch. Support for other libraries will come in the future"),Ce=p(),te=o("p"),ft=n("\u{1F917} Diffusers is tested on Python 3.7+, and PyTorch 1.7.0+."),Se=p(),x=o("h2"),O=o("a"),he=o("span"),$(U.$$.fragment),pt=p(),me=o("span"),ut=n("Install with pip"),Ne=p(),D=o("p"),ht=n("You should install \u{1F917} Diffusers in a "),q=o("a"),mt=n("virtual environment"),ct=n(`.
If you\u2019re unfamiliar with Python virtual environments, take a look at this `),M=o("a"),dt=n("guide"),vt=n(`.
A virtual environment makes it easier to manage different projects, and avoid compatibility issues between dependencies.`),Te=p(),le=o("p"),yt=n("Start by creating a virtual environment in your project directory:"),Oe=p(),$(B.$$.fragment),je=p(),ie=o("p"),wt=n("Activate the virtual environment:"),Ye=p(),$(W.$$.fragment),He=p(),oe=o("p"),$t=n("Now you\u2019re ready to install \u{1F917} Diffusers with the following command:"),Le=p(),$(G.$$.fragment),Fe=p(),C=o("h2"),j=o("a"),ce=o("span"),$(J.$$.fragment),bt=p(),de=o("span"),_t=n("Install from source"),Ue=p(),se=o("p"),Et=n("Install \u{1F917} Diffusers from source with the following command:"),qe=p(),$(R.$$.fragment),Me=p(),c=o("p"),gt=n("This command installs the bleeding edge "),ve=o("code"),kt=n("main"),Pt=n(" version rather than the latest "),ye=o("code"),Dt=n("stable"),It=n(` version.
The `),we=o("code"),At=n("main"),xt=n(` version is useful for staying up-to-date with the latest developments.
For instance, if a bug has been fixed since the last official release but a new release hasn\u2019t been rolled out yet.
However, this means the `),$e=o("code"),Ct=n("main"),St=n(` version may not always be stable.
We strive to keep the `),be=o("code"),Nt=n("main"),Tt=n(` version operational, and most issues are usually resolved within a few hours or a day.
If you run into a problem, please open an `),z=o("a"),Ot=n("Issue"),jt=n(" so we can fix it even sooner!"),Be=p(),S=o("h2"),Y=o("a"),_e=o("span"),$(K.$$.fragment),Yt=p(),Ee=o("span"),Ht=n("Editable install"),We=p(),ae=o("p"),Lt=n("You will need an editable install if you\u2019d like to:"),Ge=p(),H=o("ul"),Q=o("li"),Ft=n("Use the "),ge=o("code"),Ut=n("main"),qt=n(" version of the source code."),Mt=p(),ke=o("li"),Bt=n("Contribute to \u{1F917} Diffusers and need to test changes in the code."),Je=p(),ne=o("p"),Wt=n("Clone the repository and install \u{1F917} Diffusers with the following commands:"),Re=p(),$(V.$$.fragment),ze=p(),I=o("p"),Gt=n(`These commands will link the folder you cloned the repository to and your Python library paths.
Python will now look inside the folder you cloned to in addition to the normal library paths.
For example, if your Python packages are typically installed in `),Pe=o("code"),Jt=n("~/anaconda3/envs/main/lib/python3.7/site-packages/"),Rt=n(", Python will also search the folder you cloned to: "),De=o("code"),zt=n("~/diffusers/"),Kt=n("."),Ke=p(),$(L.$$.fragment),Qe=p(),re=o("p"),Qt=n("Now you can easily update your clone to the latest version of \u{1F917} Diffusers with the following command:"),Ve=p(),$(X.$$.fragment),Xe=p(),F=o("p"),Vt=n("Your Python environment will find the "),Ie=o("code"),Xt=n("main"),Zt=n(" version of \u{1F917} Diffusers on the next run."),this.h()},l(e){const i=Hl('[data-svelte="svelte-1phssyn"]',document.head);m=s(i,"META",{name:!0,content:!0}),i.forEach(t),N=u(e),d=s(e,"H1",{class:!0});var Z=a(d);w=s(Z,"A",{id:!0,class:!0,href:!0});var el=a(w);A=s(el,"SPAN",{});var tl=a(A);b(y.$$.fragment,tl),tl.forEach(t),el.forEach(t),P=u(Z),T=s(Z,"SPAN",{});var ll=a(T);nt=r(ll,"Installation"),ll.forEach(t),Z.forEach(t),xe=u(e),ee=s(e,"P",{});var il=a(ee);rt=r(il,"Install Diffusers for with PyTorch. Support for other libraries will come in the future"),il.forEach(t),Ce=u(e),te=s(e,"P",{});var ol=a(te);ft=r(ol,"\u{1F917} Diffusers is tested on Python 3.7+, and PyTorch 1.7.0+."),ol.forEach(t),Se=u(e),x=s(e,"H2",{class:!0});var et=a(x);O=s(et,"A",{id:!0,class:!0,href:!0});var sl=a(O);he=s(sl,"SPAN",{});var al=a(he);b(U.$$.fragment,al),al.forEach(t),sl.forEach(t),pt=u(et),me=s(et,"SPAN",{});var nl=a(me);ut=r(nl,"Install with pip"),nl.forEach(t),et.forEach(t),Ne=u(e),D=s(e,"P",{});var fe=a(D);ht=r(fe,"You should install \u{1F917} Diffusers in a "),q=s(fe,"A",{href:!0,rel:!0});var rl=a(q);mt=r(rl,"virtual environment"),rl.forEach(t),ct=r(fe,`.
If you\u2019re unfamiliar with Python virtual environments, take a look at this `),M=s(fe,"A",{href:!0,rel:!0});var fl=a(M);dt=r(fl,"guide"),fl.forEach(t),vt=r(fe,`.
A virtual environment makes it easier to manage different projects, and avoid compatibility issues between dependencies.`),fe.forEach(t),Te=u(e),le=s(e,"P",{});var pl=a(le);yt=r(pl,"Start by creating a virtual environment in your project directory:"),pl.forEach(t),Oe=u(e),b(B.$$.fragment,e),je=u(e),ie=s(e,"P",{});var ul=a(ie);wt=r(ul,"Activate the virtual environment:"),ul.forEach(t),Ye=u(e),b(W.$$.fragment,e),He=u(e),oe=s(e,"P",{});var hl=a(oe);$t=r(hl,"Now you\u2019re ready to install \u{1F917} Diffusers with the following command:"),hl.forEach(t),Le=u(e),b(G.$$.fragment,e),Fe=u(e),C=s(e,"H2",{class:!0});var tt=a(C);j=s(tt,"A",{id:!0,class:!0,href:!0});var ml=a(j);ce=s(ml,"SPAN",{});var cl=a(ce);b(J.$$.fragment,cl),cl.forEach(t),ml.forEach(t),bt=u(tt),de=s(tt,"SPAN",{});var dl=a(de);_t=r(dl,"Install from source"),dl.forEach(t),tt.forEach(t),Ue=u(e),se=s(e,"P",{});var vl=a(se);Et=r(vl,"Install \u{1F917} Diffusers from source with the following command:"),vl.forEach(t),qe=u(e),b(R.$$.fragment,e),Me=u(e),c=s(e,"P",{});var v=a(c);gt=r(v,"This command installs the bleeding edge "),ve=s(v,"CODE",{});var yl=a(ve);kt=r(yl,"main"),yl.forEach(t),Pt=r(v," version rather than the latest "),ye=s(v,"CODE",{});var wl=a(ye);Dt=r(wl,"stable"),wl.forEach(t),It=r(v,` version.
The `),we=s(v,"CODE",{});var $l=a(we);At=r($l,"main"),$l.forEach(t),xt=r(v,` version is useful for staying up-to-date with the latest developments.
For instance, if a bug has been fixed since the last official release but a new release hasn\u2019t been rolled out yet.
However, this means the `),$e=s(v,"CODE",{});var bl=a($e);Ct=r(bl,"main"),bl.forEach(t),St=r(v,` version may not always be stable.
We strive to keep the `),be=s(v,"CODE",{});var _l=a(be);Nt=r(_l,"main"),_l.forEach(t),Tt=r(v,` version operational, and most issues are usually resolved within a few hours or a day.
If you run into a problem, please open an `),z=s(v,"A",{href:!0,rel:!0});var El=a(z);Ot=r(El,"Issue"),El.forEach(t),jt=r(v," so we can fix it even sooner!"),v.forEach(t),Be=u(e),S=s(e,"H2",{class:!0});var lt=a(S);Y=s(lt,"A",{id:!0,class:!0,href:!0});var gl=a(Y);_e=s(gl,"SPAN",{});var kl=a(_e);b(K.$$.fragment,kl),kl.forEach(t),gl.forEach(t),Yt=u(lt),Ee=s(lt,"SPAN",{});var Pl=a(Ee);Ht=r(Pl,"Editable install"),Pl.forEach(t),lt.forEach(t),We=u(e),ae=s(e,"P",{});var Dl=a(ae);Lt=r(Dl,"You will need an editable install if you\u2019d like to:"),Dl.forEach(t),Ge=u(e),H=s(e,"UL",{});var it=a(H);Q=s(it,"LI",{});var ot=a(Q);Ft=r(ot,"Use the "),ge=s(ot,"CODE",{});var Il=a(ge);Ut=r(Il,"main"),Il.forEach(t),qt=r(ot," version of the source code."),ot.forEach(t),Mt=u(it),ke=s(it,"LI",{});var Al=a(ke);Bt=r(Al,"Contribute to \u{1F917} Diffusers and need to test changes in the code."),Al.forEach(t),it.forEach(t),Je=u(e),ne=s(e,"P",{});var xl=a(ne);Wt=r(xl,"Clone the repository and install \u{1F917} Diffusers with the following commands:"),xl.forEach(t),Re=u(e),b(V.$$.fragment,e),ze=u(e),I=s(e,"P",{});var pe=a(I);Gt=r(pe,`These commands will link the folder you cloned the repository to and your Python library paths.
Python will now look inside the folder you cloned to in addition to the normal library paths.
For example, if your Python packages are typically installed in `),Pe=s(pe,"CODE",{});var Cl=a(Pe);Jt=r(Cl,"~/anaconda3/envs/main/lib/python3.7/site-packages/"),Cl.forEach(t),Rt=r(pe,", Python will also search the folder you cloned to: "),De=s(pe,"CODE",{});var Sl=a(De);zt=r(Sl,"~/diffusers/"),Sl.forEach(t),Kt=r(pe,"."),pe.forEach(t),Ke=u(e),b(L.$$.fragment,e),Qe=u(e),re=s(e,"P",{});var Nl=a(re);Qt=r(Nl,"Now you can easily update your clone to the latest version of \u{1F917} Diffusers with the following command:"),Nl.forEach(t),Ve=u(e),b(X.$$.fragment,e),Xe=u(e),F=s(e,"P",{});var st=a(F);Vt=r(st,"Your Python environment will find the "),Ie=s(st,"CODE",{});var Tl=a(Ie);Xt=r(Tl,"main"),Tl.forEach(t),Zt=r(st," version of \u{1F917} Diffusers on the next run."),st.forEach(t),this.h()},h(){h(m,"name","hf:doc:metadata"),h(m,"content",JSON.stringify(Ml)),h(w,"id","installation"),h(w,"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"),h(w,"href","#installation"),h(d,"class","relative group"),h(O,"id","install-with-pip"),h(O,"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"),h(O,"href","#install-with-pip"),h(x,"class","relative group"),h(q,"href","https://docs.python.org/3/library/venv.html"),h(q,"rel","nofollow"),h(M,"href","https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/"),h(M,"rel","nofollow"),h(j,"id","install-from-source"),h(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"),h(j,"href","#install-from-source"),h(C,"class","relative group"),h(z,"href","https://github.com/huggingface/transformers/issues"),h(z,"rel","nofollow"),h(Y,"id","editable-install"),h(Y,"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"),h(Y,"href","#editable-install"),h(S,"class","relative group")},m(e,i){l(document.head,m),f(e,N,i),f(e,d,i),l(d,w),l(w,A),_(y,A,null),l(d,P),l(d,T),l(T,nt),f(e,xe,i),f(e,ee,i),l(ee,rt),f(e,Ce,i),f(e,te,i),l(te,ft),f(e,Se,i),f(e,x,i),l(x,O),l(O,he),_(U,he,null),l(x,pt),l(x,me),l(me,ut),f(e,Ne,i),f(e,D,i),l(D,ht),l(D,q),l(q,mt),l(D,ct),l(D,M),l(M,dt),l(D,vt),f(e,Te,i),f(e,le,i),l(le,yt),f(e,Oe,i),_(B,e,i),f(e,je,i),f(e,ie,i),l(ie,wt),f(e,Ye,i),_(W,e,i),f(e,He,i),f(e,oe,i),l(oe,$t),f(e,Le,i),_(G,e,i),f(e,Fe,i),f(e,C,i),l(C,j),l(j,ce),_(J,ce,null),l(C,bt),l(C,de),l(de,_t),f(e,Ue,i),f(e,se,i),l(se,Et),f(e,qe,i),_(R,e,i),f(e,Me,i),f(e,c,i),l(c,gt),l(c,ve),l(ve,kt),l(c,Pt),l(c,ye),l(ye,Dt),l(c,It),l(c,we),l(we,At),l(c,xt),l(c,$e),l($e,Ct),l(c,St),l(c,be),l(be,Nt),l(c,Tt),l(c,z),l(z,Ot),l(c,jt),f(e,Be,i),f(e,S,i),l(S,Y),l(Y,_e),_(K,_e,null),l(S,Yt),l(S,Ee),l(Ee,Ht),f(e,We,i),f(e,ae,i),l(ae,Lt),f(e,Ge,i),f(e,H,i),l(H,Q),l(Q,Ft),l(Q,ge),l(ge,Ut),l(Q,qt),l(H,Mt),l(H,ke),l(ke,Bt),f(e,Je,i),f(e,ne,i),l(ne,Wt),f(e,Re,i),_(V,e,i),f(e,ze,i),f(e,I,i),l(I,Gt),l(I,Pe),l(Pe,Jt),l(I,Rt),l(I,De),l(De,zt),l(I,Kt),f(e,Ke,i),_(L,e,i),f(e,Qe,i),f(e,re,i),l(re,Qt),f(e,Ve,i),_(X,e,i),f(e,Xe,i),f(e,F,i),l(F,Vt),l(F,Ie),l(Ie,Xt),l(F,Zt),Ze=!0},p(e,[i]){const Z={};i&2&&(Z.$$scope={dirty:i,ctx:e}),L.$set(Z)},i(e){Ze||(E(y.$$.fragment,e),E(U.$$.fragment,e),E(B.$$.fragment,e),E(W.$$.fragment,e),E(G.$$.fragment,e),E(J.$$.fragment,e),E(R.$$.fragment,e),E(K.$$.fragment,e),E(V.$$.fragment,e),E(L.$$.fragment,e),E(X.$$.fragment,e),Ze=!0)},o(e){g(y.$$.fragment,e),g(U.$$.fragment,e),g(B.$$.fragment,e),g(W.$$.fragment,e),g(G.$$.fragment,e),g(J.$$.fragment,e),g(R.$$.fragment,e),g(K.$$.fragment,e),g(V.$$.fragment,e),g(L.$$.fragment,e),g(X.$$.fragment,e),Ze=!1},d(e){t(m),e&&t(N),e&&t(d),k(y),e&&t(xe),e&&t(ee),e&&t(Ce),e&&t(te),e&&t(Se),e&&t(x),k(U),e&&t(Ne),e&&t(D),e&&t(Te),e&&t(le),e&&t(Oe),k(B,e),e&&t(je),e&&t(ie),e&&t(Ye),k(W,e),e&&t(He),e&&t(oe),e&&t(Le),k(G,e),e&&t(Fe),e&&t(C),k(J),e&&t(Ue),e&&t(se),e&&t(qe),k(R,e),e&&t(Me),e&&t(c),e&&t(Be),e&&t(S),k(K),e&&t(We),e&&t(ae),e&&t(Ge),e&&t(H),e&&t(Je),e&&t(ne),e&&t(Re),k(V,e),e&&t(ze),e&&t(I),e&&t(Ke),k(L,e),e&&t(Qe),e&&t(re),e&&t(Ve),k(X,e),e&&t(Xe),e&&t(F)}}}const Ml={local:"installation",sections:[{local:"install-with-pip",title:"Install with pip"},{local:"install-from-source",title:"Install from source"},{local:"editable-install",title:"Editable install"}],title:"Installation"};function Bl(Ae){return Ll(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class zl extends Ol{constructor(m){super();jl(this,m,Bl,ql,Yl,{})}}export{zl as default,Ml as metadata};
