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