import{S as gi,i as bi,s as vi,e as a,k as f,w as Gt,t as o,M as yi,c as s,d as t,m as c,a as r,x as It,h as n,b as l,N as E,G as e,g as d,y as kt,L as _i,q as Rt,o as Vt,B as Jt,v as Ei}from"../../../../chunks/vendor-hf-doc-builder.js";import{I as Ta}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{C as mi}from"../../../../chunks/CodeBlock-hf-doc-builder.js";function Si(xl){let S,sa,x,W,Nt,X,Ma,Wt,Aa,la,g,Za,B,Ua,Ga,H,Ia,ka,L,Ra,Va,z,Ja,Na,ra,ce,Wa,ia,y,$a,Q,Fa,Pa,q,ja,Ca,oa,m,Xa,Y,Ba,Ha,K,La,za,O,Qa,qa,ee,Ya,Ka,te,Oa,es,na,pe,ts,fa,ae,de,$,$t,w,ue,as,ss,he,ls,rs,me,is,os,u,D,ge,be,ns,fs,ve,cs,ps,ye,_e,Ft,wl,ds,T,Ee,Se,us,hs,xe,ms,gs,we,De,Pt,Dl,bs,M,Te,Me,vs,ys,Ae,_s,Es,Ze,Ue,jt,Tl,Ss,A,Ge,Ie,xs,ws,ke,Ds,Ts,Re,Ve,Ct,Ml,Ms,Z,Je,Ne,As,Zs,We,Us,Gs,$e,Fe,Xt,Al,Is,U,Pe,je,ks,Rs,Ce,Vs,Js,Xe,Be,Bt,Zl,Ns,G,He,Le,Ws,$s,ze,Fs,Ps,Qe,qe,Ht,Ul,js,I,Ye,Ke,Cs,Xs,Oe,Bs,Hs,et,tt,Lt,Gl,Ls,k,at,st,zs,Qs,lt,qs,Ys,rt,it,zt,Il,Ks,se,ot,nt,Os,el,ft,tl,al,R,ct,pt,sl,ll,dt,rl,il,ut,ht,Qt,kl,ca,V,F,qt,le,ol,Yt,nl,pa,mt,fl,da,J,P,Kt,re,cl,Ot,pl,ua,v,gt,dl,ul,bt,hl,ml,vt,gl,bl,ha,ie,ma,N,j,ea,oe,vl,ta,yl,ga,C,_l,aa,El,Sl,ba,ne,va;return X=new Ta({}),le=new Ta({}),re=new Ta({}),ie=new mi({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTJDJTIwRXVsZXJEaXNjcmV0ZVNjaGVkdWxlciUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTQlMjIpJTBBcGlwZWxpbmUuc2NoZWR1bGVyJTIwJTNEJTIwRXVsZXJEaXNjcmV0ZVNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlbGluZS5zY2hlZHVsZXIuY29uZmlnKSUwQSUwQSUyMyUyMG9yJTBBZXVsZXJfc2NoZWR1bGVyJTIwJTNEJTIwRXVsZXJEaXNjcmV0ZVNjaGVkdWxlci5mcm9tX3ByZXRyYWluZWQoJTIyQ29tcFZpcyUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNCUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnNjaGVkdWxlciUyMiklMEFwaXBlbGluZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJDb21wVmlzJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS00JTIyJTJDJTIwc2NoZWR1bGVyJTNEZXVsZXJfc2NoZWR1bGVyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline, EulerDiscreteScheduler

pipeline = StableDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>)
pipeline.scheduler = EulerDiscreteScheduler.from_config(pipeline.scheduler.config)

<span class="hljs-comment"># or</span>
euler_scheduler = EulerDiscreteScheduler.from_pretrained(<span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
pipeline = StableDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>, scheduler=euler_scheduler)`}}),oe=new Ta({}),ne=new mi({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMCglMEElMjAlMjAlMjAlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZSUyQyUwQSUyMCUyMCUyMCUyMFN0YWJsZURpZmZ1c2lvbkltZzJJbWdQaXBlbGluZSUyQyUwQSUyMCUyMCUyMCUyMFN0YWJsZURpZmZ1c2lvbklucGFpbnRQaXBlbGluZSUyQyUwQSklMEElMEF0ZXh0MmltZyUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJDb21wVmlzJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS00JTIyKSUwQWltZzJpbWclMjAlM0QlMjBTdGFibGVEaWZmdXNpb25JbWcySW1nUGlwZWxpbmUoKip0ZXh0MmltZy5jb21wb25lbnRzKSUwQWlucGFpbnQlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25JbnBhaW50UGlwZWxpbmUoKip0ZXh0MmltZy5jb21wb25lbnRzKSUwQSUwQSUyMyUyMG5vdyUyMHlvdSUyMGNhbiUyMHVzZSUyMHRleHQyaW1nKC4uLiklMkMlMjBpbWcyaW1nKC4uLiklMkMlMjBpbnBhaW50KC4uLiklMjBqdXN0JTIwbGlrZSUyMHRoZSUyMGNhbGwlMjBtZXRob2RzJTIwb2YlMjBlYWNoJTIwcmVzcGVjdGl2ZSUyMHBpcGVsaW5l",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> (
    StableDiffusionPipeline,
    StableDiffusionImg2ImgPipeline,
    StableDiffusionInpaintPipeline,
)

text2img = StableDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>)
img2img = StableDiffusionImg2ImgPipeline(**text2img.components)
inpaint = StableDiffusionInpaintPipeline(**text2img.components)

<span class="hljs-comment"># now you can use text2img(...), img2img(...), inpaint(...) just like the call methods of each respective pipeline</span>`}}),{c(){S=a("meta"),sa=f(),x=a("h1"),W=a("a"),Nt=a("span"),Gt(X.$$.fragment),Ma=f(),Wt=a("span"),Aa=o("Stable Diffusion pipelines"),la=f(),g=a("p"),Za=o("Stable Diffusion is a text-to-image latent diffusion model created by the researchers and engineers from "),B=a("a"),Ua=o("CompVis"),Ga=o(", "),H=a("a"),Ia=o("Stability AI"),ka=o(" and "),L=a("a"),Ra=o("LAION"),Va=o(". Latent diffusion applies the diffusion process over a lower dimensional latent space to reduce memory and compute complexity. This specific type of diffusion model was proposed in "),z=a("a"),Ja=o("High-Resolution Image Synthesis with Latent Diffusion Models"),Na=o(" by Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Bj\xF6rn Ommer."),ra=f(),ce=a("p"),Wa=o("Stable Diffusion is trained on 512x512 images from a subset of the LAION-5B dataset. This model uses a frozen CLIP ViT-L/14 text encoder to condition the model on text prompts. With its 860M UNet and 123M text encoder, the model is relatively lightweight and can run on consumer GPUs."),ia=f(),y=a("p"),$a=o("For more details about how Stable Diffusion works and how it differs from the base latent diffusion model, take a look at the Stability AI "),Q=a("a"),Fa=o("announcement"),Pa=o(" and our own "),q=a("a"),ja=o("blog post"),Ca=o(" for more technical details."),oa=f(),m=a("p"),Xa=o("You can find the original codebase for Stable Diffusion v1.0 at "),Y=a("a"),Ba=o("CompVis/stable-diffusion"),Ha=o(" and Stable Diffusion v2.0 at "),K=a("a"),La=o("Stability-AI/stablediffusion"),za=o(" as well as their original scripts for various tasks. Additional official checkpoints for the different Stable Diffusion versions and tasks can be found on the "),O=a("a"),Qa=o("CompVis"),qa=o(", "),ee=a("a"),Ya=o("Runway"),Ka=o(", and "),te=a("a"),Oa=o("Stability AI"),es=o(" Hub organizations. Explore these organizations to find the best checkpoint for your use-case!"),na=f(),pe=a("p"),ts=o("The table below summarizes the available Stable Diffusion pipelines, their supported tasks, and an interactive demo:"),fa=f(),ae=a("div"),de=a("div"),$=a("table"),$t=a("thead"),w=a("tr"),ue=a("th"),as=o("Pipeline"),ss=f(),he=a("th"),ls=o("Supported tasks"),rs=f(),me=a("th"),is=o("Space"),os=f(),u=a("tbody"),D=a("tr"),ge=a("td"),be=a("a"),ns=o("StableDiffusion"),fs=f(),ve=a("td"),cs=o("text-to-image"),ps=f(),ye=a("td"),_e=a("a"),Ft=a("img"),ds=f(),T=a("tr"),Ee=a("td"),Se=a("a"),us=o("StableDiffusionImg2Img"),hs=f(),xe=a("td"),ms=o("image-to-image"),gs=f(),we=a("td"),De=a("a"),Pt=a("img"),bs=f(),M=a("tr"),Te=a("td"),Me=a("a"),vs=o("StableDiffusionInpaint"),ys=f(),Ae=a("td"),_s=o("inpainting"),Es=f(),Ze=a("td"),Ue=a("a"),jt=a("img"),Ss=f(),A=a("tr"),Ge=a("td"),Ie=a("a"),xs=o("StableDiffusionDepth2Img"),ws=f(),ke=a("td"),Ds=o("depth-to-image"),Ts=f(),Re=a("td"),Ve=a("a"),Ct=a("img"),Ms=f(),Z=a("tr"),Je=a("td"),Ne=a("a"),As=o("StableDiffusionImageVariation"),Zs=f(),We=a("td"),Us=o("image variation"),Gs=f(),$e=a("td"),Fe=a("a"),Xt=a("img"),Is=f(),U=a("tr"),Pe=a("td"),je=a("a"),ks=o("StableDiffusionPipelineSafe"),Rs=f(),Ce=a("td"),Vs=o("filtered text-to-image"),Js=f(),Xe=a("td"),Be=a("a"),Bt=a("img"),Ns=f(),G=a("tr"),He=a("td"),Le=a("a"),Ws=o("StableDiffusion2"),$s=f(),ze=a("td"),Fs=o("text-to-image, inpainting, depth-to-image, super-resolution"),Ps=f(),Qe=a("td"),qe=a("a"),Ht=a("img"),js=f(),I=a("tr"),Ye=a("td"),Ke=a("a"),Cs=o("StableDiffusionXL"),Xs=f(),Oe=a("td"),Bs=o("text-to-image, image-to-image"),Hs=f(),et=a("td"),tt=a("a"),Lt=a("img"),Ls=f(),k=a("tr"),at=a("td"),st=a("a"),zs=o("StableDiffusionLatentUpscale"),Qs=f(),lt=a("td"),qs=o("super-resolution"),Ys=f(),rt=a("td"),it=a("a"),zt=a("img"),Ks=f(),se=a("tr"),ot=a("td"),nt=a("a"),Os=o("StableDiffusionUpscale"),el=f(),ft=a("td"),tl=o("super-resolution"),al=f(),R=a("tr"),ct=a("td"),pt=a("a"),sl=o("StableDiffusionLDM3D"),ll=f(),dt=a("td"),rl=o("text-to-rgb, text-to-depth"),il=f(),ut=a("td"),ht=a("a"),Qt=a("img"),ca=f(),V=a("h2"),F=a("a"),qt=a("span"),Gt(le.$$.fragment),ol=f(),Yt=a("span"),nl=o("Tips"),pa=f(),mt=a("p"),fl=o("To help you get the most out of the Stable Diffusion pipelines, here are a few tips for improving performance and usability. These tips are applicable to all Stable Diffusion pipelines."),da=f(),J=a("h3"),P=a("a"),Kt=a("span"),Gt(re.$$.fragment),cl=f(),Ot=a("span"),pl=o("Explore tradeoff between speed and quality"),ua=f(),v=a("p"),gt=a("a"),dl=o("StableDiffusionPipeline"),ul=o(" uses the "),bt=a("a"),hl=o("PNDMScheduler"),ml=o(" by default, but \u{1F917} Diffusers provides many other schedulers (some of which are faster or output better quality) that are compatible. For example, if you want to use the "),vt=a("a"),gl=o("EulerDiscreteScheduler"),bl=o(" instead of the default:"),ha=f(),Gt(ie.$$.fragment),ma=f(),N=a("h3"),j=a("a"),ea=a("span"),Gt(oe.$$.fragment),vl=f(),ta=a("span"),yl=o("Reuse pipeline components to save memory"),ga=f(),C=a("p"),_l=o("To save memory and use the same components across multiple pipelines, use the "),aa=a("code"),El=o(".components"),Sl=o(" method to avoid loading weights into RAM more than once."),ba=f(),Gt(ne.$$.fragment),this.h()},l(i){const p=yi('[data-svelte="svelte-1phssyn"]',document.head);S=s(p,"META",{name:!0,content:!0}),p.forEach(t),sa=c(i),x=s(i,"H1",{class:!0});var ya=r(x);W=s(ya,"A",{id:!0,class:!0,href:!0});var Rl=r(W);Nt=s(Rl,"SPAN",{});var Vl=r(Nt);It(X.$$.fragment,Vl),Vl.forEach(t),Rl.forEach(t),Ma=c(ya),Wt=s(ya,"SPAN",{});var Jl=r(Wt);Aa=n(Jl,"Stable Diffusion pipelines"),Jl.forEach(t),ya.forEach(t),la=c(i),g=s(i,"P",{});var _=r(g);Za=n(_,"Stable Diffusion is a text-to-image latent diffusion model created by the researchers and engineers from "),B=s(_,"A",{href:!0,rel:!0});var Nl=r(B);Ua=n(Nl,"CompVis"),Nl.forEach(t),Ga=n(_,", "),H=s(_,"A",{href:!0,rel:!0});var Wl=r(H);Ia=n(Wl,"Stability AI"),Wl.forEach(t),ka=n(_," and "),L=s(_,"A",{href:!0,rel:!0});var $l=r(L);Ra=n($l,"LAION"),$l.forEach(t),Va=n(_,". Latent diffusion applies the diffusion process over a lower dimensional latent space to reduce memory and compute complexity. This specific type of diffusion model was proposed in "),z=s(_,"A",{href:!0,rel:!0});var Fl=r(z);Ja=n(Fl,"High-Resolution Image Synthesis with Latent Diffusion Models"),Fl.forEach(t),Na=n(_," by Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Bj\xF6rn Ommer."),_.forEach(t),ra=c(i),ce=s(i,"P",{});var Pl=r(ce);Wa=n(Pl,"Stable Diffusion is trained on 512x512 images from a subset of the LAION-5B dataset. This model uses a frozen CLIP ViT-L/14 text encoder to condition the model on text prompts. With its 860M UNet and 123M text encoder, the model is relatively lightweight and can run on consumer GPUs."),Pl.forEach(t),ia=c(i),y=s(i,"P",{});var yt=r(y);$a=n(yt,"For more details about how Stable Diffusion works and how it differs from the base latent diffusion model, take a look at the Stability AI "),Q=s(yt,"A",{href:!0,rel:!0});var jl=r(Q);Fa=n(jl,"announcement"),jl.forEach(t),Pa=n(yt," and our own "),q=s(yt,"A",{href:!0,rel:!0});var Cl=r(q);ja=n(Cl,"blog post"),Cl.forEach(t),Ca=n(yt," for more technical details."),yt.forEach(t),oa=c(i),m=s(i,"P",{});var b=r(m);Xa=n(b,"You can find the original codebase for Stable Diffusion v1.0 at "),Y=s(b,"A",{href:!0,rel:!0});var Xl=r(Y);Ba=n(Xl,"CompVis/stable-diffusion"),Xl.forEach(t),Ha=n(b," and Stable Diffusion v2.0 at "),K=s(b,"A",{href:!0,rel:!0});var Bl=r(K);La=n(Bl,"Stability-AI/stablediffusion"),Bl.forEach(t),za=n(b," as well as their original scripts for various tasks. Additional official checkpoints for the different Stable Diffusion versions and tasks can be found on the "),O=s(b,"A",{href:!0,rel:!0});var Hl=r(O);Qa=n(Hl,"CompVis"),Hl.forEach(t),qa=n(b,", "),ee=s(b,"A",{href:!0,rel:!0});var Ll=r(ee);Ya=n(Ll,"Runway"),Ll.forEach(t),Ka=n(b,", and "),te=s(b,"A",{href:!0,rel:!0});var zl=r(te);Oa=n(zl,"Stability AI"),zl.forEach(t),es=n(b," Hub organizations. Explore these organizations to find the best checkpoint for your use-case!"),b.forEach(t),na=c(i),pe=s(i,"P",{});var Ql=r(pe);ts=n(Ql,"The table below summarizes the available Stable Diffusion pipelines, their supported tasks, and an interactive demo:"),Ql.forEach(t),fa=c(i),ae=s(i,"DIV",{class:!0});var ql=r(ae);de=s(ql,"DIV",{class:!0});var Yl=r(de);$=s(Yl,"TABLE",{class:!0});var _a=r($);$t=s(_a,"THEAD",{});var Kl=r($t);w=s(Kl,"TR",{});var _t=r(w);ue=s(_t,"TH",{class:!0});var Ol=r(ue);as=n(Ol,"Pipeline"),Ol.forEach(t),ss=c(_t),he=s(_t,"TH",{class:!0});var er=r(he);ls=n(er,"Supported tasks"),er.forEach(t),rs=c(_t),me=s(_t,"TH",{class:!0});var tr=r(me);is=n(tr,"Space"),tr.forEach(t),_t.forEach(t),Kl.forEach(t),os=c(_a),u=s(_a,"TBODY",{class:!0});var h=r(u);D=s(h,"TR",{});var Et=r(D);ge=s(Et,"TD",{class:!0});var ar=r(ge);be=s(ar,"A",{href:!0});var sr=r(be);ns=n(sr,"StableDiffusion"),sr.forEach(t),ar.forEach(t),fs=c(Et),ve=s(Et,"TD",{class:!0});var lr=r(ve);cs=n(lr,"text-to-image"),lr.forEach(t),ps=c(Et),ye=s(Et,"TD",{class:!0});var rr=r(ye);_e=s(rr,"A",{href:!0});var ir=r(_e);Ft=s(ir,"IMG",{src:!0}),ir.forEach(t),rr.forEach(t),Et.forEach(t),ds=c(h),T=s(h,"TR",{});var St=r(T);Ee=s(St,"TD",{class:!0});var or=r(Ee);Se=s(or,"A",{href:!0});var nr=r(Se);us=n(nr,"StableDiffusionImg2Img"),nr.forEach(t),or.forEach(t),hs=c(St),xe=s(St,"TD",{class:!0});var fr=r(xe);ms=n(fr,"image-to-image"),fr.forEach(t),gs=c(St),we=s(St,"TD",{class:!0});var cr=r(we);De=s(cr,"A",{href:!0});var pr=r(De);Pt=s(pr,"IMG",{src:!0}),pr.forEach(t),cr.forEach(t),St.forEach(t),bs=c(h),M=s(h,"TR",{});var xt=r(M);Te=s(xt,"TD",{class:!0});var dr=r(Te);Me=s(dr,"A",{href:!0});var ur=r(Me);vs=n(ur,"StableDiffusionInpaint"),ur.forEach(t),dr.forEach(t),ys=c(xt),Ae=s(xt,"TD",{class:!0});var hr=r(Ae);_s=n(hr,"inpainting"),hr.forEach(t),Es=c(xt),Ze=s(xt,"TD",{class:!0});var mr=r(Ze);Ue=s(mr,"A",{href:!0});var gr=r(Ue);jt=s(gr,"IMG",{src:!0}),gr.forEach(t),mr.forEach(t),xt.forEach(t),Ss=c(h),A=s(h,"TR",{});var wt=r(A);Ge=s(wt,"TD",{class:!0});var br=r(Ge);Ie=s(br,"A",{href:!0});var vr=r(Ie);xs=n(vr,"StableDiffusionDepth2Img"),vr.forEach(t),br.forEach(t),ws=c(wt),ke=s(wt,"TD",{class:!0});var yr=r(ke);Ds=n(yr,"depth-to-image"),yr.forEach(t),Ts=c(wt),Re=s(wt,"TD",{class:!0});var _r=r(Re);Ve=s(_r,"A",{href:!0});var Er=r(Ve);Ct=s(Er,"IMG",{src:!0}),Er.forEach(t),_r.forEach(t),wt.forEach(t),Ms=c(h),Z=s(h,"TR",{});var Dt=r(Z);Je=s(Dt,"TD",{class:!0});var Sr=r(Je);Ne=s(Sr,"A",{href:!0});var xr=r(Ne);As=n(xr,"StableDiffusionImageVariation"),xr.forEach(t),Sr.forEach(t),Zs=c(Dt),We=s(Dt,"TD",{class:!0});var wr=r(We);Us=n(wr,"image variation"),wr.forEach(t),Gs=c(Dt),$e=s(Dt,"TD",{class:!0});var Dr=r($e);Fe=s(Dr,"A",{href:!0});var Tr=r(Fe);Xt=s(Tr,"IMG",{src:!0}),Tr.forEach(t),Dr.forEach(t),Dt.forEach(t),Is=c(h),U=s(h,"TR",{});var Tt=r(U);Pe=s(Tt,"TD",{class:!0});var Mr=r(Pe);je=s(Mr,"A",{href:!0});var Ar=r(je);ks=n(Ar,"StableDiffusionPipelineSafe"),Ar.forEach(t),Mr.forEach(t),Rs=c(Tt),Ce=s(Tt,"TD",{class:!0});var Zr=r(Ce);Vs=n(Zr,"filtered text-to-image"),Zr.forEach(t),Js=c(Tt),Xe=s(Tt,"TD",{class:!0});var Ur=r(Xe);Be=s(Ur,"A",{href:!0});var Gr=r(Be);Bt=s(Gr,"IMG",{src:!0}),Gr.forEach(t),Ur.forEach(t),Tt.forEach(t),Ns=c(h),G=s(h,"TR",{});var Mt=r(G);He=s(Mt,"TD",{class:!0});var Ir=r(He);Le=s(Ir,"A",{href:!0});var kr=r(Le);Ws=n(kr,"StableDiffusion2"),kr.forEach(t),Ir.forEach(t),$s=c(Mt),ze=s(Mt,"TD",{class:!0});var Rr=r(ze);Fs=n(Rr,"text-to-image, inpainting, depth-to-image, super-resolution"),Rr.forEach(t),Ps=c(Mt),Qe=s(Mt,"TD",{class:!0});var Vr=r(Qe);qe=s(Vr,"A",{href:!0});var Jr=r(qe);Ht=s(Jr,"IMG",{src:!0}),Jr.forEach(t),Vr.forEach(t),Mt.forEach(t),js=c(h),I=s(h,"TR",{});var At=r(I);Ye=s(At,"TD",{class:!0});var Nr=r(Ye);Ke=s(Nr,"A",{href:!0});var Wr=r(Ke);Cs=n(Wr,"StableDiffusionXL"),Wr.forEach(t),Nr.forEach(t),Xs=c(At),Oe=s(At,"TD",{class:!0});var $r=r(Oe);Bs=n($r,"text-to-image, image-to-image"),$r.forEach(t),Hs=c(At),et=s(At,"TD",{class:!0});var Fr=r(et);tt=s(Fr,"A",{href:!0});var Pr=r(tt);Lt=s(Pr,"IMG",{src:!0}),Pr.forEach(t),Fr.forEach(t),At.forEach(t),Ls=c(h),k=s(h,"TR",{});var Zt=r(k);at=s(Zt,"TD",{class:!0});var jr=r(at);st=s(jr,"A",{href:!0});var Cr=r(st);zs=n(Cr,"StableDiffusionLatentUpscale"),Cr.forEach(t),jr.forEach(t),Qs=c(Zt),lt=s(Zt,"TD",{class:!0});var Xr=r(lt);qs=n(Xr,"super-resolution"),Xr.forEach(t),Ys=c(Zt),rt=s(Zt,"TD",{class:!0});var Br=r(rt);it=s(Br,"A",{href:!0});var Hr=r(it);zt=s(Hr,"IMG",{src:!0}),Hr.forEach(t),Br.forEach(t),Zt.forEach(t),Ks=c(h),se=s(h,"TR",{});var Ea=r(se);ot=s(Ea,"TD",{class:!0});var Lr=r(ot);nt=s(Lr,"A",{href:!0});var zr=r(nt);Os=n(zr,"StableDiffusionUpscale"),zr.forEach(t),Lr.forEach(t),el=c(Ea),ft=s(Ea,"TD",{class:!0});var Qr=r(ft);tl=n(Qr,"super-resolution"),Qr.forEach(t),Ea.forEach(t),al=c(h),R=s(h,"TR",{});var Ut=r(R);ct=s(Ut,"TD",{class:!0});var qr=r(ct);pt=s(qr,"A",{href:!0});var Yr=r(pt);sl=n(Yr,"StableDiffusionLDM3D"),Yr.forEach(t),qr.forEach(t),ll=c(Ut),dt=s(Ut,"TD",{class:!0});var Kr=r(dt);rl=n(Kr,"text-to-rgb, text-to-depth"),Kr.forEach(t),il=c(Ut),ut=s(Ut,"TD",{class:!0});var Or=r(ut);ht=s(Or,"A",{href:!0});var ei=r(ht);Qt=s(ei,"IMG",{src:!0}),ei.forEach(t),Or.forEach(t),Ut.forEach(t),h.forEach(t),_a.forEach(t),Yl.forEach(t),ql.forEach(t),ca=c(i),V=s(i,"H2",{class:!0});var Sa=r(V);F=s(Sa,"A",{id:!0,class:!0,href:!0});var ti=r(F);qt=s(ti,"SPAN",{});var ai=r(qt);It(le.$$.fragment,ai),ai.forEach(t),ti.forEach(t),ol=c(Sa),Yt=s(Sa,"SPAN",{});var si=r(Yt);nl=n(si,"Tips"),si.forEach(t),Sa.forEach(t),pa=c(i),mt=s(i,"P",{});var li=r(mt);fl=n(li,"To help you get the most out of the Stable Diffusion pipelines, here are a few tips for improving performance and usability. These tips are applicable to all Stable Diffusion pipelines."),li.forEach(t),da=c(i),J=s(i,"H3",{class:!0});var xa=r(J);P=s(xa,"A",{id:!0,class:!0,href:!0});var ri=r(P);Kt=s(ri,"SPAN",{});var ii=r(Kt);It(re.$$.fragment,ii),ii.forEach(t),ri.forEach(t),cl=c(xa),Ot=s(xa,"SPAN",{});var oi=r(Ot);pl=n(oi,"Explore tradeoff between speed and quality"),oi.forEach(t),xa.forEach(t),ua=c(i),v=s(i,"P",{});var fe=r(v);gt=s(fe,"A",{href:!0});var ni=r(gt);dl=n(ni,"StableDiffusionPipeline"),ni.forEach(t),ul=n(fe," uses the "),bt=s(fe,"A",{href:!0});var fi=r(bt);hl=n(fi,"PNDMScheduler"),fi.forEach(t),ml=n(fe," by default, but \u{1F917} Diffusers provides many other schedulers (some of which are faster or output better quality) that are compatible. For example, if you want to use the "),vt=s(fe,"A",{href:!0});var ci=r(vt);gl=n(ci,"EulerDiscreteScheduler"),ci.forEach(t),bl=n(fe," instead of the default:"),fe.forEach(t),ha=c(i),It(ie.$$.fragment,i),ma=c(i),N=s(i,"H3",{class:!0});var wa=r(N);j=s(wa,"A",{id:!0,class:!0,href:!0});var pi=r(j);ea=s(pi,"SPAN",{});var di=r(ea);It(oe.$$.fragment,di),di.forEach(t),pi.forEach(t),vl=c(wa),ta=s(wa,"SPAN",{});var ui=r(ta);yl=n(ui,"Reuse pipeline components to save memory"),ui.forEach(t),wa.forEach(t),ga=c(i),C=s(i,"P",{});var Da=r(C);_l=n(Da,"To save memory and use the same components across multiple pipelines, use the "),aa=s(Da,"CODE",{});var hi=r(aa);El=n(hi,".components"),hi.forEach(t),Sl=n(Da," method to avoid loading weights into RAM more than once."),Da.forEach(t),ba=c(i),It(ne.$$.fragment,i),this.h()},h(){l(S,"name","hf:doc:metadata"),l(S,"content",JSON.stringify(xi)),l(W,"id","stable-diffusion-pipelines"),l(W,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(W,"href","#stable-diffusion-pipelines"),l(x,"class","relative group"),l(B,"href","https://github.com/CompVis"),l(B,"rel","nofollow"),l(H,"href","https://stability.ai/"),l(H,"rel","nofollow"),l(L,"href","https://laion.ai/"),l(L,"rel","nofollow"),l(z,"href","https://huggingface.co/papers/2112.10752"),l(z,"rel","nofollow"),l(Q,"href","https://stability.ai/blog/stable-diffusion-announcement"),l(Q,"rel","nofollow"),l(q,"href","https://huggingface.co/blog/stable_diffusion#how-does-stable-diffusion-work"),l(q,"rel","nofollow"),l(Y,"href","https://github.com/CompVis/stable-diffusion"),l(Y,"rel","nofollow"),l(K,"href","https://github.com/Stability-AI/stablediffusion"),l(K,"rel","nofollow"),l(O,"href","https://huggingface.co/CompVis"),l(O,"rel","nofollow"),l(ee,"href","https://huggingface.co/runwayml"),l(ee,"rel","nofollow"),l(te,"href","https://huggingface.co/stabilityai"),l(te,"rel","nofollow"),l(ue,"class","px-4 py-2 font-medium text-gray-900 text-left"),l(he,"class","px-4 py-2 font-medium text-gray-900 text-left"),l(me,"class","px-4 py-2 font-medium text-gray-900 text-left"),l(be,"href","./text2img"),l(ge,"class","px-4 py-2 text-gray-700"),l(ve,"class","px-4 py-2 text-gray-700"),E(Ft.src,wl="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||l(Ft,"src",wl),l(_e,"href","https://huggingface.co/spaces/stabilityai/stable-diffusion"),l(ye,"class","px-4 py-2"),l(Se,"href","./img2img"),l(Ee,"class","px-4 py-2 text-gray-700"),l(xe,"class","px-4 py-2 text-gray-700"),E(Pt.src,Dl="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||l(Pt,"src",Dl),l(De,"href","https://huggingface.co/spaces/huggingface/diffuse-the-rest"),l(we,"class","px-4 py-2"),l(Me,"href","./inpaint"),l(Te,"class","px-4 py-2 text-gray-700"),l(Ae,"class","px-4 py-2 text-gray-700"),E(jt.src,Tl="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||l(jt,"src",Tl),l(Ue,"href","https://huggingface.co/spaces/runwayml/stable-diffusion-inpainting"),l(Ze,"class","px-4 py-2"),l(Ie,"href","./depth2img"),l(Ge,"class","px-4 py-2 text-gray-700"),l(ke,"class","px-4 py-2 text-gray-700"),E(Ct.src,Ml="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||l(Ct,"src",Ml),l(Ve,"href","https://huggingface.co/spaces/radames/stable-diffusion-depth2img"),l(Re,"class","px-4 py-2"),l(Ne,"href","./image_variation"),l(Je,"class","px-4 py-2 text-gray-700"),l(We,"class","px-4 py-2 text-gray-700"),E(Xt.src,Al="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||l(Xt,"src",Al),l(Fe,"href","https://huggingface.co/spaces/lambdalabs/stable-diffusion-image-variations"),l($e,"class","px-4 py-2"),l(je,"href","./stable_diffusion_safe"),l(Pe,"class","px-4 py-2 text-gray-700"),l(Ce,"class","px-4 py-2 text-gray-700"),E(Bt.src,Zl="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||l(Bt,"src",Zl),l(Be,"href","https://huggingface.co/spaces/AIML-TUDA/unsafe-vs-safe-stable-diffusion"),l(Xe,"class","px-4 py-2"),l(Le,"href","./stable_diffusion_2"),l(He,"class","px-4 py-2 text-gray-700"),l(ze,"class","px-4 py-2 text-gray-700"),E(Ht.src,Ul="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||l(Ht,"src",Ul),l(qe,"href","https://huggingface.co/spaces/stabilityai/stable-diffusion"),l(Qe,"class","px-4 py-2"),l(Ke,"href","./stable_diffusion_xl"),l(Ye,"class","px-4 py-2 text-gray-700"),l(Oe,"class","px-4 py-2 text-gray-700"),E(Lt.src,Gl="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||l(Lt,"src",Gl),l(tt,"href","https://huggingface.co/spaces/RamAnanth1/stable-diffusion-xl"),l(et,"class","px-4 py-2"),l(st,"href","./latent_upscale"),l(at,"class","px-4 py-2 text-gray-700"),l(lt,"class","px-4 py-2 text-gray-700"),E(zt.src,Il="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||l(zt,"src",Il),l(it,"href","https://huggingface.co/spaces/huggingface-projects/stable-diffusion-latent-upscaler"),l(rt,"class","px-4 py-2"),l(nt,"href","./upscale"),l(ot,"class","px-4 py-2 text-gray-700"),l(ft,"class","px-4 py-2 text-gray-700"),l(pt,"href","./ldm3d_diffusion"),l(ct,"class","px-4 py-2 text-gray-700"),l(dt,"class","px-4 py-2 text-gray-700"),E(Qt.src,kl="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||l(Qt,"src",kl),l(ht,"href","https://huggingface.co/spaces/r23/ldm3d-space"),l(ut,"class","px-4 py-2"),l(u,"class","divide-y divide-gray-200"),l($,"class","min-w-full divide-y-2 divide-gray-200 bg-white text-sm"),l(de,"class","rounded-xl border border-gray-200"),l(ae,"class","flex justify-center"),l(F,"id","tips"),l(F,"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"),l(F,"href","#tips"),l(V,"class","relative group"),l(P,"id","explore-tradeoff-between-speed-and-quality"),l(P,"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"),l(P,"href","#explore-tradeoff-between-speed-and-quality"),l(J,"class","relative group"),l(gt,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),l(bt,"href","/docs/diffusers/v0.19.0/en/api/schedulers/pndm#diffusers.PNDMScheduler"),l(vt,"href","/docs/diffusers/v0.19.0/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler"),l(j,"id","reuse-pipeline-components-to-save-memory"),l(j,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(j,"href","#reuse-pipeline-components-to-save-memory"),l(N,"class","relative group")},m(i,p){e(document.head,S),d(i,sa,p),d(i,x,p),e(x,W),e(W,Nt),kt(X,Nt,null),e(x,Ma),e(x,Wt),e(Wt,Aa),d(i,la,p),d(i,g,p),e(g,Za),e(g,B),e(B,Ua),e(g,Ga),e(g,H),e(H,Ia),e(g,ka),e(g,L),e(L,Ra),e(g,Va),e(g,z),e(z,Ja),e(g,Na),d(i,ra,p),d(i,ce,p),e(ce,Wa),d(i,ia,p),d(i,y,p),e(y,$a),e(y,Q),e(Q,Fa),e(y,Pa),e(y,q),e(q,ja),e(y,Ca),d(i,oa,p),d(i,m,p),e(m,Xa),e(m,Y),e(Y,Ba),e(m,Ha),e(m,K),e(K,La),e(m,za),e(m,O),e(O,Qa),e(m,qa),e(m,ee),e(ee,Ya),e(m,Ka),e(m,te),e(te,Oa),e(m,es),d(i,na,p),d(i,pe,p),e(pe,ts),d(i,fa,p),d(i,ae,p),e(ae,de),e(de,$),e($,$t),e($t,w),e(w,ue),e(ue,as),e(w,ss),e(w,he),e(he,ls),e(w,rs),e(w,me),e(me,is),e($,os),e($,u),e(u,D),e(D,ge),e(ge,be),e(be,ns),e(D,fs),e(D,ve),e(ve,cs),e(D,ps),e(D,ye),e(ye,_e),e(_e,Ft),e(u,ds),e(u,T),e(T,Ee),e(Ee,Se),e(Se,us),e(T,hs),e(T,xe),e(xe,ms),e(T,gs),e(T,we),e(we,De),e(De,Pt),e(u,bs),e(u,M),e(M,Te),e(Te,Me),e(Me,vs),e(M,ys),e(M,Ae),e(Ae,_s),e(M,Es),e(M,Ze),e(Ze,Ue),e(Ue,jt),e(u,Ss),e(u,A),e(A,Ge),e(Ge,Ie),e(Ie,xs),e(A,ws),e(A,ke),e(ke,Ds),e(A,Ts),e(A,Re),e(Re,Ve),e(Ve,Ct),e(u,Ms),e(u,Z),e(Z,Je),e(Je,Ne),e(Ne,As),e(Z,Zs),e(Z,We),e(We,Us),e(Z,Gs),e(Z,$e),e($e,Fe),e(Fe,Xt),e(u,Is),e(u,U),e(U,Pe),e(Pe,je),e(je,ks),e(U,Rs),e(U,Ce),e(Ce,Vs),e(U,Js),e(U,Xe),e(Xe,Be),e(Be,Bt),e(u,Ns),e(u,G),e(G,He),e(He,Le),e(Le,Ws),e(G,$s),e(G,ze),e(ze,Fs),e(G,Ps),e(G,Qe),e(Qe,qe),e(qe,Ht),e(u,js),e(u,I),e(I,Ye),e(Ye,Ke),e(Ke,Cs),e(I,Xs),e(I,Oe),e(Oe,Bs),e(I,Hs),e(I,et),e(et,tt),e(tt,Lt),e(u,Ls),e(u,k),e(k,at),e(at,st),e(st,zs),e(k,Qs),e(k,lt),e(lt,qs),e(k,Ys),e(k,rt),e(rt,it),e(it,zt),e(u,Ks),e(u,se),e(se,ot),e(ot,nt),e(nt,Os),e(se,el),e(se,ft),e(ft,tl),e(u,al),e(u,R),e(R,ct),e(ct,pt),e(pt,sl),e(R,ll),e(R,dt),e(dt,rl),e(R,il),e(R,ut),e(ut,ht),e(ht,Qt),d(i,ca,p),d(i,V,p),e(V,F),e(F,qt),kt(le,qt,null),e(V,ol),e(V,Yt),e(Yt,nl),d(i,pa,p),d(i,mt,p),e(mt,fl),d(i,da,p),d(i,J,p),e(J,P),e(P,Kt),kt(re,Kt,null),e(J,cl),e(J,Ot),e(Ot,pl),d(i,ua,p),d(i,v,p),e(v,gt),e(gt,dl),e(v,ul),e(v,bt),e(bt,hl),e(v,ml),e(v,vt),e(vt,gl),e(v,bl),d(i,ha,p),kt(ie,i,p),d(i,ma,p),d(i,N,p),e(N,j),e(j,ea),kt(oe,ea,null),e(N,vl),e(N,ta),e(ta,yl),d(i,ga,p),d(i,C,p),e(C,_l),e(C,aa),e(aa,El),e(C,Sl),d(i,ba,p),kt(ne,i,p),va=!0},p:_i,i(i){va||(Rt(X.$$.fragment,i),Rt(le.$$.fragment,i),Rt(re.$$.fragment,i),Rt(ie.$$.fragment,i),Rt(oe.$$.fragment,i),Rt(ne.$$.fragment,i),va=!0)},o(i){Vt(X.$$.fragment,i),Vt(le.$$.fragment,i),Vt(re.$$.fragment,i),Vt(ie.$$.fragment,i),Vt(oe.$$.fragment,i),Vt(ne.$$.fragment,i),va=!1},d(i){t(S),i&&t(sa),i&&t(x),Jt(X),i&&t(la),i&&t(g),i&&t(ra),i&&t(ce),i&&t(ia),i&&t(y),i&&t(oa),i&&t(m),i&&t(na),i&&t(pe),i&&t(fa),i&&t(ae),i&&t(ca),i&&t(V),Jt(le),i&&t(pa),i&&t(mt),i&&t(da),i&&t(J),Jt(re),i&&t(ua),i&&t(v),i&&t(ha),Jt(ie,i),i&&t(ma),i&&t(N),Jt(oe),i&&t(ga),i&&t(C),i&&t(ba),Jt(ne,i)}}}const xi={local:"stable-diffusion-pipelines",sections:[{local:"tips",sections:[{local:"explore-tradeoff-between-speed-and-quality",title:"Explore tradeoff between speed and quality"},{local:"reuse-pipeline-components-to-save-memory",title:"Reuse pipeline components to save memory"}],title:"Tips"}],title:"Stable Diffusion pipelines"};function wi(xl){return Ei(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ai extends gi{constructor(S){super();bi(this,S,wi,Si,vi,{})}}export{Ai as default,xi as metadata};
