import{S as h5,i as m5,s as g5,e as r,k as d,w as v,t as s,M as _5,c as n,d as t,m as f,a,x as b,h as i,b as c,N as v5,G as e,g as p,y as w,q as y,o as E,B as D,v as b5,L as Ab}from"../../chunks/vendor-hf-doc-builder.js";import{T as Dr}from"../../chunks/Tip-hf-doc-builder.js";import{D as $e}from"../../chunks/Docstring-hf-doc-builder.js";import{C as j}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as wo}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Sb}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function w5(L){let h,x,m,_,$,u,g,k;return{c(){h=r("p"),x=s("It is required to be logged in ("),m=r("code"),_=s("huggingface-cli login"),$=s(") when you want to use private or "),u=r("a"),g=s(`gated
models`),k=s("."),this.h()},l(T){h=n(T,"P",{});var I=a(h);x=i(I,"It is required to be logged in ("),m=n(I,"CODE",{});var X=a(m);_=i(X,"huggingface-cli login"),X.forEach(t),$=i(I,") when you want to use private or "),u=n(I,"A",{href:!0,rel:!0});var z=a(u);g=i(z,`gated
models`),z.forEach(t),k=i(I,"."),I.forEach(t),this.h()},h(){c(u,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),c(u,"rel","nofollow")},m(T,I){p(T,h,I),e(h,x),e(h,m),e(m,_),e(h,$),e(h,u),e(u,g),e(h,k)},d(T){T&&t(h)}}}function y5(L){let h,x,m,_,$;return{c(){h=r("p"),x=s("Activate the special "),m=r("a"),_=s("\u201Coffline-mode\u201D"),$=s(` to use
this method in a firewalled environment.`),this.h()},l(u){h=n(u,"P",{});var g=a(h);x=i(g,"Activate the special "),m=n(g,"A",{href:!0,rel:!0});var k=a(m);_=i(k,"\u201Coffline-mode\u201D"),k.forEach(t),$=i(g,` to use
this method in a firewalled environment.`),g.forEach(t),this.h()},h(){c(m,"href","https://huggingface.co/diffusers/installation.html#offline-mode"),c(m,"rel","nofollow")},m(u,g){p(u,h,g),e(h,x),e(h,m),e(m,_),e(h,$)},d(u){u&&t(h)}}}function E5(L){let h,x,m,_,$,u,g,k,T,I,X,z,ce;return{c(){h=r("p"),x=s("It is required to be logged in ("),m=r("code"),_=s("huggingface-cli login"),$=s(") when you want to use private or "),u=r("a"),g=s(`gated
models`),k=s(", "),T=r("em"),I=s("e.g."),X=d(),z=r("code"),ce=s('"runwayml/stable-diffusion-v1-5"'),this.h()},l(J){h=n(J,"P",{});var P=a(h);x=i(P,"It is required to be logged in ("),m=n(P,"CODE",{});var Me=a(m);_=i(Me,"huggingface-cli login"),Me.forEach(t),$=i(P,") when you want to use private or "),u=n(P,"A",{href:!0,rel:!0});var he=a(u);g=i(he,`gated
models`),he.forEach(t),k=i(P,", "),T=n(P,"EM",{});var io=a(T);I=i(io,"e.g."),io.forEach(t),X=f(P),z=n(P,"CODE",{});var je=a(z);ce=i(je,'"runwayml/stable-diffusion-v1-5"'),je.forEach(t),P.forEach(t),this.h()},h(){c(u,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),c(u,"rel","nofollow")},m(J,P){p(J,h,P),e(h,x),e(h,m),e(m,_),e(h,$),e(h,u),e(u,g),e(h,k),e(h,T),e(T,I),e(h,X),e(h,z),e(z,ce)},d(J){J&&t(h)}}}function D5(L){let h,x,m,_,$;return{c(){h=r("p"),x=s("Activate the special "),m=r("a"),_=s("\u201Coffline-mode\u201D"),$=s(` to use
this method in a firewalled environment.`),this.h()},l(u){h=n(u,"P",{});var g=a(h);x=i(g,"Activate the special "),m=n(g,"A",{href:!0,rel:!0});var k=a(m);_=i(k,"\u201Coffline-mode\u201D"),k.forEach(t),$=i(g,` to use
this method in a firewalled environment.`),g.forEach(t),this.h()},h(){c(m,"href","https://huggingface.co/diffusers/installation.html#offline-mode"),c(m,"rel","nofollow")},m(u,g){p(u,h,g),e(h,x),e(h,m),e(m,_),e(h,$)},d(u){u&&t(h)}}}function $5(L){let h,x,m,_,$;return _=new j({props:{code:`from diffusers import DiffusionPipeline

# Download pipeline from huggingface.co and cache.
pipeline = DiffusionPipeline.from_pretrained("CompVis/ldm-text2im-large-256")

# Download pipeline that requires an authorization token
# For more information on access tokens, please refer to this section
# of the documentation](https://huggingface.co/docs/hub/security-tokens)
pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")

# Download pipeline, but overwrite scheduler
from diffusers import LMSDiscreteScheduler

scheduler = LMSDiscreteScheduler.from_config("runwayml/stable-diffusion-v1-5", subfolder="scheduler")
pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", scheduler=scheduler)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download pipeline from huggingface.co and cache.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;CompVis/ldm-text2im-large-256&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download pipeline that requires an authorization token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># For more information on access tokens, please refer to this section</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># of the documentation](https://huggingface.co/docs/hub/security-tokens)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download pipeline, but overwrite scheduler</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LMSDiscreteScheduler

<span class="hljs-meta">&gt;&gt;&gt; </span>scheduler = LMSDiscreteScheduler.from_config(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, scheduler=scheduler)`}}),{c(){h=r("p"),x=s("Examples:"),m=d(),v(_.$$.fragment)},l(u){h=n(u,"P",{});var g=a(h);x=i(g,"Examples:"),g.forEach(t),m=f(u),b(_.$$.fragment,u)},m(u,g){p(u,h,g),e(h,x),p(u,m,g),w(_,u,g),$=!0},p:Ab,i(u){$||(y(_.$$.fragment,u),$=!0)},o(u){E(_.$$.fragment,u),$=!1},d(u){u&&t(h),u&&t(m),D(_,u)}}}function x5(L){let h,x,m,_,$;return _=new j({props:{code:`from diffusers import FlaxUNet2DConditionModel

# Download model and configuration from huggingface.co and cache.
model, params = FlaxUNet2DConditionModel.from_pretrained("runwayml/stable-diffusion-v1-5")
# Model was saved using *save_pretrained('./test/saved_model/')* (for example purposes, not runnable).
model, params = FlaxUNet2DConditionModel.from_pretrained("./test/saved_model/")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxUNet2DConditionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download model and configuration from huggingface.co and cache.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model, params = FlaxUNet2DConditionModel.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Model was saved using *save_pretrained(&#x27;./test/saved_model/&#x27;)* (for example purposes, not runnable).</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model, params = FlaxUNet2DConditionModel.from_pretrained(<span class="hljs-string">&quot;./test/saved_model/&quot;</span>)`}}),{c(){h=r("p"),x=s("Examples:"),m=d(),v(_.$$.fragment)},l(u){h=n(u,"P",{});var g=a(h);x=i(g,"Examples:"),g.forEach(t),m=f(u),b(_.$$.fragment,u)},m(u,g){p(u,h,g),e(h,x),p(u,m,g),w(_,u,g),$=!0},p:Ab,i(u){$||(y(_.$$.fragment,u),$=!0)},o(u){E(_.$$.fragment,u),$=!1},d(u){u&&t(h),u&&t(m),D(_,u)}}}function P5(L){let h,x,m,_,$,u,g,k,T,I,X,z,ce;return{c(){h=r("p"),x=s("It is required to be logged in ("),m=r("code"),_=s("huggingface-cli login"),$=s(") when you want to use private or "),u=r("a"),g=s(`gated
models`),k=s(", "),T=r("em"),I=s("e.g."),X=d(),z=r("code"),ce=s('"runwayml/stable-diffusion-v1-5"'),this.h()},l(J){h=n(J,"P",{});var P=a(h);x=i(P,"It is required to be logged in ("),m=n(P,"CODE",{});var Me=a(m);_=i(Me,"huggingface-cli login"),Me.forEach(t),$=i(P,") when you want to use private or "),u=n(P,"A",{href:!0,rel:!0});var he=a(u);g=i(he,`gated
models`),he.forEach(t),k=i(P,", "),T=n(P,"EM",{});var io=a(T);I=i(io,"e.g."),io.forEach(t),X=f(P),z=n(P,"CODE",{});var je=a(z);ce=i(je,'"runwayml/stable-diffusion-v1-5"'),je.forEach(t),P.forEach(t),this.h()},h(){c(u,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),c(u,"rel","nofollow")},m(J,P){p(J,h,P),e(h,x),e(h,m),e(m,_),e(h,$),e(h,u),e(u,g),e(h,k),e(h,T),e(T,I),e(h,X),e(h,z),e(z,ce)},d(J){J&&t(h)}}}function k5(L){let h,x,m,_,$;return{c(){h=r("p"),x=s("Activate the special "),m=r("a"),_=s("\u201Coffline-mode\u201D"),$=s(` to use
this method in a firewalled environment.`),this.h()},l(u){h=n(u,"P",{});var g=a(h);x=i(g,"Activate the special "),m=n(g,"A",{href:!0,rel:!0});var k=a(m);_=i(k,"\u201Coffline-mode\u201D"),k.forEach(t),$=i(g,` to use
this method in a firewalled environment.`),g.forEach(t),this.h()},h(){c(m,"href","https://huggingface.co/diffusers/installation.html#offline-mode"),c(m,"rel","nofollow")},m(u,g){p(u,h,g),e(h,x),e(h,m),e(m,_),e(h,$)},d(u){u&&t(h)}}}function M5(L){let h,x,m,_,$;return _=new j({props:{code:`from diffusers import FlaxDiffusionPipeline

# Download pipeline from huggingface.co and cache.
pipeline = FlaxDiffusionPipeline.from_pretrained("CompVis/ldm-text2im-large-256")

# Download pipeline that requires an authorization token
# For more information on access tokens, please refer to this section
# of the documentation](https://huggingface.co/docs/hub/security-tokens)
pipeline = FlaxDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")

# Download pipeline, but overwrite scheduler
from diffusers import LMSDiscreteScheduler

scheduler = LMSDiscreteScheduler.from_config("runwayml/stable-diffusion-v1-5", subfolder="scheduler")
pipeline = FlaxDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", scheduler=scheduler)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxDiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download pipeline from huggingface.co and cache.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = FlaxDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;CompVis/ldm-text2im-large-256&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download pipeline that requires an authorization token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># For more information on access tokens, please refer to this section</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># of the documentation](https://huggingface.co/docs/hub/security-tokens)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = FlaxDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download pipeline, but overwrite scheduler</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LMSDiscreteScheduler

<span class="hljs-meta">&gt;&gt;&gt; </span>scheduler = LMSDiscreteScheduler.from_config(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = FlaxDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, scheduler=scheduler)`}}),{c(){h=r("p"),x=s("Examples:"),m=d(),v(_.$$.fragment)},l(u){h=n(u,"P",{});var g=a(h);x=i(g,"Examples:"),g.forEach(t),m=f(u),b(_.$$.fragment,u)},m(u,g){p(u,h,g),e(h,x),p(u,m,g),w(_,u,g),$=!0},p:Ab,i(u){$||(y(_.$$.fragment,u),$=!0)},o(u){E(_.$$.fragment,u),$=!1},d(u){u&&t(h),u&&t(m),D(_,u)}}}function j5(L){let h,x,m,_,$,u,g,k,T,I,X,z,ce,J,P,Me,he,io,je,qe,dt,$r,Wf,Hf,Bs,Bf,Rf,ft,xr,Gf,Kf,Rs,Jf,Qf,ct,Pr,Zf,ec,Gs,oc,Tl,ro,yo,kr,pt,tc,Mr,sc,Il,me,ic,Ks,rc,nc,ut,ac,lc,ht,dc,fc,Sl,mt,Al,N,cc,Js,pc,uc,jr,hc,mc,Qs,gc,_c,qr,vc,bc,Eo,wc,Tr,yc,Ec,Dc,Ir,$c,xc,Ll,Do,Pc,Zs,kc,Mc,Cl,gt,Ol,q,jc,Sr,qc,Tc,Ar,Ic,Sc,Lr,Ac,Lc,Cr,Cc,Oc,ei,Fc,Xc,oi,zc,Nc,_t,Uc,Vc,ti,Yc,Wc,Fl,no,$o,Or,vt,Hc,Fr,Bc,Xl,Te,Rc,Xr,Gc,Kc,bt,zr,Jc,Qc,zl,wt,Nl,Ie,Zc,Nr,ep,op,yt,tp,sp,Ul,Et,Vl,Se,ip,Ur,rp,np,Dt,ap,lp,Yl,xe,dp,fp,si,Lb,cp,pp,Wl,ii,up,Hl,$t,Bl,oe,hp,xt,mp,gp,Vr,_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Fa,av,lv,Xa,dv,fv,Ki,cv,pv,uv,Y,ms,hv,za,mv,gv,_o,_v,Na,vv,bv,Ua,wv,yv,Ev,gs,Dv,Va,$v,xv,Pv,_s,kv,Ya,Mv,jv,qv,No,Tv,Uo,Iv,Vo,vs,Sv,bs,Av,Wa,Lv,Cv,Zd,S,ws,Ov,Ha,Fv,Xv,Ji,Qi,zv,Nv,Uv,ys,Ba,Vv,Yv,Ra,Wv,Hv,Ga,Bv,Rv,Ka,Yo,Ja,Gv,Kv,Qa,Jv,Qv,Zv,C,Es,e1,Za,o1,t1,Ds,s1,el,i1,r1,n1,$s,a1,ol,l1,d1,f1,xs,c1,tl,p1,u1,h1,Wo,m1,Ho,g1,Bo,_1,Ro,Ps,v1,ks,b1,sl,w1,y1,ef,Z,Ms,E1,il,D1,$1,Zi,er,x1,P1,k1,ae,js,M1,rl,j1,q1,qs,T1,nl,I1,S1,A1,Ts,L1,al,C1,O1,F1,Go,X1,Ko,Is,z1,Ss,N1,ll,U1,V1,of,A,As,Y1,dl,W1,H1,or,tr,B1,R1,G1,fl,cl,K1,J1,pl,Q1,Z1,ul,Jo,hl,eb,ob,ml,tb,sb,ib,O,Ls,rb,gl,nb,ab,Cs,lb,_l,db,fb,cb,Os,pb,vl,ub,hb,mb,Fs,gb,bl,_b,vb,bb,Qo,wb,Zo,yb,et,Eb,ot,Xs,Db,zs,$b,wl,xb,Pb,tf;return u=new wo({}),pt=new wo({}),mt=new j({props:{code:`from diffusers import DiffusionPipeline

repo_id = "CompVis/ldm-text2im-large-256"
ldm = DiffusionPipeline.from_pretrained(repo_id)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

repo_id = <span class="hljs-string">&quot;CompVis/ldm-text2im-large-256&quot;</span>
ldm = DiffusionPipeline.from_pretrained(repo_id)`}}),gt=new j({props:{code:`from diffusers import LDMTextToImagePipeline

repo_id = "CompVis/ldm-text2im-large-256"
ldm = LDMTextToImagePipeline.from_pretrained(repo_id)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LDMTextToImagePipeline

repo_id = <span class="hljs-string">&quot;CompVis/ldm-text2im-large-256&quot;</span>
ldm = LDMTextToImagePipeline.from_pretrained(repo_id)`}}),vt=new wo({}),wt=new j({props:{code:`from diffusers import DiffusionPipeline

repo_id = "runwayml/stable-diffusion-v1-5"
stable_diffusion = DiffusionPipeline.from_pretrained(repo_id)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

repo_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
stable_diffusion = DiffusionPipeline.from_pretrained(repo_id)`}}),Et=new j({props:{code:"OSError: runwayml/stable-diffusion-v1-5 is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'\nIf this is a private repository, make sure to pass a token having permission to this repo with `use_auth_token` or log in with `huggingface-cli login`",highlighted:'OSError: runwayml/stable-diffusion-v1<span class="hljs-number">-5</span> is <span class="hljs-keyword">not</span> <span class="hljs-keyword">a</span> <span class="hljs-built_in">local</span> <span class="hljs-built_in">folder</span> <span class="hljs-keyword">and</span> is <span class="hljs-keyword">not</span> <span class="hljs-keyword">a</span> valid model identifier listed <span class="hljs-keyword">on</span> <span class="hljs-string">&#x27;https://huggingface.co/models&#x27;</span>\nIf this is <span class="hljs-keyword">a</span> <span class="hljs-keyword">private</span> repository, make sure <span class="hljs-built_in">to</span> pass <span class="hljs-keyword">a</span> <span class="hljs-keyword">token</span> having permission <span class="hljs-built_in">to</span> this repo <span class="hljs-keyword">with</span> `use_auth_token` <span class="hljs-keyword">or</span> <span class="hljs-built_in">log</span> <span class="hljs-keyword">in</span> <span class="hljs-keyword">with</span> `huggingface-cli login`'}}),$t=new j({props:{code:"huggingface-cli login",highlighted:'huggingface-<span class="hljs-keyword">cli</span> login'}}),Pt=new j({props:{code:`from diffusers import DiffusionPipeline

repo_id = "runwayml/stable-diffusion-v1-5"
stable_diffusion = DiffusionPipeline.from_pretrained(repo_id, use_auth_token="<your-access-token>")`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

repo_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
stable_diffusion = DiffusionPipeline.from_pretrained(repo_id, use_auth_token=<span class="hljs-string">&quot;&lt;your-access-token&gt;&quot;</span>)`}}),kt=new wo({}),Tt=new j({props:{code:`git lfs install
git clone https://huggingface.co/runwayml/stable-diffusion-v1-5`,highlighted:`git lfs install
git clone https:<span class="hljs-regexp">//</span>huggingface.co<span class="hljs-regexp">/runwayml/</span>stable-diffusion-v1-<span class="hljs-number">5</span>`}}),It=new j({props:{code:`from diffusers import DiffusionPipeline

repo_id = "./stable-diffusion-v1-5"
stable_diffusion = DiffusionPipeline.from_pretrained(repo_id)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

repo_id = <span class="hljs-string">&quot;./stable-diffusion-v1-5&quot;</span>
stable_diffusion = DiffusionPipeline.from_pretrained(repo_id)`}}),St=new wo({}),Lt=new j({props:{code:`from diffusers import DiffusionPipeline, EulerDiscreteScheduler, DPMSolverMultistepScheduler

repo_id = "runwayml/stable-diffusion-v1-5"

scheduler = EulerDiscreteScheduler.from_config(repo_id, subfolder="scheduler")
# or
# scheduler = DPMSolverMultistepScheduler.from_config(repo_id, subfolder="scheduler")

stable_diffusion = DiffusionPipeline.from_pretrained(repo_id, scheduler=scheduler)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline, EulerDiscreteScheduler, DPMSolverMultistepScheduler

repo_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>

scheduler = EulerDiscreteScheduler.from_config(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
<span class="hljs-comment"># or</span>
<span class="hljs-comment"># scheduler = DPMSolverMultistepScheduler.from_config(repo_id, subfolder=&quot;scheduler&quot;)</span>

stable_diffusion = DiffusionPipeline.from_pretrained(repo_id, scheduler=scheduler)`}}),Xt=new j({props:{code:`from diffusers import DiffusionPipeline, EulerDiscreteScheduler, DPMSolverMultistepScheduler

stable_diffusion = DiffusionPipeline.from_pretrained(repo_id, safety_checker=None)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline, EulerDiscreteScheduler, DPMSolverMultistepScheduler

stable_diffusion = DiffusionPipeline.from_pretrained(repo_id, safety_checker=<span class="hljs-literal">None</span>)`}}),Nt=new j({props:{code:`from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline

model_id = "runwayml/stable-diffusion-v1-5"
stable_diffusion_txt2img = StableDiffusionPipeline.from_pretrained(model_id)

components = stable_diffusion_txt2img.components

# weights are not reloaded into RAM
stable_diffusion_img2img = StableDiffusionImg2ImgPipeline(**components)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline, StableDiffusionImg2ImgPipeline

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
stable_diffusion_txt2img = StableDiffusionPipeline.from_pretrained(model_id)

components = stable_diffusion_txt2img.components

<span class="hljs-comment"># weights are not reloaded into RAM</span>
stable_diffusion_img2img = StableDiffusionImg2ImgPipeline(**components)`}}),Ut=new wo({}),Yt=new j({props:{code:`from diffusers import DiffusionPipeline

repo_id = "CompVis/ldm-text2im-large-256"
ldm = DiffusionPipeline.from_pretrained(repo_id)
print(ldm)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

repo_id = <span class="hljs-string">&quot;CompVis/ldm-text2im-large-256&quot;</span>
ldm = DiffusionPipeline.from_pretrained(repo_id)
<span class="hljs-built_in">print</span>(ldm)`}}),Ht=new j({props:{code:`LDMTextToImagePipeline {
  "bert": [
    "latent_diffusion",
    "LDMBertModel"
  ],
  "scheduler": [
    "diffusers",
    "DDIMScheduler"
  ],
  "tokenizer": [
    "transformers",
    "BertTokenizer"
  ],
  "unet": [
    "diffusers",
    "UNet2DConditionModel"
  ],
  "vqvae": [
    "diffusers",
    "AutoencoderKL"
  ]
}`,highlighted:`<span class="hljs-symbol">LDMTextToImagePipeline</span> {
  <span class="hljs-string">&quot;bert&quot;</span>: [
    <span class="hljs-string">&quot;latent_diffusion&quot;</span>,
    <span class="hljs-string">&quot;LDMBertModel&quot;</span>
  ],
  <span class="hljs-string">&quot;scheduler&quot;</span>: [
    <span class="hljs-string">&quot;diffusers&quot;</span>,
    <span class="hljs-string">&quot;DDIMScheduler&quot;</span>
  ],
  <span class="hljs-string">&quot;tokenizer&quot;</span>: [
    <span class="hljs-string">&quot;transformers&quot;</span>,
    <span class="hljs-string">&quot;BertTokenizer&quot;</span>
  ],
  <span class="hljs-string">&quot;unet&quot;</span>: [
    <span class="hljs-string">&quot;diffusers&quot;</span>,
    <span class="hljs-string">&quot;UNet2DConditionModel&quot;</span>
  ],
  <span class="hljs-string">&quot;vqvae&quot;</span>: [
    <span class="hljs-string">&quot;diffusers&quot;</span>,
    <span class="hljs-string">&quot;AutoencoderKL&quot;</span>
  ]
}`}}),Qt=new j({props:{code:`.
\u251C\u2500\u2500 bert
\u2502\xA0\xA0 \u251C\u2500\u2500 config.json
\u2502\xA0\xA0 \u2514\u2500\u2500 pytorch_model.bin
\u251C\u2500\u2500 model_index.json
\u251C\u2500\u2500 scheduler
\u2502\xA0\xA0 \u2514\u2500\u2500 scheduler_config.json
\u251C\u2500\u2500 tokenizer
\u2502\xA0\xA0 \u251C\u2500\u2500 special_tokens_map.json
\u2502\xA0\xA0 \u251C\u2500\u2500 tokenizer_config.json
\u2502\xA0\xA0 \u2514\u2500\u2500 vocab.txt
\u251C\u2500\u2500 unet
\u2502\xA0\xA0 \u251C\u2500\u2500 config.json
\u2502\xA0\xA0 \u2514\u2500\u2500 diffusion_pytorch_model.bin
\u2514\u2500\u2500 vqvae
    \u251C\u2500\u2500 config.json
    \u2514\u2500\u2500 diffusion_pytorch_model.bin`,highlighted:`.
\u251C\u2500\u2500 <span class="hljs-keyword">bert
</span>\u2502\xA0\xA0 \u251C\u2500\u2500 <span class="hljs-built_in">config</span>.<span class="hljs-keyword">json
</span>\u2502\xA0\xA0 \u2514\u2500\u2500 pytorch_model.<span class="hljs-keyword">bin
</span>\u251C\u2500\u2500 model_index.<span class="hljs-keyword">json
</span>\u251C\u2500\u2500 <span class="hljs-keyword">scheduler
</span>\u2502\xA0\xA0 \u2514\u2500\u2500 <span class="hljs-keyword">scheduler_config.json
</span>\u251C\u2500\u2500 tokenizer
\u2502\xA0\xA0 \u251C\u2500\u2500 special_tokens_map.<span class="hljs-keyword">json
</span>\u2502\xA0\xA0 \u251C\u2500\u2500 tokenizer_config.<span class="hljs-keyword">json
</span>\u2502\xA0\xA0 \u2514\u2500\u2500 vocab.txt
\u251C\u2500\u2500 unet
\u2502\xA0\xA0 \u251C\u2500\u2500 <span class="hljs-built_in">config</span>.<span class="hljs-keyword">json
</span>\u2502\xA0\xA0 \u2514\u2500\u2500 <span class="hljs-keyword">diffusion_pytorch_model.bin
</span>\u2514\u2500\u2500 vqvae
    \u251C\u2500\u2500 <span class="hljs-built_in">config</span>.<span class="hljs-keyword">json
</span>    \u2514\u2500\u2500 <span class="hljs-keyword">diffusion_pytorch_model.bin</span>`}}),Zt=new j({props:{code:`{
  "_class_name": "LDMTextToImagePipeline",
  "_diffusers_version": "0.0.4",
  "bert": [
    "latent_diffusion",
    "LDMBertModel"
  ],
  "scheduler": [
    "diffusers",
    "DDIMScheduler"
  ],
  "tokenizer": [
    "transformers",
    "BertTokenizer"
  ],
  "unet": [
    "diffusers",
    "UNet2DConditionModel"
  ],
  "vqvae": [
    "diffusers",
    "AutoencoderKL"
  ]
}`,highlighted:`{
  <span class="hljs-string">&quot;_class_name&quot;</span>: <span class="hljs-string">&quot;LDMTextToImagePipeline&quot;</span>,
  <span class="hljs-string">&quot;_diffusers_version&quot;</span>: <span class="hljs-string">&quot;0.0.4&quot;</span>,
  <span class="hljs-string">&quot;bert&quot;</span>: [
    <span class="hljs-string">&quot;latent_diffusion&quot;</span>,
    <span class="hljs-string">&quot;LDMBertModel&quot;</span>
  ],
  <span class="hljs-string">&quot;scheduler&quot;</span>: [
    <span class="hljs-string">&quot;diffusers&quot;</span>,
    <span class="hljs-string">&quot;DDIMScheduler&quot;</span>
  ],
  <span class="hljs-string">&quot;tokenizer&quot;</span>: [
    <span class="hljs-string">&quot;transformers&quot;</span>,
    <span class="hljs-string">&quot;BertTokenizer&quot;</span>
  ],
  <span class="hljs-string">&quot;unet&quot;</span>: [
    <span class="hljs-string">&quot;diffusers&quot;</span>,
    <span class="hljs-string">&quot;UNet2DConditionModel&quot;</span>
  ],
  <span class="hljs-string">&quot;vqvae&quot;</span>: [
    <span class="hljs-string">&quot;diffusers&quot;</span>,
    <span class="hljs-string">&quot;AutoencoderKL&quot;</span>
  ]
}`}}),es=new j({props:{code:`"name" : [
  "library",
  "class"
]`,highlighted:`<span class="hljs-string">&quot;name&quot;</span> : [
  <span class="hljs-string">&quot;library&quot;</span>,
  <span class="hljs-string">&quot;class&quot;</span>
]`}}),is=new wo({}),ns=new j({props:{code:`from diffusers import UNet2DConditionModel

repo_id = "CompVis/ldm-text2im-large-256"
model = UNet2DConditionModel.from_pretrained(repo_id, subfolder="unet")`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DConditionModel

repo_id = <span class="hljs-string">&quot;CompVis/ldm-text2im-large-256&quot;</span>
model = UNet2DConditionModel.from_pretrained(repo_id, subfolder=<span class="hljs-string">&quot;unet&quot;</span>)`}}),ls=new j({props:{code:`from diffusers import DiffusionPipeline

repo_id = "CompVis/ldm-text2im-large-256"
ldm = DiffusionPipeline.from_pretrained(repo_id, unet=model)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

repo_id = <span class="hljs-string">&quot;CompVis/ldm-text2im-large-256&quot;</span>
ldm = DiffusionPipeline.from_pretrained(repo_id, unet=model)`}}),fs=new j({props:{code:`from diffusers import UNet2DModel

repo_id = "google/ddpm-cifar10-32"
model = UNet2DModel.from_pretrained(repo_id)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DModel

repo_id = <span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>
model = UNet2DModel.from_pretrained(repo_id)`}}),cs=new wo({}),ps=new j({props:{code:`from diffusers import StableDiffusionPipeline
from diffusers import (
    DDPMScheduler,
    DDIMScheduler,
    PNDMScheduler,
    LMSDiscreteScheduler,
    EulerDiscreteScheduler,
    EulerAncestralDiscreteScheduler,
    DPMSolverMultistepScheduler,
)

repo_id = "runwayml/stable-diffusion-v1-5"

ddpm = DDPMScheduler.from_config(repo_id, subfolder="scheduler")
ddim = DDIMScheduler.from_config(repo_id, subfolder="scheduler")
pndm = PNDMScheduler.from_config(repo_id, subfolder="scheduler")
lms = LMSDiscreteScheduler.from_config(repo_id, subfolder="scheduler")
euler_anc = EulerAncestralDiscreteScheduler.from_config(repo_id, subfolder="scheduler")
euler = EulerDiscreteScheduler.from_config(repo_id, subfolder="scheduler")
dpm = DPMSolverMultistepScheduler.from_config(repo_id, subfolder="scheduler")

# replace \`dpm\` with any of \`ddpm\`, \`ddim\`, \`pndm\`, \`lms\`, \`euler\`, \`euler_anc\`
pipeline = StableDiffusionPipeline.from_pretrained(repo_id, scheduler=dpm)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> (
    DDPMScheduler,
    DDIMScheduler,
    PNDMScheduler,
    LMSDiscreteScheduler,
    EulerDiscreteScheduler,
    EulerAncestralDiscreteScheduler,
    DPMSolverMultistepScheduler,
)

repo_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>

ddpm = DDPMScheduler.from_config(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
ddim = DDIMScheduler.from_config(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
pndm = PNDMScheduler.from_config(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
lms = LMSDiscreteScheduler.from_config(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
euler_anc = EulerAncestralDiscreteScheduler.from_config(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
euler = EulerDiscreteScheduler.from_config(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
dpm = DPMSolverMultistepScheduler.from_config(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)

<span class="hljs-comment"># replace \`dpm\` with any of \`ddpm\`, \`ddim\`, \`pndm\`, \`lms\`, \`euler\`, \`euler_anc\`</span>
pipeline = StableDiffusionPipeline.from_pretrained(repo_id, scheduler=dpm)`}}),us=new wo({}),hs=new $e({props:{name:"class diffusers.ModelMixin",anchor:"diffusers.ModelMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_1116/src/diffusers/modeling_utils.py#L134"}}),ms=new $e({props:{name:"from_pretrained",anchor:"diffusers.ModelMixin.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike, NoneType]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.ModelMixin.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids should have an organization name, like <code>google/ddpm-celebahq-256</code>.</li>
<li>A path to a <em>directory</em> containing model weights saved using <code>~ModelMixin.save_config</code>, e.g.,
<code>./my_model_directory/</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.ModelMixin.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"diffusers.ModelMixin.from_pretrained.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model under this dtype. If <code>&quot;auto&quot;</code> is passed the dtype
will be automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.ModelMixin.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.ModelMixin.from_pretrained.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,name:"resume_download"},{anchor:"diffusers.ModelMixin.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.ModelMixin.from_pretrained.output_loading_info(bool,",description:`<strong>output_loading_info(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.`,name:"output_loading_info(bool,"},{anchor:"diffusers.ModelMixin.from_pretrained.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"diffusers.ModelMixin.from_pretrained.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"use_auth_token"},{anchor:"diffusers.ModelMixin.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"},{anchor:"diffusers.ModelMixin.from_pretrained.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
In case the relevant files are located inside a subfolder of the model repo (either remote in
huggingface.co or downloaded locally), you can specify the folder name here.`,name:"subfolder"},{anchor:"diffusers.ModelMixin.from_pretrained.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information.`,name:"mirror"},{anchor:"diffusers.ModelMixin.from_pretrained.device_map",description:`<strong>device_map</strong> (<code>str</code> or <code>Dict[str, Union[int, str, torch.device]]</code>, <em>optional</em>) &#x2014;
A map that specifies where each submodule should go. It doesn&#x2019;t need to be refined to each
parameter/buffer name, once a given module name is inside, every submodule of it will be sent to the
same device.</p>
<p>To have Accelerate compute the most optimized <code>device_map</code> automatically, set <code>device_map=&quot;auto&quot;</code>. For
more information about each option see <a href="https://hf.co/docs/accelerate/main/en/usage_guides/big_modeling#designing-a-device-map" rel="nofollow">designing a device
map</a>.`,name:"device_map"},{anchor:"diffusers.ModelMixin.from_pretrained.low_cpu_mem_usage",description:`<strong>low_cpu_mem_usage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code> if torch version &gt;= 1.9.0 else <code>False</code>) &#x2014;
Speed up model loading by not initializing the weights and only loading the pre-trained weights. This
also tries to not use more than 1x model size in CPU memory (including peak memory) while loading the
model. This is only supported when torch version &gt;= 1.9.0. If you are using an older version of torch,
setting this argument to <code>True</code> will raise an error.`,name:"low_cpu_mem_usage"}],source:"https://github.com/huggingface/diffusers/blob/vr_1116/src/diffusers/modeling_utils.py#L232"}}),No=new Dr({props:{$$slots:{default:[w5]},$$scope:{ctx:L}}}),Uo=new Dr({props:{$$slots:{default:[y5]},$$scope:{ctx:L}}}),vs=new $e({props:{name:"save_pretrained",anchor:"diffusers.ModelMixin.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"is_main_process",val:": bool = True"},{name:"save_function",val:": typing.Callable = <function save at 0x7fc70d789670>"}],parametersDescription:[{anchor:"diffusers.ModelMixin.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to which to save. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"diffusers.ModelMixin.save_pretrained.is_main_process",description:`<strong>is_main_process</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the process calling this is the main process or not. Useful when in distributed training like
TPUs and need to call this function on all processes. In this case, set <code>is_main_process=True</code> only on
the main process to avoid race conditions.`,name:"is_main_process"},{anchor:"diffusers.ModelMixin.save_pretrained.save_function",description:`<strong>save_function</strong> (<code>Callable</code>) &#x2014;
The function to use to save the state dictionary. Useful on distributed training like TPUs when one
need to replace <code>torch.save</code> by another method.`,name:"save_function"}],source:"https://github.com/huggingface/diffusers/blob/vr_1116/src/diffusers/modeling_utils.py#L182"}}),ws=new $e({props:{name:"class diffusers.DiffusionPipeline",anchor:"diffusers.DiffusionPipeline",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_1116/src/diffusers/pipeline_utils.py#L113"}}),Es=new $e({props:{name:"from_pretrained",anchor:"diffusers.DiffusionPipeline.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike, NoneType]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.DiffusionPipeline.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>repo id</em> of a pretrained pipeline hosted inside a model repo on
<a href="https://huggingface.co/" rel="nofollow">https://huggingface.co/</a> Valid repo ids have to be located under a user or organization name, like
<code>CompVis/ldm-text2im-large-256</code>.</li>
<li>A path to a <em>directory</em> containing pipeline weights saved using
<a href="/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline.save_pretrained">save_pretrained()</a>, e.g., <code>./my_pipeline_directory/</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model under this dtype. If <code>&quot;auto&quot;</code> is passed the dtype
will be automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.custom_pipeline",description:`<strong>custom_pipeline</strong> (<code>str</code>, <em>optional</em>) &#x2014;</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>This is an experimental feature and is likely to change in the future.</p>

					</div>
<p>Can be either:</p>
<ul>
<li>
<p>A string, the <em>repo id</em> of a custom pipeline hosted inside a model repo on
<a href="https://huggingface.co/" rel="nofollow">https://huggingface.co/</a>. Valid repo ids have to be located under a user or organization name,
like <code>hf-internal-testing/diffusers-dummy-pipeline</code>.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>It is required that the model repo has a file, called <code>pipeline.py</code> that defines the custom
pipeline.</p>

					</div>
</li>
<li>
<p>A string, the <em>file name</em> of a community pipeline hosted on GitHub under
<a href="https://github.com/huggingface/diffusers/tree/main/examples/community" rel="nofollow">https://github.com/huggingface/diffusers/tree/main/examples/community</a>. Valid file names have to
match exactly the file name without <code>.py</code> located under the above link, <em>e.g.</em>
<code>clip_guided_stable_diffusion</code>.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Community pipelines are always loaded from the current <code>main</code> branch of GitHub.</p>

					</div>
</li>
<li>
<p>A path to a <em>directory</em> containing a custom pipeline, e.g., <code>./my_pipeline_directory/</code>.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>It is required that the directory has a file, called <code>pipeline.py</code> that defines the custom
pipeline.</p>

					</div>
</li>
</ul>
<p>For more information on how to load and create custom pipelines, please have a look at <a href="https://huggingface.co/docs/diffusers/using-diffusers/custom_pipeline_overview" rel="nofollow">Loading and
Adding Custom
Pipelines</a>`,name:"custom_pipeline"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.torch_dtype",description:"<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;",name:"torch_dtype"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,name:"resume_download"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.output_loading_info(bool,",description:`<strong>output_loading_info(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.`,name:"output_loading_info(bool,"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"use_auth_token"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information. specify the folder name here.`,name:"mirror"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.device_map",description:`<strong>device_map</strong> (<code>str</code> or <code>Dict[str, Union[int, str, torch.device]]</code>, <em>optional</em>) &#x2014;
A map that specifies where each submodule should go. It doesn&#x2019;t need to be refined to each
parameter/buffer name, once a given module name is inside, every submodule of it will be sent to the
same device.</p>
<p>To have Accelerate compute the most optimized <code>device_map</code> automatically, set <code>device_map=&quot;auto&quot;</code>. For
more information about each option see <a href="https://hf.co/docs/accelerate/main/en/usage_guides/big_modeling#designing-a-device-map" rel="nofollow">designing a device
map</a>.`,name:"device_map"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.low_cpu_mem_usage",description:`<strong>low_cpu_mem_usage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code> if torch version &gt;= 1.9.0 else <code>False</code>) &#x2014;
Speed up model loading by not initializing the weights and only loading the pre-trained weights. This
also tries to not use more than 1x model size in CPU memory (including peak memory) while loading the
model. This is only supported when torch version &gt;= 1.9.0. If you are using an older version of torch,
setting this argument to <code>True</code> will raise an error.`,name:"low_cpu_mem_usage"},{anchor:"diffusers.DiffusionPipeline.from_pretrained.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to overwrite load - and saveable variables - <em>i.e.</em> the pipeline components - of the
specific pipeline class. The overwritten components are then directly passed to the pipelines
<code>__init__</code> method. See example below for more information.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/vr_1116/src/diffusers/pipeline_utils.py#L238"}}),Wo=new Dr({props:{$$slots:{default:[E5]},$$scope:{ctx:L}}}),Ho=new Dr({props:{$$slots:{default:[D5]},$$scope:{ctx:L}}}),Bo=new Sb({props:{anchor:"diffusers.DiffusionPipeline.from_pretrained.example",$$slots:{default:[$5]},$$scope:{ctx:L}}}),Ps=new $e({props:{name:"save_pretrained",anchor:"diffusers.DiffusionPipeline.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"}],parametersDescription:[{anchor:"diffusers.DiffusionPipeline.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to which to save. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"}],source:"https://github.com/huggingface/diffusers/blob/vr_1116/src/diffusers/pipeline_utils.py#L163"}}),Ms=new $e({props:{name:"class diffusers.FlaxModelMixin",anchor:"diffusers.FlaxModelMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_1116/src/diffusers/modeling_flax_utils.py#L45"}}),js=new $e({props:{name:"from_pretrained",anchor:"diffusers.FlaxModelMixin.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike]"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"*model_args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.FlaxModelMixin.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids are namespaced under a user or organization name, like
<code>runwayml/stable-diffusion-v1-5</code>.</li>
<li>A path to a <em>directory</em> containing model weights saved using <a href="/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.ModelMixin.save_pretrained">save_pretrained()</a>,
e.g., <code>./my_model_directory/</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.FlaxModelMixin.from_pretrained.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <code>~ModelMixin.to_fp16</code> and
<code>~ModelMixin.to_bf16</code>.`,name:"dtype"},{anchor:"diffusers.FlaxModelMixin.from_pretrained.model_args",description:`<strong>model_args</strong> (sequence of positional arguments, <em>optional</em>) &#x2014;
All remaining positional arguments will be passed to the underlying model&#x2019;s <code>__init__</code> method.`,name:"model_args"},{anchor:"diffusers.FlaxModelMixin.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"diffusers.FlaxModelMixin.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.FlaxModelMixin.from_pretrained.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,name:"resume_download"},{anchor:"diffusers.FlaxModelMixin.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.FlaxModelMixin.from_pretrained.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"diffusers.FlaxModelMixin.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"},{anchor:"diffusers.FlaxModelMixin.from_pretrained.from_pt",description:`<strong>from_pt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Load the model weights from a PyTorch checkpoint save file.`,name:"from_pt"},{anchor:"diffusers.FlaxModelMixin.from_pretrained.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to update the configuration object (after it being loaded) and initiate the model (e.g.,
<code>output_attentions=True</code>). Behaves differently depending on whether a <code>config</code> is provided or
automatically loaded:</p>
<ul>
<li>If a configuration is provided with <code>config</code>, <code>**kwargs</code> will be directly passed to the
underlying model&#x2019;s <code>__init__</code> method (we assume all relevant updates to the configuration have
already been done)</li>
<li>If a configuration is not provided, <code>kwargs</code> will be first passed to the configuration class
initialization function (<a href="/docs/diffusers/pr_1116/en/using-diffusers/configuration#diffusers.ConfigMixin.from_config">from_config()</a>). Each key of <code>kwargs</code> that corresponds to
a configuration attribute will be used to override said attribute with the supplied <code>kwargs</code>
value. Remaining keys that do not correspond to any configuration attribute will be passed to the
underlying model&#x2019;s <code>__init__</code> function.</li>
</ul>`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/vr_1116/src/diffusers/modeling_flax_utils.py#L195"}}),Go=new Sb({props:{anchor:"diffusers.FlaxModelMixin.from_pretrained.example",$$slots:{default:[x5]},$$scope:{ctx:L}}}),Is=new $e({props:{name:"save_pretrained",anchor:"diffusers.FlaxModelMixin.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"is_main_process",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.FlaxModelMixin.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to which to save. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"diffusers.FlaxModelMixin.save_pretrained.params",description:`<strong>params</strong> (<code>Union[Dict, FrozenDict]</code>) &#x2014;
A <code>PyTree</code> of model parameters.`,name:"params"},{anchor:"diffusers.FlaxModelMixin.save_pretrained.is_main_process",description:`<strong>is_main_process</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the process calling this is the main process or not. Useful when in distributed training like
TPUs and need to call this function on all processes. In this case, set <code>is_main_process=True</code> only on
the main process to avoid race conditions.`,name:"is_main_process"}],source:"https://github.com/huggingface/diffusers/blob/vr_1116/src/diffusers/modeling_flax_utils.py#L487"}}),As=new $e({props:{name:"class diffusers.FlaxDiffusionPipeline",anchor:"diffusers.FlaxDiffusionPipeline",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_1116/src/diffusers/pipeline_flax_utils.py#L93"}}),Ls=new $e({props:{name:"from_pretrained",anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike, NoneType]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>repo id</em> of a pretrained pipeline hosted inside a model repo on
<a href="https://huggingface.co/" rel="nofollow">https://huggingface.co/</a> Valid repo ids have to be located under a user or organization name, like
<code>CompVis/ldm-text2im-large-256</code>.</li>
<li>A path to a <em>directory</em> containing pipeline weights saved using
<a href="/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.FlaxDiffusionPipeline.save_pretrained">save_pretrained()</a>, e.g., <code>./my_pipeline_directory/</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.dtype",description:`<strong>dtype</strong> (<code>str</code> or <code>jnp.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>jnp.dtype</code> and load the model under this dtype. If <code>&quot;auto&quot;</code> is passed the dtype
will be automatically derived from the model&#x2019;s weights.`,name:"dtype"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,name:"resume_download"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.output_loading_info(bool,",description:`<strong>output_loading_info(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.`,name:"output_loading_info(bool,"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"use_auth_token"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information. specify the folder name here.`,name:"mirror"},{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to overwrite load - and saveable variables - <em>i.e.</em> the pipeline components - of the
specific pipeline class. The overwritten components are then directly passed to the pipelines
<code>__init__</code> method. See example below for more information.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/vr_1116/src/diffusers/pipeline_flax_utils.py#L193"}}),Qo=new Dr({props:{$$slots:{default:[P5]},$$scope:{ctx:L}}}),Zo=new Dr({props:{$$slots:{default:[k5]},$$scope:{ctx:L}}}),et=new Sb({props:{anchor:"diffusers.FlaxDiffusionPipeline.from_pretrained.example",$$slots:{default:[M5]},$$scope:{ctx:L}}}),Xs=new $e({props:{name:"save_pretrained",anchor:"diffusers.FlaxDiffusionPipeline.save_pretrained",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"}],parametersDescription:[{anchor:"diffusers.FlaxDiffusionPipeline.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to which to save. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"}],source:"https://github.com/huggingface/diffusers/blob/vr_1116/src/diffusers/pipeline_flax_utils.py#L143"}}),{c(){h=r("meta"),x=d(),m=r("h1"),_=r("a"),$=r("span"),v(u.$$.fragment),g=d(),k=r("span"),T=s("Loading"),I=d(),X=r("p"),z=s("A core premise of the diffusers library is to make diffusion models "),ce=r("strong"),J=s("as accessible as possible"),P=s(`.
Accessibility is therefore achieved by providing an API to load complete diffusion pipelines as well as individual components with a single line of code.`),Me=d(),he=r("p"),io=s("In the following we explain in-detail how to easily load:"),je=d(),qe=r("ul"),dt=r("li"),$r=r("em"),Wf=s("Complete Diffusion Pipelines"),Hf=s(" via the "),Bs=r("a"),Bf=s("DiffusionPipeline.from_pretrained()"),Rf=d(),ft=r("li"),xr=r("em"),Gf=s("Diffusion Models"),Kf=s(" via "),Rs=r("a"),Jf=s("ModelMixin.from_pretrained()"),Qf=d(),ct=r("li"),Pr=r("em"),Zf=s("Schedulers"),ec=s(" via "),Gs=r("a"),oc=s("ConfigMixin.from_config()"),Tl=d(),ro=r("h2"),yo=r("a"),kr=r("span"),v(pt.$$.fragment),tc=d(),Mr=r("span"),sc=s("Loading pipelines"),Il=d(),me=r("p"),ic=s("The "),Ks=r("a"),rc=s("DiffusionPipeline"),nc=s(" class is the easiest way to access any diffusion model that is "),ut=r("a"),ac=s("available on the Hub"),lc=s(". Let\u2019s look at an example on how to download "),ht=r("a"),dc=s("CompVis\u2019 Latent Diffusion model"),fc=s("."),Sl=d(),v(mt.$$.fragment),Al=d(),N=r("p"),cc=s("Here "),Js=r("a"),pc=s("DiffusionPipeline"),uc=s(" automatically detects the correct pipeline ("),jr=r("em"),hc=s("i.e."),mc=d(),Qs=r("a"),gc=s("LDMTextToImagePipeline"),_c=s("), downloads and caches all required configuration and weight files (if not already done so), and finally returns a pipeline instance, called "),qr=r("code"),vc=s("ldm"),bc=s(`.
The pipeline instance can then be called using `),Eo=r("a"),wc=s("LDMTextToImagePipeline."),Tr=r("strong"),yc=s("call"),Ec=s("()"),Dc=s(" (i.e., "),Ir=r("code"),$c=s('ldm("image of a astronaut riding a horse")'),xc=s(") for text-to-image generation."),Ll=d(),Do=r("p"),Pc=s("Instead of using the generic "),Zs=r("a"),kc=s("DiffusionPipeline"),Mc=s(" class for loading, you can also load the appropriate pipeline class directly. The code snippet above yields the same instance as when doing:"),Cl=d(),v(gt.$$.fragment),Ol=d(),q=r("p"),jc=s("Diffusion pipelines like "),Sr=r("code"),qc=s("LDMTextToImagePipeline"),Tc=s(" often consist of multiple components. These components can be both parameterized models, such as "),Ar=r("code"),Ic=s('"unet"'),Sc=s(", "),Lr=r("code"),Ac=s('"vqvae"'),Lc=s(" and \u201Cbert\u201D, tokenizers or schedulers. These components can interact in complex ways with each other when using the pipeline in inference, "),Cr=r("em"),Cc=s("e.g."),Oc=s(" for "),ei=r("a"),Fc=s("LDMTextToImagePipeline"),Xc=s(" or "),oi=r("a"),zc=s("StableDiffusionPipeline"),Nc=s(" the inference call is explained "),_t=r("a"),Uc=s("here"),Vc=s(`.
The purpose of the `),ti=r("a"),Yc=s("pipeline classes"),Wc=s(" is to wrap the complexity of these diffusion systems and give the user an easy-to-use API while staying flexible for customization, as will be shown later."),Fl=d(),no=r("h3"),$o=r("a"),Or=r("span"),v(vt.$$.fragment),Hc=d(),Fr=r("span"),Bc=s("Loading pipelines that require access request"),Xl=d(),Te=r("p"),Rc=s("Due to the capabilities of diffusion models to generate extremely realistic images, there is a certain danger that such models might be misused for unwanted applications, "),Xr=r("em"),Gc=s("e.g."),Kc=s(` generating pornography or violent images.
In order to minimize the possibility of such unsolicited use cases, some of the most powerful diffusion models require users to acknowledge a license before being able to use the model. If the user does not agree to the license, the pipeline cannot be downloaded.
If you try to load `),bt=r("a"),zr=r("code"),Jc=s("runwayml/stable-diffusion-v1-5"),Qc=s(" the same way as done previously:"),zl=d(),v(wt.$$.fragment),Nl=d(),Ie=r("p"),Zc=s("it will only work if you have both "),Nr=r("em"),ep=s("click-accepted"),op=s(" the license on "),yt=r("a"),tp=s("the model card"),sp=s(` and are logged into the Hugging Face Hub. Otherwise you will get an error message
such as the following:`),Ul=d(),v(Et.$$.fragment),Vl=d(),Se=r("p"),ip=s("Therefore, we need to make sure to "),Ur=r("em"),rp=s("click-accept"),np=s(` the license. You can do this by simply visiting
the `),Dt=r("a"),ap=s("model card"),lp=s(" and clicking on \u201CAgree and access repository\u201D:"),Yl=d(),xe=r("p"),dp=r("br"),fp=d(),si=r("img"),cp=d(),pp=r("br"),Wl=d(),ii=r("p"),up=s("Second, you need to login with your access token:"),Hl=d(),v($t.$$.fragment),Bl=d(),oe=r("p"),hp=s("before trying to load the model. Or alternatively, you can pass "),xt=r("a"),mp=s("your access token"),gp=s(" directly via the flag "),Vr=r("code"),_p=s("use_auth_token"),vp=s(". In this case you do "),Yr=r("strong"),bp=s("not"),wp=s(` need
to run `),Wr=r("code"),yp=s("huggingface-cli login"),Ep=s(" before:"),Rl=d(),v(Pt.$$.fragment),Gl=d(),ri=r("p"),Dp=s("The final option to use pipelines that require access without having to rely on the Hugging Face Hub is to load the pipeline locally as explained in the next section."),Kl=d(),ao=r("h3"),xo=r("a"),Hr=r("span"),v(kt.$$.fragment),$p=d(),Br=r("span"),xp=s("Loading pipelines locally"),Jl=d(),ni=r("p"),Pp=s(`If you prefer to have complete control over the pipeline and its corresponding files or, as said before, if you want to use pipelines that require an access request without having to be connected to the Hugging Face Hub,
we recommend loading pipelines locally.`),Ql=d(),Ae=r("p"),kp=s("To load a diffusion pipeline locally, you first need to manually download the whole folder structure on your local disk and then pass a local path to the "),ai=r("a"),Mp=s("DiffusionPipeline.from_pretrained()"),jp=s(`. Let\u2019s again look at an example for
`),Mt=r("a"),qp=s("CompVis\u2019 Latent Diffusion model"),Tp=s("."),Zl=d(),Le=r("p"),Ip=s("First, you should make use of "),jt=r("a"),Rr=r("code"),Sp=s("git-lfs"),Ap=s(" to download the whole folder structure that has been uploaded to the "),qt=r("a"),Lp=s("model repository"),Cp=s(":"),ed=d(),v(Tt.$$.fragment),od=d(),Ce=r("p"),Op=s("The command above will create a local folder called "),Gr=r("code"),Fp=s("./stable-diffusion-v1-5"),Xp=s(` on your disk.
Now, all you have to do is to simply pass the local folder path to `),Kr=r("code"),zp=s("from_pretrained"),Np=s(":"),td=d(),v(It.$$.fragment),sd=d(),Oe=r("p"),Up=s("If "),Jr=r("code"),Vp=s("repo_id"),Yp=s(" is a local path, as it is the case here, "),li=r("a"),Wp=s("DiffusionPipeline.from_pretrained()"),Hp=s(` will automatically detect it and therefore not try to download any files from the Hub.
While we usually recommend to load weights directly from the Hub to be certain to stay up to date with the newest changes, loading pipelines locally should be preferred if one
wants to stay anonymous, self-contained applications, etc\u2026`),id=d(),lo=r("h3"),Po=r("a"),Qr=r("span"),v(St.$$.fragment),Bp=d(),Zr=r("span"),Rp=s("Loading customized pipelines"),rd=d(),te=r("p"),Gp=s("Advanced users that want to load customized versions of diffusion pipelines can do so by swapping any of the default components, "),en=r("em"),Kp=s("e.g."),Jp=s(` the scheduler, with other scheduler classes.
A classical use case of this functionality is to swap the scheduler. `),At=r("a"),Qp=s("Stable Diffusion v1-5"),Zp=s(" uses the "),di=r("a"),eu=s("PNDMScheduler"),ou=s(` by default which is generally not the most performant scheduler. Since the release
of stable diffusion, multiple improved schedulers have been published. To use those, the user has to manually load their preferred scheduler and pass it into `),fi=r("a"),tu=s("DiffusionPipeline.from_pretrained()"),su=s("."),nd=d(),Pe=r("p"),on=r("em"),iu=s("E.g."),ru=s(" to use "),ci=r("a"),nu=s("EulerDiscreteScheduler"),au=s(" or "),pi=r("a"),lu=s("DPMSolverMultistepScheduler"),du=s(" to have a better quality vs. generation speed trade-off for inference, one could load them as follows:"),ad=d(),v(Lt.$$.fragment),ld=d(),ui=r("p"),fu=s("Three things are worth paying attention to here."),dd=d(),Fe=r("ul"),Ct=r("li"),cu=s("First, the scheduler is loaded with "),hi=r("a"),pu=s("ConfigMixin.from_config()"),uu=s(" since it only depends on a configuration file and not any parameterized weights"),hu=d(),ko=r("li"),mu=s("Second, the scheduler is loaded with a function argument, called "),tn=r("code"),gu=s('subfolder="scheduler"'),_u=s(" as the configuration of stable diffusion\u2019s scheduling is defined in a "),Ot=r("a"),vu=s("subfolder of the official pipeline repository"),bu=d(),U=r("li"),wu=s("Third, the scheduler instance can simply be passed with the "),sn=r("code"),yu=s("scheduler"),Eu=s(" keyword argument to "),mi=r("a"),Du=s("DiffusionPipeline.from_pretrained()"),$u=s(". This works because the "),gi=r("a"),xu=s("StableDiffusionPipeline"),Pu=s(" defines its scheduler with the "),rn=r("code"),ku=s("scheduler"),Mu=s(" attribute. It\u2019s not possible to use a different name, such as "),nn=r("code"),ju=s("sampler=scheduler"),qu=s(" since "),an=r("code"),Tu=s("sampler"),Iu=s(" is not a defined keyword for "),ln=r("code"),Su=s("StableDiffusionPipeline.__init__()"),fd=d(),ge=r("p"),Au=s("Not only the scheduler components can be customized for diffusion pipelines; in theory, all components of a pipeline can be customized. In practice, however, it often only makes sense to switch out a component that has "),dn=r("strong"),Lu=s("compatible"),Cu=s(` alternatives to what the pipeline expects.
Many scheduler classes are compatible with each other as can be seen `),Ft=r("a"),Ou=s("here"),Fu=s(". This is not always the case for other components, such as the "),fn=r("code"),Xu=s('"unet"'),zu=s("."),cd=d(),Xe=r("p"),Nu=s("One special case that can also be customized is the "),cn=r("code"),Uu=s('"safety_checker"'),Vu=s(" of stable diffusion. If you believe the safety checker doesn\u2019t serve you any good, you can simply disable it by passing "),pn=r("code"),Yu=s("None"),Wu=s(":"),pd=d(),v(Xt.$$.fragment),ud=d(),se=r("p"),Hu=s("Another common use case is to reuse the same components in multiple pipelines, "),un=r("em"),Bu=s("e.g."),Ru=s(" the weights and configurations of "),zt=r("a"),hn=r("code"),Gu=s('"runwayml/stable-diffusion-v1-5"'),Ku=s(" can be used for both "),_i=r("a"),Ju=s("StableDiffusionPipeline"),Qu=s(" and "),vi=r("a"),Zu=s("StableDiffusionImg2ImgPipeline"),eh=s(` and we might not want to
use the exact same weights into RAM twice. In this case, customizing all the input instances would help us
to only load the weights into RAM once:`),hd=d(),v(Nt.$$.fragment),md=d(),Mo=r("p"),oh=s("Note how the above code snippet makes use of "),bi=r("a"),th=s("DiffusionPipeline.components"),sh=s("."),gd=d(),fo=r("h3"),jo=r("a"),mn=r("span"),v(Ut.$$.fragment),ih=d(),gn=r("span"),rh=s("How does loading work?"),_d=d(),qo=r("p"),nh=s("As a class method, "),wi=r("a"),ah=s("DiffusionPipeline.from_pretrained()"),lh=s(" is responsible for two things:"),vd=d(),To=r("ul"),pe=r("li"),dh=s("Download the latest version of the folder structure required to run the "),_n=r("code"),fh=s("repo_id"),ch=s(" with "),vn=r("code"),ph=s("diffusers"),uh=s(" and cache them. If the latest folder structure is available in the local cache, "),yi=r("a"),hh=s("DiffusionPipeline.from_pretrained()"),mh=s(" will simply reuse the cache and "),bn=r("strong"),gh=s("not"),_h=s(" re-download the files."),vh=d(),ue=r("li"),bh=s("Load the cached weights into the "),wn=r("em"),wh=s("correct"),yh=s(" pipeline class \u2013 one of the "),Ei=r("a"),Eh=s("officially supported pipeline classes"),Dh=s(" - and return an instance of the class. The "),yn=r("em"),$h=s("correct"),xh=s(" pipeline class is thereby retrieved from the "),En=r("code"),Ph=s("model_index.json"),kh=s(" file."),bd=d(),ie=r("p"),Mh=s("The underlying folder structure of diffusion pipelines correspond 1-to-1 to their corresponding class instances, "),Dn=r("em"),jh=s("e.g."),qh=d(),Di=r("a"),Th=s("LDMTextToImagePipeline"),Ih=s(" for "),Vt=r("a"),$n=r("code"),Sh=s("CompVis/ldm-text2im-large-256"),Ah=s(`
This can be understood better by looking at an example. Let\u2019s print out pipeline class instance `),xn=r("code"),Lh=s("pipeline"),Ch=s(" we just defined:"),wd=d(),v(Yt.$$.fragment),yd=d(),Wt=r("p"),Pn=r("em"),Oh=s("Output"),Fh=s(":"),Ed=d(),v(Ht.$$.fragment),Dd=d(),ze=r("p"),Xh=s("First, we see that the official pipeline is the "),$i=r("a"),zh=s("LDMTextToImagePipeline"),Nh=s(", and second we see that the "),kn=r("code"),Uh=s("LDMTextToImagePipeline"),Vh=s(" consists of 5 components:"),$d=d(),re=r("ul"),co=r("li"),Mn=r("code"),Yh=s('"bert"'),Wh=s(" of class "),jn=r("code"),Hh=s("LDMBertModel"),Bh=s(" as defined "),Bt=r("a"),Rh=s("in the pipeline"),Gh=d(),Rt=r("li"),qn=r("code"),Kh=s('"scheduler"'),Jh=s(" of class "),xi=r("a"),Qh=s("DDIMScheduler"),Zh=d(),po=r("li"),Tn=r("code"),em=s('"tokenizer"'),om=s(" of class "),In=r("code"),tm=s("BertTokenizer"),sm=s(" as defined "),Io=r("a"),im=s("in "),Sn=r("code"),rm=s("transformers"),nm=d(),Gt=r("li"),An=r("code"),am=s('"unet"'),lm=s(" of class "),Pi=r("a"),dm=s("UNet2DConditionModel"),fm=d(),Kt=r("li"),Ln=r("code"),cm=s('"vqvae"'),pm=s(" of class "),ki=r("a"),um=s("AutoencoderKL"),xd=d(),_e=r("p"),hm=s("Let\u2019s now compare the pipeline instance to the folder structure of the model repository "),Cn=r("code"),mm=s("CompVis/ldm-text2im-large-256"),gm=s(". Looking at the folder structure of "),Jt=r("a"),On=r("code"),_m=s("CompVis/ldm-text2im-large-256"),vm=s(" on the Hub, we can see it matches 1-to-1 the printed out instance of "),Fn=r("code"),bm=s("LDMTextToImagePipeline"),wm=s(" above:"),Pd=d(),v(Qt.$$.fragment),kd=d(),M=r("p"),ym=s("As we can see each attribute of the instance of "),Xn=r("code"),Em=s("LDMTextToImagePipeline"),Dm=s(" has its configuration and possibly weights defined in a subfolder that is called "),zn=r("strong"),$m=s("exactly"),xm=s(" like the class attribute ("),Nn=r("code"),Pm=s('"bert"'),km=s(", "),Un=r("code"),Mm=s('"scheduler"'),jm=s(", "),Vn=r("code"),qm=s('"tokenizer"'),Tm=s(", "),Yn=r("code"),Im=s('"unet"'),Sm=s(", "),Wn=r("code"),Am=s('"vqvae"'),Lm=s("). Importantly, every pipeline expects a "),Hn=r("code"),Cm=s("model_index.json"),Om=s(" file that tells the "),Bn=r("code"),Fm=s("DiffusionPipeline"),Xm=s(" both:"),Md=d(),So=r("ul"),Rn=r("li"),zm=s("which pipeline class should be loaded, and"),Nm=d(),Gn=r("li"),Um=s("what sub-classes from which library are stored in which subfolders"),jd=d(),Ne=r("p"),Vm=s("In the case of "),Kn=r("code"),Ym=s("CompVis/ldm-text2im-large-256"),Wm=s(" the "),Jn=r("code"),Hm=s("model_index.json"),Bm=s(" is therefore defined as follows:"),qd=d(),v(Zt.$$.fragment),Td=d(),Ue=r("ul"),Ao=r("li"),Qn=r("code"),Rm=s("_class_name"),Gm=s(" tells "),Zn=r("code"),Km=s("DiffusionPipeline"),Jm=s(" which pipeline class should be loaded."),Qm=d(),Lo=r("li"),ea=r("code"),Zm=s("_diffusers_version"),eg=s(" can be useful to know under which "),oa=r("code"),og=s("diffusers"),tg=s(" version this model was created."),sg=d(),ta=r("li"),ig=s("Every component of the pipeline is then defined under the form:"),Id=d(),v(es.$$.fragment),Sd=d(),Ve=r("ul"),Ye=r("li"),rg=s("The "),sa=r("code"),ng=s('"name"'),ag=s(" field corresponds both to the name of the subfolder in which the configuration and weights are stored as well as the attribute name of the pipeline class (as can be seen "),os=r("a"),lg=s("here"),dg=s(" and "),ts=r("a"),fg=s("here"),cg=d(),Q=r("li"),pg=s("The "),ia=r("code"),ug=s('"library"'),hg=s(" field corresponds to the name of the library, "),ra=r("em"),mg=s("e.g."),gg=d(),na=r("code"),_g=s("diffusers"),vg=s(" or "),aa=r("code"),bg=s("transformers"),wg=s(" from which the "),la=r("code"),yg=s('"class"'),Eg=s(" should be loaded"),Dg=d(),ve=r("li"),$g=s("The "),da=r("code"),xg=s('"class"'),Pg=s(" field corresponds to the name of the class, "),fa=r("em"),kg=s("e.g."),Mg=d(),ss=r("a"),ca=r("code"),jg=s("BertTokenizer"),qg=s(" or "),Mi=r("a"),Tg=s("UNet2DConditionModel"),Ad=d(),uo=r("h2"),Co=r("a"),pa=r("span"),v(is.$$.fragment),Ig=d(),ua=r("span"),Sg=s("Loading models"),Ld=d(),be=r("p"),Ag=s("Models as defined under "),rs=r("a"),Lg=s("src/diffusers/models"),Cg=s(" can be loaded via the "),ji=r("a"),Og=s("ModelMixin.from_pretrained()"),Fg=s(" function. The API is very similar the "),qi=r("a"),Xg=s("DiffusionPipeline.from_pretrained()"),zg=s(" and works in the same way:"),Cd=d(),Oo=r("ul"),ke=r("li"),Ng=s("Download the latest version of the model weights and configuration with "),ha=r("code"),Ug=s("diffusers"),Vg=s(" and cache them. If the latest files are available in the local cache, "),Ti=r("a"),Yg=s("ModelMixin.from_pretrained()"),Wg=s(" will simply reuse the cache and "),ma=r("strong"),Hg=s("not"),Bg=s(" re-download the files."),Rg=d(),ho=r("li"),Gg=s("Load the cached weights into the "),ga=r("em"),Kg=s("defined"),Jg=s(" model class - one of "),Ii=r("a"),Qg=s("the existing model classes"),Zg=s(" - and return an instance of the class."),Od=d(),we=r("p"),e_=s("In constrast to "),Si=r("a"),o_=s("DiffusionPipeline.from_pretrained()"),t_=s(", models rely on fewer files that usually don\u2019t require a folder structure, but just a "),_a=r("code"),s_=s("diffusion_pytorch_model.bin"),i_=s(" and "),va=r("code"),r_=s("config.json"),n_=s(" file."),Fd=d(),Ai=r("p"),a_=s("Let\u2019s look at an example:"),Xd=d(),v(ns.$$.fragment),zd=d(),ye=r("p"),l_=s("Note how we have to define the "),ba=r("code"),d_=s('subfolder="unet"'),f_=s(" argument to tell "),Li=r("a"),c_=s("ModelMixin.from_pretrained()"),p_=s(" that the model weights are located in a "),as=r("a"),u_=s("subfolder of the repository"),h_=s("."),Nd=d(),We=r("p"),m_=s("As explained in "),Ci=r("a"),g_=s("Loading customized pipelines"),__=s(", one can pass a loaded model to a diffusion pipeline, via "),Oi=r("a"),v_=s("DiffusionPipeline.from_pretrained()"),b_=s(":"),Ud=d(),v(ls.$$.fragment),Vd=d(),He=r("p"),w_=s("If the model files can be found directly at the root level, which is usually only the case for some very simple diffusion models, such as "),ds=r("a"),wa=r("code"),y_=s("google/ddpm-cifar10-32"),E_=s(`, we don\u2019t
need to pass a `),ya=r("code"),D_=s("subfolder"),$_=s(" argument:"),Yd=d(),v(fs.$$.fragment),Wd=d(),mo=r("h2"),Fo=r("a"),Ea=r("span"),v(cs.$$.fragment),x_=d(),Da=r("span"),P_=s("Loading schedulers"),Hd=d(),ne=r("p"),k_=s("Schedulers cannot be loaded via a "),$a=r("code"),M_=s("from_pretrained"),j_=s(" method, but instead rely on "),Fi=r("a"),q_=s("ConfigMixin.from_config()"),T_=s(". Schedulers are "),xa=r("strong"),I_=s("not parameterized"),S_=s(" or "),Pa=r("strong"),A_=s("trained"),L_=s(`, but instead purely defined by a configuration file.
Therefore the loading method was given a different name here.`),Bd=d(),Xi=r("p"),C_=s(`In constrast to pipelines or models, loading schedulers does not consume any significant amount of memory and the same configuration file can often be used for a variety of different schedulers.
For example, all of:`),Rd=d(),V=r("ul"),ka=r("li"),zi=r("a"),O_=s("DDPMScheduler"),F_=d(),Ma=r("li"),Ni=r("a"),X_=s("DDIMScheduler"),z_=d(),ja=r("li"),Ui=r("a"),N_=s("PNDMScheduler"),U_=d(),qa=r("li"),Vi=r("a"),V_=s("LMSDiscreteScheduler"),Y_=d(),Ta=r("li"),Yi=r("a"),W_=s("EulerDiscreteScheduler"),H_=d(),Ia=r("li"),Wi=r("a"),B_=s("EulerAncestralDiscreteScheduler"),R_=d(),Sa=r("li"),Hi=r("a"),G_=s("DPMSolverMultistepScheduler"),Gd=d(),Xo=r("p"),K_=s("are compatible with "),Bi=r("a"),J_=s("StableDiffusionPipeline"),Q_=s(" and therefore the same scheduler configuration file can be loaded in any of those classes:"),Kd=d(),v(ps.$$.fragment),Jd=d(),go=r("h2"),zo=r("a"),Aa=r("span"),v(us.$$.fragment),Z_=d(),La=r("span"),ev=s("API"),Qd=d(),H=r("div"),v(hs.$$.fragment),ov=d(),Ca=r("p"),tv=s("Base class for all models."),sv=d(),Ri=r("p"),Gi=r("a"),iv=s("ModelMixin"),rv=s(` takes care of storing the configuration of the models and handles methods for loading, downloading
and saving models.`),nv=d(),Oa=r("ul"),Be=r("li"),Fa=r("strong"),av=s("config_name"),lv=s(" ("),Xa=r("code"),dv=s("str"),fv=s(`) \u2014 A filename under which the model should be stored when calling
`),Ki=r("a"),cv=s("save_pretrained()"),pv=s("."),uv=d(),Y=r("div"),v(ms.$$.fragment),hv=d(),za=r("p"),mv=s("Instantiate a pretrained pytorch model from a pre-trained model configuration."),gv=d(),_o=r("p"),_v=s("The model is set in evaluation mode by default using "),Na=r("code"),vv=s("model.eval()"),bv=s(` (Dropout modules are deactivated). To train
the model, you should first set it back in training mode with `),Ua=r("code"),wv=s("model.train()"),yv=s("."),Ev=d(),gs=r("p"),Dv=s("The warning "),Va=r("em"),$v=s("Weights from XXX not initialized from pretrained model"),xv=s(` means that the weights of XXX do not come
pretrained with the rest of the model. It is up to you to train those weights with a downstream fine-tuning
task.`),Pv=d(),_s=r("p"),kv=s("The warning "),Ya=r("em"),Mv=s("Weights from XXX not used in YYY"),jv=s(` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),qv=d(),v(No.$$.fragment),Tv=d(),v(Uo.$$.fragment),Iv=d(),Vo=r("div"),v(vs.$$.fragment),Sv=d(),bs=r("p"),Av=s(`Save a model and its configuration file to a directory, so that it can be re-loaded using the
`),Wa=r("code"),Lv=s("[from_pretrained()](/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.ModelMixin.from_pretrained)"),Cv=s(" class method."),Zd=d(),S=r("div"),v(ws.$$.fragment),Ov=d(),Ha=r("p"),Fv=s("Base class for all models."),Xv=d(),Ji=r("p"),Qi=r("a"),zv=s("DiffusionPipeline"),Nv=s(` takes care of storing all components (models, schedulers, processors) for diffusion pipelines
and handles methods for loading, downloading and saving models as well as a few methods common to all pipelines to:`),Uv=d(),ys=r("ul"),Ba=r("li"),Vv=s("move all PyTorch modules to the device of your choice"),Yv=d(),Ra=r("li"),Wv=s("enabling/disabling the progress bar for the denoising iteration"),Hv=d(),Ga=r("p"),Bv=s("Class attributes:"),Rv=d(),Ka=r("ul"),Yo=r("li"),Ja=r("strong"),Gv=s("config_name"),Kv=s(" ("),Qa=r("code"),Jv=s("str"),Qv=s(`) \u2014 name of the config file that will store the class and module names of all
components of the diffusion pipeline.`),Zv=d(),C=r("div"),v(Es.$$.fragment),e1=d(),Za=r("p"),o1=s("Instantiate a PyTorch diffusion pipeline from pre-trained pipeline weights."),t1=d(),Ds=r("p"),s1=s("The pipeline is set in evaluation mode by default using "),el=r("code"),i1=s("model.eval()"),r1=s(" (Dropout modules are deactivated)."),n1=d(),$s=r("p"),a1=s("The warning "),ol=r("em"),l1=s("Weights from XXX not initialized from pretrained model"),d1=s(` means that the weights of XXX do not come
pretrained with the rest of the model. It is up to you to train those weights with a downstream fine-tuning
task.`),f1=d(),xs=r("p"),c1=s("The warning "),tl=r("em"),p1=s("Weights from XXX not used in YYY"),u1=s(` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),h1=d(),v(Wo.$$.fragment),m1=d(),v(Ho.$$.fragment),g1=d(),v(Bo.$$.fragment),_1=d(),Ro=r("div"),v(Ps.$$.fragment),v1=d(),ks=r("p"),b1=s(`Save all variables of the pipeline that can be saved and loaded as well as the pipelines configuration file to
a directory. A pipeline variable can be saved and loaded if its class implements both a save and loading
method. The pipeline can easily be re-loaded using the `),sl=r("code"),w1=s("[from_pretrained()](/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline.from_pretrained)"),y1=s(" class method."),ef=d(),Z=r("div"),v(Ms.$$.fragment),E1=d(),il=r("p"),D1=s("Base class for all flax models."),$1=d(),Zi=r("p"),er=r("a"),x1=s("FlaxModelMixin"),P1=s(` takes care of storing the configuration of the models and handles methods for loading,
downloading and saving models.`),k1=d(),ae=r("div"),v(js.$$.fragment),M1=d(),rl=r("p"),j1=s("Instantiate a pretrained flax model from a pre-trained model configuration."),q1=d(),qs=r("p"),T1=s("The warning "),nl=r("em"),I1=s("Weights from XXX not initialized from pretrained model"),S1=s(` means that the weights of XXX do not come
pretrained with the rest of the model. It is up to you to train those weights with a downstream fine-tuning
task.`),A1=d(),Ts=r("p"),L1=s("The warning "),al=r("em"),C1=s("Weights from XXX not used in YYY"),O1=s(` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),F1=d(),v(Go.$$.fragment),X1=d(),Ko=r("div"),v(Is.$$.fragment),z1=d(),Ss=r("p"),N1=s(`Save a model and its configuration file to a directory, so that it can be re-loaded using the
`),ll=r("code"),U1=s("[from_pretrained()](/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.FlaxModelMixin.from_pretrained)"),V1=s(" class method"),of=d(),A=r("div"),v(As.$$.fragment),Y1=d(),dl=r("p"),W1=s("Base class for all models."),H1=d(),or=r("p"),tr=r("a"),B1=s("FlaxDiffusionPipeline"),R1=s(` takes care of storing all components (models, schedulers, processors) for diffusion
pipelines and handles methods for loading, downloading and saving models as well as a few methods common to all
pipelines to:`),G1=d(),fl=r("ul"),cl=r("li"),K1=s("enabling/disabling the progress bar for the denoising iteration"),J1=d(),pl=r("p"),Q1=s("Class attributes:"),Z1=d(),ul=r("ul"),Jo=r("li"),hl=r("strong"),eb=s("config_name"),ob=s(" ("),ml=r("code"),tb=s("str"),sb=s(`) \u2014 name of the config file that will store the class and module names of all
components of the diffusion pipeline.`),ib=d(),O=r("div"),v(Ls.$$.fragment),rb=d(),gl=r("p"),nb=s("Instantiate a Flax diffusion pipeline from pre-trained pipeline weights."),ab=d(),Cs=r("p"),lb=s("The pipeline is set in evaluation mode by default using "),_l=r("code"),db=s("model.eval()"),fb=s(" (Dropout modules are deactivated)."),cb=d(),Os=r("p"),pb=s("The warning "),vl=r("em"),ub=s("Weights from XXX not initialized from pretrained model"),hb=s(` means that the weights of XXX do not come
pretrained with the rest of the model. It is up to you to train those weights with a downstream fine-tuning
task.`),mb=d(),Fs=r("p"),gb=s("The warning "),bl=r("em"),_b=s("Weights from XXX not used in YYY"),vb=s(` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),bb=d(),v(Qo.$$.fragment),wb=d(),v(Zo.$$.fragment),yb=d(),v(et.$$.fragment),Eb=d(),ot=r("div"),v(Xs.$$.fragment),Db=d(),zs=r("p"),$b=s(`Save all variables of the pipeline that can be saved and loaded as well as the pipelines configuration file to
a directory. A pipeline variable can be saved and loaded if its class implements both a save and loading
method. The pipeline can easily be re-loaded using the `),wl=r("code"),xb=s("[from_pretrained()](/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.FlaxDiffusionPipeline.from_pretrained)"),Pb=s(` class
method.`),this.h()},l(o){const l=_5('[data-svelte="svelte-1phssyn"]',document.head);h=n(l,"META",{name:!0,content:!0}),l.forEach(t),x=f(o),m=n(o,"H1",{class:!0});var Ns=a(m);_=n(Ns,"A",{id:!0,class:!0,href:!0});var yl=a(_);$=n(yl,"SPAN",{});var El=a($);b(u.$$.fragment,El),El.forEach(t),yl.forEach(t),g=f(Ns),k=n(Ns,"SPAN",{});var Dl=a(k);T=i(Dl,"Loading"),Dl.forEach(t),Ns.forEach(t),I=f(o),X=n(o,"P",{});var Us=a(X);z=i(Us,"A core premise of the diffusers library is to make diffusion models "),ce=n(Us,"STRONG",{});var $l=a(ce);J=i($l,"as accessible as possible"),$l.forEach(t),P=i(Us,`.
Accessibility is therefore achieved by providing an API to load complete diffusion pipelines as well as individual components with a single line of code.`),Us.forEach(t),Me=f(o),he=n(o,"P",{});var xl=a(he);io=i(xl,"In the following we explain in-detail how to easily load:"),xl.forEach(t),je=f(o),qe=n(o,"UL",{});var vo=a(qe);dt=n(vo,"LI",{});var Vs=a(dt);$r=n(Vs,"EM",{});var Cb=a($r);Wf=i(Cb,"Complete Diffusion Pipelines"),Cb.forEach(t),Hf=i(Vs," via the "),Bs=n(Vs,"A",{href:!0});var Ob=a(Bs);Bf=i(Ob,"DiffusionPipeline.from_pretrained()"),Ob.forEach(t),Vs.forEach(t),Rf=f(vo),ft=n(vo,"LI",{});var sf=a(ft);xr=n(sf,"EM",{});var Fb=a(xr);Gf=i(Fb,"Diffusion Models"),Fb.forEach(t),Kf=i(sf," via "),Rs=n(sf,"A",{href:!0});var Xb=a(Rs);Jf=i(Xb,"ModelMixin.from_pretrained()"),Xb.forEach(t),sf.forEach(t),Qf=f(vo),ct=n(vo,"LI",{});var rf=a(ct);Pr=n(rf,"EM",{});var zb=a(Pr);Zf=i(zb,"Schedulers"),zb.forEach(t),ec=i(rf," via "),Gs=n(rf,"A",{href:!0});var Nb=a(Gs);oc=i(Nb,"ConfigMixin.from_config()"),Nb.forEach(t),rf.forEach(t),vo.forEach(t),Tl=f(o),ro=n(o,"H2",{class:!0});var nf=a(ro);yo=n(nf,"A",{id:!0,class:!0,href:!0});var Ub=a(yo);kr=n(Ub,"SPAN",{});var Vb=a(kr);b(pt.$$.fragment,Vb),Vb.forEach(t),Ub.forEach(t),tc=f(nf),Mr=n(nf,"SPAN",{});var Yb=a(Mr);sc=i(Yb,"Loading pipelines"),Yb.forEach(t),nf.forEach(t),Il=f(o),me=n(o,"P",{});var tt=a(me);ic=i(tt,"The "),Ks=n(tt,"A",{href:!0});var Wb=a(Ks);rc=i(Wb,"DiffusionPipeline"),Wb.forEach(t),nc=i(tt," class is the easiest way to access any diffusion model that is "),ut=n(tt,"A",{href:!0,rel:!0});var Hb=a(ut);ac=i(Hb,"available on the Hub"),Hb.forEach(t),lc=i(tt,". Let\u2019s look at an example on how to download "),ht=n(tt,"A",{href:!0,rel:!0});var Bb=a(ht);dc=i(Bb,"CompVis\u2019 Latent Diffusion model"),Bb.forEach(t),fc=i(tt,"."),tt.forEach(t),Sl=f(o),b(mt.$$.fragment,o),Al=f(o),N=n(o,"P",{});var le=a(N);cc=i(le,"Here "),Js=n(le,"A",{href:!0});var Rb=a(Js);pc=i(Rb,"DiffusionPipeline"),Rb.forEach(t),uc=i(le," automatically detects the correct pipeline ("),jr=n(le,"EM",{});var Gb=a(jr);hc=i(Gb,"i.e."),Gb.forEach(t),mc=f(le),Qs=n(le,"A",{href:!0});var Kb=a(Qs);gc=i(Kb,"LDMTextToImagePipeline"),Kb.forEach(t),_c=i(le,"), downloads and caches all required configuration and weight files (if not already done so), and finally returns a pipeline instance, called "),qr=n(le,"CODE",{});var Jb=a(qr);vc=i(Jb,"ldm"),Jb.forEach(t),bc=i(le,`.
The pipeline instance can then be called using `),Eo=n(le,"A",{href:!0});var af=a(Eo);wc=i(af,"LDMTextToImagePipeline."),Tr=n(af,"STRONG",{});var Qb=a(Tr);yc=i(Qb,"call"),Qb.forEach(t),Ec=i(af,"()"),af.forEach(t),Dc=i(le," (i.e., "),Ir=n(le,"CODE",{});var Zb=a(Ir);$c=i(Zb,'ldm("image of a astronaut riding a horse")'),Zb.forEach(t),xc=i(le,") for text-to-image generation."),le.forEach(t),Ll=f(o),Do=n(o,"P",{});var lf=a(Do);Pc=i(lf,"Instead of using the generic "),Zs=n(lf,"A",{href:!0});var ew=a(Zs);kc=i(ew,"DiffusionPipeline"),ew.forEach(t),Mc=i(lf," class for loading, you can also load the appropriate pipeline class directly. The code snippet above yields the same instance as when doing:"),lf.forEach(t),Cl=f(o),b(gt.$$.fragment,o),Ol=f(o),q=n(o,"P",{});var W=a(q);jc=i(W,"Diffusion pipelines like "),Sr=n(W,"CODE",{});var ow=a(Sr);qc=i(ow,"LDMTextToImagePipeline"),ow.forEach(t),Tc=i(W," often consist of multiple components. These components can be both parameterized models, such as "),Ar=n(W,"CODE",{});var tw=a(Ar);Ic=i(tw,'"unet"'),tw.forEach(t),Sc=i(W,", "),Lr=n(W,"CODE",{});var sw=a(Lr);Ac=i(sw,'"vqvae"'),sw.forEach(t),Lc=i(W," and \u201Cbert\u201D, tokenizers or schedulers. These components can interact in complex ways with each other when using the pipeline in inference, "),Cr=n(W,"EM",{});var iw=a(Cr);Cc=i(iw,"e.g."),iw.forEach(t),Oc=i(W," for "),ei=n(W,"A",{href:!0});var rw=a(ei);Fc=i(rw,"LDMTextToImagePipeline"),rw.forEach(t),Xc=i(W," or "),oi=n(W,"A",{href:!0});var nw=a(oi);zc=i(nw,"StableDiffusionPipeline"),nw.forEach(t),Nc=i(W," the inference call is explained "),_t=n(W,"A",{href:!0,rel:!0});var aw=a(_t);Uc=i(aw,"here"),aw.forEach(t),Vc=i(W,`.
The purpose of the `),ti=n(W,"A",{href:!0});var lw=a(ti);Yc=i(lw,"pipeline classes"),lw.forEach(t),Wc=i(W," is to wrap the complexity of these diffusion systems and give the user an easy-to-use API while staying flexible for customization, as will be shown later."),W.forEach(t),Fl=f(o),no=n(o,"H3",{class:!0});var df=a(no);$o=n(df,"A",{id:!0,class:!0,href:!0});var dw=a($o);Or=n(dw,"SPAN",{});var fw=a(Or);b(vt.$$.fragment,fw),fw.forEach(t),dw.forEach(t),Hc=f(df),Fr=n(df,"SPAN",{});var cw=a(Fr);Bc=i(cw,"Loading pipelines that require access request"),cw.forEach(t),df.forEach(t),Xl=f(o),Te=n(o,"P",{});var sr=a(Te);Rc=i(sr,"Due to the capabilities of diffusion models to generate extremely realistic images, there is a certain danger that such models might be misused for unwanted applications, "),Xr=n(sr,"EM",{});var pw=a(Xr);Gc=i(pw,"e.g."),pw.forEach(t),Kc=i(sr,` generating pornography or violent images.
In order to minimize the possibility of such unsolicited use cases, some of the most powerful diffusion models require users to acknowledge a license before being able to use the model. If the user does not agree to the license, the pipeline cannot be downloaded.
If you try to load `),bt=n(sr,"A",{href:!0,rel:!0});var uw=a(bt);zr=n(uw,"CODE",{});var hw=a(zr);Jc=i(hw,"runwayml/stable-diffusion-v1-5"),hw.forEach(t),uw.forEach(t),Qc=i(sr," the same way as done previously:"),sr.forEach(t),zl=f(o),b(wt.$$.fragment,o),Nl=f(o),Ie=n(o,"P",{});var ir=a(Ie);Zc=i(ir,"it will only work if you have both "),Nr=n(ir,"EM",{});var mw=a(Nr);ep=i(mw,"click-accepted"),mw.forEach(t),op=i(ir," the license on "),yt=n(ir,"A",{href:!0,rel:!0});var gw=a(yt);tp=i(gw,"the model card"),gw.forEach(t),sp=i(ir,` and are logged into the Hugging Face Hub. Otherwise you will get an error message
such as the following:`),ir.forEach(t),Ul=f(o),b(Et.$$.fragment,o),Vl=f(o),Se=n(o,"P",{});var rr=a(Se);ip=i(rr,"Therefore, we need to make sure to "),Ur=n(rr,"EM",{});var _w=a(Ur);rp=i(_w,"click-accept"),_w.forEach(t),np=i(rr,` the license. You can do this by simply visiting
the `),Dt=n(rr,"A",{href:!0,rel:!0});var vw=a(Dt);ap=i(vw,"model card"),vw.forEach(t),lp=i(rr," and clicking on \u201CAgree and access repository\u201D:"),rr.forEach(t),Yl=f(o),xe=n(o,"P",{align:!0});var nr=a(xe);dp=n(nr,"BR",{}),fp=f(nr),si=n(nr,"IMG",{src:!0,width:!0}),cp=f(nr),pp=n(nr,"BR",{}),nr.forEach(t),Wl=f(o),ii=n(o,"P",{});var bw=a(ii);up=i(bw,"Second, you need to login with your access token:"),bw.forEach(t),Hl=f(o),b($t.$$.fragment,o),Bl=f(o),oe=n(o,"P",{});var Re=a(oe);hp=i(Re,"before trying to load the model. Or alternatively, you can pass "),xt=n(Re,"A",{href:!0,rel:!0});var ww=a(xt);mp=i(ww,"your access token"),ww.forEach(t),gp=i(Re," directly via the flag "),Vr=n(Re,"CODE",{});var yw=a(Vr);_p=i(yw,"use_auth_token"),yw.forEach(t),vp=i(Re,". In this case you do "),Yr=n(Re,"STRONG",{});var Ew=a(Yr);bp=i(Ew,"not"),Ew.forEach(t),wp=i(Re,` need
to run `),Wr=n(Re,"CODE",{});var Dw=a(Wr);yp=i(Dw,"huggingface-cli login"),Dw.forEach(t),Ep=i(Re," before:"),Re.forEach(t),Rl=f(o),b(Pt.$$.fragment,o),Gl=f(o),ri=n(o,"P",{});var $w=a(ri);Dp=i($w,"The final option to use pipelines that require access without having to rely on the Hugging Face Hub is to load the pipeline locally as explained in the next section."),$w.forEach(t),Kl=f(o),ao=n(o,"H3",{class:!0});var ff=a(ao);xo=n(ff,"A",{id:!0,class:!0,href:!0});var xw=a(xo);Hr=n(xw,"SPAN",{});var Pw=a(Hr);b(kt.$$.fragment,Pw),Pw.forEach(t),xw.forEach(t),$p=f(ff),Br=n(ff,"SPAN",{});var kw=a(Br);xp=i(kw,"Loading pipelines locally"),kw.forEach(t),ff.forEach(t),Jl=f(o),ni=n(o,"P",{});var Mw=a(ni);Pp=i(Mw,`If you prefer to have complete control over the pipeline and its corresponding files or, as said before, if you want to use pipelines that require an access request without having to be connected to the Hugging Face Hub,
we recommend loading pipelines locally.`),Mw.forEach(t),Ql=f(o),Ae=n(o,"P",{});var ar=a(Ae);kp=i(ar,"To load a diffusion pipeline locally, you first need to manually download the whole folder structure on your local disk and then pass a local path to the "),ai=n(ar,"A",{href:!0});var jw=a(ai);Mp=i(jw,"DiffusionPipeline.from_pretrained()"),jw.forEach(t),jp=i(ar,`. Let\u2019s again look at an example for
`),Mt=n(ar,"A",{href:!0,rel:!0});var qw=a(Mt);qp=i(qw,"CompVis\u2019 Latent Diffusion model"),qw.forEach(t),Tp=i(ar,"."),ar.forEach(t),Zl=f(o),Le=n(o,"P",{});var lr=a(Le);Ip=i(lr,"First, you should make use of "),jt=n(lr,"A",{href:!0,rel:!0});var Tw=a(jt);Rr=n(Tw,"CODE",{});var Iw=a(Rr);Sp=i(Iw,"git-lfs"),Iw.forEach(t),Tw.forEach(t),Ap=i(lr," to download the whole folder structure that has been uploaded to the "),qt=n(lr,"A",{href:!0,rel:!0});var Sw=a(qt);Lp=i(Sw,"model repository"),Sw.forEach(t),Cp=i(lr,":"),lr.forEach(t),ed=f(o),b(Tt.$$.fragment,o),od=f(o),Ce=n(o,"P",{});var dr=a(Ce);Op=i(dr,"The command above will create a local folder called "),Gr=n(dr,"CODE",{});var Aw=a(Gr);Fp=i(Aw,"./stable-diffusion-v1-5"),Aw.forEach(t),Xp=i(dr,` on your disk.
Now, all you have to do is to simply pass the local folder path to `),Kr=n(dr,"CODE",{});var Lw=a(Kr);zp=i(Lw,"from_pretrained"),Lw.forEach(t),Np=i(dr,":"),dr.forEach(t),td=f(o),b(It.$$.fragment,o),sd=f(o),Oe=n(o,"P",{});var fr=a(Oe);Up=i(fr,"If "),Jr=n(fr,"CODE",{});var Cw=a(Jr);Vp=i(Cw,"repo_id"),Cw.forEach(t),Yp=i(fr," is a local path, as it is the case here, "),li=n(fr,"A",{href:!0});var Ow=a(li);Wp=i(Ow,"DiffusionPipeline.from_pretrained()"),Ow.forEach(t),Hp=i(fr,` will automatically detect it and therefore not try to download any files from the Hub.
While we usually recommend to load weights directly from the Hub to be certain to stay up to date with the newest changes, loading pipelines locally should be preferred if one
wants to stay anonymous, self-contained applications, etc\u2026`),fr.forEach(t),id=f(o),lo=n(o,"H3",{class:!0});var cf=a(lo);Po=n(cf,"A",{id:!0,class:!0,href:!0});var Fw=a(Po);Qr=n(Fw,"SPAN",{});var Xw=a(Qr);b(St.$$.fragment,Xw),Xw.forEach(t),Fw.forEach(t),Bp=f(cf),Zr=n(cf,"SPAN",{});var zw=a(Zr);Rp=i(zw,"Loading customized pipelines"),zw.forEach(t),cf.forEach(t),rd=f(o),te=n(o,"P",{});var Ge=a(te);Gp=i(Ge,"Advanced users that want to load customized versions of diffusion pipelines can do so by swapping any of the default components, "),en=n(Ge,"EM",{});var Nw=a(en);Kp=i(Nw,"e.g."),Nw.forEach(t),Jp=i(Ge,` the scheduler, with other scheduler classes.
A classical use case of this functionality is to swap the scheduler. `),At=n(Ge,"A",{href:!0,rel:!0});var Uw=a(At);Qp=i(Uw,"Stable Diffusion v1-5"),Uw.forEach(t),Zp=i(Ge," uses the "),di=n(Ge,"A",{href:!0});var Vw=a(di);eu=i(Vw,"PNDMScheduler"),Vw.forEach(t),ou=i(Ge,` by default which is generally not the most performant scheduler. Since the release
of stable diffusion, multiple improved schedulers have been published. To use those, the user has to manually load their preferred scheduler and pass it into `),fi=n(Ge,"A",{href:!0});var Yw=a(fi);tu=i(Yw,"DiffusionPipeline.from_pretrained()"),Yw.forEach(t),su=i(Ge,"."),Ge.forEach(t),nd=f(o),Pe=n(o,"P",{});var Ys=a(Pe);on=n(Ys,"EM",{});var Ww=a(on);iu=i(Ww,"E.g."),Ww.forEach(t),ru=i(Ys," to use "),ci=n(Ys,"A",{href:!0});var Hw=a(ci);nu=i(Hw,"EulerDiscreteScheduler"),Hw.forEach(t),au=i(Ys," or "),pi=n(Ys,"A",{href:!0});var Bw=a(pi);lu=i(Bw,"DPMSolverMultistepScheduler"),Bw.forEach(t),du=i(Ys," to have a better quality vs. generation speed trade-off for inference, one could load them as follows:"),Ys.forEach(t),ad=f(o),b(Lt.$$.fragment,o),ld=f(o),ui=n(o,"P",{});var Rw=a(ui);fu=i(Rw,"Three things are worth paying attention to here."),Rw.forEach(t),dd=f(o),Fe=n(o,"UL",{});var cr=a(Fe);Ct=n(cr,"LI",{});var pf=a(Ct);cu=i(pf,"First, the scheduler is loaded with "),hi=n(pf,"A",{href:!0});var Gw=a(hi);pu=i(Gw,"ConfigMixin.from_config()"),Gw.forEach(t),uu=i(pf," since it only depends on a configuration file and not any parameterized weights"),pf.forEach(t),hu=f(cr),ko=n(cr,"LI",{});var Pl=a(ko);mu=i(Pl,"Second, the scheduler is loaded with a function argument, called "),tn=n(Pl,"CODE",{});var Kw=a(tn);gu=i(Kw,'subfolder="scheduler"'),Kw.forEach(t),_u=i(Pl," as the configuration of stable diffusion\u2019s scheduling is defined in a "),Ot=n(Pl,"A",{href:!0,rel:!0});var Jw=a(Ot);vu=i(Jw,"subfolder of the official pipeline repository"),Jw.forEach(t),Pl.forEach(t),bu=f(cr),U=n(cr,"LI",{});var ee=a(U);wu=i(ee,"Third, the scheduler instance can simply be passed with the "),sn=n(ee,"CODE",{});var Qw=a(sn);yu=i(Qw,"scheduler"),Qw.forEach(t),Eu=i(ee," keyword argument to "),mi=n(ee,"A",{href:!0});var Zw=a(mi);Du=i(Zw,"DiffusionPipeline.from_pretrained()"),Zw.forEach(t),$u=i(ee,". This works because the "),gi=n(ee,"A",{href:!0});var ey=a(gi);xu=i(ey,"StableDiffusionPipeline"),ey.forEach(t),Pu=i(ee," defines its scheduler with the "),rn=n(ee,"CODE",{});var oy=a(rn);ku=i(oy,"scheduler"),oy.forEach(t),Mu=i(ee," attribute. It\u2019s not possible to use a different name, such as "),nn=n(ee,"CODE",{});var ty=a(nn);ju=i(ty,"sampler=scheduler"),ty.forEach(t),qu=i(ee," since "),an=n(ee,"CODE",{});var sy=a(an);Tu=i(sy,"sampler"),sy.forEach(t),Iu=i(ee," is not a defined keyword for "),ln=n(ee,"CODE",{});var iy=a(ln);Su=i(iy,"StableDiffusionPipeline.__init__()"),iy.forEach(t),ee.forEach(t),cr.forEach(t),fd=f(o),ge=n(o,"P",{});var st=a(ge);Au=i(st,"Not only the scheduler components can be customized for diffusion pipelines; in theory, all components of a pipeline can be customized. In practice, however, it often only makes sense to switch out a component that has "),dn=n(st,"STRONG",{});var ry=a(dn);Lu=i(ry,"compatible"),ry.forEach(t),Cu=i(st,` alternatives to what the pipeline expects.
Many scheduler classes are compatible with each other as can be seen `),Ft=n(st,"A",{href:!0,rel:!0});var ny=a(Ft);Ou=i(ny,"here"),ny.forEach(t),Fu=i(st,". This is not always the case for other components, such as the "),fn=n(st,"CODE",{});var ay=a(fn);Xu=i(ay,'"unet"'),ay.forEach(t),zu=i(st,"."),st.forEach(t),cd=f(o),Xe=n(o,"P",{});var pr=a(Xe);Nu=i(pr,"One special case that can also be customized is the "),cn=n(pr,"CODE",{});var ly=a(cn);Uu=i(ly,'"safety_checker"'),ly.forEach(t),Vu=i(pr," of stable diffusion. If you believe the safety checker doesn\u2019t serve you any good, you can simply disable it by passing "),pn=n(pr,"CODE",{});var dy=a(pn);Yu=i(dy,"None"),dy.forEach(t),Wu=i(pr,":"),pr.forEach(t),pd=f(o),b(Xt.$$.fragment,o),ud=f(o),se=n(o,"P",{});var Ke=a(se);Hu=i(Ke,"Another common use case is to reuse the same components in multiple pipelines, "),un=n(Ke,"EM",{});var fy=a(un);Bu=i(fy,"e.g."),fy.forEach(t),Ru=i(Ke," the weights and configurations of "),zt=n(Ke,"A",{href:!0,rel:!0});var cy=a(zt);hn=n(cy,"CODE",{});var py=a(hn);Gu=i(py,'"runwayml/stable-diffusion-v1-5"'),py.forEach(t),cy.forEach(t),Ku=i(Ke," can be used for both "),_i=n(Ke,"A",{href:!0});var uy=a(_i);Ju=i(uy,"StableDiffusionPipeline"),uy.forEach(t),Qu=i(Ke," and "),vi=n(Ke,"A",{href:!0});var hy=a(vi);Zu=i(hy,"StableDiffusionImg2ImgPipeline"),hy.forEach(t),eh=i(Ke,` and we might not want to
use the exact same weights into RAM twice. In this case, customizing all the input instances would help us
to only load the weights into RAM once:`),Ke.forEach(t),hd=f(o),b(Nt.$$.fragment,o),md=f(o),Mo=n(o,"P",{});var uf=a(Mo);oh=i(uf,"Note how the above code snippet makes use of "),bi=n(uf,"A",{href:!0});var my=a(bi);th=i(my,"DiffusionPipeline.components"),my.forEach(t),sh=i(uf,"."),uf.forEach(t),gd=f(o),fo=n(o,"H3",{class:!0});var hf=a(fo);jo=n(hf,"A",{id:!0,class:!0,href:!0});var gy=a(jo);mn=n(gy,"SPAN",{});var _y=a(mn);b(Ut.$$.fragment,_y),_y.forEach(t),gy.forEach(t),ih=f(hf),gn=n(hf,"SPAN",{});var vy=a(gn);rh=i(vy,"How does loading work?"),vy.forEach(t),hf.forEach(t),_d=f(o),qo=n(o,"P",{});var mf=a(qo);nh=i(mf,"As a class method, "),wi=n(mf,"A",{href:!0});var by=a(wi);ah=i(by,"DiffusionPipeline.from_pretrained()"),by.forEach(t),lh=i(mf," is responsible for two things:"),mf.forEach(t),vd=f(o),To=n(o,"UL",{});var gf=a(To);pe=n(gf,"LI",{});var Je=a(pe);dh=i(Je,"Download the latest version of the folder structure required to run the "),_n=n(Je,"CODE",{});var wy=a(_n);fh=i(wy,"repo_id"),wy.forEach(t),ch=i(Je," with "),vn=n(Je,"CODE",{});var yy=a(vn);ph=i(yy,"diffusers"),yy.forEach(t),uh=i(Je," and cache them. If the latest folder structure is available in the local cache, "),yi=n(Je,"A",{href:!0});var Ey=a(yi);hh=i(Ey,"DiffusionPipeline.from_pretrained()"),Ey.forEach(t),mh=i(Je," will simply reuse the cache and "),bn=n(Je,"STRONG",{});var Dy=a(bn);gh=i(Dy,"not"),Dy.forEach(t),_h=i(Je," re-download the files."),Je.forEach(t),vh=f(gf),ue=n(gf,"LI",{});var Qe=a(ue);bh=i(Qe,"Load the cached weights into the "),wn=n(Qe,"EM",{});var $y=a(wn);wh=i($y,"correct"),$y.forEach(t),yh=i(Qe," pipeline class \u2013 one of the "),Ei=n(Qe,"A",{href:!0});var xy=a(Ei);Eh=i(xy,"officially supported pipeline classes"),xy.forEach(t),Dh=i(Qe," - and return an instance of the class. The "),yn=n(Qe,"EM",{});var Py=a(yn);$h=i(Py,"correct"),Py.forEach(t),xh=i(Qe," pipeline class is thereby retrieved from the "),En=n(Qe,"CODE",{});var ky=a(En);Ph=i(ky,"model_index.json"),ky.forEach(t),kh=i(Qe," file."),Qe.forEach(t),gf.forEach(t),bd=f(o),ie=n(o,"P",{});var Ze=a(ie);Mh=i(Ze,"The underlying folder structure of diffusion pipelines correspond 1-to-1 to their corresponding class instances, "),Dn=n(Ze,"EM",{});var My=a(Dn);jh=i(My,"e.g."),My.forEach(t),qh=f(Ze),Di=n(Ze,"A",{href:!0});var jy=a(Di);Th=i(jy,"LDMTextToImagePipeline"),jy.forEach(t),Ih=i(Ze," for "),Vt=n(Ze,"A",{href:!0,rel:!0});var qy=a(Vt);$n=n(qy,"CODE",{});var Ty=a($n);Sh=i(Ty,"CompVis/ldm-text2im-large-256"),Ty.forEach(t),qy.forEach(t),Ah=i(Ze,`
This can be understood better by looking at an example. Let\u2019s print out pipeline class instance `),xn=n(Ze,"CODE",{});var Iy=a(xn);Lh=i(Iy,"pipeline"),Iy.forEach(t),Ch=i(Ze," we just defined:"),Ze.forEach(t),wd=f(o),b(Yt.$$.fragment,o),yd=f(o),Wt=n(o,"P",{});var kb=a(Wt);Pn=n(kb,"EM",{});var Sy=a(Pn);Oh=i(Sy,"Output"),Sy.forEach(t),Fh=i(kb,":"),kb.forEach(t),Ed=f(o),b(Ht.$$.fragment,o),Dd=f(o),ze=n(o,"P",{});var ur=a(ze);Xh=i(ur,"First, we see that the official pipeline is the "),$i=n(ur,"A",{href:!0});var Ay=a($i);zh=i(Ay,"LDMTextToImagePipeline"),Ay.forEach(t),Nh=i(ur,", and second we see that the "),kn=n(ur,"CODE",{});var Ly=a(kn);Uh=i(Ly,"LDMTextToImagePipeline"),Ly.forEach(t),Vh=i(ur," consists of 5 components:"),ur.forEach(t),$d=f(o),re=n(o,"UL",{});var eo=a(re);co=n(eo,"LI",{});var hr=a(co);Mn=n(hr,"CODE",{});var Cy=a(Mn);Yh=i(Cy,'"bert"'),Cy.forEach(t),Wh=i(hr," of class "),jn=n(hr,"CODE",{});var Oy=a(jn);Hh=i(Oy,"LDMBertModel"),Oy.forEach(t),Bh=i(hr," as defined "),Bt=n(hr,"A",{href:!0,rel:!0});var Fy=a(Bt);Rh=i(Fy,"in the pipeline"),Fy.forEach(t),hr.forEach(t),Gh=f(eo),Rt=n(eo,"LI",{});var _f=a(Rt);qn=n(_f,"CODE",{});var Xy=a(qn);Kh=i(Xy,'"scheduler"'),Xy.forEach(t),Jh=i(_f," of class "),xi=n(_f,"A",{href:!0});var zy=a(xi);Qh=i(zy,"DDIMScheduler"),zy.forEach(t),_f.forEach(t),Zh=f(eo),po=n(eo,"LI",{});var mr=a(po);Tn=n(mr,"CODE",{});var Ny=a(Tn);em=i(Ny,'"tokenizer"'),Ny.forEach(t),om=i(mr," of class "),In=n(mr,"CODE",{});var Uy=a(In);tm=i(Uy,"BertTokenizer"),Uy.forEach(t),sm=i(mr," as defined "),Io=n(mr,"A",{href:!0,rel:!0});var Mb=a(Io);im=i(Mb,"in "),Sn=n(Mb,"CODE",{});var Vy=a(Sn);rm=i(Vy,"transformers"),Vy.forEach(t),Mb.forEach(t),mr.forEach(t),nm=f(eo),Gt=n(eo,"LI",{});var vf=a(Gt);An=n(vf,"CODE",{});var Yy=a(An);am=i(Yy,'"unet"'),Yy.forEach(t),lm=i(vf," of class "),Pi=n(vf,"A",{href:!0});var Wy=a(Pi);dm=i(Wy,"UNet2DConditionModel"),Wy.forEach(t),vf.forEach(t),fm=f(eo),Kt=n(eo,"LI",{});var bf=a(Kt);Ln=n(bf,"CODE",{});var Hy=a(Ln);cm=i(Hy,'"vqvae"'),Hy.forEach(t),pm=i(bf," of class "),ki=n(bf,"A",{href:!0});var By=a(ki);um=i(By,"AutoencoderKL"),By.forEach(t),bf.forEach(t),eo.forEach(t),xd=f(o),_e=n(o,"P",{});var it=a(_e);hm=i(it,"Let\u2019s now compare the pipeline instance to the folder structure of the model repository "),Cn=n(it,"CODE",{});var Ry=a(Cn);mm=i(Ry,"CompVis/ldm-text2im-large-256"),Ry.forEach(t),gm=i(it,". Looking at the folder structure of "),Jt=n(it,"A",{href:!0,rel:!0});var Gy=a(Jt);On=n(Gy,"CODE",{});var Ky=a(On);_m=i(Ky,"CompVis/ldm-text2im-large-256"),Ky.forEach(t),Gy.forEach(t),vm=i(it," on the Hub, we can see it matches 1-to-1 the printed out instance of "),Fn=n(it,"CODE",{});var Jy=a(Fn);bm=i(Jy,"LDMTextToImagePipeline"),Jy.forEach(t),wm=i(it," above:"),it.forEach(t),Pd=f(o),b(Qt.$$.fragment,o),kd=f(o),M=n(o,"P",{});var F=a(M);ym=i(F,"As we can see each attribute of the instance of "),Xn=n(F,"CODE",{});var Qy=a(Xn);Em=i(Qy,"LDMTextToImagePipeline"),Qy.forEach(t),Dm=i(F," has its configuration and possibly weights defined in a subfolder that is called "),zn=n(F,"STRONG",{});var Zy=a(zn);$m=i(Zy,"exactly"),Zy.forEach(t),xm=i(F," like the class attribute ("),Nn=n(F,"CODE",{});var e2=a(Nn);Pm=i(e2,'"bert"'),e2.forEach(t),km=i(F,", "),Un=n(F,"CODE",{});var o2=a(Un);Mm=i(o2,'"scheduler"'),o2.forEach(t),jm=i(F,", "),Vn=n(F,"CODE",{});var t2=a(Vn);qm=i(t2,'"tokenizer"'),t2.forEach(t),Tm=i(F,", "),Yn=n(F,"CODE",{});var s2=a(Yn);Im=i(s2,'"unet"'),s2.forEach(t),Sm=i(F,", "),Wn=n(F,"CODE",{});var i2=a(Wn);Am=i(i2,'"vqvae"'),i2.forEach(t),Lm=i(F,"). Importantly, every pipeline expects a "),Hn=n(F,"CODE",{});var r2=a(Hn);Cm=i(r2,"model_index.json"),r2.forEach(t),Om=i(F," file that tells the "),Bn=n(F,"CODE",{});var n2=a(Bn);Fm=i(n2,"DiffusionPipeline"),n2.forEach(t),Xm=i(F," both:"),F.forEach(t),Md=f(o),So=n(o,"UL",{});var wf=a(So);Rn=n(wf,"LI",{});var a2=a(Rn);zm=i(a2,"which pipeline class should be loaded, and"),a2.forEach(t),Nm=f(wf),Gn=n(wf,"LI",{});var l2=a(Gn);Um=i(l2,"what sub-classes from which library are stored in which subfolders"),l2.forEach(t),wf.forEach(t),jd=f(o),Ne=n(o,"P",{});var gr=a(Ne);Vm=i(gr,"In the case of "),Kn=n(gr,"CODE",{});var d2=a(Kn);Ym=i(d2,"CompVis/ldm-text2im-large-256"),d2.forEach(t),Wm=i(gr," the "),Jn=n(gr,"CODE",{});var f2=a(Jn);Hm=i(f2,"model_index.json"),f2.forEach(t),Bm=i(gr," is therefore defined as follows:"),gr.forEach(t),qd=f(o),b(Zt.$$.fragment,o),Td=f(o),Ue=n(o,"UL",{});var _r=a(Ue);Ao=n(_r,"LI",{});var kl=a(Ao);Qn=n(kl,"CODE",{});var c2=a(Qn);Rm=i(c2,"_class_name"),c2.forEach(t),Gm=i(kl," tells "),Zn=n(kl,"CODE",{});var p2=a(Zn);Km=i(p2,"DiffusionPipeline"),p2.forEach(t),Jm=i(kl," which pipeline class should be loaded."),kl.forEach(t),Qm=f(_r),Lo=n(_r,"LI",{});var Ml=a(Lo);ea=n(Ml,"CODE",{});var u2=a(ea);Zm=i(u2,"_diffusers_version"),u2.forEach(t),eg=i(Ml," can be useful to know under which "),oa=n(Ml,"CODE",{});var h2=a(oa);og=i(h2,"diffusers"),h2.forEach(t),tg=i(Ml," version this model was created."),Ml.forEach(t),sg=f(_r),ta=n(_r,"LI",{});var m2=a(ta);ig=i(m2,"Every component of the pipeline is then defined under the form:"),m2.forEach(t),_r.forEach(t),Id=f(o),b(es.$$.fragment,o),Sd=f(o),Ve=n(o,"UL",{});var vr=a(Ve);Ye=n(vr,"LI",{});var Ws=a(Ye);rg=i(Ws,"The "),sa=n(Ws,"CODE",{});var g2=a(sa);ng=i(g2,'"name"'),g2.forEach(t),ag=i(Ws," field corresponds both to the name of the subfolder in which the configuration and weights are stored as well as the attribute name of the pipeline class (as can be seen "),os=n(Ws,"A",{href:!0,rel:!0});var _2=a(os);lg=i(_2,"here"),_2.forEach(t),dg=i(Ws," and "),ts=n(Ws,"A",{href:!0,rel:!0});var v2=a(ts);fg=i(v2,"here"),v2.forEach(t),Ws.forEach(t),cg=f(vr),Q=n(vr,"LI",{});var Ee=a(Q);pg=i(Ee,"The "),ia=n(Ee,"CODE",{});var b2=a(ia);ug=i(b2,'"library"'),b2.forEach(t),hg=i(Ee," field corresponds to the name of the library, "),ra=n(Ee,"EM",{});var w2=a(ra);mg=i(w2,"e.g."),w2.forEach(t),gg=f(Ee),na=n(Ee,"CODE",{});var y2=a(na);_g=i(y2,"diffusers"),y2.forEach(t),vg=i(Ee," or "),aa=n(Ee,"CODE",{});var E2=a(aa);bg=i(E2,"transformers"),E2.forEach(t),wg=i(Ee," from which the "),la=n(Ee,"CODE",{});var D2=a(la);yg=i(D2,'"class"'),D2.forEach(t),Eg=i(Ee," should be loaded"),Ee.forEach(t),Dg=f(vr),ve=n(vr,"LI",{});var bo=a(ve);$g=i(bo,"The "),da=n(bo,"CODE",{});var $2=a(da);xg=i($2,'"class"'),$2.forEach(t),Pg=i(bo," field corresponds to the name of the class, "),fa=n(bo,"EM",{});var x2=a(fa);kg=i(x2,"e.g."),x2.forEach(t),Mg=f(bo),ss=n(bo,"A",{href:!0,rel:!0});var P2=a(ss);ca=n(P2,"CODE",{});var k2=a(ca);jg=i(k2,"BertTokenizer"),k2.forEach(t),P2.forEach(t),qg=i(bo," or "),Mi=n(bo,"A",{href:!0});var M2=a(Mi);Tg=i(M2,"UNet2DConditionModel"),M2.forEach(t),bo.forEach(t),vr.forEach(t),Ad=f(o),uo=n(o,"H2",{class:!0});var yf=a(uo);Co=n(yf,"A",{id:!0,class:!0,href:!0});var j2=a(Co);pa=n(j2,"SPAN",{});var q2=a(pa);b(is.$$.fragment,q2),q2.forEach(t),j2.forEach(t),Ig=f(yf),ua=n(yf,"SPAN",{});var T2=a(ua);Sg=i(T2,"Loading models"),T2.forEach(t),yf.forEach(t),Ld=f(o),be=n(o,"P",{});var rt=a(be);Ag=i(rt,"Models as defined under "),rs=n(rt,"A",{href:!0,rel:!0});var I2=a(rs);Lg=i(I2,"src/diffusers/models"),I2.forEach(t),Cg=i(rt," can be loaded via the "),ji=n(rt,"A",{href:!0});var S2=a(ji);Og=i(S2,"ModelMixin.from_pretrained()"),S2.forEach(t),Fg=i(rt," function. The API is very similar the "),qi=n(rt,"A",{href:!0});var A2=a(qi);Xg=i(A2,"DiffusionPipeline.from_pretrained()"),A2.forEach(t),zg=i(rt," and works in the same way:"),rt.forEach(t),Cd=f(o),Oo=n(o,"UL",{});var Ef=a(Oo);ke=n(Ef,"LI",{});var nt=a(ke);Ng=i(nt,"Download the latest version of the model weights and configuration with "),ha=n(nt,"CODE",{});var L2=a(ha);Ug=i(L2,"diffusers"),L2.forEach(t),Vg=i(nt," and cache them. If the latest files are available in the local cache, "),Ti=n(nt,"A",{href:!0});var C2=a(Ti);Yg=i(C2,"ModelMixin.from_pretrained()"),C2.forEach(t),Wg=i(nt," will simply reuse the cache and "),ma=n(nt,"STRONG",{});var O2=a(ma);Hg=i(O2,"not"),O2.forEach(t),Bg=i(nt," re-download the files."),nt.forEach(t),Rg=f(Ef),ho=n(Ef,"LI",{});var br=a(ho);Gg=i(br,"Load the cached weights into the "),ga=n(br,"EM",{});var F2=a(ga);Kg=i(F2,"defined"),F2.forEach(t),Jg=i(br," model class - one of "),Ii=n(br,"A",{href:!0});var X2=a(Ii);Qg=i(X2,"the existing model classes"),X2.forEach(t),Zg=i(br," - and return an instance of the class."),br.forEach(t),Ef.forEach(t),Od=f(o),we=n(o,"P",{});var at=a(we);e_=i(at,"In constrast to "),Si=n(at,"A",{href:!0});var z2=a(Si);o_=i(z2,"DiffusionPipeline.from_pretrained()"),z2.forEach(t),t_=i(at,", models rely on fewer files that usually don\u2019t require a folder structure, but just a "),_a=n(at,"CODE",{});var N2=a(_a);s_=i(N2,"diffusion_pytorch_model.bin"),N2.forEach(t),i_=i(at," and "),va=n(at,"CODE",{});var U2=a(va);r_=i(U2,"config.json"),U2.forEach(t),n_=i(at," file."),at.forEach(t),Fd=f(o),Ai=n(o,"P",{});var V2=a(Ai);a_=i(V2,"Let\u2019s look at an example:"),V2.forEach(t),Xd=f(o),b(ns.$$.fragment,o),zd=f(o),ye=n(o,"P",{});var lt=a(ye);l_=i(lt,"Note how we have to define the "),ba=n(lt,"CODE",{});var Y2=a(ba);d_=i(Y2,'subfolder="unet"'),Y2.forEach(t),f_=i(lt," argument to tell "),Li=n(lt,"A",{href:!0});var W2=a(Li);c_=i(W2,"ModelMixin.from_pretrained()"),W2.forEach(t),p_=i(lt," that the model weights are located in a "),as=n(lt,"A",{href:!0,rel:!0});var H2=a(as);u_=i(H2,"subfolder of the repository"),H2.forEach(t),h_=i(lt,"."),lt.forEach(t),Nd=f(o),We=n(o,"P",{});var wr=a(We);m_=i(wr,"As explained in "),Ci=n(wr,"A",{href:!0});var B2=a(Ci);g_=i(B2,"Loading customized pipelines"),B2.forEach(t),__=i(wr,", one can pass a loaded model to a diffusion pipeline, via "),Oi=n(wr,"A",{href:!0});var R2=a(Oi);v_=i(R2,"DiffusionPipeline.from_pretrained()"),R2.forEach(t),b_=i(wr,":"),wr.forEach(t),Ud=f(o),b(ls.$$.fragment,o),Vd=f(o),He=n(o,"P",{});var yr=a(He);w_=i(yr,"If the model files can be found directly at the root level, which is usually only the case for some very simple diffusion models, such as "),ds=n(yr,"A",{href:!0,rel:!0});var G2=a(ds);wa=n(G2,"CODE",{});var K2=a(wa);y_=i(K2,"google/ddpm-cifar10-32"),K2.forEach(t),G2.forEach(t),E_=i(yr,`, we don\u2019t
need to pass a `),ya=n(yr,"CODE",{});var J2=a(ya);D_=i(J2,"subfolder"),J2.forEach(t),$_=i(yr," argument:"),yr.forEach(t),Yd=f(o),b(fs.$$.fragment,o),Wd=f(o),mo=n(o,"H2",{class:!0});var Df=a(mo);Fo=n(Df,"A",{id:!0,class:!0,href:!0});var Q2=a(Fo);Ea=n(Q2,"SPAN",{});var Z2=a(Ea);b(cs.$$.fragment,Z2),Z2.forEach(t),Q2.forEach(t),x_=f(Df),Da=n(Df,"SPAN",{});var eE=a(Da);P_=i(eE,"Loading schedulers"),eE.forEach(t),Df.forEach(t),Hd=f(o),ne=n(o,"P",{});var oo=a(ne);k_=i(oo,"Schedulers cannot be loaded via a "),$a=n(oo,"CODE",{});var oE=a($a);M_=i(oE,"from_pretrained"),oE.forEach(t),j_=i(oo," method, but instead rely on "),Fi=n(oo,"A",{href:!0});var tE=a(Fi);q_=i(tE,"ConfigMixin.from_config()"),tE.forEach(t),T_=i(oo,". Schedulers are "),xa=n(oo,"STRONG",{});var sE=a(xa);I_=i(sE,"not parameterized"),sE.forEach(t),S_=i(oo," or "),Pa=n(oo,"STRONG",{});var iE=a(Pa);A_=i(iE,"trained"),iE.forEach(t),L_=i(oo,`, but instead purely defined by a configuration file.
Therefore the loading method was given a different name here.`),oo.forEach(t),Bd=f(o),Xi=n(o,"P",{});var rE=a(Xi);C_=i(rE,`In constrast to pipelines or models, loading schedulers does not consume any significant amount of memory and the same configuration file can often be used for a variety of different schedulers.
For example, all of:`),rE.forEach(t),Rd=f(o),V=n(o,"UL",{});var de=a(V);ka=n(de,"LI",{});var nE=a(ka);zi=n(nE,"A",{href:!0});var aE=a(zi);O_=i(aE,"DDPMScheduler"),aE.forEach(t),nE.forEach(t),F_=f(de),Ma=n(de,"LI",{});var lE=a(Ma);Ni=n(lE,"A",{href:!0});var dE=a(Ni);X_=i(dE,"DDIMScheduler"),dE.forEach(t),lE.forEach(t),z_=f(de),ja=n(de,"LI",{});var fE=a(ja);Ui=n(fE,"A",{href:!0});var cE=a(Ui);N_=i(cE,"PNDMScheduler"),cE.forEach(t),fE.forEach(t),U_=f(de),qa=n(de,"LI",{});var pE=a(qa);Vi=n(pE,"A",{href:!0});var uE=a(Vi);V_=i(uE,"LMSDiscreteScheduler"),uE.forEach(t),pE.forEach(t),Y_=f(de),Ta=n(de,"LI",{});var hE=a(Ta);Yi=n(hE,"A",{href:!0});var mE=a(Yi);W_=i(mE,"EulerDiscreteScheduler"),mE.forEach(t),hE.forEach(t),H_=f(de),Ia=n(de,"LI",{});var gE=a(Ia);Wi=n(gE,"A",{href:!0});var _E=a(Wi);B_=i(_E,"EulerAncestralDiscreteScheduler"),_E.forEach(t),gE.forEach(t),R_=f(de),Sa=n(de,"LI",{});var vE=a(Sa);Hi=n(vE,"A",{href:!0});var bE=a(Hi);G_=i(bE,"DPMSolverMultistepScheduler"),bE.forEach(t),vE.forEach(t),de.forEach(t),Gd=f(o),Xo=n(o,"P",{});var $f=a(Xo);K_=i($f,"are compatible with "),Bi=n($f,"A",{href:!0});var wE=a(Bi);J_=i(wE,"StableDiffusionPipeline"),wE.forEach(t),Q_=i($f," and therefore the same scheduler configuration file can be loaded in any of those classes:"),$f.forEach(t),Kd=f(o),b(ps.$$.fragment,o),Jd=f(o),go=n(o,"H2",{class:!0});var xf=a(go);zo=n(xf,"A",{id:!0,class:!0,href:!0});var yE=a(zo);Aa=n(yE,"SPAN",{});var EE=a(Aa);b(us.$$.fragment,EE),EE.forEach(t),yE.forEach(t),Z_=f(xf),La=n(xf,"SPAN",{});var DE=a(La);ev=i(DE,"API"),DE.forEach(t),xf.forEach(t),Qd=f(o),H=n(o,"DIV",{class:!0});var De=a(H);b(hs.$$.fragment,De),ov=f(De),Ca=n(De,"P",{});var $E=a(Ca);tv=i($E,"Base class for all models."),$E.forEach(t),sv=f(De),Ri=n(De,"P",{});var jb=a(Ri);Gi=n(jb,"A",{href:!0});var xE=a(Gi);iv=i(xE,"ModelMixin"),xE.forEach(t),rv=i(jb,` takes care of storing the configuration of the models and handles methods for loading, downloading
and saving models.`),jb.forEach(t),nv=f(De),Oa=n(De,"UL",{});var PE=a(Oa);Be=n(PE,"LI",{});var Hs=a(Be);Fa=n(Hs,"STRONG",{});var kE=a(Fa);av=i(kE,"config_name"),kE.forEach(t),lv=i(Hs," ("),Xa=n(Hs,"CODE",{});var ME=a(Xa);dv=i(ME,"str"),ME.forEach(t),fv=i(Hs,`) \u2014 A filename under which the model should be stored when calling
`),Ki=n(Hs,"A",{href:!0});var jE=a(Ki);cv=i(jE,"save_pretrained()"),jE.forEach(t),pv=i(Hs,"."),Hs.forEach(t),PE.forEach(t),uv=f(De),Y=n(De,"DIV",{class:!0});var fe=a(Y);b(ms.$$.fragment,fe),hv=f(fe),za=n(fe,"P",{});var qE=a(za);mv=i(qE,"Instantiate a pretrained pytorch model from a pre-trained model configuration."),qE.forEach(t),gv=f(fe),_o=n(fe,"P",{});var Er=a(_o);_v=i(Er,"The model is set in evaluation mode by default using "),Na=n(Er,"CODE",{});var TE=a(Na);vv=i(TE,"model.eval()"),TE.forEach(t),bv=i(Er,` (Dropout modules are deactivated). To train
the model, you should first set it back in training mode with `),Ua=n(Er,"CODE",{});var IE=a(Ua);wv=i(IE,"model.train()"),IE.forEach(t),yv=i(Er,"."),Er.forEach(t),Ev=f(fe),gs=n(fe,"P",{});var Pf=a(gs);Dv=i(Pf,"The warning "),Va=n(Pf,"EM",{});var SE=a(Va);$v=i(SE,"Weights from XXX not initialized from pretrained model"),SE.forEach(t),xv=i(Pf,` means that the weights of XXX do not come
pretrained with the rest of the model. It is up to you to train those weights with a downstream fine-tuning
task.`),Pf.forEach(t),Pv=f(fe),_s=n(fe,"P",{});var kf=a(_s);kv=i(kf,"The warning "),Ya=n(kf,"EM",{});var AE=a(Ya);Mv=i(AE,"Weights from XXX not used in YYY"),AE.forEach(t),jv=i(kf,` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),kf.forEach(t),qv=f(fe),b(No.$$.fragment,fe),Tv=f(fe),b(Uo.$$.fragment,fe),fe.forEach(t),Iv=f(De),Vo=n(De,"DIV",{class:!0});var Mf=a(Vo);b(vs.$$.fragment,Mf),Sv=f(Mf),bs=n(Mf,"P",{});var jf=a(bs);Av=i(jf,`Save a model and its configuration file to a directory, so that it can be re-loaded using the
`),Wa=n(jf,"CODE",{});var LE=a(Wa);Lv=i(LE,"[from_pretrained()](/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.ModelMixin.from_pretrained)"),LE.forEach(t),Cv=i(jf," class method."),jf.forEach(t),Mf.forEach(t),De.forEach(t),Zd=f(o),S=n(o,"DIV",{class:!0});var B=a(S);b(ws.$$.fragment,B),Ov=f(B),Ha=n(B,"P",{});var CE=a(Ha);Fv=i(CE,"Base class for all models."),CE.forEach(t),Xv=f(B),Ji=n(B,"P",{});var qb=a(Ji);Qi=n(qb,"A",{href:!0});var OE=a(Qi);zv=i(OE,"DiffusionPipeline"),OE.forEach(t),Nv=i(qb,` takes care of storing all components (models, schedulers, processors) for diffusion pipelines
and handles methods for loading, downloading and saving models as well as a few methods common to all pipelines to:`),qb.forEach(t),Uv=f(B),ys=n(B,"UL",{});var qf=a(ys);Ba=n(qf,"LI",{});var FE=a(Ba);Vv=i(FE,"move all PyTorch modules to the device of your choice"),FE.forEach(t),Yv=f(qf),Ra=n(qf,"LI",{});var XE=a(Ra);Wv=i(XE,"enabling/disabling the progress bar for the denoising iteration"),XE.forEach(t),qf.forEach(t),Hv=f(B),Ga=n(B,"P",{});var zE=a(Ga);Bv=i(zE,"Class attributes:"),zE.forEach(t),Rv=f(B),Ka=n(B,"UL",{});var NE=a(Ka);Yo=n(NE,"LI",{});var jl=a(Yo);Ja=n(jl,"STRONG",{});var UE=a(Ja);Gv=i(UE,"config_name"),UE.forEach(t),Kv=i(jl," ("),Qa=n(jl,"CODE",{});var VE=a(Qa);Jv=i(VE,"str"),VE.forEach(t),Qv=i(jl,`) \u2014 name of the config file that will store the class and module names of all
components of the diffusion pipeline.`),jl.forEach(t),NE.forEach(t),Zv=f(B),C=n(B,"DIV",{class:!0});var R=a(C);b(Es.$$.fragment,R),e1=f(R),Za=n(R,"P",{});var YE=a(Za);o1=i(YE,"Instantiate a PyTorch diffusion pipeline from pre-trained pipeline weights."),YE.forEach(t),t1=f(R),Ds=n(R,"P",{});var Tf=a(Ds);s1=i(Tf,"The pipeline is set in evaluation mode by default using "),el=n(Tf,"CODE",{});var WE=a(el);i1=i(WE,"model.eval()"),WE.forEach(t),r1=i(Tf," (Dropout modules are deactivated)."),Tf.forEach(t),n1=f(R),$s=n(R,"P",{});var If=a($s);a1=i(If,"The warning "),ol=n(If,"EM",{});var HE=a(ol);l1=i(HE,"Weights from XXX not initialized from pretrained model"),HE.forEach(t),d1=i(If,` means that the weights of XXX do not come
pretrained with the rest of the model. It is up to you to train those weights with a downstream fine-tuning
task.`),If.forEach(t),f1=f(R),xs=n(R,"P",{});var Sf=a(xs);c1=i(Sf,"The warning "),tl=n(Sf,"EM",{});var BE=a(tl);p1=i(BE,"Weights from XXX not used in YYY"),BE.forEach(t),u1=i(Sf,` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),Sf.forEach(t),h1=f(R),b(Wo.$$.fragment,R),m1=f(R),b(Ho.$$.fragment,R),g1=f(R),b(Bo.$$.fragment,R),R.forEach(t),_1=f(B),Ro=n(B,"DIV",{class:!0});var Af=a(Ro);b(Ps.$$.fragment,Af),v1=f(Af),ks=n(Af,"P",{});var Lf=a(ks);b1=i(Lf,`Save all variables of the pipeline that can be saved and loaded as well as the pipelines configuration file to
a directory. A pipeline variable can be saved and loaded if its class implements both a save and loading
method. The pipeline can easily be re-loaded using the `),sl=n(Lf,"CODE",{});var RE=a(sl);w1=i(RE,"[from_pretrained()](/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline.from_pretrained)"),RE.forEach(t),y1=i(Lf," class method."),Lf.forEach(t),Af.forEach(t),B.forEach(t),ef=f(o),Z=n(o,"DIV",{class:!0});var to=a(Z);b(Ms.$$.fragment,to),E1=f(to),il=n(to,"P",{});var GE=a(il);D1=i(GE,"Base class for all flax models."),GE.forEach(t),$1=f(to),Zi=n(to,"P",{});var Tb=a(Zi);er=n(Tb,"A",{href:!0});var KE=a(er);x1=i(KE,"FlaxModelMixin"),KE.forEach(t),P1=i(Tb,` takes care of storing the configuration of the models and handles methods for loading,
downloading and saving models.`),Tb.forEach(t),k1=f(to),ae=n(to,"DIV",{class:!0});var so=a(ae);b(js.$$.fragment,so),M1=f(so),rl=n(so,"P",{});var JE=a(rl);j1=i(JE,"Instantiate a pretrained flax model from a pre-trained model configuration."),JE.forEach(t),q1=f(so),qs=n(so,"P",{});var Cf=a(qs);T1=i(Cf,"The warning "),nl=n(Cf,"EM",{});var QE=a(nl);I1=i(QE,"Weights from XXX not initialized from pretrained model"),QE.forEach(t),S1=i(Cf,` means that the weights of XXX do not come
pretrained with the rest of the model. It is up to you to train those weights with a downstream fine-tuning
task.`),Cf.forEach(t),A1=f(so),Ts=n(so,"P",{});var Of=a(Ts);L1=i(Of,"The warning "),al=n(Of,"EM",{});var ZE=a(al);C1=i(ZE,"Weights from XXX not used in YYY"),ZE.forEach(t),O1=i(Of,` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),Of.forEach(t),F1=f(so),b(Go.$$.fragment,so),so.forEach(t),X1=f(to),Ko=n(to,"DIV",{class:!0});var Ff=a(Ko);b(Is.$$.fragment,Ff),z1=f(Ff),Ss=n(Ff,"P",{});var Xf=a(Ss);N1=i(Xf,`Save a model and its configuration file to a directory, so that it can be re-loaded using the
`),ll=n(Xf,"CODE",{});var e5=a(ll);U1=i(e5,"[from_pretrained()](/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.FlaxModelMixin.from_pretrained)"),e5.forEach(t),V1=i(Xf," class method"),Xf.forEach(t),Ff.forEach(t),to.forEach(t),of=f(o),A=n(o,"DIV",{class:!0});var G=a(A);b(As.$$.fragment,G),Y1=f(G),dl=n(G,"P",{});var o5=a(dl);W1=i(o5,"Base class for all models."),o5.forEach(t),H1=f(G),or=n(G,"P",{});var Ib=a(or);tr=n(Ib,"A",{href:!0});var t5=a(tr);B1=i(t5,"FlaxDiffusionPipeline"),t5.forEach(t),R1=i(Ib,` takes care of storing all components (models, schedulers, processors) for diffusion
pipelines and handles methods for loading, downloading and saving models as well as a few methods common to all
pipelines to:`),Ib.forEach(t),G1=f(G),fl=n(G,"UL",{});var s5=a(fl);cl=n(s5,"LI",{});var i5=a(cl);K1=i(i5,"enabling/disabling the progress bar for the denoising iteration"),i5.forEach(t),s5.forEach(t),J1=f(G),pl=n(G,"P",{});var r5=a(pl);Q1=i(r5,"Class attributes:"),r5.forEach(t),Z1=f(G),ul=n(G,"UL",{});var n5=a(ul);Jo=n(n5,"LI",{});var ql=a(Jo);hl=n(ql,"STRONG",{});var a5=a(hl);eb=i(a5,"config_name"),a5.forEach(t),ob=i(ql," ("),ml=n(ql,"CODE",{});var l5=a(ml);tb=i(l5,"str"),l5.forEach(t),sb=i(ql,`) \u2014 name of the config file that will store the class and module names of all
components of the diffusion pipeline.`),ql.forEach(t),n5.forEach(t),ib=f(G),O=n(G,"DIV",{class:!0});var K=a(O);b(Ls.$$.fragment,K),rb=f(K),gl=n(K,"P",{});var d5=a(gl);nb=i(d5,"Instantiate a Flax diffusion pipeline from pre-trained pipeline weights."),d5.forEach(t),ab=f(K),Cs=n(K,"P",{});var zf=a(Cs);lb=i(zf,"The pipeline is set in evaluation mode by default using "),_l=n(zf,"CODE",{});var f5=a(_l);db=i(f5,"model.eval()"),f5.forEach(t),fb=i(zf," (Dropout modules are deactivated)."),zf.forEach(t),cb=f(K),Os=n(K,"P",{});var Nf=a(Os);pb=i(Nf,"The warning "),vl=n(Nf,"EM",{});var c5=a(vl);ub=i(c5,"Weights from XXX not initialized from pretrained model"),c5.forEach(t),hb=i(Nf,` means that the weights of XXX do not come
pretrained with the rest of the model. It is up to you to train those weights with a downstream fine-tuning
task.`),Nf.forEach(t),mb=f(K),Fs=n(K,"P",{});var Uf=a(Fs);gb=i(Uf,"The warning "),bl=n(Uf,"EM",{});var p5=a(bl);_b=i(p5,"Weights from XXX not used in YYY"),p5.forEach(t),vb=i(Uf,` means that the layer XXX is not used by YYY, therefore those
weights are discarded.`),Uf.forEach(t),bb=f(K),b(Qo.$$.fragment,K),wb=f(K),b(Zo.$$.fragment,K),yb=f(K),b(et.$$.fragment,K),K.forEach(t),Eb=f(G),ot=n(G,"DIV",{class:!0});var Vf=a(ot);b(Xs.$$.fragment,Vf),Db=f(Vf),zs=n(Vf,"P",{});var Yf=a(zs);$b=i(Yf,`Save all variables of the pipeline that can be saved and loaded as well as the pipelines configuration file to
a directory. A pipeline variable can be saved and loaded if its class implements both a save and loading
method. The pipeline can easily be re-loaded using the `),wl=n(Yf,"CODE",{});var u5=a(wl);xb=i(u5,"[from_pretrained()](/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.FlaxDiffusionPipeline.from_pretrained)"),u5.forEach(t),Pb=i(Yf,` class
method.`),Yf.forEach(t),Vf.forEach(t),G.forEach(t),this.h()},h(){c(h,"name","hf:doc:metadata"),c(h,"content",JSON.stringify(q5)),c(_,"id","loading"),c(_,"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"),c(_,"href","#loading"),c(m,"class","relative group"),c(Bs,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline.from_pretrained"),c(Rs,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.ModelMixin.from_pretrained"),c(Gs,"href","/docs/diffusers/pr_1116/en/using-diffusers/configuration#diffusers.ConfigMixin.from_config"),c(yo,"id","loading-pipelines"),c(yo,"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"),c(yo,"href","#loading-pipelines"),c(ro,"class","relative group"),c(Ks,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline"),c(ut,"href","https://huggingface.co/models?library=diffusers"),c(ut,"rel","nofollow"),c(ht,"href","https://huggingface.co/CompVis/ldm-text2im-large-256"),c(ht,"rel","nofollow"),c(Js,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline"),c(Qs,"href","/docs/diffusers/pr_1116/en/api/pipelines/latent_diffusion#diffusers.LDMTextToImagePipeline"),c(Eo,"href","/docs/diffusers/pr_1116/en/api/pipelines/latent_diffusion#diffusers.LDMTextToImagePipeline.__call__"),c(Zs,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline"),c(ei,"href","/docs/diffusers/pr_1116/en/api/pipelines/latent_diffusion#diffusers.LDMTextToImagePipeline"),c(oi,"href","/docs/diffusers/pr_1116/en/api/pipelines/stable_diffusion#diffusers.StableDiffusionPipeline"),c(_t,"href","https://huggingface.co/blog/stable_diffusion#how-does-stable-diffusion-work"),c(_t,"rel","nofollow"),c(ti,"href","./api/overview#diffusers-summary"),c($o,"id","loading-pipelines-that-require-access-request"),c($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"),c($o,"href","#loading-pipelines-that-require-access-request"),c(no,"class","relative group"),c(bt,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),c(bt,"rel","nofollow"),c(yt,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),c(yt,"rel","nofollow"),c(Dt,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),c(Dt,"rel","nofollow"),v5(si.src,Lb="https://raw.githubusercontent.com/huggingface/diffusers/main/docs/source/imgs/access_request.png")||c(si,"src",Lb),c(si,"width","400"),c(xe,"align","center"),c(xt,"href","https://huggingface.co/docs/hub/security-tokens#user-access-tokens"),c(xt,"rel","nofollow"),c(xo,"id","loading-pipelines-locally"),c(xo,"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"),c(xo,"href","#loading-pipelines-locally"),c(ao,"class","relative group"),c(ai,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline.from_pretrained"),c(Mt,"href","https://huggingface.co/CompVis/ldm-text2im-large-256"),c(Mt,"rel","nofollow"),c(jt,"href","https://git-lfs.github.com/"),c(jt,"rel","nofollow"),c(qt,"href","https://huggingface.co/CompVis/ldm-text2im-large-256/tree/main"),c(qt,"rel","nofollow"),c(li,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline.from_pretrained"),c(Po,"id","loading-customized-pipelines"),c(Po,"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"),c(Po,"href","#loading-customized-pipelines"),c(lo,"class","relative group"),c(At,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),c(At,"rel","nofollow"),c(di,"href","/docs/diffusers/pr_1116/en/api/schedulers#diffusers.PNDMScheduler"),c(fi,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline.from_pretrained"),c(ci,"href","/docs/diffusers/pr_1116/en/api/schedulers#diffusers.EulerDiscreteScheduler"),c(pi,"href","/docs/diffusers/pr_1116/en/api/schedulers#diffusers.DPMSolverMultistepScheduler"),c(hi,"href","/docs/diffusers/pr_1116/en/using-diffusers/configuration#diffusers.ConfigMixin.from_config"),c(Ot,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5/tree/main/scheduler"),c(Ot,"rel","nofollow"),c(mi,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline.from_pretrained"),c(gi,"href","/docs/diffusers/pr_1116/en/api/pipelines/stable_diffusion#diffusers.StableDiffusionPipeline"),c(Ft,"href","https://github.com/huggingface/diffusers/blob/0dd8c6b4dbab4069de9ed1cafb53cbd495873879/src/diffusers/schedulers/scheduling_ddim.py#L112"),c(Ft,"rel","nofollow"),c(zt,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),c(zt,"rel","nofollow"),c(_i,"href","/docs/diffusers/pr_1116/en/api/pipelines/stable_diffusion#diffusers.StableDiffusionPipeline"),c(vi,"href","/docs/diffusers/pr_1116/en/api/pipelines/stable_diffusion#diffusers.StableDiffusionImg2ImgPipeline"),c(bi,"href","/docs/diffusers/pr_1116/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.components"),c(jo,"id","how-does-loading-work"),c(jo,"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"),c(jo,"href","#how-does-loading-work"),c(fo,"class","relative group"),c(wi,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline.from_pretrained"),c(yi,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline.from_pretrained"),c(Ei,"href","./api/overview#diffusers-summary"),c(Di,"href","/docs/diffusers/pr_1116/en/api/pipelines/latent_diffusion#diffusers.LDMTextToImagePipeline"),c(Vt,"href","https://huggingface.co/CompVis/ldm-text2im-large-256"),c(Vt,"rel","nofollow"),c($i,"href","/docs/diffusers/pr_1116/en/api/pipelines/latent_diffusion#diffusers.LDMTextToImagePipeline"),c(Bt,"href","https://github.com/huggingface/diffusers/blob/cd502b25cf0debac6f98d27a6638ef95208d1ea2/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py#L664"),c(Bt,"rel","nofollow"),c(xi,"href","/docs/diffusers/pr_1116/en/api/schedulers#diffusers.DDIMScheduler"),c(Io,"href","https://huggingface.co/docs/transformers/model_doc/bert#transformers.BertTokenizer"),c(Io,"rel","nofollow"),c(Pi,"href","/docs/diffusers/pr_1116/en/api/models#diffusers.UNet2DConditionModel"),c(ki,"href","/docs/diffusers/pr_1116/en/api/models#diffusers.AutoencoderKL"),c(Jt,"href","https://huggingface.co/CompVis/ldm-text2im-large-256/tree/main"),c(Jt,"rel","nofollow"),c(os,"href","https://huggingface.co/CompVis/ldm-text2im-large-256/tree/main/bert"),c(os,"rel","nofollow"),c(ts,"href","https://github.com/huggingface/diffusers/blob/cd502b25cf0debac6f98d27a6638ef95208d1ea2/src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py#L42"),c(ts,"rel","nofollow"),c(ss,"href","https://huggingface.co/docs/transformers/model_doc/bert#transformers.BertTokenizer"),c(ss,"rel","nofollow"),c(Mi,"href","/docs/diffusers/pr_1116/en/api/models#diffusers.UNet2DConditionModel"),c(Co,"id","loading-models"),c(Co,"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"),c(Co,"href","#loading-models"),c(uo,"class","relative group"),c(rs,"href","https://github.com/huggingface/diffusers/tree/main/src/diffusers/models"),c(rs,"rel","nofollow"),c(ji,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.ModelMixin.from_pretrained"),c(qi,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline.from_pretrained"),c(Ti,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.ModelMixin.from_pretrained"),c(Ii,"href","./api/models"),c(Si,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline.from_pretrained"),c(Li,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.ModelMixin.from_pretrained"),c(as,"href","https://huggingface.co/CompVis/ldm-text2im-large-256/tree/main/unet"),c(as,"rel","nofollow"),c(Ci,"href","%22./using-diffusers/loading#loading-customized-pipelines%22"),c(Oi,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline.from_pretrained"),c(ds,"href","https://huggingface.co/google/ddpm-cifar10-32"),c(ds,"rel","nofollow"),c(Fo,"id","loading-schedulers"),c(Fo,"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"),c(Fo,"href","#loading-schedulers"),c(mo,"class","relative group"),c(Fi,"href","/docs/diffusers/pr_1116/en/using-diffusers/configuration#diffusers.ConfigMixin.from_config"),c(zi,"href","/docs/diffusers/pr_1116/en/api/schedulers#diffusers.DDPMScheduler"),c(Ni,"href","/docs/diffusers/pr_1116/en/api/schedulers#diffusers.DDIMScheduler"),c(Ui,"href","/docs/diffusers/pr_1116/en/api/schedulers#diffusers.PNDMScheduler"),c(Vi,"href","/docs/diffusers/pr_1116/en/api/schedulers#diffusers.LMSDiscreteScheduler"),c(Yi,"href","/docs/diffusers/pr_1116/en/api/schedulers#diffusers.EulerDiscreteScheduler"),c(Wi,"href","/docs/diffusers/pr_1116/en/api/schedulers#diffusers.EulerAncestralDiscreteScheduler"),c(Hi,"href","/docs/diffusers/pr_1116/en/api/schedulers#diffusers.DPMSolverMultistepScheduler"),c(Bi,"href","/docs/diffusers/pr_1116/en/api/pipelines/stable_diffusion#diffusers.StableDiffusionPipeline"),c(zo,"id","diffusers.ModelMixin"),c(zo,"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"),c(zo,"href","#diffusers.ModelMixin"),c(go,"class","relative group"),c(Gi,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.ModelMixin"),c(Ki,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.ModelMixin.save_pretrained"),c(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Qi,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.DiffusionPipeline"),c(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(er,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.FlaxModelMixin"),c(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ko,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(tr,"href","/docs/diffusers/pr_1116/en/using-diffusers/loading#diffusers.FlaxDiffusionPipeline"),c(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(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(o,l){e(document.head,h),p(o,x,l),p(o,m,l),e(m,_),e(_,$),w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eg),e(Ve,Dg),e(Ve,ve),e(ve,$g),e(ve,da),e(da,xg),e(ve,Pg),e(ve,fa),e(fa,kg),e(ve,Mg),e(ve,ss),e(ss,ca),e(ca,jg),e(ve,qg),e(ve,Mi),e(Mi,Tg),p(o,Ad,l),p(o,uo,l),e(uo,Co),e(Co,pa),w(is,pa,null),e(uo,Ig),e(uo,ua),e(ua,Sg),p(o,Ld,l),p(o,be,l),e(be,Ag),e(be,rs),e(rs,Lg),e(be,Cg),e(be,ji),e(ji,Og),e(be,Fg),e(be,qi),e(qi,Xg),e(be,zg),p(o,Cd,l),p(o,Oo,l),e(Oo,ke),e(ke,Ng),e(ke,ha),e(ha,Ug),e(ke,Vg),e(ke,Ti),e(Ti,Yg),e(ke,Wg),e(ke,ma),e(ma,Hg),e(ke,Bg),e(Oo,Rg),e(Oo,ho),e(ho,Gg),e(ho,ga),e(ga,Kg),e(ho,Jg),e(ho,Ii),e(Ii,Qg),e(ho,Zg),p(o,Od,l),p(o,we,l),e(we,e_),e(we,Si),e(Si,o_),e(we,t_),e(we,_a),e(_a,s_),e(we,i_),e(we,va),e(va,r_),e(we,n_),p(o,Fd,l),p(o,Ai,l),e(Ai,a_),p(o,Xd,l),w(ns,o,l),p(o,zd,l),p(o,ye,l),e(ye,l_),e(ye,ba),e(ba,d_),e(ye,f_),e(ye,Li),e(Li,c_),e(ye,p_),e(ye,as),e(as,u_),e(ye,h_),p(o,Nd,l),p(o,We,l),e(We,m_),e(We,Ci),e(Ci,g_),e(We,__),e(We,Oi),e(Oi,v_),e(We,b_),p(o,Ud,l),w(ls,o,l),p(o,Vd,l),p(o,He,l),e(He,w_),e(He,ds),e(ds,wa),e(wa,y_),e(He,E_),e(He,ya),e(ya,D_),e(He,$_),p(o,Yd,l),w(fs,o,l),p(o,Wd,l),p(o,mo,l),e(mo,Fo),e(Fo,Ea),w(cs,Ea,null),e(mo,x_),e(mo,Da),e(Da,P_),p(o,Hd,l),p(o,ne,l),e(ne,k_),e(ne,$a),e($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e(A,fl),e(fl,cl),e(cl,K1),e(A,J1),e(A,pl),e(pl,Q1),e(A,Z1),e(A,ul),e(ul,Jo),e(Jo,hl),e(hl,eb),e(Jo,ob),e(Jo,ml),e(ml,tb),e(Jo,sb),e(A,ib),e(A,O),w(Ls,O,null),e(O,rb),e(O,gl),e(gl,nb),e(O,ab),e(O,Cs),e(Cs,lb),e(Cs,_l),e(_l,db),e(Cs,fb),e(O,cb),e(O,Os),e(Os,pb),e(Os,vl),e(vl,ub),e(Os,hb),e(O,mb),e(O,Fs),e(Fs,gb),e(Fs,bl),e(bl,_b),e(Fs,vb),e(O,bb),w(Qo,O,null),e(O,wb),w(Zo,O,null),e(O,yb),w(et,O,null),e(A,Eb),e(A,ot),w(Xs,ot,null),e(ot,Db),e(ot,zs),e(zs,$b),e(zs,wl),e(wl,xb),e(zs,Pb),tf=!0},p(o,[l]){const Ns={};l&2&&(Ns.$$scope={dirty:l,ctx:o}),No.$set(Ns);const yl={};l&2&&(yl.$$scope={dirty:l,ctx:o}),Uo.$set(yl);const El={};l&2&&(El.$$scope={dirty:l,ctx:o}),Wo.$set(El);const Dl={};l&2&&(Dl.$$scope={dirty:l,ctx:o}),Ho.$set(Dl);const Us={};l&2&&(Us.$$scope={dirty:l,ctx:o}),Bo.$set(Us);const $l={};l&2&&($l.$$scope={dirty:l,ctx:o}),Go.$set($l);const xl={};l&2&&(xl.$$scope={dirty:l,ctx:o}),Qo.$set(xl);const vo={};l&2&&(vo.$$scope={dirty:l,ctx:o}),Zo.$set(vo);const Vs={};l&2&&(Vs.$$scope={dirty:l,ctx:o}),et.$set(Vs)},i(o){tf||(y(u.$$.fragment,o),y(pt.$$.fragment,o),y(mt.$$.fragment,o),y(gt.$$.fragment,o),y(vt.$$.fragment,o),y(wt.$$.fragment,o),y(Et.$$.fragment,o),y($t.$$.fragment,o),y(Pt.$$.fragment,o),y(kt.$$.fragment,o),y(Tt.$$.fragment,o),y(It.$$.fragment,o),y(St.$$.fragment,o),y(Lt.$$.fragment,o),y(Xt.$$.fragment,o),y(Nt.$$.fragment,o),y(Ut.$$.fragment,o),y(Yt.$$.fragment,o),y(Ht.$$.fragment,o),y(Qt.$$.fragment,o),y(Zt.$$.fragment,o),y(es.$$.fragment,o),y(is.$$.fragment,o),y(ns.$$.fragment,o),y(ls.$$.fragment,o),y(fs.$$.fragment,o),y(cs.$$.fragment,o),y(ps.$$.fragment,o),y(us.$$.fragment,o),y(hs.$$.fragment,o),y(ms.$$.fragment,o),y(No.$$.fragment,o),y(Uo.$$.fragment,o),y(vs.$$.fragment,o),y(ws.$$.fragment,o),y(Es.$$.fragment,o),y(Wo.$$.fragment,o),y(Ho.$$.fragment,o),y(Bo.$$.fragment,o),y(Ps.$$.fragment,o),y(Ms.$$.fragment,o),y(js.$$.fragment,o),y(Go.$$.fragment,o),y(Is.$$.fragment,o),y(As.$$.fragment,o),y(Ls.$$.fragment,o),y(Qo.$$.fragment,o),y(Zo.$$.fragment,o),y(et.$$.fragment,o),y(Xs.$$.fragment,o),tf=!0)},o(o){E(u.$$.fragment,o),E(pt.$$.fragment,o),E(mt.$$.fragment,o),E(gt.$$.fragment,o),E(vt.$$.fragment,o),E(wt.$$.fragment,o),E(Et.$$.fragment,o),E($t.$$.fragment,o),E(Pt.$$.fragment,o),E(kt.$$.fragment,o),E(Tt.$$.fragment,o),E(It.$$.fragment,o),E(St.$$.fragment,o),E(Lt.$$.fragment,o),E(Xt.$$.fragment,o),E(Nt.$$.fragment,o),E(Ut.$$.fragment,o),E(Yt.$$.fragment,o),E(Ht.$$.fragment,o),E(Qt.$$.fragment,o),E(Zt.$$.fragment,o),E(es.$$.fragment,o),E(is.$$.fragment,o),E(ns.$$.fragment,o),E(ls.$$.fragment,o),E(fs.$$.fragment,o),E(cs.$$.fragment,o),E(ps.$$.fragment,o),E(us.$$.fragment,o),E(hs.$$.fragment,o),E(ms.$$.fragment,o),E(No.$$.fragment,o),E(Uo.$$.fragment,o),E(vs.$$.fragment,o),E(ws.$$.fragment,o),E(Es.$$.fragment,o),E(Wo.$$.fragment,o),E(Ho.$$.fragment,o),E(Bo.$$.fragment,o),E(Ps.$$.fragment,o),E(Ms.$$.fragment,o),E(js.$$.fragment,o),E(Go.$$.fragment,o),E(Is.$$.fragment,o),E(As.$$.fragment,o),E(Ls.$$.fragment,o),E(Qo.$$.fragment,o),E(Zo.$$.fragment,o),E(et.$$.fragment,o),E(Xs.$$.fragment,o),tf=!1},d(o){t(h),o&&t(x),o&&t(m),D(u),o&&t(I),o&&t(X),o&&t(Me),o&&t(he),o&&t(je),o&&t(qe),o&&t(Tl),o&&t(ro),D(pt),o&&t(Il),o&&t(me),o&&t(Sl),D(mt,o),o&&t(Al),o&&t(N),o&&t(Ll),o&&t(Do),o&&t(Cl),D(gt,o),o&&t(Ol),o&&t(q),o&&t(Fl),o&&t(no),D(vt),o&&t(Xl),o&&t(Te),o&&t(zl),D(wt,o),o&&t(Nl),o&&t(Ie),o&&t(Ul),D(Et,o),o&&t(Vl),o&&t(Se),o&&t(Yl),o&&t(xe),o&&t(Wl),o&&t(ii),o&&t(Hl),D($t,o),o&&t(Bl),o&&t(oe),o&&t(Rl),D(Pt,o),o&&t(Gl),o&&t(ri),o&&t(Kl),o&&t(ao),D(kt),o&&t(Jl),o&&t(ni),o&&t(Ql),o&&t(Ae),o&&t(Zl),o&&t(Le),o&&t(ed),D(Tt,o),o&&t(od),o&&t(Ce),o&&t(td),D(It,o),o&&t(sd),o&&t(Oe),o&&t(id),o&&t(lo),D(St),o&&t(rd),o&&t(te),o&&t(nd),o&&t(Pe),o&&t(ad),D(Lt,o),o&&t(ld),o&&t(ui),o&&t(dd),o&&t(Fe),o&&t(fd),o&&t(ge),o&&t(cd),o&&t(Xe),o&&t(pd),D(Xt,o),o&&t(ud),o&&t(se),o&&t(hd),D(Nt,o),o&&t(md),o&&t(Mo),o&&t(gd),o&&t(fo),D(Ut),o&&t(_d),o&&t(qo),o&&t(vd),o&&t(To),o&&t(bd),o&&t(ie),o&&t(wd),D(Yt,o),o&&t(yd),o&&t(Wt),o&&t(Ed),D(Ht,o),o&&t(Dd),o&&t(ze),o&&t($d),o&&t(re),o&&t(xd),o&&t(_e),o&&t(Pd),D(Qt,o),o&&t(kd),o&&t(M),o&&t(Md),o&&t(So),o&&t(jd),o&&t(Ne),o&&t(qd),D(Zt,o),o&&t(Td),o&&t(Ue),o&&t(Id),D(es,o),o&&t(Sd),o&&t(Ve),o&&t(Ad),o&&t(uo),D(is),o&&t(Ld),o&&t(be),o&&t(Cd),o&&t(Oo),o&&t(Od),o&&t(we),o&&t(Fd),o&&t(Ai),o&&t(Xd),D(ns,o),o&&t(zd),o&&t(ye),o&&t(Nd),o&&t(We),o&&t(Ud),D(ls,o),o&&t(Vd),o&&t(He),o&&t(Yd),D(fs,o),o&&t(Wd),o&&t(mo),D(cs),o&&t(Hd),o&&t(ne),o&&t(Bd),o&&t(Xi),o&&t(Rd),o&&t(V),o&&t(Gd),o&&t(Xo),o&&t(Kd),D(ps,o),o&&t(Jd),o&&t(go),D(us),o&&t(Qd),o&&t(H),D(hs),D(ms),D(No),D(Uo),D(vs),o&&t(Zd),o&&t(S),D(ws),D(Es),D(Wo),D(Ho),D(Bo),D(Ps),o&&t(ef),o&&t(Z),D(Ms),D(js),D(Go),D(Is),o&&t(of),o&&t(A),D(As),D(Ls),D(Qo),D(Zo),D(et),D(Xs)}}}const q5={local:"loading",sections:[{local:"loading-pipelines",sections:[{local:"loading-pipelines-that-require-access-request",title:"Loading pipelines that require access request"},{local:"loading-pipelines-locally",title:"Loading pipelines locally"},{local:"loading-customized-pipelines",title:"Loading customized pipelines"},{local:"how-does-loading-work",title:"How does loading work?"}],title:"Loading pipelines"},{local:"loading-models",title:"Loading models"},{local:"loading-schedulers",title:"Loading schedulers"},{local:"diffusers.ModelMixin",title:"API"}],title:"Loading"};function T5(L){return b5(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class F5 extends h5{constructor(h){super();m5(this,h,T5,j5,g5,{})}}export{F5 as default,q5 as metadata};
