import{S as mr,i as gr,s as vr,e as a,k as f,w as X,t as o,M as br,c as s,d as t,m as u,a as l,x as Z,h as r,b as n,N as Ya,G as e,g as h,y as ee,L as _r,q as te,o as ae,B as se,v as Er}from"../../../../chunks/vendor-hf-doc-builder.js";import{D as Dr}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as pr}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as da}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";function wr(yl){let $,ha,A,j,bt,ie,Wa,_t,Ja,ca,g,Ka,Et,Qa,Xa,le,Za,es,oe,ts,as,re,ss,is,ne,ls,os,pa,T,rs,fe,ns,fs,Ge,us,ds,ma,x,hs,ue,cs,ps,de,ms,gs,ga,he,Dt,vs,bs,va,Ne,Re,_s,ce,Ve,Il,ba,pe,wt,Es,Ds,_a,G,St,_,yt,ws,Ss,It,ys,Is,He,Ps,Ts,qe,xs,$s,m,E,Pt,Be,As,ks,Tt,xt,Ms,Ls,Ue,me,ze,Pl,Cs,Fe,ge,Os,js,D,$t,Ye,Gs,Ns,At,kt,Rs,Vs,We,ve,Je,Tl,Hs,Ke,be,qs,Bs,w,Mt,Qe,Us,zs,_e,Lt,Fs,Ys,Ct,Ws,Js,Xe,Ee,Ze,xl,Ks,et,Qs,Xs,S,Ot,tt,Zs,ei,De,jt,ti,ai,Gt,si,ii,Nt,li,at,oi,ri,y,Rt,st,ni,fi,we,Vt,ui,di,Ht,hi,ci,qt,pi,it,Se,mi,gi,I,Bt,lt,vi,bi,ye,Ut,_i,Ei,zt,Di,wi,Ft,Si,ot,yi,Ii,P,Yt,rt,Pi,Ti,Ie,Wt,xi,$i,Jt,Ai,ki,Kt,Mi,nt,Pe,Li,Ea,k,N,Qt,Te,Ci,Xt,Oi,Da,M,R,Zt,xe,ji,ea,Gi,wa,c,Ni,ft,Ri,Vi,ta,Hi,qi,ut,Bi,Ui,dt,zi,Fi,ht,Yi,Wi,ct,Ji,Ki,pt,Qi,Xi,aa,Zi,el,sa,tl,al,mt,sl,il,Sa,$e,ya,L,V,ia,Ae,ll,la,ol,Ia,H,rl,oa,nl,fl,Pa,q,ke,ul,Me,dl,hl,cl,Le,pl,ra,ml,gl,Ta,Ce,xa,C,B,na,Oe,vl,fa,bl,$a,O,je,_l,ua,El,Aa;return ie=new da({}),Te=new da({}),xe=new da({}),$e=new pr({props:{code:`from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler

pipeline = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4")
pipeline.scheduler = EulerDiscreteScheduler.from_config(pipeline.scheduler.config)

# or
euler_scheduler = EulerDiscreteScheduler.from_pretrained("CompVis/stable-diffusion-v1-4", subfolder="scheduler")
pipeline = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", scheduler=euler_scheduler)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline, EulerDiscreteScheduler

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># or</span>
<span class="hljs-meta">&gt;&gt;&gt; </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>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>, scheduler=euler_scheduler)`}}),Ae=new da({}),Ce=new pr({props:{code:`from diffusers import (
    StableDiffusionPipeline,
    StableDiffusionImg2ImgPipeline,
    StableDiffusionInpaintPipeline,
)

text2img = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4")
img2img = StableDiffusionImg2ImgPipeline(**text2img.components)
inpaint = StableDiffusionInpaintPipeline(**text2img.components)

# now you can use text2img(...), img2img(...), inpaint(...) just like the call methods of each respective pipeline`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> (
<span class="hljs-meta">... </span>    StableDiffusionPipeline,
<span class="hljs-meta">... </span>    StableDiffusionImg2ImgPipeline,
<span class="hljs-meta">... </span>    StableDiffusionInpaintPipeline,
<span class="hljs-meta">... </span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># now you can use text2img(...), img2img(...), inpaint(...) just like the call methods of each respective pipeline</span>`}}),Oe=new da({}),je=new Dr({props:{name:"class diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"},{name:"nsfw_content_detected",val:": typing.Optional[typing.List[bool]]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.images",description:`<strong>images</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or numpy array of shape <code>(batch_size, height, width, num_channels)</code>. PIL images or numpy array present the denoised images of the diffusion pipeline.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List of flags denoting whether the corresponding generated image likely represents &#x201C;not-safe-for-work&#x201D;
(nsfw) content, or <code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/v0.12.0/src/diffusers/pipelines/stable_diffusion/__init__.py#L23"}}),{c(){$=a("meta"),ha=f(),A=a("h1"),j=a("a"),bt=a("span"),X(ie.$$.fragment),Wa=f(),_t=a("span"),Ja=o("Stable diffusion pipelines"),ca=f(),g=a("p"),Ka=o("Stable Diffusion is a text-to-image "),Et=a("em"),Qa=o("latent diffusion"),Xa=o(" model created by the researchers and engineers from "),le=a("a"),Za=o("CompVis"),es=o(", "),oe=a("a"),ts=o("Stability AI"),as=o(" and "),re=a("a"),ss=o("LAION"),is=o(". It\u2019s trained on 512x512 images from a subset of the "),ne=a("a"),ls=o("LAION-5B"),os=o(" 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."),pa=f(),T=a("p"),rs=o("Latent diffusion is the research on top of which Stable Diffusion was built. It was proposed in "),fe=a("a"),ns=o("High-Resolution Image Synthesis with Latent Diffusion Models"),fs=o(" by Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Bj\xF6rn Ommer. You can learn more details about it in the "),Ge=a("a"),us=o("specific pipeline for latent diffusion"),ds=o(" that is part of \u{1F917} Diffusers."),ma=f(),x=a("p"),hs=o("For more details about how Stable Diffusion works and how it differs from the base latent diffusion model, please refer to the official "),ue=a("a"),cs=o("launch announcement post"),ps=o(" and "),de=a("a"),ms=o("this section of our own blog post"),gs=o("."),ga=f(),he=a("p"),Dt=a("em"),vs=o("Tips"),bs=o(":"),va=f(),Ne=a("ul"),Re=a("li"),_s=o("To tweak your prompts on a specific result you liked, you can generate your own latents, as demonstrated in the following notebook: "),ce=a("a"),Ve=a("img"),ba=f(),pe=a("p"),wt=a("em"),Es=o("Overview"),Ds=o(":"),_a=f(),G=a("table"),St=a("thead"),_=a("tr"),yt=a("th"),ws=o("Pipeline"),Ss=f(),It=a("th"),ys=o("Tasks"),Is=f(),He=a("th"),Ps=o("Colab"),Ts=f(),qe=a("th"),xs=o("Demo"),$s=f(),m=a("tbody"),E=a("tr"),Pt=a("td"),Be=a("a"),As=o("StableDiffusionPipeline"),ks=f(),Tt=a("td"),xt=a("em"),Ms=o("Text-to-Image Generation"),Ls=f(),Ue=a("td"),me=a("a"),ze=a("img"),Cs=f(),Fe=a("td"),ge=a("a"),Os=o("\u{1F917} Stable Diffusion"),js=f(),D=a("tr"),$t=a("td"),Ye=a("a"),Gs=o("StableDiffusionImg2ImgPipeline"),Ns=f(),At=a("td"),kt=a("em"),Rs=o("Image-to-Image Text-Guided Generation"),Vs=f(),We=a("td"),ve=a("a"),Je=a("img"),Hs=f(),Ke=a("td"),be=a("a"),qs=o("\u{1F917} Diffuse the Rest"),Bs=f(),w=a("tr"),Mt=a("td"),Qe=a("a"),Us=o("StableDiffusionInpaintPipeline"),zs=f(),_e=a("td"),Lt=a("strong"),Fs=o("Experimental"),Ys=o(" \u2013 "),Ct=a("em"),Ws=o("Text-Guided Image Inpainting"),Js=f(),Xe=a("td"),Ee=a("a"),Ze=a("img"),Ks=f(),et=a("td"),Qs=o("Coming soon"),Xs=f(),S=a("tr"),Ot=a("td"),tt=a("a"),Zs=o("StableDiffusionDepth2ImgPipeline"),ei=f(),De=a("td"),jt=a("strong"),ti=o("Experimental"),ai=o(" \u2013 "),Gt=a("em"),si=o("Depth-to-Image Text-Guided Generation"),ii=f(),Nt=a("td"),li=f(),at=a("td"),oi=o("Coming soon"),ri=f(),y=a("tr"),Rt=a("td"),st=a("a"),ni=o("StableDiffusionImageVariationPipeline"),fi=f(),we=a("td"),Vt=a("strong"),ui=o("Experimental"),di=o(" \u2013 "),Ht=a("em"),hi=o("Image Variation Generation"),ci=f(),qt=a("td"),pi=f(),it=a("td"),Se=a("a"),mi=o("\u{1F917} Stable Diffusion Image Variations"),gi=f(),I=a("tr"),Bt=a("td"),lt=a("a"),vi=o("StableDiffusionUpscalePipeline"),bi=f(),ye=a("td"),Ut=a("strong"),_i=o("Experimental"),Ei=o(" \u2013 "),zt=a("em"),Di=o("Text-Guided Image Super-Resolution"),wi=f(),Ft=a("td"),Si=f(),ot=a("td"),yi=o("Coming soon"),Ii=f(),P=a("tr"),Yt=a("td"),rt=a("a"),Pi=o("StableDiffusionInstructPix2PixPipeline"),Ti=f(),Ie=a("td"),Wt=a("strong"),xi=o("Experimental"),$i=o(" \u2013 "),Jt=a("em"),Ai=o("Text-Based Image Editing"),ki=f(),Kt=a("td"),Mi=f(),nt=a("td"),Pe=a("a"),Li=o("InstructPix2Pix: Learning to Follow Image Editing Instructions"),Ea=f(),k=a("h2"),N=a("a"),Qt=a("span"),X(Te.$$.fragment),Ci=f(),Xt=a("span"),Oi=o("Tips"),Da=f(),M=a("h3"),R=a("a"),Zt=a("span"),X(xe.$$.fragment),ji=f(),ea=a("span"),Gi=o("How to load and use different schedulers."),wa=f(),c=a("p"),Ni=o("The stable diffusion pipeline uses "),ft=a("a"),Ri=o("PNDMScheduler"),Vi=o(" scheduler by default. But "),ta=a("code"),Hi=o("diffusers"),qi=o(" provides many other schedulers that can be used with the stable diffusion pipeline such as "),ut=a("a"),Bi=o("DDIMScheduler"),Ui=o(", "),dt=a("a"),zi=o("LMSDiscreteScheduler"),Fi=o(", "),ht=a("a"),Yi=o("EulerDiscreteScheduler"),Wi=o(", "),ct=a("a"),Ji=o("EulerAncestralDiscreteScheduler"),Ki=o(` etc.
To use a different scheduler, you can either change it via the `),pt=a("a"),Qi=o("ConfigMixin.from_config()"),Xi=o(" method or pass the "),aa=a("code"),Zi=o("scheduler"),el=o(" argument to the "),sa=a("code"),tl=o("from_pretrained"),al=o(" method of the pipeline. For example, to use the "),mt=a("a"),sl=o("EulerDiscreteScheduler"),il=o(", you can do the following:"),Sa=f(),X($e.$$.fragment),ya=f(),L=a("h3"),V=a("a"),ia=a("span"),X(Ae.$$.fragment),ll=f(),la=a("span"),ol=o("How to convert all use cases with multiple or single pipeline"),Ia=f(),H=a("p"),rl=o("If you want to use all possible use cases in a single "),oa=a("code"),nl=o("DiffusionPipeline"),fl=o(" you can either:"),Pa=f(),q=a("ul"),ke=a("li"),ul=o("Make use of the "),Me=a("a"),dl=o("Stable Diffusion Mega Pipeline"),hl=o(" or"),cl=f(),Le=a("li"),pl=o("Make use of the "),ra=a("code"),ml=o("components"),gl=o(" functionality to instantiate all components in the most memory-efficient way:"),Ta=f(),X(Ce.$$.fragment),xa=f(),C=a("h2"),B=a("a"),na=a("span"),X(Oe.$$.fragment),vl=f(),fa=a("span"),bl=o("StableDiffusionPipelineOutput"),$a=f(),O=a("div"),X(je.$$.fragment),_l=f(),ua=a("p"),El=o("Output class for Stable Diffusion pipelines."),this.h()},l(i){const d=br('[data-svelte="svelte-1phssyn"]',document.head);$=s(d,"META",{name:!0,content:!0}),d.forEach(t),ha=u(i),A=s(i,"H1",{class:!0});var ka=l(A);j=s(ka,"A",{id:!0,class:!0,href:!0});var $l=l(j);bt=s($l,"SPAN",{});var Al=l(bt);Z(ie.$$.fragment,Al),Al.forEach(t),$l.forEach(t),Wa=u(ka),_t=s(ka,"SPAN",{});var kl=l(_t);Ja=r(kl,"Stable diffusion pipelines"),kl.forEach(t),ka.forEach(t),ca=u(i),g=s(i,"P",{});var b=l(g);Ka=r(b,"Stable Diffusion is a text-to-image "),Et=s(b,"EM",{});var Ml=l(Et);Qa=r(Ml,"latent diffusion"),Ml.forEach(t),Xa=r(b," model created by the researchers and engineers from "),le=s(b,"A",{href:!0,rel:!0});var Ll=l(le);Za=r(Ll,"CompVis"),Ll.forEach(t),es=r(b,", "),oe=s(b,"A",{href:!0,rel:!0});var Cl=l(oe);ts=r(Cl,"Stability AI"),Cl.forEach(t),as=r(b," and "),re=s(b,"A",{href:!0,rel:!0});var Ol=l(re);ss=r(Ol,"LAION"),Ol.forEach(t),is=r(b,". It\u2019s trained on 512x512 images from a subset of the "),ne=s(b,"A",{href:!0,rel:!0});var jl=l(ne);ls=r(jl,"LAION-5B"),jl.forEach(t),os=r(b," 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."),b.forEach(t),pa=u(i),T=s(i,"P",{});var gt=l(T);rs=r(gt,"Latent diffusion is the research on top of which Stable Diffusion was built. It was proposed in "),fe=s(gt,"A",{href:!0,rel:!0});var Gl=l(fe);ns=r(Gl,"High-Resolution Image Synthesis with Latent Diffusion Models"),Gl.forEach(t),fs=r(gt," by Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Bj\xF6rn Ommer. You can learn more details about it in the "),Ge=s(gt,"A",{href:!0});var Nl=l(Ge);us=r(Nl,"specific pipeline for latent diffusion"),Nl.forEach(t),ds=r(gt," that is part of \u{1F917} Diffusers."),gt.forEach(t),ma=u(i),x=s(i,"P",{});var vt=l(x);hs=r(vt,"For more details about how Stable Diffusion works and how it differs from the base latent diffusion model, please refer to the official "),ue=s(vt,"A",{href:!0,rel:!0});var Rl=l(ue);cs=r(Rl,"launch announcement post"),Rl.forEach(t),ps=r(vt," and "),de=s(vt,"A",{href:!0,rel:!0});var Vl=l(de);ms=r(Vl,"this section of our own blog post"),Vl.forEach(t),gs=r(vt,"."),vt.forEach(t),ga=u(i),he=s(i,"P",{});var Dl=l(he);Dt=s(Dl,"EM",{});var Hl=l(Dt);vs=r(Hl,"Tips"),Hl.forEach(t),bs=r(Dl,":"),Dl.forEach(t),va=u(i),Ne=s(i,"UL",{});var ql=l(Ne);Re=s(ql,"LI",{});var wl=l(Re);_s=r(wl,"To tweak your prompts on a specific result you liked, you can generate your own latents, as demonstrated in the following notebook: "),ce=s(wl,"A",{href:!0,rel:!0});var Bl=l(ce);Ve=s(Bl,"IMG",{src:!0,alt:!0}),Bl.forEach(t),wl.forEach(t),ql.forEach(t),ba=u(i),pe=s(i,"P",{});var Sl=l(pe);wt=s(Sl,"EM",{});var Ul=l(wt);Es=r(Ul,"Overview"),Ul.forEach(t),Ds=r(Sl,":"),Sl.forEach(t),_a=u(i),G=s(i,"TABLE",{});var Ma=l(G);St=s(Ma,"THEAD",{});var zl=l(St);_=s(zl,"TR",{});var U=l(_);yt=s(U,"TH",{});var Fl=l(yt);ws=r(Fl,"Pipeline"),Fl.forEach(t),Ss=u(U),It=s(U,"TH",{});var Yl=l(It);ys=r(Yl,"Tasks"),Yl.forEach(t),Is=u(U),He=s(U,"TH",{align:!0});var Wl=l(He);Ps=r(Wl,"Colab"),Wl.forEach(t),Ts=u(U),qe=s(U,"TH",{align:!0});var Jl=l(qe);xs=r(Jl,"Demo"),Jl.forEach(t),U.forEach(t),zl.forEach(t),$s=u(Ma),m=s(Ma,"TBODY",{});var v=l(m);E=s(v,"TR",{});var z=l(E);Pt=s(z,"TD",{});var Kl=l(Pt);Be=s(Kl,"A",{href:!0});var Ql=l(Be);As=r(Ql,"StableDiffusionPipeline"),Ql.forEach(t),Kl.forEach(t),ks=u(z),Tt=s(z,"TD",{});var Xl=l(Tt);xt=s(Xl,"EM",{});var Zl=l(xt);Ms=r(Zl,"Text-to-Image Generation"),Zl.forEach(t),Xl.forEach(t),Ls=u(z),Ue=s(z,"TD",{align:!0});var eo=l(Ue);me=s(eo,"A",{href:!0,rel:!0});var to=l(me);ze=s(to,"IMG",{src:!0,alt:!0}),to.forEach(t),eo.forEach(t),Cs=u(z),Fe=s(z,"TD",{align:!0});var ao=l(Fe);ge=s(ao,"A",{href:!0,rel:!0});var so=l(ge);Os=r(so,"\u{1F917} Stable Diffusion"),so.forEach(t),ao.forEach(t),z.forEach(t),js=u(v),D=s(v,"TR",{});var F=l(D);$t=s(F,"TD",{});var io=l($t);Ye=s(io,"A",{href:!0});var lo=l(Ye);Gs=r(lo,"StableDiffusionImg2ImgPipeline"),lo.forEach(t),io.forEach(t),Ns=u(F),At=s(F,"TD",{});var oo=l(At);kt=s(oo,"EM",{});var ro=l(kt);Rs=r(ro,"Image-to-Image Text-Guided Generation"),ro.forEach(t),oo.forEach(t),Vs=u(F),We=s(F,"TD",{align:!0});var no=l(We);ve=s(no,"A",{href:!0,rel:!0});var fo=l(ve);Je=s(fo,"IMG",{src:!0,alt:!0}),fo.forEach(t),no.forEach(t),Hs=u(F),Ke=s(F,"TD",{align:!0});var uo=l(Ke);be=s(uo,"A",{href:!0,rel:!0});var ho=l(be);qs=r(ho,"\u{1F917} Diffuse the Rest"),ho.forEach(t),uo.forEach(t),F.forEach(t),Bs=u(v),w=s(v,"TR",{});var Y=l(w);Mt=s(Y,"TD",{});var co=l(Mt);Qe=s(co,"A",{href:!0});var po=l(Qe);Us=r(po,"StableDiffusionInpaintPipeline"),po.forEach(t),co.forEach(t),zs=u(Y),_e=s(Y,"TD",{});var La=l(_e);Lt=s(La,"STRONG",{});var mo=l(Lt);Fs=r(mo,"Experimental"),mo.forEach(t),Ys=r(La," \u2013 "),Ct=s(La,"EM",{});var go=l(Ct);Ws=r(go,"Text-Guided Image Inpainting"),go.forEach(t),La.forEach(t),Js=u(Y),Xe=s(Y,"TD",{align:!0});var vo=l(Xe);Ee=s(vo,"A",{href:!0,rel:!0});var bo=l(Ee);Ze=s(bo,"IMG",{src:!0,alt:!0}),bo.forEach(t),vo.forEach(t),Ks=u(Y),et=s(Y,"TD",{align:!0});var _o=l(et);Qs=r(_o,"Coming soon"),_o.forEach(t),Y.forEach(t),Xs=u(v),S=s(v,"TR",{});var W=l(S);Ot=s(W,"TD",{});var Eo=l(Ot);tt=s(Eo,"A",{href:!0});var Do=l(tt);Zs=r(Do,"StableDiffusionDepth2ImgPipeline"),Do.forEach(t),Eo.forEach(t),ei=u(W),De=s(W,"TD",{});var Ca=l(De);jt=s(Ca,"STRONG",{});var wo=l(jt);ti=r(wo,"Experimental"),wo.forEach(t),ai=r(Ca," \u2013 "),Gt=s(Ca,"EM",{});var So=l(Gt);si=r(So,"Depth-to-Image Text-Guided Generation"),So.forEach(t),Ca.forEach(t),ii=u(W),Nt=s(W,"TD",{align:!0}),l(Nt).forEach(t),li=u(W),at=s(W,"TD",{align:!0});var yo=l(at);oi=r(yo,"Coming soon"),yo.forEach(t),W.forEach(t),ri=u(v),y=s(v,"TR",{});var J=l(y);Rt=s(J,"TD",{});var Io=l(Rt);st=s(Io,"A",{href:!0});var Po=l(st);ni=r(Po,"StableDiffusionImageVariationPipeline"),Po.forEach(t),Io.forEach(t),fi=u(J),we=s(J,"TD",{});var Oa=l(we);Vt=s(Oa,"STRONG",{});var To=l(Vt);ui=r(To,"Experimental"),To.forEach(t),di=r(Oa," \u2013 "),Ht=s(Oa,"EM",{});var xo=l(Ht);hi=r(xo,"Image Variation Generation"),xo.forEach(t),Oa.forEach(t),ci=u(J),qt=s(J,"TD",{align:!0}),l(qt).forEach(t),pi=u(J),it=s(J,"TD",{align:!0});var $o=l(it);Se=s($o,"A",{href:!0,rel:!0});var Ao=l(Se);mi=r(Ao,"\u{1F917} Stable Diffusion Image Variations"),Ao.forEach(t),$o.forEach(t),J.forEach(t),gi=u(v),I=s(v,"TR",{});var K=l(I);Bt=s(K,"TD",{});var ko=l(Bt);lt=s(ko,"A",{href:!0});var Mo=l(lt);vi=r(Mo,"StableDiffusionUpscalePipeline"),Mo.forEach(t),ko.forEach(t),bi=u(K),ye=s(K,"TD",{});var ja=l(ye);Ut=s(ja,"STRONG",{});var Lo=l(Ut);_i=r(Lo,"Experimental"),Lo.forEach(t),Ei=r(ja," \u2013 "),zt=s(ja,"EM",{});var Co=l(zt);Di=r(Co,"Text-Guided Image Super-Resolution"),Co.forEach(t),ja.forEach(t),wi=u(K),Ft=s(K,"TD",{align:!0}),l(Ft).forEach(t),Si=u(K),ot=s(K,"TD",{align:!0});var Oo=l(ot);yi=r(Oo,"Coming soon"),Oo.forEach(t),K.forEach(t),Ii=u(v),P=s(v,"TR",{});var Q=l(P);Yt=s(Q,"TD",{});var jo=l(Yt);rt=s(jo,"A",{href:!0});var Go=l(rt);Pi=r(Go,"StableDiffusionInstructPix2PixPipeline"),Go.forEach(t),jo.forEach(t),Ti=u(Q),Ie=s(Q,"TD",{});var Ga=l(Ie);Wt=s(Ga,"STRONG",{});var No=l(Wt);xi=r(No,"Experimental"),No.forEach(t),$i=r(Ga," \u2013 "),Jt=s(Ga,"EM",{});var Ro=l(Jt);Ai=r(Ro,"Text-Based Image Editing"),Ro.forEach(t),Ga.forEach(t),ki=u(Q),Kt=s(Q,"TD",{align:!0}),l(Kt).forEach(t),Mi=u(Q),nt=s(Q,"TD",{align:!0});var Vo=l(nt);Pe=s(Vo,"A",{href:!0,rel:!0});var Ho=l(Pe);Li=r(Ho,"InstructPix2Pix: Learning to Follow Image Editing Instructions"),Ho.forEach(t),Vo.forEach(t),Q.forEach(t),v.forEach(t),Ma.forEach(t),Ea=u(i),k=s(i,"H2",{class:!0});var Na=l(k);N=s(Na,"A",{id:!0,class:!0,href:!0});var qo=l(N);Qt=s(qo,"SPAN",{});var Bo=l(Qt);Z(Te.$$.fragment,Bo),Bo.forEach(t),qo.forEach(t),Ci=u(Na),Xt=s(Na,"SPAN",{});var Uo=l(Xt);Oi=r(Uo,"Tips"),Uo.forEach(t),Na.forEach(t),Da=u(i),M=s(i,"H3",{class:!0});var Ra=l(M);R=s(Ra,"A",{id:!0,class:!0,href:!0});var zo=l(R);Zt=s(zo,"SPAN",{});var Fo=l(Zt);Z(xe.$$.fragment,Fo),Fo.forEach(t),zo.forEach(t),ji=u(Ra),ea=s(Ra,"SPAN",{});var Yo=l(ea);Gi=r(Yo,"How to load and use different schedulers."),Yo.forEach(t),Ra.forEach(t),wa=u(i),c=s(i,"P",{});var p=l(c);Ni=r(p,"The stable diffusion pipeline uses "),ft=s(p,"A",{href:!0});var Wo=l(ft);Ri=r(Wo,"PNDMScheduler"),Wo.forEach(t),Vi=r(p," scheduler by default. But "),ta=s(p,"CODE",{});var Jo=l(ta);Hi=r(Jo,"diffusers"),Jo.forEach(t),qi=r(p," provides many other schedulers that can be used with the stable diffusion pipeline such as "),ut=s(p,"A",{href:!0});var Ko=l(ut);Bi=r(Ko,"DDIMScheduler"),Ko.forEach(t),Ui=r(p,", "),dt=s(p,"A",{href:!0});var Qo=l(dt);zi=r(Qo,"LMSDiscreteScheduler"),Qo.forEach(t),Fi=r(p,", "),ht=s(p,"A",{href:!0});var Xo=l(ht);Yi=r(Xo,"EulerDiscreteScheduler"),Xo.forEach(t),Wi=r(p,", "),ct=s(p,"A",{href:!0});var Zo=l(ct);Ji=r(Zo,"EulerAncestralDiscreteScheduler"),Zo.forEach(t),Ki=r(p,` etc.
To use a different scheduler, you can either change it via the `),pt=s(p,"A",{href:!0});var er=l(pt);Qi=r(er,"ConfigMixin.from_config()"),er.forEach(t),Xi=r(p," method or pass the "),aa=s(p,"CODE",{});var tr=l(aa);Zi=r(tr,"scheduler"),tr.forEach(t),el=r(p," argument to the "),sa=s(p,"CODE",{});var ar=l(sa);tl=r(ar,"from_pretrained"),ar.forEach(t),al=r(p," method of the pipeline. For example, to use the "),mt=s(p,"A",{href:!0});var sr=l(mt);sl=r(sr,"EulerDiscreteScheduler"),sr.forEach(t),il=r(p,", you can do the following:"),p.forEach(t),Sa=u(i),Z($e.$$.fragment,i),ya=u(i),L=s(i,"H3",{class:!0});var Va=l(L);V=s(Va,"A",{id:!0,class:!0,href:!0});var ir=l(V);ia=s(ir,"SPAN",{});var lr=l(ia);Z(Ae.$$.fragment,lr),lr.forEach(t),ir.forEach(t),ll=u(Va),la=s(Va,"SPAN",{});var or=l(la);ol=r(or,"How to convert all use cases with multiple or single pipeline"),or.forEach(t),Va.forEach(t),Ia=u(i),H=s(i,"P",{});var Ha=l(H);rl=r(Ha,"If you want to use all possible use cases in a single "),oa=s(Ha,"CODE",{});var rr=l(oa);nl=r(rr,"DiffusionPipeline"),rr.forEach(t),fl=r(Ha," you can either:"),Ha.forEach(t),Pa=u(i),q=s(i,"UL",{});var qa=l(q);ke=s(qa,"LI",{});var Ba=l(ke);ul=r(Ba,"Make use of the "),Me=s(Ba,"A",{href:!0,rel:!0});var nr=l(Me);dl=r(nr,"Stable Diffusion Mega Pipeline"),nr.forEach(t),hl=r(Ba," or"),Ba.forEach(t),cl=u(qa),Le=s(qa,"LI",{});var Ua=l(Le);pl=r(Ua,"Make use of the "),ra=s(Ua,"CODE",{});var fr=l(ra);ml=r(fr,"components"),fr.forEach(t),gl=r(Ua," functionality to instantiate all components in the most memory-efficient way:"),Ua.forEach(t),qa.forEach(t),Ta=u(i),Z(Ce.$$.fragment,i),xa=u(i),C=s(i,"H2",{class:!0});var za=l(C);B=s(za,"A",{id:!0,class:!0,href:!0});var ur=l(B);na=s(ur,"SPAN",{});var dr=l(na);Z(Oe.$$.fragment,dr),dr.forEach(t),ur.forEach(t),vl=u(za),fa=s(za,"SPAN",{});var hr=l(fa);bl=r(hr,"StableDiffusionPipelineOutput"),hr.forEach(t),za.forEach(t),$a=u(i),O=s(i,"DIV",{class:!0});var Fa=l(O);Z(je.$$.fragment,Fa),_l=u(Fa),ua=s(Fa,"P",{});var cr=l(ua);El=r(cr,"Output class for Stable Diffusion pipelines."),cr.forEach(t),Fa.forEach(t),this.h()},h(){n($,"name","hf:doc:metadata"),n($,"content",JSON.stringify(Sr)),n(j,"id","stable-diffusion-pipelines"),n(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"),n(j,"href","#stable-diffusion-pipelines"),n(A,"class","relative group"),n(le,"href","https://github.com/CompVis"),n(le,"rel","nofollow"),n(oe,"href","https://stability.ai/"),n(oe,"rel","nofollow"),n(re,"href","https://laion.ai/"),n(re,"rel","nofollow"),n(ne,"href","https://laion.ai/blog/laion-5b/"),n(ne,"rel","nofollow"),n(fe,"href","https://arxiv.org/abs/2112.10752"),n(fe,"rel","nofollow"),n(Ge,"href","pipelines/latent_diffusion"),n(ue,"href","https://stability.ai/blog/stable-diffusion-announcement"),n(ue,"rel","nofollow"),n(de,"href","https://huggingface.co/blog/stable_diffusion#how-does-stable-diffusion-work"),n(de,"rel","nofollow"),Ya(Ve.src,Il="https://colab.research.google.com/assets/colab-badge.svg")||n(Ve,"src",Il),n(Ve,"alt","Open In Colab"),n(ce,"href","https://colab.research.google.com/github/pcuenca/diffusers-examples/blob/main/notebooks/stable-diffusion-seeds.ipynb"),n(ce,"rel","nofollow"),n(He,"align","center"),n(qe,"align","center"),n(Be,"href","./text2img"),Ya(ze.src,Pl="https://colab.research.google.com/assets/colab-badge.svg")||n(ze,"src",Pl),n(ze,"alt","Open In Colab"),n(me,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/stable_diffusion.ipynb"),n(me,"rel","nofollow"),n(Ue,"align","center"),n(ge,"href","https://huggingface.co/spaces/stabilityai/stable-diffusion"),n(ge,"rel","nofollow"),n(Fe,"align","center"),n(Ye,"href","./img2img"),Ya(Je.src,Tl="https://colab.research.google.com/assets/colab-badge.svg")||n(Je,"src",Tl),n(Je,"alt","Open In Colab"),n(ve,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/image_2_image_using_diffusers.ipynb"),n(ve,"rel","nofollow"),n(We,"align","center"),n(be,"href","https://huggingface.co/spaces/huggingface/diffuse-the-rest"),n(be,"rel","nofollow"),n(Ke,"align","center"),n(Qe,"href","./inpaint"),Ya(Ze.src,xl="https://colab.research.google.com/assets/colab-badge.svg")||n(Ze,"src",xl),n(Ze,"alt","Open In Colab"),n(Ee,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/in_painting_with_stable_diffusion_using_diffusers.ipynb"),n(Ee,"rel","nofollow"),n(Xe,"align","center"),n(et,"align","center"),n(tt,"href","./depth2img"),n(Nt,"align","center"),n(at,"align","center"),n(st,"href","./image_variation"),n(qt,"align","center"),n(Se,"href","https://huggingface.co/spaces/lambdalabs/stable-diffusion-image-variations"),n(Se,"rel","nofollow"),n(it,"align","center"),n(lt,"href","./upscale"),n(Ft,"align","center"),n(ot,"align","center"),n(rt,"href","./pix2pix"),n(Kt,"align","center"),n(Pe,"href","https://huggingface.co/spaces/timbrooks/instruct-pix2pix"),n(Pe,"rel","nofollow"),n(nt,"align","center"),n(N,"id","tips"),n(N,"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"),n(N,"href","#tips"),n(k,"class","relative group"),n(R,"id","how-to-load-and-use-different-schedulers"),n(R,"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"),n(R,"href","#how-to-load-and-use-different-schedulers"),n(M,"class","relative group"),n(ft,"href","/docs/diffusers/v0.12.0/en/api/schedulers/pndm#diffusers.PNDMScheduler"),n(ut,"href","/docs/diffusers/v0.12.0/en/api/schedulers/ddim#diffusers.DDIMScheduler"),n(dt,"href","/docs/diffusers/v0.12.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler"),n(ht,"href","/docs/diffusers/v0.12.0/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler"),n(ct,"href","/docs/diffusers/v0.12.0/en/api/schedulers/euler_ancestral#diffusers.EulerAncestralDiscreteScheduler"),n(pt,"href","/docs/diffusers/v0.12.0/en/api/configuration#diffusers.ConfigMixin.from_config"),n(mt,"href","/docs/diffusers/v0.12.0/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler"),n(V,"id","how-to-convert-all-use-cases-with-multiple-or-single-pipeline"),n(V,"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"),n(V,"href","#how-to-convert-all-use-cases-with-multiple-or-single-pipeline"),n(L,"class","relative group"),n(Me,"href","https://github.com/huggingface/diffusers/tree/main/examples/community#stable-diffusion-mega"),n(Me,"rel","nofollow"),n(B,"id","diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),n(B,"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"),n(B,"href","#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),n(C,"class","relative group"),n(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(i,d){e(document.head,$),h(i,ha,d),h(i,A,d),e(A,j),e(j,bt),ee(ie,bt,null),e(A,Wa),e(A,_t),e(_t,Ja),h(i,ca,d),h(i,g,d),e(g,Ka),e(g,Et),e(Et,Qa),e(g,Xa),e(g,le),e(le,Za),e(g,es),e(g,oe),e(oe,ts),e(g,as),e(g,re),e(re,ss),e(g,is),e(g,ne),e(ne,ls),e(g,os),h(i,pa,d),h(i,T,d),e(T,rs),e(T,fe),e(fe,ns),e(T,fs),e(T,Ge),e(Ge,us),e(T,ds),h(i,ma,d),h(i,x,d),e(x,hs),e(x,ue),e(ue,cs),e(x,ps),e(x,de),e(de,ms),e(x,gs),h(i,ga,d),h(i,he,d),e(he,Dt),e(Dt,vs),e(he,bs),h(i,va,d),h(i,Ne,d),e(Ne,Re),e(Re,_s),e(Re,ce),e(ce,Ve),h(i,ba,d),h(i,pe,d),e(pe,wt),e(wt,Es),e(pe,Ds),h(i,_a,d),h(i,G,d),e(G,St),e(St,_),e(_,yt),e(yt,ws),e(_,Ss),e(_,It),e(It,ys),e(_,Is),e(_,He),e(He,Ps),e(_,Ts),e(_,qe),e(qe,xs),e(G,$s),e(G,m),e(m,E),e(E,Pt),e(Pt,Be),e(Be,As),e(E,ks),e(E,Tt),e(Tt,xt),e(xt,Ms),e(E,Ls),e(E,Ue),e(Ue,me),e(me,ze),e(E,Cs),e(E,Fe),e(Fe,ge),e(ge,Os),e(m,js),e(m,D),e(D,$t),e($t,Ye),e(Ye,Gs),e(D,Ns),e(D,At),e(At,kt),e(kt,Rs),e(D,Vs),e(D,We),e(We,ve),e(ve,Je),e(D,Hs),e(D,Ke),e(Ke,be),e(be,qs),e(m,Bs),e(m,w),e(w,Mt),e(Mt,Qe),e(Qe,Us),e(w,zs),e(w,_e),e(_e,Lt),e(Lt,Fs),e(_e,Ys),e(_e,Ct),e(Ct,Ws),e(w,Js),e(w,Xe),e(Xe,Ee),e(Ee,Ze),e(w,Ks),e(w,et),e(et,Qs),e(m,Xs),e(m,S),e(S,Ot),e(Ot,tt),e(tt,Zs),e(S,ei),e(S,De),e(De,jt),e(jt,ti),e(De,ai),e(De,Gt),e(Gt,si),e(S,ii),e(S,Nt),e(S,li),e(S,at),e(at,oi),e(m,ri),e(m,y),e(y,Rt),e(Rt,st),e(st,ni),e(y,fi),e(y,we),e(we,Vt),e(Vt,ui),e(we,di),e(we,Ht),e(Ht,hi),e(y,ci),e(y,qt),e(y,pi),e(y,it),e(it,Se),e(Se,mi),e(m,gi),e(m,I),e(I,Bt),e(Bt,lt),e(lt,vi),e(I,bi),e(I,ye),e(ye,Ut),e(Ut,_i),e(ye,Ei),e(ye,zt),e(zt,Di),e(I,wi),e(I,Ft),e(I,Si),e(I,ot),e(ot,yi),e(m,Ii),e(m,P),e(P,Yt),e(Yt,rt),e(rt,Pi),e(P,Ti),e(P,Ie),e(Ie,Wt),e(Wt,xi),e(Ie,$i),e(Ie,Jt),e(Jt,Ai),e(P,ki),e(P,Kt),e(P,Mi),e(P,nt),e(nt,Pe),e(Pe,Li),h(i,Ea,d),h(i,k,d),e(k,N),e(N,Qt),ee(Te,Qt,null),e(k,Ci),e(k,Xt),e(Xt,Oi),h(i,Da,d),h(i,M,d),e(M,R),e(R,Zt),ee(xe,Zt,null),e(M,ji),e(M,ea),e(ea,Gi),h(i,wa,d),h(i,c,d),e(c,Ni),e(c,ft),e(ft,Ri),e(c,Vi),e(c,ta),e(ta,Hi),e(c,qi),e(c,ut),e(ut,Bi),e(c,Ui),e(c,dt),e(dt,zi),e(c,Fi),e(c,ht),e(ht,Yi),e(c,Wi),e(c,ct),e(ct,Ji),e(c,Ki),e(c,pt),e(pt,Qi),e(c,Xi),e(c,aa),e(aa,Zi),e(c,el),e(c,sa),e(sa,tl),e(c,al),e(c,mt),e(mt,sl),e(c,il),h(i,Sa,d),ee($e,i,d),h(i,ya,d),h(i,L,d),e(L,V),e(V,ia),ee(Ae,ia,null),e(L,ll),e(L,la),e(la,ol),h(i,Ia,d),h(i,H,d),e(H,rl),e(H,oa),e(oa,nl),e(H,fl),h(i,Pa,d),h(i,q,d),e(q,ke),e(ke,ul),e(ke,Me),e(Me,dl),e(ke,hl),e(q,cl),e(q,Le),e(Le,pl),e(Le,ra),e(ra,ml),e(Le,gl),h(i,Ta,d),ee(Ce,i,d),h(i,xa,d),h(i,C,d),e(C,B),e(B,na),ee(Oe,na,null),e(C,vl),e(C,fa),e(fa,bl),h(i,$a,d),h(i,O,d),ee(je,O,null),e(O,_l),e(O,ua),e(ua,El),Aa=!0},p:_r,i(i){Aa||(te(ie.$$.fragment,i),te(Te.$$.fragment,i),te(xe.$$.fragment,i),te($e.$$.fragment,i),te(Ae.$$.fragment,i),te(Ce.$$.fragment,i),te(Oe.$$.fragment,i),te(je.$$.fragment,i),Aa=!0)},o(i){ae(ie.$$.fragment,i),ae(Te.$$.fragment,i),ae(xe.$$.fragment,i),ae($e.$$.fragment,i),ae(Ae.$$.fragment,i),ae(Ce.$$.fragment,i),ae(Oe.$$.fragment,i),ae(je.$$.fragment,i),Aa=!1},d(i){t($),i&&t(ha),i&&t(A),se(ie),i&&t(ca),i&&t(g),i&&t(pa),i&&t(T),i&&t(ma),i&&t(x),i&&t(ga),i&&t(he),i&&t(va),i&&t(Ne),i&&t(ba),i&&t(pe),i&&t(_a),i&&t(G),i&&t(Ea),i&&t(k),se(Te),i&&t(Da),i&&t(M),se(xe),i&&t(wa),i&&t(c),i&&t(Sa),se($e,i),i&&t(ya),i&&t(L),se(Ae),i&&t(Ia),i&&t(H),i&&t(Pa),i&&t(q),i&&t(Ta),se(Ce,i),i&&t(xa),i&&t(C),se(Oe),i&&t($a),i&&t(O),se(je)}}}const Sr={local:"stable-diffusion-pipelines",sections:[{local:"tips",sections:[{local:"how-to-load-and-use-different-schedulers",title:"How to load and use different schedulers."},{local:"how-to-convert-all-use-cases-with-multiple-or-single-pipeline",title:"How to convert all use cases with multiple or single pipeline"}],title:"Tips"},{local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",title:"StableDiffusionPipelineOutput"}],title:"Stable diffusion pipelines"};function yr(yl){return Er(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $r extends mr{constructor($){super();gr(this,$,yr,wr,vr,{})}}export{$r as default,Sr as metadata};
