import{S as yw,i as ww,s as Mw,e as n,k as p,w as m,t as a,M as Iw,c as i,d as o,m as d,a as s,x as g,h as l,b as c,N as zl,G as e,g as f,y as u,q as h,o as _,B as b,v as Tw,L as rb}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as ab}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as $}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as P}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Z}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as lb}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function xw(W){let y,S,M,w,L,v,I,A,H,je,R;return{c(){y=n("p"),S=a("One can use these negative conditions in the other SDXL pipelines ("),M=n("a"),w=a("Image-To-Image"),L=a(", "),v=n("a"),I=a("Inpainting"),A=a(", "),H=n("a"),je=a("ControlNet"),R=a(") too!"),this.h()},l(me){y=i(me,"P",{});var j=s(y);S=l(j,"One can use these negative conditions in the other SDXL pipelines ("),M=i(j,"A",{href:!0});var Bn=s(M);w=l(Bn,"Image-To-Image"),Bn.forEach(o),L=l(j,", "),v=i(j,"A",{href:!0});var zn=s(v);I=l(zn,"Inpainting"),zn.forEach(o),A=l(j,", "),H=i(j,"A",{href:!0});var Bt=s(H);je=l(Bt,"ControlNet"),Bt.forEach(o),R=l(j,") too!"),j.forEach(o),this.h()},h(){c(M,"href","#image-to-image"),c(v,"href","#inpainting"),c(H,"href","../controlnet_sdxl.md")},m(me,j){f(me,y,j),e(y,S),e(y,M),e(M,w),e(y,L),e(y,v),e(v,I),e(y,A),e(y,H),e(H,je),e(y,R)},d(me){me&&o(y)}}}function Ew(W){let y,S;return{c(){y=n("p"),S=a("The ensemble-of-experts method works well on all available schedulers!")},l(M){y=i(M,"P",{});var w=s(y);S=l(w,"The ensemble-of-experts method works well on all available schedulers!"),w.forEach(o)},m(M,w){f(M,y,w),e(y,S)},d(M){M&&o(y)}}}function Jw(W){let y,S,M,w,L;return{c(){y=n("p"),S=a(`The refiner can also very well be used in an in-painting setting. To do so just make
sure you use the `),M=n("a"),w=a("StableDiffusionXLInpaintPipeline"),L=a(" classes as shown below"),this.h()},l(v){y=i(v,"P",{});var I=s(y);S=l(I,`The refiner can also very well be used in an in-painting setting. To do so just make
sure you use the `),M=i(I,"A",{href:!0});var A=s(M);w=l(A,"StableDiffusionXLInpaintPipeline"),A.forEach(o),L=l(I," classes as shown below"),I.forEach(o),this.h()},h(){c(M,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/stable_diffusion_xl#diffusers.StableDiffusionXLInpaintPipeline")},m(v,I){f(v,y,I),e(y,S),e(y,M),e(M,w),e(y,L)},d(v){v&&o(y)}}}function Sw(W){let y,S,M,w,L;return w=new P({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExQaXBlbGluZSUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtYmFzZS0xLjAlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBcGlwZSUyMCUzRCUyMHBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionXLPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){y=n("p"),S=a("Examples:"),M=p(),m(w.$$.fragment)},l(v){y=i(v,"P",{});var I=s(y);S=l(I,"Examples:"),I.forEach(o),M=d(v),g(w.$$.fragment,v)},m(v,I){f(v,y,I),e(y,S),f(v,M,I),u(w,v,I),L=!0},p:rb,i(v){L||(h(w.$$.fragment,v),L=!0)},o(v){_(w.$$.fragment,v),L=!1},d(v){v&&o(y),v&&o(M),b(w,v)}}}function Lw(W){let y,S,M,w,L;return w=new P({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExJbWcySW1nUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTEltZzJJbWdQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXhsLXJlZmluZXItMS4wJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKCUyMmN1ZGElMjIpJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGcGF0cmlja3ZvbnBsYXRlbiUyRmltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGYWFfeGwlMkYwMDAwMDAwMDkucG5nJTIyJTBBJTBBaW5pdF9pbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UodXJsKS5jb252ZXJ0KCUyMlJHQiUyMiklMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUyQyUyMGltYWdlJTNEaW5pdF9pbWFnZSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLImg2ImgPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionXLImg2ImgPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-refiner-1.0&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/aa_xl/000000009.png&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>init_image = load_image(url).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt, image=init_image).images[<span class="hljs-number">0</span>]`}}),{c(){y=n("p"),S=a("Examples:"),M=p(),m(w.$$.fragment)},l(v){y=i(v,"P",{});var I=s(y);S=l(I,"Examples:"),I.forEach(o),M=d(v),g(w.$$.fragment,v)},m(v,I){f(v,y,I),e(y,S),f(v,M,I),u(w,v,I),L=!0},p:rb,i(v){L||(h(w.$$.fragment,v),L=!0)},o(v){_(w.$$.fragment,v),L=!1},d(v){v&&o(y),v&&o(M),b(w,v)}}}function Uw(W){let y,S,M,w,L;return w=new P({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExJbnBhaW50UGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTElucGFpbnRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXhsLWJhc2UtMS4wJTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIlMkMlMEElMjAlMjAlMjAlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlJTJDJTBBKSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFpbWdfdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZyYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tJTJGQ29tcFZpcyUyRmxhdGVudC1kaWZmdXNpb24lMkZtYWluJTJGZGF0YSUyRmlucGFpbnRpbmdfZXhhbXBsZXMlMkZvdmVydHVyZS1jcmVhdGlvbnMtNXNJNmZRZ1lJdW8ucG5nJTIyJTBBbWFza191cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRnJhdy5naXRodWJ1c2VyY29udGVudC5jb20lMkZDb21wVmlzJTJGbGF0ZW50LWRpZmZ1c2lvbiUyRm1haW4lMkZkYXRhJTJGaW5wYWludGluZ19leGFtcGxlcyUyRm92ZXJ0dXJlLWNyZWF0aW9ucy01c0k2ZlFnWUl1b19tYXNrLnBuZyUyMiUwQSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKGltZ191cmwpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQW1hc2tfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKG1hc2tfdXJsKS5jb252ZXJ0KCUyMlJHQiUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwbWFqZXN0aWMlMjB0aWdlciUyMHNpdHRpbmclMjBvbiUyMGElMjBiZW5jaCUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0Rwcm9tcHQlMkMlMjBpbWFnZSUzRGluaXRfaW1hZ2UlMkMlMjBtYXNrX2ltYWdlJTNEbWFza19pbWFnZSUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q1MCUyQyUyMHN0cmVuZ3RoJTNEMC44MCUwQSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLInpaintPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionXLInpaintPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
<span class="hljs-meta">... </span>    use_safetensors=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>img_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>init_image = load_image(img_url).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_image = load_image(mask_url).convert(<span class="hljs-string">&quot;RGB&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A majestic tiger sitting on a bench&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    prompt=prompt, image=init_image, mask_image=mask_image, num_inference_steps=<span class="hljs-number">50</span>, strength=<span class="hljs-number">0.80</span>
<span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>]`}}),{c(){y=n("p"),S=a("Examples:"),M=p(),m(w.$$.fragment)},l(v){y=i(v,"P",{});var I=s(y);S=l(I,"Examples:"),I.forEach(o),M=d(v),g(w.$$.fragment,v)},m(v,I){f(v,y,I),e(y,S),f(v,M,I),u(w,v,I),L=!0},p:rb,i(v){L||(h(w.$$.fragment,v),L=!0)},o(v){_(w.$$.fragment,v),L=!1},d(v){v&&o(y),v&&o(M),b(w,v)}}}function Xw(W){let y,S,M,w,L,v,I,A,H,je,R,me,j,Bn,zn,Bt,An,Cd,Al,Rn,Wi,Nd,Rl,ge,We,Gi,zt,Bd,Ci,zd,Fl,F,Ni,Ad,Rd,Bi,Fd,Vd,zi,Yd,Qd,q,qd,Ai,Hd,Od,Ri,Kd,ec,Fi,tc,oc,Vl,ue,Ge,Vi,At,nc,Yi,ic,Yl,Ce,he,Qi,sc,ac,Rt,lc,rc,Fn,pc,dc,_e,qi,cc,fc,Ft,mc,gc,Vn,uc,Ql,be,Ne,Hi,Vt,hc,Oi,_c,ql,G,bc,Ki,vc,yc,es,wc,Mc,ts,Ic,Tc,os,xc,Ec,Hl,Yt,Ol,ve,Be,ns,Qt,Jc,is,Sc,Kl,ze,Lc,qt,Uc,Xc,er,Ht,tr,O,kc,ss,Dc,$c,as,Pc,Zc,or,Yn,jc,nr,Ot,ir,ye,Ae,ls,Kt,Wc,rs,Gc,sr,Re,Cc,ps,Nc,Bc,ar,eo,lr,Qn,zc,rr,to,pr,Fe,Ac,ds,Rc,Fc,dr,qn,cs,pb,cr,Ve,fr,we,Ye,fs,oo,Vc,ms,Yc,mr,Qe,Qc,gs,qc,Hc,gr,no,ur,Me,qe,us,io,Oc,hs,Kc,hr,so,ef,_s,tf,_r,ao,br,Ie,He,bs,lo,of,vs,nf,vr,K,sf,ro,af,lf,Hn,rf,pf,yr,On,df,wr,Oe,Te,cf,ys,ff,mf,po,gf,uf,hf,co,_f,fo,bf,vf,Mr,xe,ws,yf,wf,Ms,Mf,If,Ir,V,Is,mo,Tf,xf,Ts,go,Ef,Jf,xs,uo,Sf,Lf,Es,ho,Uf,Tr,Ee,Ke,Js,_o,Xf,Ss,kf,xr,Kn,Df,Er,ei,$f,Jr,C,Pf,Ls,Zf,jf,Us,Wf,Gf,bo,Xs,Cf,Nf,vo,ks,Bf,zf,Sr,Y,Af,Ds,Rf,Ff,$s,Vf,Yf,Ps,Qf,qf,Lr,ti,Hf,Ur,yo,Xr,et,Of,Zs,Kf,em,kr,wo,Dr,tt,tm,js,om,nm,$r,ee,im,Ws,sm,am,Gs,lm,rm,Pr,Q,pm,Cs,dm,cm,Ns,fm,mm,Bs,gm,um,Zr,Mo,jr,oi,hm,Wr,ot,zs,Io,As,_m,bm,Rs,vm,ym,Fs,To,Vs,ni,db,wm,Ys,ii,cb,Gr,si,Mm,Cr,nt,Nr,Je,it,Qs,xo,Im,qs,Tm,Br,te,xm,ai,Em,Jm,li,Sm,Lm,zr,ri,Um,Ar,Eo,Rr,st,Hs,Jo,Os,Xm,km,Ks,Dm,$m,ea,So,ta,oa,fb,Pm,na,ia,mb,Fr,at,Vr,pi,Zm,Yr,Lo,Qr,oe,jm,sa,Wm,Gm,aa,Cm,Nm,qr,Se,lt,la,Uo,Bm,ra,zm,Hr,ne,Am,di,Rm,Fm,pa,Vm,Ym,Or,Xo,Kr,Le,rt,da,ko,Qm,ca,qm,ep,pt,Hm,ci,Om,Km,tp,Do,op,fi,eg,np,$o,ip,Ue,dt,fa,Po,tg,mi,og,ma,ng,sp,ie,ig,ga,sg,ag,ua,lg,rg,ap,Zo,lp,Xe,ct,ha,jo,pg,gi,dg,_a,cg,rp,ke,ba,fg,mg,va,gg,ug,pp,Wo,dp,Go,cp,De,ft,ya,Co,hg,wa,_g,fp,T,No,bg,Ma,vg,yg,Bo,wg,ui,Mg,Ig,Tg,Ia,xg,Eg,zo,Ao,Ta,Jg,Sg,xa,Lg,Ug,Ro,Ea,Xg,kg,hi,Dg,$g,Ja,Pg,Zg,Sa,Fo,La,jg,Wg,Ua,Gg,Cg,se,Vo,Ng,Xa,Bg,zg,mt,Ag,gt,Yo,Rg,Qo,Fg,ka,Vg,Yg,Qg,ut,qo,qg,Ho,Hg,Da,Og,Kg,eu,ht,Oo,tu,N,ou,$a,nu,iu,Pa,su,au,Za,lu,ru,ja,pu,du,cu,_t,Ko,fu,Wa,mu,gu,bt,en,uu,Ga,hu,_u,vt,tn,bu,Ca,vu,mp,$e,yt,Na,on,yu,Ba,wu,gp,x,nn,Mu,za,Iu,Tu,sn,xu,_i,Eu,Ju,Su,Aa,Lu,Uu,an,ln,Ra,Xu,ku,bi,Du,$u,rn,Fa,Pu,Zu,vi,ju,Wu,Va,Gu,Cu,Ya,pn,Qa,Nu,Bu,yi,zu,Au,ae,dn,Ru,qa,Fu,Vu,wt,Yu,Mt,cn,Qu,fn,qu,Ha,Hu,Ou,Ku,It,mn,eh,gn,th,Oa,oh,nh,ih,Tt,un,sh,B,ah,Ka,lh,rh,el,ph,dh,tl,ch,fh,ol,mh,gh,uh,xt,hn,hh,nl,_h,bh,Et,_n,vh,il,yh,wh,Jt,bn,Mh,sl,Ih,up,Pe,St,al,vn,Th,ll,xh,hp,E,yn,Eh,rl,Jh,Sh,wn,Lh,wi,Uh,Xh,kh,pl,Dh,$h,Mn,In,dl,Ph,Zh,Mi,jh,Wh,Tn,cl,Gh,Ch,Ii,Nh,Bh,fl,zh,Ah,ml,xn,gl,Rh,Fh,Ti,Vh,Yh,le,En,Qh,ul,qh,Hh,Lt,Oh,Ut,Jn,Kh,Sn,e_,hl,t_,o_,n_,Xt,Ln,i_,Un,s_,_l,a_,l_,r_,kt,Xn,p_,z,d_,bl,c_,f_,vl,m_,g_,yl,u_,h_,wl,__,b_,v_,Dt,kn,y_,Ml,w_,M_,$t,Dn,I_,Il,T_,x_,Pt,$n,E_,Tl,J_,_p,Ze,Zt,xl,Pn,S_,El,L_,bp,J,U_,Zn,X_,k_,Jl,D_,$_,Sl,P_,Z_,Ll,j_,W_,Ul,G_,C_,Xl,N_,B_,kl,z_,A_,Dl,R_,F_,jn,V_,Y_,$l,Q_,q_,Pl,H_,O_,Zl,K_,eb,Wn,tb,ob,vp,Gn,yp;return v=new Z({}),zt=new Z({}),At=new Z({}),Vt=new Z({}),Yt=new P({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUwQXBpcCUyMGluc3RhbGwlMjBhY2NlbGVyYXRlJTBBcGlwJTIwaW5zdGFsbCUyMHNhZmV0ZW5zb3Jz",highlighted:`pip <span class="hljs-keyword">install</span> transformers
pip <span class="hljs-keyword">install</span> accelerate
pip <span class="hljs-keyword">install</span> safetensors`}}),Qt=new Z({}),Ht=new P({props:{code:"cGlwJTIwaW5zdGFsbCUyMGludmlzaWJsZS13YXRlcm1hcmslM0UlM0QwLjIuMA==",highlighted:'<span class="hljs-attribute">pip</span> install invisible-watermark&gt;=<span class="hljs-number">0</span>.<span class="hljs-number">2</span>.<span class="hljs-number">0</span>'}}),Ot=new P({props:{code:"cGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKC4uLiUyQyUyMGFkZF93YXRlcm1hcmtlciUzREZhbHNlKQ==",highlighted:'pipe = StableDiffusionXLPipeline.from_pretrained(..., add_watermarker=<span class="hljs-literal">False</span>)'}}),Kt=new Z({}),eo=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtYmFzZS0xLjAlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMEEpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkFzdHJvbmF1dCUyMGluJTIwYSUyMGp1bmdsZSUyQyUyMGNvbGQlMjBjb2xvciUyMHBhbGV0dGUlMkMlMjBtdXRlZCUyMGNvbG9ycyUyQyUyMGRldGFpbGVkJTJDJTIwOGslMjIlMEFpbWFnZSUyMCUzRCUyMHBpcGUocHJvbXB0JTNEcHJvbXB0KS5pbWFnZXMlNUIwJTVE",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline
<span class="hljs-keyword">import</span> torch

pipe = StableDiffusionXLPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;Astronaut in a jungle, cold color palette, muted colors, detailed, 8k&quot;</span>
image = pipe(prompt=prompt).images[<span class="hljs-number">0</span>]`}}),to=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtYmFzZS0xLjAlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMEEpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkFzdHJvbmF1dCUyMGluJTIwYSUyMGp1bmdsZSUyQyUyMGNvbGQlMjBjb2xvciUyMHBhbGV0dGUlMkMlMjBtdXRlZCUyMGNvbG9ycyUyQyUyMGRldGFpbGVkJTJDJTIwOGslMjIlMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfb3JpZ2luYWxfc2l6ZSUzRCg1MTIlMkMlMjA1MTIpJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfY3JvcHNfY29vcmRzX3RvcF9sZWZ0JTNEKDAlMkMlMjAwKSUyQyUwQSUyMCUyMCUyMCUyMG5lZ2F0aXZlX3RhcmdldF9zaXplJTNEKDEwMjQlMkMlMjAxMDI0KSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline
<span class="hljs-keyword">import</span> torch

pipe = StableDiffusionXLPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;Astronaut in a jungle, cold color palette, muted colors, detailed, 8k&quot;</span>
image = pipe(
    prompt=prompt,
    negative_original_size=(<span class="hljs-number">512</span>, <span class="hljs-number">512</span>),
    negative_crops_coords_top_left=(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>),
    negative_target_size=(<span class="hljs-number">1024</span>, <span class="hljs-number">1024</span>),
).images[<span class="hljs-number">0</span>]`}}),Ve=new ab({props:{$$slots:{default:[xw]},$$scope:{ctx:W}}}),oo=new Z({}),no=new P({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExJbWcySW1nUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTEltZzJJbWdQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXhsLXJlZmluZXItMS4wJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlJTBBKSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKCUyMmN1ZGElMjIpJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGcGF0cmlja3ZvbnBsYXRlbiUyRmltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGYWFfeGwlMkYwMDAwMDAwMDkucG5nJTIyJTBBJTBBaW5pdF9pbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UodXJsKS5jb252ZXJ0KCUyMlJHQiUyMiklMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUyQyUyMGltYWdlJTNEaW5pdF9pbWFnZSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLImg2ImgPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

pipe = StableDiffusionXLImg2ImgPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-refiner-1.0&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>
)
pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
url = <span class="hljs-string">&quot;https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/aa_xl/000000009.png&quot;</span>

init_image = load_image(url).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
image = pipe(prompt, image=init_image).images[<span class="hljs-number">0</span>]`}}),io=new Z({}),ao=new P({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExJbnBhaW50UGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTElucGFpbnRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXhsLWJhc2UtMS4wJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlJTBBKSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFpbWdfdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZyYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tJTJGQ29tcFZpcyUyRmxhdGVudC1kaWZmdXNpb24lMkZtYWluJTJGZGF0YSUyRmlucGFpbnRpbmdfZXhhbXBsZXMlMkZvdmVydHVyZS1jcmVhdGlvbnMtNXNJNmZRZ1lJdW8ucG5nJTIyJTBBbWFza191cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRnJhdy5naXRodWJ1c2VyY29udGVudC5jb20lMkZDb21wVmlzJTJGbGF0ZW50LWRpZmZ1c2lvbiUyRm1haW4lMkZkYXRhJTJGaW5wYWludGluZ19leGFtcGxlcyUyRm92ZXJ0dXJlLWNyZWF0aW9ucy01c0k2ZlFnWUl1b19tYXNrLnBuZyUyMiUwQSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKGltZ191cmwpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQW1hc2tfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKG1hc2tfdXJsKS5jb252ZXJ0KCUyMlJHQiUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwbWFqZXN0aWMlMjB0aWdlciUyMHNpdHRpbmclMjBvbiUyMGElMjBiZW5jaCUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlM0Rwcm9tcHQlMkMlMjBpbWFnZSUzRGluaXRfaW1hZ2UlMkMlMjBtYXNrX2ltYWdlJTNEbWFza19pbWFnZSUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q1MCUyQyUyMHN0cmVuZ3RoJTNEMC44MCkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLInpaintPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

pipe = StableDiffusionXLInpaintPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

img_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png&quot;</span>
mask_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png&quot;</span>

init_image = load_image(img_url).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
mask_image = load_image(mask_url).convert(<span class="hljs-string">&quot;RGB&quot;</span>)

prompt = <span class="hljs-string">&quot;A majestic tiger sitting on a bench&quot;</span>
image = pipe(prompt=prompt, image=init_image, mask_image=mask_image, num_inference_steps=<span class="hljs-number">50</span>, strength=<span class="hljs-number">0.80</span>).images[<span class="hljs-number">0</span>]`}}),lo=new Z({}),_o=new Z({}),yo=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFiYXNlJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi14bC1iYXNlLTEuMCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHZhcmlhbnQlM0QlMjJmcDE2JTIyJTJDJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUwQSklMEFiYXNlLnRvKCUyMmN1ZGElMjIpJTBBJTBBcmVmaW5lciUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtcmVmaW5lci0xLjAlMjIlMkMlMEElMjAlMjAlMjAlMjB0ZXh0X2VuY29kZXJfMiUzRGJhc2UudGV4dF9lbmNvZGVyXzIlMkMlMEElMjAlMjAlMjAlMjB2YWUlM0RiYXNlLnZhZSUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUwQSUyMCUyMCUyMCUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUwQSklMEFyZWZpbmVyLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch

base = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>
)
base.to(<span class="hljs-string">&quot;cuda&quot;</span>)

refiner = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-refiner-1.0&quot;</span>,
    text_encoder_2=base.text_encoder_2,
    vae=base.vae,
    torch_dtype=torch.float16,
    use_safetensors=<span class="hljs-literal">True</span>,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
)
refiner.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),wo=new P({props:{code:"bl9zdGVwcyUyMCUzRCUyMDQwJTBBaGlnaF9ub2lzZV9mcmFjJTIwJTNEJTIwMC44",highlighted:`n_steps = <span class="hljs-number">40</span>
high_noise_frac = <span class="hljs-number">0.8</span>`}}),Mo=new P({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMG1hamVzdGljJTIwbGlvbiUyMGp1bXBpbmclMjBmcm9tJTIwYSUyMGJpZyUyMHN0b25lJTIwYXQlMjBuaWdodCUyMiUwQSUwQWltYWdlJTIwJTNEJTIwYmFzZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0Rwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEbl9zdGVwcyUyQyUwQSUyMCUyMCUyMCUyMGRlbm9pc2luZ19lbmQlM0RoaWdoX25vaXNlX2ZyYWMlMkMlMEElMjAlMjAlMjAlMjBvdXRwdXRfdHlwZSUzRCUyMmxhdGVudCUyMiUyQyUwQSkuaW1hZ2VzJTBBaW1hZ2UlMjAlM0QlMjByZWZpbmVyKCUwQSUyMCUyMCUyMCUyMHByb21wdCUzRHByb21wdCUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0RuX3N0ZXBzJTJDJTBBJTIwJTIwJTIwJTIwZGVub2lzaW5nX3N0YXJ0JTNEaGlnaF9ub2lzZV9mcmFjJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0RpbWFnZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`prompt = <span class="hljs-string">&quot;A majestic lion jumping from a big stone at night&quot;</span>

image = base(
    prompt=prompt,
    num_inference_steps=n_steps,
    denoising_end=high_noise_frac,
    output_type=<span class="hljs-string">&quot;latent&quot;</span>,
).images
image = refiner(
    prompt=prompt,
    num_inference_steps=n_steps,
    denoising_start=high_noise_frac,
    image=image,
).images[<span class="hljs-number">0</span>]`}}),nt=new ab({props:{$$slots:{default:[Ew]},$$scope:{ctx:W}}}),xo=new Z({}),Eo=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi14bC1iYXNlLTEuMCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHZhcmlhbnQlM0QlMjJmcDE2JTIyJTJDJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUwQSklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBcmVmaW5lciUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtcmVmaW5lci0xLjAlMjIlMkMlMEElMjAlMjAlMjAlMjB0ZXh0X2VuY29kZXJfMiUzRHBpcGUudGV4dF9lbmNvZGVyXzIlMkMlMEElMjAlMjAlMjAlMjB2YWUlM0RwaXBlLnZhZSUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUwQSUyMCUyMCUyMCUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUwQSklMEFyZWZpbmVyLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQXN0cm9uYXV0JTIwaW4lMjBhJTIwanVuZ2xlJTJDJTIwY29sZCUyMGNvbG9yJTIwcGFsZXR0ZSUyQyUyMG11dGVkJTIwY29sb3JzJTJDJTIwZGV0YWlsZWQlMkMlMjA4ayUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlM0Rwcm9tcHQlMkMlMjBvdXRwdXRfdHlwZSUzRCUyMmxhdGVudCUyMiUyMGlmJTIwdXNlX3JlZmluZXIlMjBlbHNlJTIwJTIycGlsJTIyKS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2UlMjAlM0QlMjByZWZpbmVyKHByb21wdCUzRHByb21wdCUyQyUyMGltYWdlJTNEaW1hZ2UlNUJOb25lJTJDJTIwJTNBJTVEKS5pbWFnZXMlNUIwJTVE",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch

pipe = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

refiner = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-refiner-1.0&quot;</span>,
    text_encoder_2=pipe.text_encoder_2,
    vae=pipe.vae,
    torch_dtype=torch.float16,
    use_safetensors=<span class="hljs-literal">True</span>,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
)
refiner.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;Astronaut in a jungle, cold color palette, muted colors, detailed, 8k&quot;</span>

image = pipe(prompt=prompt, output_type=<span class="hljs-string">&quot;latent&quot;</span> <span class="hljs-keyword">if</span> use_refiner <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;pil&quot;</span>).images[<span class="hljs-number">0</span>]
image = refiner(prompt=prompt, image=image[<span class="hljs-literal">None</span>, :]).images[<span class="hljs-number">0</span>]`}}),at=new ab({props:{$$slots:{default:[Jw]},$$scope:{ctx:W}}}),Lo=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMSW5wYWludFBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uWExJbnBhaW50UGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi14bC1iYXNlLTEuMCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHZhcmlhbnQlM0QlMjJmcDE2JTIyJTJDJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUwQSklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBcmVmaW5lciUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblhMSW5wYWludFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtcmVmaW5lci0xLjAlMjIlMkMlMEElMjAlMjAlMjAlMjB0ZXh0X2VuY29kZXJfMiUzRHBpcGUudGV4dF9lbmNvZGVyXzIlMkMlMEElMjAlMjAlMjAlMjB2YWUlM0RwaXBlLnZhZSUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUwQSUyMCUyMCUyMCUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUwQSklMEFyZWZpbmVyLnRvKCUyMmN1ZGElMjIpJTBBJTBBaW1nX3VybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRkNvbXBWaXMlMkZsYXRlbnQtZGlmZnVzaW9uJTJGbWFpbiUyRmRhdGElMkZpbnBhaW50aW5nX2V4YW1wbGVzJTJGb3ZlcnR1cmUtY3JlYXRpb25zLTVzSTZmUWdZSXVvLnBuZyUyMiUwQW1hc2tfdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZyYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tJTJGQ29tcFZpcyUyRmxhdGVudC1kaWZmdXNpb24lMkZtYWluJTJGZGF0YSUyRmlucGFpbnRpbmdfZXhhbXBsZXMlMkZvdmVydHVyZS1jcmVhdGlvbnMtNXNJNmZRZ1lJdW9fbWFzay5wbmclMjIlMEElMEFpbml0X2ltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZShpbWdfdXJsKS5jb252ZXJ0KCUyMlJHQiUyMiklMEFtYXNrX2ltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZShtYXNrX3VybCkuY29udmVydCglMjJSR0IlMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMG1hamVzdGljJTIwdGlnZXIlMjBzaXR0aW5nJTIwb24lMjBhJTIwYmVuY2glMjIlMEFudW1faW5mZXJlbmNlX3N0ZXBzJTIwJTNEJTIwNzUlMEFoaWdoX25vaXNlX2ZyYWMlMjAlM0QlMjAwLjclMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0Rpbml0X2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbWFza19pbWFnZSUzRG1hc2tfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEbnVtX2luZmVyZW5jZV9zdGVwcyUyQyUwQSUyMCUyMCUyMCUyMGRlbm9pc2luZ19zdGFydCUzRGhpZ2hfbm9pc2VfZnJhYyUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF90eXBlJTNEJTIybGF0ZW50JTIyJTJDJTBBKS5pbWFnZXMlMEFpbWFnZSUyMCUzRCUyMHJlZmluZXIoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0RpbWFnZSUyQyUwQSUyMCUyMCUyMCUyMG1hc2tfaW1hZ2UlM0RtYXNrX2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRG51bV9pbmZlcmVuY2Vfc3RlcHMlMkMlMEElMjAlMjAlMjAlMjBkZW5vaXNpbmdfc3RhcnQlM0RoaWdoX25vaXNlX2ZyYWMlMkMlMEEpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLInpaintPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

pipe = StableDiffusionXLInpaintPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

refiner = StableDiffusionXLInpaintPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-refiner-1.0&quot;</span>,
    text_encoder_2=pipe.text_encoder_2,
    vae=pipe.vae,
    torch_dtype=torch.float16,
    use_safetensors=<span class="hljs-literal">True</span>,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
)
refiner.to(<span class="hljs-string">&quot;cuda&quot;</span>)

img_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png&quot;</span>
mask_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png&quot;</span>

init_image = load_image(img_url).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
mask_image = load_image(mask_url).convert(<span class="hljs-string">&quot;RGB&quot;</span>)

prompt = <span class="hljs-string">&quot;A majestic tiger sitting on a bench&quot;</span>
num_inference_steps = <span class="hljs-number">75</span>
high_noise_frac = <span class="hljs-number">0.7</span>

image = pipe(
    prompt=prompt,
    image=init_image,
    mask_image=mask_image,
    num_inference_steps=num_inference_steps,
    denoising_start=high_noise_frac,
    output_type=<span class="hljs-string">&quot;latent&quot;</span>,
).images
image = refiner(
    prompt=prompt,
    image=image,
    mask_image=mask_image,
    num_inference_steps=num_inference_steps,
    denoising_start=high_noise_frac,
).images[<span class="hljs-number">0</span>]`}}),Uo=new Z({}),Xo=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMkMlMjBTdGFibGVEaWZmdXNpb25YTEltZzJJbWdQaXBlbGluZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMEElMjAlMjAlMjAlMjAlMjIuJTJGc2RfeGxfYmFzZV8xLjAuc2FmZXRlbnNvcnMlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMEEpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXJlZmluZXIlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTEltZzJJbWdQaXBlbGluZS5mcm9tX3NpbmdsZV9maWxlKCUwQSUyMCUyMCUyMCUyMCUyMi4lMkZzZF94bF9yZWZpbmVyXzEuMC5zYWZldGVuc29ycyUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUwQSklMEFyZWZpbmVyLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline, StableDiffusionXLImg2ImgPipeline
<span class="hljs-keyword">import</span> torch

pipe = StableDiffusionXLPipeline.from_single_file(
    <span class="hljs-string">&quot;./sd_xl_base_1.0.safetensors&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

refiner = StableDiffusionXLImg2ImgPipeline.from_single_file(
    <span class="hljs-string">&quot;./sd_xl_refiner_1.0.safetensors&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>
)
refiner.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),ko=new Z({}),Do=new P({props:{code:"LSUyMHBpcGUudG8oJTIyY3VkYSUyMiklMEElMkIlMjBwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgp",highlighted:`<span class="hljs-deletion">- pipe.to(&quot;cuda&quot;)</span>
<span class="hljs-addition">+ pipe.enable_model_cpu_offload()</span>`}}),$o=new P({props:{code:"LSUyMHJlZmluZXIudG8oJTIyY3VkYSUyMiklMEElMkIlMjByZWZpbmVyLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgp",highlighted:`<span class="hljs-deletion">- refiner.to(&quot;cuda&quot;)</span>
<span class="hljs-addition">+ refiner.enable_model_cpu_offload()</span>`}}),Po=new Z({}),Zo=new P({props:{code:"JTJCJTIwcGlwZS51bmV0JTIwJTNEJTIwdG9yY2guY29tcGlsZShwaXBlLnVuZXQlMkMlMjBtb2RlJTNEJTIycmVkdWNlLW92ZXJoZWFkJTIyJTJDJTIwZnVsbGdyYXBoJTNEVHJ1ZSklMEElMkIlMjByZWZpbmVyLnVuZXQlMjAlM0QlMjB0b3JjaC5jb21waWxlKHJlZmluZXIudW5ldCUyQyUyMG1vZGUlM0QlMjJyZWR1Y2Utb3ZlcmhlYWQlMjIlMkMlMjBmdWxsZ3JhcGglM0RUcnVlKQ==",highlighted:`<span class="hljs-addition">+ pipe.unet = torch.compile(pipe.unet, mode=&quot;reduce-overhead&quot;, fullgraph=True)</span>
<span class="hljs-addition">+ refiner.unet = torch.compile(refiner.unet, mode=&quot;reduce-overhead&quot;, fullgraph=True)</span>`}}),jo=new Z({}),Wo=new P({props:{code:"cGlwJTIwaW5zdGFsbCUyMHhmb3JtZXJz",highlighted:'pip <span class="hljs-keyword">install</span> xformers'}}),Go=new P({props:{code:"JTJCcGlwZS5lbmFibGVfeGZvcm1lcnNfbWVtb3J5X2VmZmljaWVudF9hdHRlbnRpb24oKSUwQSUyQnJlZmluZXIuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKCk=",highlighted:`<span class="hljs-addition">+pipe.enable_xformers_memory_efficient_attention()</span>
<span class="hljs-addition">+refiner.enable_xformers_memory_efficient_attention()</span>`}}),Co=new Z({}),No=new $({props:{name:"class diffusers.StableDiffusionXLPipeline",anchor:"diffusers.StableDiffusionXLPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"text_encoder_2",val:": CLIPTextModelWithProjection"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"tokenizer_2",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"force_zeros_for_empty_prompt",val:": bool = True"},{name:"add_watermarker",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionXLPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion XL uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionXLPipeline.text_encoder_2",description:`<strong>text_encoder_2</strong> (<code> CLIPTextModelWithProjection</code>) &#x2014;
Second frozen text-encoder. Stable Diffusion XL uses the text and pool portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModelWithProjection" rel="nofollow">CLIP</a>,
specifically the
<a href="https://huggingface.co/laion/CLIP-ViT-bigG-14-laion2B-39B-b160k" rel="nofollow">laion/CLIP-ViT-bigG-14-laion2B-39B-b160k</a>
variant.`,name:"text_encoder_2"},{anchor:"diffusers.StableDiffusionXLPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionXLPipeline.tokenizer_2",description:`<strong>tokenizer_2</strong> (<code>CLIPTokenizer</code>) &#x2014;
Second Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer_2"},{anchor:"diffusers.StableDiffusionXLPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionXLPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionXLPipeline.force_zeros_for_empty_prompt",description:`<strong>force_zeros_for_empty_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>&quot;True&quot;</code>) &#x2014;
Whether the negative prompt embeddings shall be forced to always be set to 0. Also see the config of
<code>stabilityai/stable-diffusion-xl-base-1-0</code>.`,name:"force_zeros_for_empty_prompt"},{anchor:"diffusers.StableDiffusionXLPipeline.add_watermarker",description:`<strong>add_watermarker</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to use the <a href="https://github.com/ShieldMnt/invisible-watermark/" rel="nofollow">invisible_watermark library</a> to
watermark output images. If not defined, it will default to True if the package is installed, otherwise no
watermarker will be used.`,name:"add_watermarker"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py#L82"}}),Vo=new $({props:{name:"__call__",anchor:"diffusers.StableDiffusionXLPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"prompt_2",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"denoising_end",val:": typing.Optional[float] = None"},{name:"guidance_scale",val:": float = 5.0"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"negative_prompt_2",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"guidance_rescale",val:": float = 0.0"},{name:"original_size",val:": typing.Union[typing.Tuple[int, int], NoneType] = None"},{name:"crops_coords_top_left",val:": typing.Tuple[int, int] = (0, 0)"},{name:"target_size",val:": typing.Union[typing.Tuple[int, int], NoneType] = None"},{name:"negative_original_size",val:": typing.Union[typing.Tuple[int, int], NoneType] = None"},{name:"negative_crops_coords_top_left",val:": typing.Tuple[int, int] = (0, 0)"},{name:"negative_target_size",val:": typing.Union[typing.Tuple[int, int], NoneType] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to be sent to the <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is
used in both text-encoders`,name:"prompt_2"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.denoising_end",description:`<strong>denoising_end</strong> (<code>float</code>, <em>optional</em>) &#x2014;
When specified, determines the fraction (between 0.0 and 1.0) of the total denoising process to be
completed before it is intentionally prematurely terminated. As a result, the returned sample will
still retain a substantial amount of noise as determined by the discrete timesteps selected by the
scheduler. The denoising_end parameter should ideally be utilized when this pipeline forms a part of a
&#x201C;Mixture of Denoisers&#x201D; multi-pipeline setup, as elaborated in <a href="https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/stable_diffusion_xl#refining-the-image-output" rel="nofollow"><strong>Refining the Image
Output</strong></a>`,name:"denoising_end"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 5.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.negative_prompt_2",description:`<strong>negative_prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_2</code> and
<code>text_encoder_2</code>. If not defined, <code>negative_prompt</code> is used in both text-encoders`,name:"negative_prompt_2"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting.
If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.negative_pooled_prompt_embeds",description:`<strong>negative_pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, pooled negative_prompt_embeds will be generated from <code>negative_prompt</code>
input argument.`,name:"negative_pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>StableDiffusionXLPipelineOutput</code> instead
of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.guidance_rescale",description:`<strong>guidance_rescale</strong> (<code>float</code>, <em>optional</em>, defaults to 0.7) &#x2014;
Guidance rescale factor proposed by <a href="https://arxiv.org/pdf/2305.08891.pdf" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are
Flawed</a> <code>guidance_scale</code> is defined as <code>&#x3C6;</code> in equation 16. of
<a href="https://arxiv.org/pdf/2305.08891.pdf" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are Flawed</a>.
Guidance rescale factor should fix overexposure when using zero terminal SNR.`,name:"guidance_rescale"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.original_size",description:`<strong>original_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
If <code>original_size</code> is not the same as <code>target_size</code> the image will appear to be down- or upsampled.
<code>original_size</code> defaults to <code>(width, height)</code> if not specified. Part of SDXL&#x2019;s micro-conditioning as
explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"original_size"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.crops_coords_top_left",description:`<strong>crops_coords_top_left</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (0, 0)) &#x2014;
<code>crops_coords_top_left</code> can be used to generate an image that appears to be &#x201C;cropped&#x201D; from the position
<code>crops_coords_top_left</code> downwards. Favorable, well-centered images are usually achieved by setting
<code>crops_coords_top_left</code> to (0, 0). Part of SDXL&#x2019;s micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"crops_coords_top_left"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.target_size",description:`<strong>target_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
For most cases, <code>target_size</code> should be set to the desired height and width of the generated image. If
not specified it will default to <code>(width, height)</code>. Part of SDXL&#x2019;s micro-conditioning as explained in
section 2.2 of <a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"target_size"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.negative_original_size",description:`<strong>negative_original_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
To negatively condition the generation process based on a specific image resolution. Part of SDXL&#x2019;s
micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. For more
information, refer to this issue thread: <a href="https://github.com/huggingface/diffusers/issues/4208" rel="nofollow">https://github.com/huggingface/diffusers/issues/4208</a>.`,name:"negative_original_size"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.negative_crops_coords_top_left",description:`<strong>negative_crops_coords_top_left</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (0, 0)) &#x2014;
To negatively condition the generation process based on a specific crop coordinates. Part of SDXL&#x2019;s
micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. For more
information, refer to this issue thread: <a href="https://github.com/huggingface/diffusers/issues/4208" rel="nofollow">https://github.com/huggingface/diffusers/issues/4208</a>.`,name:"negative_crops_coords_top_left"},{anchor:"diffusers.StableDiffusionXLPipeline.__call__.negative_target_size",description:`<strong>negative_target_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
To negatively condition the generation process based on a target image resolution. It should be as same
as the <code>target_size</code> for most cases. Part of SDXL&#x2019;s micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. For more
information, refer to this issue thread: <a href="https://github.com/huggingface/diffusers/issues/4208" rel="nofollow">https://github.com/huggingface/diffusers/issues/4208</a>.`,name:"negative_target_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py#L562",returnDescription:`
<p><code>StableDiffusionXLPipelineOutput</code> if <code>return_dict</code> is True, otherwise a
<code>tuple</code>. When returning a tuple, the first element is a list with the generated images.</p>
`,returnType:`
<p><code>StableDiffusionXLPipelineOutput</code> or <code>tuple</code></p>
`}}),mt=new lb({props:{anchor:"diffusers.StableDiffusionXLPipeline.__call__.example",$$slots:{default:[Sw]},$$scope:{ctx:W}}}),Yo=new $({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionXLPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py#L172"}}),qo=new $({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionXLPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py#L189"}}),Oo=new $({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionXLPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py#L196"}}),Ko=new $({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionXLPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py#L164"}}),en=new $({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionXLPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py#L180"}}),tn=new $({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionXLPipeline.encode_prompt",parameters:[{name:"prompt",val:": str"},{name:"prompt_2",val:": typing.Optional[str] = None"},{name:"device",val:": typing.Optional[torch.device] = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"negative_prompt",val:": typing.Optional[str] = None"},{name:"negative_prompt_2",val:": typing.Optional[str] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"},{anchor:"diffusers.StableDiffusionXLPipeline.encode_prompt.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to be sent to the <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is
used in both text-encoders
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt_2"},{anchor:"diffusers.StableDiffusionXLPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionXLPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionXLPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionXLPipeline.encode_prompt.negative_prompt_2",description:`<strong>negative_prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_2</code> and
<code>text_encoder_2</code>. If not defined, <code>negative_prompt</code> is used in both text-encoders`,name:"negative_prompt_2"},{anchor:"diffusers.StableDiffusionXLPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionXLPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLPipeline.encode_prompt.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting.
If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLPipeline.encode_prompt.negative_pooled_prompt_embeds",description:`<strong>negative_pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, pooled negative_prompt_embeds will be generated from <code>negative_prompt</code>
input argument.`,name:"negative_pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py#L226"}}),on=new Z({}),nn=new $({props:{name:"class diffusers.StableDiffusionXLImg2ImgPipeline",anchor:"diffusers.StableDiffusionXLImg2ImgPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"text_encoder_2",val:": CLIPTextModelWithProjection"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"tokenizer_2",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"requires_aesthetics_score",val:": bool = False"},{name:"force_zeros_for_empty_prompt",val:": bool = True"},{name:"add_watermarker",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion XL uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.text_encoder_2",description:`<strong>text_encoder_2</strong> (<code> CLIPTextModelWithProjection</code>) &#x2014;
Second frozen text-encoder. Stable Diffusion XL uses the text and pool portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModelWithProjection" rel="nofollow">CLIP</a>,
specifically the
<a href="https://huggingface.co/laion/CLIP-ViT-bigG-14-laion2B-39B-b160k" rel="nofollow">laion/CLIP-ViT-bigG-14-laion2B-39B-b160k</a>
variant.`,name:"text_encoder_2"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.tokenizer_2",description:`<strong>tokenizer_2</strong> (<code>CLIPTokenizer</code>) &#x2014;
Second Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer_2"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.requires_aesthetics_score",description:`<strong>requires_aesthetics_score</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>&quot;False&quot;</code>) &#x2014;
Whether the <code>unet</code> requires an <code>aesthetic_score</code> condition to be passed during inference. Also see the
config of <code>stabilityai/stable-diffusion-xl-refiner-1-0</code>.`,name:"requires_aesthetics_score"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.force_zeros_for_empty_prompt",description:`<strong>force_zeros_for_empty_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>&quot;True&quot;</code>) &#x2014;
Whether the negative prompt embeddings shall be forced to always be set to 0. Also see the config of
<code>stabilityai/stable-diffusion-xl-base-1-0</code>.`,name:"force_zeros_for_empty_prompt"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.add_watermarker",description:`<strong>add_watermarker</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to use the <a href="https://github.com/ShieldMnt/invisible-watermark/" rel="nofollow">invisible_watermark library</a> to
watermark output images. If not defined, it will default to True if the package is installed, otherwise no
watermarker will be used.`,name:"add_watermarker"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py#L86"}}),dn=new $({props:{name:"__call__",anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"prompt_2",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"strength",val:": float = 0.3"},{name:"num_inference_steps",val:": int = 50"},{name:"denoising_start",val:": typing.Optional[float] = None"},{name:"denoising_end",val:": typing.Optional[float] = None"},{name:"guidance_scale",val:": float = 5.0"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"negative_prompt_2",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"guidance_rescale",val:": float = 0.0"},{name:"original_size",val:": typing.Tuple[int, int] = None"},{name:"crops_coords_top_left",val:": typing.Tuple[int, int] = (0, 0)"},{name:"target_size",val:": typing.Tuple[int, int] = None"},{name:"negative_original_size",val:": typing.Union[typing.Tuple[int, int], NoneType] = None"},{name:"negative_crops_coords_top_left",val:": typing.Tuple[int, int] = (0, 0)"},{name:"negative_target_size",val:": typing.Union[typing.Tuple[int, int], NoneType] = None"},{name:"aesthetic_score",val:": float = 6.0"},{name:"negative_aesthetic_score",val:": float = 2.5"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to be sent to the <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is
used in both text-encoders`,name:"prompt_2"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code> or <code>PIL.Image.Image</code> or <code>np.ndarray</code> or <code>List[torch.FloatTensor]</code> or <code>List[PIL.Image.Image]</code> or <code>List[np.ndarray]</code>) &#x2014;
The image(s) to modify with the pipeline.`,name:"image"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.3) &#x2014;
Conceptually, indicates how much to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code>
will be used as a starting point, adding more noise to it the larger the <code>strength</code>. The number of
denoising steps depends on the amount of noise initially added. When <code>strength</code> is 1, added noise will
be maximum and the denoising process will run for the full number of iterations specified in
<code>num_inference_steps</code>. A value of 1, therefore, essentially ignores <code>image</code>. Note that in the case of
<code>denoising_start</code> being declared as an integer, the value of <code>strength</code> will be ignored.`,name:"strength"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.denoising_start",description:`<strong>denoising_start</strong> (<code>float</code>, <em>optional</em>) &#x2014;
When specified, indicates the fraction (between 0.0 and 1.0) of the total denoising process to be
bypassed before it is initiated. Consequently, the initial part of the denoising process is skipped and
it is assumed that the passed <code>image</code> is a partly denoised image. Note that when this is specified,
strength will be ignored. The <code>denoising_start</code> parameter is particularly beneficial when this pipeline
is integrated into a &#x201C;Mixture of Denoisers&#x201D; multi-pipeline setup, as detailed in <a href="https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/stable_diffusion_xl#refining-the-image-output" rel="nofollow"><strong>Refining the Image
Output</strong></a>.`,name:"denoising_start"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.denoising_end",description:`<strong>denoising_end</strong> (<code>float</code>, <em>optional</em>) &#x2014;
When specified, determines the fraction (between 0.0 and 1.0) of the total denoising process to be
completed before it is intentionally prematurely terminated. As a result, the returned sample will
still retain a substantial amount of noise (ca. final 20% of timesteps still needed) and should be
denoised by a successor pipeline that has <code>denoising_start</code> set to 0.8 so that it only denoises the
final 20% of the scheduler. The denoising_end parameter should ideally be utilized when this pipeline
forms a part of a &#x201C;Mixture of Denoisers&#x201D; multi-pipeline setup, as elaborated in <a href="https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/stable_diffusion_xl#refining-the-image-output" rel="nofollow"><strong>Refining the Image
Output</strong></a>.`,name:"denoising_end"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.negative_prompt_2",description:`<strong>negative_prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_2</code> and
<code>text_encoder_2</code>. If not defined, <code>negative_prompt</code> is used in both text-encoders`,name:"negative_prompt_2"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting.
If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.negative_pooled_prompt_embeds",description:`<strong>negative_pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, pooled negative_prompt_embeds will be generated from <code>negative_prompt</code>
input argument.`,name:"negative_pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>~pipelines.stable_diffusion.StableDiffusionXLPipelineOutput</code> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.guidance_rescale",description:`<strong>guidance_rescale</strong> (<code>float</code>, <em>optional</em>, defaults to 0.7) &#x2014;
Guidance rescale factor proposed by <a href="https://arxiv.org/pdf/2305.08891.pdf" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are
Flawed</a> <code>guidance_scale</code> is defined as <code>&#x3C6;</code> in equation 16. of
<a href="https://arxiv.org/pdf/2305.08891.pdf" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are Flawed</a>.
Guidance rescale factor should fix overexposure when using zero terminal SNR.`,name:"guidance_rescale"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.original_size",description:`<strong>original_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
If <code>original_size</code> is not the same as <code>target_size</code> the image will appear to be down- or upsampled.
<code>original_size</code> defaults to <code>(width, height)</code> if not specified. Part of SDXL&#x2019;s micro-conditioning as
explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"original_size"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.crops_coords_top_left",description:`<strong>crops_coords_top_left</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (0, 0)) &#x2014;
<code>crops_coords_top_left</code> can be used to generate an image that appears to be &#x201C;cropped&#x201D; from the position
<code>crops_coords_top_left</code> downwards. Favorable, well-centered images are usually achieved by setting
<code>crops_coords_top_left</code> to (0, 0). Part of SDXL&#x2019;s micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"crops_coords_top_left"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.target_size",description:`<strong>target_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
For most cases, <code>target_size</code> should be set to the desired height and width of the generated image. If
not specified it will default to <code>(width, height)</code>. Part of SDXL&#x2019;s micro-conditioning as explained in
section 2.2 of <a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"target_size"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.negative_original_size",description:`<strong>negative_original_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
To negatively condition the generation process based on a specific image resolution. Part of SDXL&#x2019;s
micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. For more
information, refer to this issue thread: <a href="https://github.com/huggingface/diffusers/issues/4208" rel="nofollow">https://github.com/huggingface/diffusers/issues/4208</a>.`,name:"negative_original_size"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.negative_crops_coords_top_left",description:`<strong>negative_crops_coords_top_left</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (0, 0)) &#x2014;
To negatively condition the generation process based on a specific crop coordinates. Part of SDXL&#x2019;s
micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. For more
information, refer to this issue thread: <a href="https://github.com/huggingface/diffusers/issues/4208" rel="nofollow">https://github.com/huggingface/diffusers/issues/4208</a>.`,name:"negative_crops_coords_top_left"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.negative_target_size",description:`<strong>negative_target_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
To negatively condition the generation process based on a target image resolution. It should be as same
as the <code>target_size</code> for most cases. Part of SDXL&#x2019;s micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. For more
information, refer to this issue thread: <a href="https://github.com/huggingface/diffusers/issues/4208" rel="nofollow">https://github.com/huggingface/diffusers/issues/4208</a>.`,name:"negative_target_size"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.aesthetic_score",description:`<strong>aesthetic_score</strong> (<code>float</code>, <em>optional</em>, defaults to 6.0) &#x2014;
Used to simulate an aesthetic score of the generated image by influencing the positive text condition.
Part of SDXL&#x2019;s micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"aesthetic_score"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.negative_aesthetic_score",description:`<strong>negative_aesthetic_score</strong> (<code>float</code>, <em>optional</em>, defaults to 2.5) &#x2014;
Part of SDXL&#x2019;s micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. Can be used to
simulate an aesthetic score of the generated image by influencing the negative text condition.`,name:"negative_aesthetic_score"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py#L673",returnDescription:`
<p><code>~pipelines.stable_diffusion.StableDiffusionXLPipelineOutput</code> if <code>return_dict</code> is True, otherwise a
\`tuple. When returning a tuple, the first element is a list with the generated images.</p>
`,returnType:`
<p><code>~pipelines.stable_diffusion.StableDiffusionXLPipelineOutput</code> or <code>tuple</code></p>
`}}),wt=new lb({props:{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.__call__.example",$$slots:{default:[Lw]},$$scope:{ctx:W}}}),cn=new $({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py#L181"}}),mn=new $({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py#L198"}}),un=new $({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py#L205"}}),hn=new $({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py#L173"}}),_n=new $({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py#L189"}}),bn=new $({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.encode_prompt",parameters:[{name:"prompt",val:": str"},{name:"prompt_2",val:": typing.Optional[str] = None"},{name:"device",val:": typing.Optional[torch.device] = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"negative_prompt",val:": typing.Optional[str] = None"},{name:"negative_prompt_2",val:": typing.Optional[str] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.encode_prompt.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to be sent to the <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is
used in both text-encoders
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt_2"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.encode_prompt.negative_prompt_2",description:`<strong>negative_prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_2</code> and
<code>text_encoder_2</code>. If not defined, <code>negative_prompt</code> is used in both text-encoders`,name:"negative_prompt_2"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.encode_prompt.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting.
If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.encode_prompt.negative_pooled_prompt_embeds",description:`<strong>negative_pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, pooled negative_prompt_embeds will be generated from <code>negative_prompt</code>
input argument.`,name:"negative_pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLImg2ImgPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py#L236"}}),vn=new Z({}),yn=new $({props:{name:"class diffusers.StableDiffusionXLInpaintPipeline",anchor:"diffusers.StableDiffusionXLInpaintPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"text_encoder_2",val:": CLIPTextModelWithProjection"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"tokenizer_2",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"requires_aesthetics_score",val:": bool = False"},{name:"force_zeros_for_empty_prompt",val:": bool = True"},{name:"add_watermarker",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLInpaintPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion XL uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.text_encoder_2",description:`<strong>text_encoder_2</strong> (<code> CLIPTextModelWithProjection</code>) &#x2014;
Second frozen text-encoder. Stable Diffusion XL uses the text and pool portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModelWithProjection" rel="nofollow">CLIP</a>,
specifically the
<a href="https://huggingface.co/laion/CLIP-ViT-bigG-14-laion2B-39B-b160k" rel="nofollow">laion/CLIP-ViT-bigG-14-laion2B-39B-b160k</a>
variant.`,name:"text_encoder_2"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.tokenizer_2",description:`<strong>tokenizer_2</strong> (<code>CLIPTokenizer</code>) &#x2014;
Second Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer_2"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.requires_aesthetics_score",description:`<strong>requires_aesthetics_score</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>&quot;False&quot;</code>) &#x2014;
Whether the <code>unet</code> requires a aesthetic_score condition to be passed during inference. Also see the config
of <code>stabilityai/stable-diffusion-xl-refiner-1-0</code>.`,name:"requires_aesthetics_score"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.force_zeros_for_empty_prompt",description:`<strong>force_zeros_for_empty_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>&quot;True&quot;</code>) &#x2014;
Whether the negative prompt embeddings shall be forced to always be set to 0. Also see the config of
<code>stabilityai/stable-diffusion-xl-base-1-0</code>.`,name:"force_zeros_for_empty_prompt"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.add_watermarker",description:`<strong>add_watermarker</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to use the <a href="https://github.com/ShieldMnt/invisible-watermark/" rel="nofollow">invisible_watermark library</a> to
watermark output images. If not defined, it will default to True if the package is installed, otherwise no
watermarker will be used.`,name:"add_watermarker"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py#L232"}}),En=new $({props:{name:"__call__",anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"prompt_2",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"mask_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"strength",val:": float = 1.0"},{name:"num_inference_steps",val:": int = 50"},{name:"denoising_start",val:": typing.Optional[float] = None"},{name:"denoising_end",val:": typing.Optional[float] = None"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"negative_prompt_2",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"guidance_rescale",val:": float = 0.0"},{name:"original_size",val:": typing.Tuple[int, int] = None"},{name:"crops_coords_top_left",val:": typing.Tuple[int, int] = (0, 0)"},{name:"target_size",val:": typing.Tuple[int, int] = None"},{name:"negative_original_size",val:": typing.Union[typing.Tuple[int, int], NoneType] = None"},{name:"negative_crops_coords_top_left",val:": typing.Tuple[int, int] = (0, 0)"},{name:"negative_target_size",val:": typing.Union[typing.Tuple[int, int], NoneType] = None"},{name:"aesthetic_score",val:": float = 6.0"},{name:"negative_aesthetic_score",val:": float = 2.5"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to be sent to the <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is
used in both text-encoders`,name:"prompt_2"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.image",description:`<strong>image</strong> (<code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch which will be inpainted, <em>i.e.</em> parts of the image will
be masked out with <code>mask_image</code> and repainted according to <code>prompt</code>.`,name:"image"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.mask_image",description:`<strong>mask_image</strong> (<code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, to mask <code>image</code>. White pixels in the mask will be
repainted, while black pixels will be preserved. If <code>mask_image</code> is a PIL image, it will be converted
to a single channel (luminance) before use. If it&#x2019;s a tensor, it should contain one color channel (L)
instead of 3, so the expected shape would be <code>(B, H, W, 1)</code>.`,name:"mask_image"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 1.) &#x2014;
Conceptually, indicates how much to transform the masked portion of the reference <code>image</code>. Must be
between 0 and 1. <code>image</code> will be used as a starting point, adding more noise to it the larger the
<code>strength</code>. The number of denoising steps depends on the amount of noise initially added. When
<code>strength</code> is 1, added noise will be maximum and the denoising process will run for the full number of
iterations specified in <code>num_inference_steps</code>. A value of 1, therefore, essentially ignores the masked
portion of the reference <code>image</code>. Note that in the case of <code>denoising_start</code> being declared as an
integer, the value of <code>strength</code> will be ignored.`,name:"strength"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.denoising_start",description:`<strong>denoising_start</strong> (<code>float</code>, <em>optional</em>) &#x2014;
When specified, indicates the fraction (between 0.0 and 1.0) of the total denoising process to be
bypassed before it is initiated. Consequently, the initial part of the denoising process is skipped and
it is assumed that the passed <code>image</code> is a partly denoised image. Note that when this is specified,
strength will be ignored. The <code>denoising_start</code> parameter is particularly beneficial when this pipeline
is integrated into a &#x201C;Mixture of Denoisers&#x201D; multi-pipeline setup, as detailed in <a href="https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/stable_diffusion_xl#refining-the-image-output" rel="nofollow"><strong>Refining the Image
Output</strong></a>.`,name:"denoising_start"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.denoising_end",description:`<strong>denoising_end</strong> (<code>float</code>, <em>optional</em>) &#x2014;
When specified, determines the fraction (between 0.0 and 1.0) of the total denoising process to be
completed before it is intentionally prematurely terminated. As a result, the returned sample will
still retain a substantial amount of noise (ca. final 20% of timesteps still needed) and should be
denoised by a successor pipeline that has <code>denoising_start</code> set to 0.8 so that it only denoises the
final 20% of the scheduler. The denoising_end parameter should ideally be utilized when this pipeline
forms a part of a &#x201C;Mixture of Denoisers&#x201D; multi-pipeline setup, as elaborated in <a href="https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/stable_diffusion_xl#refining-the-image-output" rel="nofollow"><strong>Refining the Image
Output</strong></a>.`,name:"denoising_end"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.negative_prompt_2",description:`<strong>negative_prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_2</code> and
<code>text_encoder_2</code>. If not defined, <code>negative_prompt</code> is used in both text-encoders`,name:"negative_prompt_2"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting.
If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.negative_pooled_prompt_embeds",description:`<strong>negative_pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, pooled negative_prompt_embeds will be generated from <code>negative_prompt</code>
input argument.`,name:"negative_pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.original_size",description:`<strong>original_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
If <code>original_size</code> is not the same as <code>target_size</code> the image will appear to be down- or upsampled.
<code>original_size</code> defaults to <code>(width, height)</code> if not specified. Part of SDXL&#x2019;s micro-conditioning as
explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"original_size"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.crops_coords_top_left",description:`<strong>crops_coords_top_left</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (0, 0)) &#x2014;
<code>crops_coords_top_left</code> can be used to generate an image that appears to be &#x201C;cropped&#x201D; from the position
<code>crops_coords_top_left</code> downwards. Favorable, well-centered images are usually achieved by setting
<code>crops_coords_top_left</code> to (0, 0). Part of SDXL&#x2019;s micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"crops_coords_top_left"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.target_size",description:`<strong>target_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
For most cases, <code>target_size</code> should be set to the desired height and width of the generated image. If
not specified it will default to <code>(width, height)</code>. Part of SDXL&#x2019;s micro-conditioning as explained in
section 2.2 of <a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"target_size"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.negative_original_size",description:`<strong>negative_original_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
To negatively condition the generation process based on a specific image resolution. Part of SDXL&#x2019;s
micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. For more
information, refer to this issue thread: <a href="https://github.com/huggingface/diffusers/issues/4208" rel="nofollow">https://github.com/huggingface/diffusers/issues/4208</a>.`,name:"negative_original_size"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.negative_crops_coords_top_left",description:`<strong>negative_crops_coords_top_left</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (0, 0)) &#x2014;
To negatively condition the generation process based on a specific crop coordinates. Part of SDXL&#x2019;s
micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. For more
information, refer to this issue thread: <a href="https://github.com/huggingface/diffusers/issues/4208" rel="nofollow">https://github.com/huggingface/diffusers/issues/4208</a>.`,name:"negative_crops_coords_top_left"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.negative_target_size",description:`<strong>negative_target_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
To negatively condition the generation process based on a target image resolution. It should be as same
as the <code>target_size</code> for most cases. Part of SDXL&#x2019;s micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. For more
information, refer to this issue thread: <a href="https://github.com/huggingface/diffusers/issues/4208" rel="nofollow">https://github.com/huggingface/diffusers/issues/4208</a>.`,name:"negative_target_size"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.aesthetic_score",description:`<strong>aesthetic_score</strong> (<code>float</code>, <em>optional</em>, defaults to 6.0) &#x2014;
Used to simulate an aesthetic score of the generated image by influencing the positive text condition.
Part of SDXL&#x2019;s micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"aesthetic_score"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.negative_aesthetic_score",description:`<strong>negative_aesthetic_score</strong> (<code>float</code>, <em>optional</em>, defaults to 2.5) &#x2014;
Part of SDXL&#x2019;s micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. Can be used to
simulate an aesthetic score of the generated image by influencing the negative text condition.`,name:"negative_aesthetic_score"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py#L885",returnDescription:`
<p><code>~pipelines.stable_diffusion.StableDiffusionXLPipelineOutput</code> if <code>return_dict</code> is True, otherwise a
<code>tuple. </code>tuple. When returning a tuple, the first element is a list with the generated images.</p>
`,returnType:`
<p><code>~pipelines.stable_diffusion.StableDiffusionXLPipelineOutput</code> or <code>tuple</code></p>
`}}),Lt=new lb({props:{anchor:"diffusers.StableDiffusionXLInpaintPipeline.__call__.example",$$slots:{default:[Uw]},$$scope:{ctx:W}}}),Jn=new $({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionXLInpaintPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py#L330"}}),Ln=new $({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionXLInpaintPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py#L347"}}),Xn=new $({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionXLInpaintPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py#L355"}}),kn=new $({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionXLInpaintPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py#L322"}}),Dn=new $({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionXLInpaintPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py#L338"}}),$n=new $({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionXLInpaintPipeline.encode_prompt",parameters:[{name:"prompt",val:": str"},{name:"prompt_2",val:": typing.Optional[str] = None"},{name:"device",val:": typing.Optional[torch.device] = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"negative_prompt",val:": typing.Optional[str] = None"},{name:"negative_prompt_2",val:": typing.Optional[str] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLInpaintPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.encode_prompt.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to be sent to the <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is
used in both text-encoders
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt_2"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.encode_prompt.negative_prompt_2",description:`<strong>negative_prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_2</code> and
<code>text_encoder_2</code>. If not defined, <code>negative_prompt</code> is used in both text-encoders`,name:"negative_prompt_2"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.encode_prompt.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting.
If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.encode_prompt.negative_pooled_prompt_embeds",description:`<strong>negative_pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, pooled negative_prompt_embeds will be generated from <code>negative_prompt</code>
input argument.`,name:"negative_pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLInpaintPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py#L386"}}),Pn=new Z({}),Gn=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtYmFzZS0xLjAlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMEEpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQSUyMyUyMHByb21wdCUyMHdpbGwlMjBiZSUyMHBhc3NlZCUyMHRvJTIwT0FJJTIwQ0xJUC1WaVQlMkZMLTE0JTBBcHJvbXB0JTIwJTNEJTIwJTIyQXN0cm9uYXV0JTIwaW4lMjBhJTIwanVuZ2xlJTJDJTIwY29sZCUyMGNvbG9yJTIwcGFsZXR0ZSUyQyUyMG11dGVkJTIwY29sb3JzJTJDJTIwZGV0YWlsZWQlMkMlMjA4ayUyMiUwQSUyMyUyMHByb21wdF8yJTIwd2lsbCUyMGJlJTIwcGFzc2VkJTIwdG8lMjBPcGVuQ0xJUC1WaVQlMkZiaWdHLTE0JTBBcHJvbXB0XzIlMjAlM0QlMjAlMjJtb25ldCUyMHBhaW50aW5nJTIyJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRHByb21wdCUyQyUyMHByb21wdF8yJTNEcHJvbXB0XzIpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline
<span class="hljs-keyword">import</span> torch

pipe = StableDiffusionXLPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># prompt will be passed to OAI CLIP-ViT/L-14</span>
prompt = <span class="hljs-string">&quot;Astronaut in a jungle, cold color palette, muted colors, detailed, 8k&quot;</span>
<span class="hljs-comment"># prompt_2 will be passed to OpenCLIP-ViT/bigG-14</span>
prompt_2 = <span class="hljs-string">&quot;monet painting&quot;</span>
image = pipe(prompt=prompt, prompt_2=prompt_2).images[<span class="hljs-number">0</span>]`}}),{c(){y=n("meta"),S=p(),M=n("h1"),w=n("a"),L=n("span"),m(v.$$.fragment),I=p(),A=n("span"),H=a("Stable diffusion XL"),je=p(),R=n("p"),me=a("Stable Diffusion XL was proposed in "),j=n("a"),Bn=a("SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesis"),zn=a(" by Dustin Podell, Zion English, Kyle Lacey, Andreas Blattmann, Tim Dockhorn, Jonas M\xFCller, Joe Penna, Robin Rombach"),Bt=p(),An=n("p"),Cd=a("The abstract of the paper is the following:"),Al=p(),Rn=n("p"),Wi=n("em"),Nd=a("We present SDXL, a latent diffusion model for text-to-image synthesis. Compared to previous versions of Stable Diffusion, SDXL leverages a three times larger UNet backbone: The increase of model parameters is mainly due to more attention blocks and a larger cross-attention context as SDXL uses a second text encoder. We design multiple novel conditioning schemes and train SDXL on multiple aspect ratios. We also introduce a refinement model which is used to improve the visual fidelity of samples generated by SDXL using a post-hoc image-to-image technique. We demonstrate that SDXL shows drastically improved performance compared the previous versions of Stable Diffusion and achieves results competitive with those of black-box state-of-the-art image generators."),Rl=p(),ge=n("h2"),We=n("a"),Gi=n("span"),m(zt.$$.fragment),Bd=p(),Ci=n("span"),zd=a("Tips"),Fl=p(),F=n("ul"),Ni=n("li"),Ad=a("Stable Diffusion XL works especially well with images between 768 and 1024."),Rd=p(),Bi=n("li"),Fd=a("Stable Diffusion XL can pass a different prompt for each of the text encoders it was trained on as shown below. We can even pass different parts of the same prompt to the text encoders."),Vd=p(),zi=n("li"),Yd=a("Stable Diffusion XL output image can be improved by making use of a refiner as shown below."),Qd=p(),q=n("li"),qd=a("One can make use of "),Ai=n("code"),Hd=a("negative_original_size"),Od=a(", "),Ri=n("code"),Kd=a("negative_crops_coords_top_left"),ec=a(", and "),Fi=n("code"),tc=a("negative_target_size"),oc=a(" to influence the generation process."),Vl=p(),ue=n("h3"),Ge=n("a"),Vi=n("span"),m(At.$$.fragment),nc=p(),Yi=n("span"),ic=a("Available checkpoints:"),Yl=p(),Ce=n("ul"),he=n("li"),Qi=n("em"),sc=a("Text-to-Image (1024x1024 resolution)"),ac=a(": "),Rt=n("a"),lc=a("stabilityai/stable-diffusion-xl-base-1.0"),rc=a(" with "),Fn=n("a"),pc=a("StableDiffusionXLPipeline"),dc=p(),_e=n("li"),qi=n("em"),cc=a("Image-to-Image / Refiner (1024x1024 resolution)"),fc=a(": "),Ft=n("a"),mc=a("stabilityai/stable-diffusion-xl-refiner-1.0"),gc=a(" with "),Vn=n("a"),uc=a("StableDiffusionXLImg2ImgPipeline"),Ql=p(),be=n("h2"),Ne=n("a"),Hi=n("span"),m(Vt.$$.fragment),hc=p(),Oi=n("span"),_c=a("Usage Example"),ql=p(),G=n("p"),bc=a("Before using SDXL make sure to have "),Ki=n("code"),vc=a("transformers"),yc=a(", "),es=n("code"),wc=a("accelerate"),Mc=a(", "),ts=n("code"),Ic=a("safetensors"),Tc=a(" and "),os=n("code"),xc=a("invisible_watermark"),Ec=a(` installed.
You can install the libraries as follows:`),Hl=p(),m(Yt.$$.fragment),Ol=p(),ve=n("h3"),Be=n("a"),ns=n("span"),m(Qt.$$.fragment),Jc=p(),is=n("span"),Sc=a("Watermarker"),Kl=p(),ze=n("p"),Lc=a(`We recommend to add an invisible watermark to images generating by Stable Diffusion XL, this can help with identifying if an image is machine-synthesised for downstream applications. To do so, please install
the `),qt=n("a"),Uc=a("invisible-watermark library"),Xc=a(" via:"),er=p(),m(Ht.$$.fragment),tr=p(),O=n("p"),kc=a("If the "),ss=n("code"),Dc=a("invisible-watermark"),$c=a(" library is installed the watermarker will be used "),as=n("strong"),Pc=a("by default"),Zc=a("."),or=p(),Yn=n("p"),jc=a("If you have other provisions for generating or deploying images safely, you can disable the watermarker as follows:"),nr=p(),m(Ot.$$.fragment),ir=p(),ye=n("h3"),Ae=n("a"),ls=n("span"),m(Kt.$$.fragment),Wc=p(),rs=n("span"),Gc=a("Text-to-Image"),sr=p(),Re=n("p"),Cc=a("You can use SDXL as follows for "),ps=n("em"),Nc=a("text-to-image"),Bc=a(":"),ar=p(),m(eo.$$.fragment),lr=p(),Qn=n("p"),zc=a("You can additionally pass negative conditions about an image\u2019s size and position to avoid undesirable cropping behavior in the generated image, and improve image resolution. Let\u2019s take an example:"),rr=p(),m(to.$$.fragment),pr=p(),Fe=n("p"),Ac=a("Here is a comparative example that shows the influence of using three "),ds=n("code"),Rc=a("negative_original_size"),Fc=a(`s of
(128, 128), (256, 256), and (512, 512) respectively:`),dr=p(),qn=n("p"),cs=n("img"),cr=p(),m(Ve.$$.fragment),fr=p(),we=n("h3"),Ye=n("a"),fs=n("span"),m(oo.$$.fragment),Vc=p(),ms=n("span"),Yc=a("Image-to-image"),mr=p(),Qe=n("p"),Qc=a("You can use SDXL as follows for "),gs=n("em"),qc=a("image-to-image"),Hc=a(":"),gr=p(),m(no.$$.fragment),ur=p(),Me=n("h3"),qe=n("a"),us=n("span"),m(io.$$.fragment),Oc=p(),hs=n("span"),Kc=a("Inpainting"),hr=p(),so=n("p"),ef=a("You can use SDXL as follows for "),_s=n("em"),tf=a("inpainting"),_r=p(),m(ao.$$.fragment),br=p(),Ie=n("h3"),He=n("a"),bs=n("span"),m(lo.$$.fragment),of=p(),vs=n("span"),nf=a("Refining the image output"),vr=p(),K=n("p"),sf=a("In addition to the "),ro=n("a"),af=a("base model checkpoint"),lf=a(`,
StableDiffusion-XL also includes a `),Hn=n("a"),rf=a("refiner checkpoint"),pf=a(`
that is specialized in denoising low-noise stage images to generate images of improved high-frequency quality.
This refiner checkpoint can be used as a \u201Csecond-step\u201D pipeline after having run the base checkpoint to improve
image quality.`),yr=p(),On=n("p"),df=a("When using the refiner, one can easily"),wr=p(),Oe=n("ul"),Te=n("li"),cf=a("1.) employ the base model and refiner as an "),ys=n("em"),ff=a("Ensemble of Expert Denoisers"),mf=a(" as first proposed in "),po=n("a"),gf=a("eDiff-I"),uf=a(" or"),hf=p(),co=n("li"),_f=a("2.) simply run the refiner in "),fo=n("a"),bf=a("SDEdit"),vf=a(" fashion after the base model."),Mr=p(),xe=n("p"),ws=n("strong"),yf=a("Note"),wf=a(`: The idea of using SD-XL base & refiner as an ensemble of experts was first brought forward by
a couple community contributors which also helped shape the following `),Ms=n("code"),Mf=a("diffusers"),If=a(" implementation, namely:"),Ir=p(),V=n("ul"),Is=n("li"),mo=n("a"),Tf=a("SytanSD"),xf=p(),Ts=n("li"),go=n("a"),Ef=a("bghira"),Jf=p(),xs=n("li"),uo=n("a"),Sf=a("Birch-san"),Lf=p(),Es=n("li"),ho=n("a"),Uf=a("AmericanPresidentJimmyCarter"),Tr=p(),Ee=n("h4"),Ke=n("a"),Js=n("span"),m(_o.$$.fragment),Xf=p(),Ss=n("span"),kf=a("1.) Ensemble of Expert Denoisers"),xr=p(),Kn=n("p"),Df=a(`When using the base and refiner model as an ensemble of expert of denoisers, the base model should serve as the
expert for the high-noise diffusion stage and the refiner serves as the expert for the low-noise diffusion stage.`),Er=p(),ei=n("p"),$f=a(`The advantage of 1.) over 2.) is that it requires less overall denoising steps and therefore should be significantly
faster. The drawback is that one cannot really inspect the output of the base model; it will still be heavily denoised.`),Jr=p(),C=n("p"),Pf=a(`To use the base model and refiner as an ensemble of expert denoisers, make sure to define the span
of timesteps which should be run through the high-noise denoising stage (`),Ls=n("em"),Zf=a("i.e."),jf=a(` the base model) and the low-noise
denoising stage (`),Us=n("em"),Wf=a("i.e."),Gf=a(" the refiner model) respectively. We can set the intervals using the "),bo=n("a"),Xs=n("code"),Cf=a("denoising_end"),Nf=a(` of the base model
and `),vo=n("a"),ks=n("code"),Bf=a("denoising_start"),zf=a(" of the refiner model."),Sr=p(),Y=n("p"),Af=a("For both "),Ds=n("code"),Rf=a("denoising_end"),Ff=a(" and "),$s=n("code"),Vf=a("denoising_start"),Yf=a(` a float value between 0 and 1 should be passed.
When passed, the end and start of denoising will be defined by proportions of discrete timesteps as
defined by the model schedule.
Note that this will override `),Ps=n("code"),Qf=a("strength"),qf=a(` if it is also declared, since the number of denoising steps
is determined by the discrete timesteps the model was trained on and the declared fractional cutoff.`),Lr=p(),ti=n("p"),Hf=a(`Let\u2019s look at an example.
First, we import the two pipelines. Since the text encoders and variational autoencoder are the same
you don\u2019t have to load those again for the refiner.`),Ur=p(),m(yo.$$.fragment),Xr=p(),et=n("p"),Of=a(`Now we define the number of inference steps and the point at which the model shall be run through the
high-noise denoising stage (`),Zs=n("em"),Kf=a("i.e."),em=a(" the base model)."),kr=p(),m(wo.$$.fragment),Dr=p(),tt=n("p"),tm=a(`Stable Diffusion XL base is trained on timesteps 0-999 and Stable Diffusion XL refiner is finetuned
from the base model on low noise timesteps 0-199 inclusive, so we use the base model for the first
800 timesteps (high noise) and the refiner for the last 200 timesteps (low noise). Hence, `),js=n("code"),om=a("high_noise_frac"),nm=a(`
is set to 0.8, so that all steps 200-999 (the first 80% of denoising timesteps) are performed by the
base model and steps 0-199 (the last 20% of denoising timesteps) are performed by the refiner model.`),$r=p(),ee=n("p"),im=a("Remember, the denoising process starts at "),Ws=n("strong"),sm=a("high value"),am=a(` (high noise) timesteps and ends at
`),Gs=n("strong"),lm=a("low value"),rm=a(" (low noise) timesteps."),Pr=p(),Q=n("p"),pm=a("Let\u2019s run the two pipelines now. Make sure to set "),Cs=n("code"),dm=a("denoising_end"),cm=a(` and
`),Ns=n("code"),fm=a("denoising_start"),mm=a(" to the same values and keep "),Bs=n("code"),gm=a("num_inference_steps"),um=a(` constant. Also remember that
the output of the base model should be in latent space:`),Zr=p(),m(Mo.$$.fragment),jr=p(),oi=n("p"),hm=a("Let\u2019s have a look at the images"),Wr=p(),ot=n("table"),zs=n("thead"),Io=n("tr"),As=n("th"),_m=a("Original Image"),bm=p(),Rs=n("th"),vm=a("Ensemble of Denoisers Experts"),ym=p(),Fs=n("tbody"),To=n("tr"),Vs=n("td"),ni=n("img"),wm=p(),Ys=n("td"),ii=n("img"),Gr=p(),si=n("p"),Mm=a("If we would have just run the base model on the same 40 steps, the image would have been arguably less detailed (e.g. the lion eyes and nose):"),Cr=p(),m(nt.$$.fragment),Nr=p(),Je=n("h4"),it=n("a"),Qs=n("span"),m(xo.$$.fragment),Im=p(),qs=n("span"),Tm=a("2.) Refining the image output from fully denoised base image"),Br=p(),te=n("p"),xm=a("In standard "),ai=n("a"),Em=a("StableDiffusionImg2ImgPipeline"),Jm=a(`-fashion, the fully-denoised image generated of the base model
can be further improved using the `),li=n("a"),Sm=a("refiner checkpoint"),Lm=a("."),zr=p(),ri=n("p"),Um=a(`For this, you simply run the refiner as a normal image-to-image pipeline after the \u201Cbase\u201D text-to-image
pipeline. You can leave the outputs of the base model in latent space.`),Ar=p(),m(Eo.$$.fragment),Rr=p(),st=n("table"),Hs=n("thead"),Jo=n("tr"),Os=n("th"),Xm=a("Original Image"),km=p(),Ks=n("th"),Dm=a("Refined Image"),$m=p(),ea=n("tbody"),So=n("tr"),ta=n("td"),oa=n("img"),Pm=p(),na=n("td"),ia=n("img"),Fr=p(),m(at.$$.fragment),Vr=p(),pi=n("p"),Zm=a("To use the refiner for inpainting in the Ensemble of Expert Denoisers setting you can do the following:"),Yr=p(),m(Lo.$$.fragment),Qr=p(),oe=n("p"),jm=a("To use the refiner for inpainting in the standard SDE-style setting, simply remove "),sa=n("code"),Wm=a("denoising_end"),Gm=a(" and "),aa=n("code"),Cm=a("denoising_start"),Nm=a(` and choose a smaller
number of inference steps for the refiner.`),qr=p(),Se=n("h3"),lt=n("a"),la=n("span"),m(Uo.$$.fragment),Bm=p(),ra=n("span"),zm=a("Loading single file checkpoints / original file format"),Hr=p(),ne=n("p"),Am=a("By making use of "),di=n("a"),Rm=a("from_single_file()"),Fm=a(` you can also load the
original file format into `),pa=n("code"),Vm=a("diffusers"),Ym=a(":"),Or=p(),m(Xo.$$.fragment),Kr=p(),Le=n("h3"),rt=n("a"),da=n("span"),m(ko.$$.fragment),Qm=p(),ca=n("span"),qm=a("Memory optimization via model offloading"),ep=p(),pt=n("p"),Hm=a("If you are seeing out-of-memory errors, we recommend making use of "),ci=n("a"),Om=a("StableDiffusionXLPipeline.enable_model_cpu_offload()"),Km=a("."),tp=p(),m(Do.$$.fragment),op=p(),fi=n("p"),eg=a("and"),np=p(),m($o.$$.fragment),ip=p(),Ue=n("h3"),dt=n("a"),fa=n("span"),m(Po.$$.fragment),tg=p(),mi=n("span"),og=a("Speed-up inference with "),ma=n("code"),ng=a("torch.compile"),sp=p(),ie=n("p"),ig=a("You can speed up inference by making use of "),ga=n("code"),sg=a("torch.compile"),ag=a(". This should give you "),ua=n("strong"),lg=a("ca."),rg=a(" 20% speed-up."),ap=p(),m(Zo.$$.fragment),lp=p(),Xe=n("h3"),ct=n("a"),ha=n("span"),m(jo.$$.fragment),pg=p(),gi=n("span"),dg=a("Running with "),_a=n("code"),cg=a("torch < 2.0"),rp=p(),ke=n("p"),ba=n("strong"),fg=a("Note"),mg=a(" that if you want to run Stable Diffusion XL with "),va=n("code"),gg=a("torch"),ug=a(` < 2.0, please make sure to enable xformers
attention:`),pp=p(),m(Wo.$$.fragment),dp=p(),m(Go.$$.fragment),cp=p(),De=n("h2"),ft=n("a"),ya=n("span"),m(Co.$$.fragment),hg=p(),wa=n("span"),_g=a("StableDiffusionXLPipeline"),fp=p(),T=n("div"),m(No.$$.fragment),bg=p(),Ma=n("p"),vg=a("Pipeline for text-to-image generation using Stable Diffusion XL."),yg=p(),Bo=n("p"),wg=a("This model inherits from "),ui=n("a"),Mg=a("DiffusionPipeline"),Ig=a(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Tg=p(),Ia=n("p"),xg=a("In addition the pipeline inherits the following loading methods:"),Eg=p(),zo=n("ul"),Ao=n("li"),Ta=n("em"),Jg=a("LoRA"),Sg=a(": "),xa=n("code"),Lg=a("StableDiffusionXLPipeline.load_lora_weights()"),Ug=p(),Ro=n("li"),Ea=n("em"),Xg=a("Ckpt"),kg=a(": "),hi=n("a"),Dg=a("loaders.FromSingleFileMixin.from_single_file()"),$g=p(),Ja=n("p"),Pg=a("as well as the following saving methods:"),Zg=p(),Sa=n("ul"),Fo=n("li"),La=n("em"),jg=a("LoRA"),Wg=a(": "),Ua=n("code"),Gg=a("loaders.StableDiffusionXLPipeline.save_lora_weights"),Cg=p(),se=n("div"),m(Vo.$$.fragment),Ng=p(),Xa=n("p"),Bg=a("Function invoked when calling the pipeline for generation."),zg=p(),m(mt.$$.fragment),Ag=p(),gt=n("div"),m(Yo.$$.fragment),Rg=p(),Qo=n("p"),Fg=a("Disable sliced VAE decoding. If "),ka=n("code"),Vg=a("enable_vae_slicing"),Yg=a(` was previously enabled, this method will go back to
computing decoding in one step.`),Qg=p(),ut=n("div"),m(qo.$$.fragment),qg=p(),Ho=n("p"),Hg=a("Disable tiled VAE decoding. If "),Da=n("code"),Og=a("enable_vae_tiling"),Kg=a(` was previously enabled, this method will go back to
computing decoding in one step.`),eu=p(),ht=n("div"),m(Oo.$$.fragment),tu=p(),N=n("p"),ou=a(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),$a=n("code"),nu=a("enable_sequential_cpu_offload"),iu=a(", this method moves one whole model at a time to the GPU when its "),Pa=n("code"),su=a("forward"),au=a(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Za=n("code"),lu=a("enable_sequential_cpu_offload"),ru=a(", but performance is much better due to the iterative execution of the "),ja=n("code"),pu=a("unet"),du=a("."),cu=p(),_t=n("div"),m(Ko.$$.fragment),fu=p(),Wa=n("p"),mu=a(`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),gu=p(),bt=n("div"),m(en.$$.fragment),uu=p(),Ga=n("p"),hu=a(`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),_u=p(),vt=n("div"),m(tn.$$.fragment),bu=p(),Ca=n("p"),vu=a("Encodes the prompt into text encoder hidden states."),mp=p(),$e=n("h2"),yt=n("a"),Na=n("span"),m(on.$$.fragment),yu=p(),Ba=n("span"),wu=a("StableDiffusionXLImg2ImgPipeline"),gp=p(),x=n("div"),m(nn.$$.fragment),Mu=p(),za=n("p"),Iu=a("Pipeline for text-to-image generation using Stable Diffusion XL."),Tu=p(),sn=n("p"),xu=a("This model inherits from "),_i=n("a"),Eu=a("DiffusionPipeline"),Ju=a(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Su=p(),Aa=n("p"),Lu=a("In addition the pipeline inherits the following loading methods:"),Uu=p(),an=n("ul"),ln=n("li"),Ra=n("em"),Xu=a("LoRA"),ku=a(": "),bi=n("a"),Du=a("loaders.LoraLoaderMixin.load_lora_weights()"),$u=p(),rn=n("li"),Fa=n("em"),Pu=a("Ckpt"),Zu=a(": "),vi=n("a"),ju=a("loaders.FromSingleFileMixin.from_single_file()"),Wu=p(),Va=n("p"),Gu=a("as well as the following saving methods:"),Cu=p(),Ya=n("ul"),pn=n("li"),Qa=n("em"),Nu=a("LoRA"),Bu=a(": "),yi=n("a"),zu=a("loaders.LoraLoaderMixin.save_lora_weights()"),Au=p(),ae=n("div"),m(dn.$$.fragment),Ru=p(),qa=n("p"),Fu=a("Function invoked when calling the pipeline for generation."),Vu=p(),m(wt.$$.fragment),Yu=p(),Mt=n("div"),m(cn.$$.fragment),Qu=p(),fn=n("p"),qu=a("Disable sliced VAE decoding. If "),Ha=n("code"),Hu=a("enable_vae_slicing"),Ou=a(` was previously enabled, this method will go back to
computing decoding in one step.`),Ku=p(),It=n("div"),m(mn.$$.fragment),eh=p(),gn=n("p"),th=a("Disable tiled VAE decoding. If "),Oa=n("code"),oh=a("enable_vae_tiling"),nh=a(` was previously enabled, this method will go back to
computing decoding in one step.`),ih=p(),Tt=n("div"),m(un.$$.fragment),sh=p(),B=n("p"),ah=a(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ka=n("code"),lh=a("enable_sequential_cpu_offload"),rh=a(", this method moves one whole model at a time to the GPU when its "),el=n("code"),ph=a("forward"),dh=a(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),tl=n("code"),ch=a("enable_sequential_cpu_offload"),fh=a(", but performance is much better due to the iterative execution of the "),ol=n("code"),mh=a("unet"),gh=a("."),uh=p(),xt=n("div"),m(hn.$$.fragment),hh=p(),nl=n("p"),_h=a(`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),bh=p(),Et=n("div"),m(_n.$$.fragment),vh=p(),il=n("p"),yh=a(`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),wh=p(),Jt=n("div"),m(bn.$$.fragment),Mh=p(),sl=n("p"),Ih=a("Encodes the prompt into text encoder hidden states."),up=p(),Pe=n("h2"),St=n("a"),al=n("span"),m(vn.$$.fragment),Th=p(),ll=n("span"),xh=a("StableDiffusionXLInpaintPipeline"),hp=p(),E=n("div"),m(yn.$$.fragment),Eh=p(),rl=n("p"),Jh=a("Pipeline for text-to-image generation using Stable Diffusion XL."),Sh=p(),wn=n("p"),Lh=a("This model inherits from "),wi=n("a"),Uh=a("DiffusionPipeline"),Xh=a(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),kh=p(),pl=n("p"),Dh=a("In addition the pipeline inherits the following loading methods:"),$h=p(),Mn=n("ul"),In=n("li"),dl=n("em"),Ph=a("LoRA"),Zh=a(": "),Mi=n("a"),jh=a("loaders.LoraLoaderMixin.load_lora_weights()"),Wh=p(),Tn=n("li"),cl=n("em"),Gh=a("Ckpt"),Ch=a(": "),Ii=n("a"),Nh=a("loaders.FromSingleFileMixin.from_single_file()"),Bh=p(),fl=n("p"),zh=a("as well as the following saving methods:"),Ah=p(),ml=n("ul"),xn=n("li"),gl=n("em"),Rh=a("LoRA"),Fh=a(": "),Ti=n("a"),Vh=a("loaders.LoraLoaderMixin.save_lora_weights()"),Yh=p(),le=n("div"),m(En.$$.fragment),Qh=p(),ul=n("p"),qh=a("Function invoked when calling the pipeline for generation."),Hh=p(),m(Lt.$$.fragment),Oh=p(),Ut=n("div"),m(Jn.$$.fragment),Kh=p(),Sn=n("p"),e_=a("Disable sliced VAE decoding. If "),hl=n("code"),t_=a("enable_vae_slicing"),o_=a(` was previously enabled, this method will go back to
computing decoding in one step.`),n_=p(),Xt=n("div"),m(Ln.$$.fragment),i_=p(),Un=n("p"),s_=a("Disable tiled VAE decoding. If "),_l=n("code"),a_=a("enable_vae_tiling"),l_=a(` was previously enabled, this method will go back to
computing decoding in one step.`),r_=p(),kt=n("div"),m(Xn.$$.fragment),p_=p(),z=n("p"),d_=a(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),bl=n("code"),c_=a("enable_sequential_cpu_offload"),f_=a(", this method moves one whole model at a time to the GPU when its "),vl=n("code"),m_=a("forward"),g_=a(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),yl=n("code"),u_=a("enable_sequential_cpu_offload"),h_=a(", but performance is much better due to the iterative execution of the "),wl=n("code"),__=a("unet"),b_=a("."),v_=p(),Dt=n("div"),m(kn.$$.fragment),y_=p(),Ml=n("p"),w_=a(`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),M_=p(),$t=n("div"),m(Dn.$$.fragment),I_=p(),Il=n("p"),T_=a(`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),x_=p(),Pt=n("div"),m($n.$$.fragment),E_=p(),Tl=n("p"),J_=a("Encodes the prompt into text encoder hidden states."),_p=p(),Ze=n("h3"),Zt=n("a"),xl=n("span"),m(Pn.$$.fragment),S_=p(),El=n("span"),L_=a("Passing different prompts to each text-encoder"),bp=p(),J=n("p"),U_=a("Stable Diffusion XL was trained on two text encoders. The default behavior is to pass the same prompt to each. But it is possible to pass a different prompt for each text-encoder, as "),Zn=n("a"),X_=a("some users"),k_=a(` noted that it can boost quality.
To do so, you can pass `),Jl=n("code"),D_=a("prompt_2"),$_=a(" and "),Sl=n("code"),P_=a("negative_prompt_2"),Z_=a(" in addition to "),Ll=n("code"),j_=a("prompt"),W_=a(" and "),Ul=n("code"),G_=a("negative_prompt"),C_=a(". By doing that, you will pass the original prompts and negative prompts (as in "),Xl=n("code"),N_=a("prompt"),B_=a(" and "),kl=n("code"),z_=a("negative_prompt"),A_=a(") to "),Dl=n("code"),R_=a("text_encoder"),F_=a(" (in official SDXL 0.9/1.0 that is "),jn=n("a"),V_=a("OpenAI CLIP-ViT/L-14"),Y_=a(`),
and `),$l=n("code"),Q_=a("prompt_2"),q_=a(" and "),Pl=n("code"),H_=a("negative_prompt_2"),O_=a(" to "),Zl=n("code"),K_=a("text_encoder_2"),eb=a(" (in official SDXL 0.9/1.0 that is "),Wn=n("a"),tb=a("OpenCLIP-ViT/bigG-14"),ob=a(")."),vp=p(),m(Gn.$$.fragment),this.h()},l(t){const r=Iw('[data-svelte="svelte-1phssyn"]',document.head);y=i(r,"META",{name:!0,content:!0}),r.forEach(o),S=d(t),M=i(t,"H1",{class:!0});var Cn=s(M);w=i(Cn,"A",{id:!0,class:!0,href:!0});var jl=s(w);L=i(jl,"SPAN",{});var Wl=s(L);g(v.$$.fragment,Wl),Wl.forEach(o),jl.forEach(o),I=d(Cn),A=i(Cn,"SPAN",{});var Gl=s(A);H=l(Gl,"Stable diffusion XL"),Gl.forEach(o),Cn.forEach(o),je=d(t),R=i(t,"P",{});var Nn=s(R);me=l(Nn,"Stable Diffusion XL was proposed in "),j=i(Nn,"A",{href:!0,rel:!0});var Cl=s(j);Bn=l(Cl,"SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesis"),Cl.forEach(o),zn=l(Nn," by Dustin Podell, Zion English, Kyle Lacey, Andreas Blattmann, Tim Dockhorn, Jonas M\xFCller, Joe Penna, Robin Rombach"),Nn.forEach(o),Bt=d(t),An=i(t,"P",{});var gb=s(An);Cd=l(gb,"The abstract of the paper is the following:"),gb.forEach(o),Al=d(t),Rn=i(t,"P",{});var ub=s(Rn);Wi=i(ub,"EM",{});var hb=s(Wi);Nd=l(hb,"We present SDXL, a latent diffusion model for text-to-image synthesis. Compared to previous versions of Stable Diffusion, SDXL leverages a three times larger UNet backbone: The increase of model parameters is mainly due to more attention blocks and a larger cross-attention context as SDXL uses a second text encoder. We design multiple novel conditioning schemes and train SDXL on multiple aspect ratios. We also introduce a refinement model which is used to improve the visual fidelity of samples generated by SDXL using a post-hoc image-to-image technique. We demonstrate that SDXL shows drastically improved performance compared the previous versions of Stable Diffusion and achieves results competitive with those of black-box state-of-the-art image generators."),hb.forEach(o),ub.forEach(o),Rl=d(t),ge=i(t,"H2",{class:!0});var wp=s(ge);We=i(wp,"A",{id:!0,class:!0,href:!0});var _b=s(We);Gi=i(_b,"SPAN",{});var bb=s(Gi);g(zt.$$.fragment,bb),bb.forEach(o),_b.forEach(o),Bd=d(wp),Ci=i(wp,"SPAN",{});var vb=s(Ci);zd=l(vb,"Tips"),vb.forEach(o),wp.forEach(o),Fl=d(t),F=i(t,"UL",{});var jt=s(F);Ni=i(jt,"LI",{});var yb=s(Ni);Ad=l(yb,"Stable Diffusion XL works especially well with images between 768 and 1024."),yb.forEach(o),Rd=d(jt),Bi=i(jt,"LI",{});var wb=s(Bi);Fd=l(wb,"Stable Diffusion XL can pass a different prompt for each of the text encoders it was trained on as shown below. We can even pass different parts of the same prompt to the text encoders."),wb.forEach(o),Vd=d(jt),zi=i(jt,"LI",{});var Mb=s(zi);Yd=l(Mb,"Stable Diffusion XL output image can be improved by making use of a refiner as shown below."),Mb.forEach(o),Qd=d(jt),q=i(jt,"LI",{});var Wt=s(q);qd=l(Wt,"One can make use of "),Ai=i(Wt,"CODE",{});var Ib=s(Ai);Hd=l(Ib,"negative_original_size"),Ib.forEach(o),Od=l(Wt,", "),Ri=i(Wt,"CODE",{});var Tb=s(Ri);Kd=l(Tb,"negative_crops_coords_top_left"),Tb.forEach(o),ec=l(Wt,", and "),Fi=i(Wt,"CODE",{});var xb=s(Fi);tc=l(xb,"negative_target_size"),xb.forEach(o),oc=l(Wt," to influence the generation process."),Wt.forEach(o),jt.forEach(o),Vl=d(t),ue=i(t,"H3",{class:!0});var Mp=s(ue);Ge=i(Mp,"A",{id:!0,class:!0,href:!0});var Eb=s(Ge);Vi=i(Eb,"SPAN",{});var Jb=s(Vi);g(At.$$.fragment,Jb),Jb.forEach(o),Eb.forEach(o),nc=d(Mp),Yi=i(Mp,"SPAN",{});var Sb=s(Yi);ic=l(Sb,"Available checkpoints:"),Sb.forEach(o),Mp.forEach(o),Yl=d(t),Ce=i(t,"UL",{});var Ip=s(Ce);he=i(Ip,"LI",{});var xi=s(he);Qi=i(xi,"EM",{});var Lb=s(Qi);sc=l(Lb,"Text-to-Image (1024x1024 resolution)"),Lb.forEach(o),ac=l(xi,": "),Rt=i(xi,"A",{href:!0,rel:!0});var Ub=s(Rt);lc=l(Ub,"stabilityai/stable-diffusion-xl-base-1.0"),Ub.forEach(o),rc=l(xi," with "),Fn=i(xi,"A",{href:!0});var Xb=s(Fn);pc=l(Xb,"StableDiffusionXLPipeline"),Xb.forEach(o),xi.forEach(o),dc=d(Ip),_e=i(Ip,"LI",{});var Ei=s(_e);qi=i(Ei,"EM",{});var kb=s(qi);cc=l(kb,"Image-to-Image / Refiner (1024x1024 resolution)"),kb.forEach(o),fc=l(Ei,": "),Ft=i(Ei,"A",{href:!0,rel:!0});var Db=s(Ft);mc=l(Db,"stabilityai/stable-diffusion-xl-refiner-1.0"),Db.forEach(o),gc=l(Ei," with "),Vn=i(Ei,"A",{href:!0});var $b=s(Vn);uc=l($b,"StableDiffusionXLImg2ImgPipeline"),$b.forEach(o),Ei.forEach(o),Ip.forEach(o),Ql=d(t),be=i(t,"H2",{class:!0});var Tp=s(be);Ne=i(Tp,"A",{id:!0,class:!0,href:!0});var Pb=s(Ne);Hi=i(Pb,"SPAN",{});var Zb=s(Hi);g(Vt.$$.fragment,Zb),Zb.forEach(o),Pb.forEach(o),hc=d(Tp),Oi=i(Tp,"SPAN",{});var jb=s(Oi);_c=l(jb,"Usage Example"),jb.forEach(o),Tp.forEach(o),ql=d(t),G=i(t,"P",{});var re=s(G);bc=l(re,"Before using SDXL make sure to have "),Ki=i(re,"CODE",{});var Wb=s(Ki);vc=l(Wb,"transformers"),Wb.forEach(o),yc=l(re,", "),es=i(re,"CODE",{});var Gb=s(es);wc=l(Gb,"accelerate"),Gb.forEach(o),Mc=l(re,", "),ts=i(re,"CODE",{});var Cb=s(ts);Ic=l(Cb,"safetensors"),Cb.forEach(o),Tc=l(re," and "),os=i(re,"CODE",{});var Nb=s(os);xc=l(Nb,"invisible_watermark"),Nb.forEach(o),Ec=l(re,` installed.
You can install the libraries as follows:`),re.forEach(o),Hl=d(t),g(Yt.$$.fragment,t),Ol=d(t),ve=i(t,"H3",{class:!0});var xp=s(ve);Be=i(xp,"A",{id:!0,class:!0,href:!0});var Bb=s(Be);ns=i(Bb,"SPAN",{});var zb=s(ns);g(Qt.$$.fragment,zb),zb.forEach(o),Bb.forEach(o),Jc=d(xp),is=i(xp,"SPAN",{});var Ab=s(is);Sc=l(Ab,"Watermarker"),Ab.forEach(o),xp.forEach(o),Kl=d(t),ze=i(t,"P",{});var Ep=s(ze);Lc=l(Ep,`We recommend to add an invisible watermark to images generating by Stable Diffusion XL, this can help with identifying if an image is machine-synthesised for downstream applications. To do so, please install
the `),qt=i(Ep,"A",{href:!0,rel:!0});var Rb=s(qt);Uc=l(Rb,"invisible-watermark library"),Rb.forEach(o),Xc=l(Ep," via:"),Ep.forEach(o),er=d(t),g(Ht.$$.fragment,t),tr=d(t),O=i(t,"P",{});var Ji=s(O);kc=l(Ji,"If the "),ss=i(Ji,"CODE",{});var Fb=s(ss);Dc=l(Fb,"invisible-watermark"),Fb.forEach(o),$c=l(Ji," library is installed the watermarker will be used "),as=i(Ji,"STRONG",{});var Vb=s(as);Pc=l(Vb,"by default"),Vb.forEach(o),Zc=l(Ji,"."),Ji.forEach(o),or=d(t),Yn=i(t,"P",{});var Yb=s(Yn);jc=l(Yb,"If you have other provisions for generating or deploying images safely, you can disable the watermarker as follows:"),Yb.forEach(o),nr=d(t),g(Ot.$$.fragment,t),ir=d(t),ye=i(t,"H3",{class:!0});var Jp=s(ye);Ae=i(Jp,"A",{id:!0,class:!0,href:!0});var Qb=s(Ae);ls=i(Qb,"SPAN",{});var qb=s(ls);g(Kt.$$.fragment,qb),qb.forEach(o),Qb.forEach(o),Wc=d(Jp),rs=i(Jp,"SPAN",{});var Hb=s(rs);Gc=l(Hb,"Text-to-Image"),Hb.forEach(o),Jp.forEach(o),sr=d(t),Re=i(t,"P",{});var Sp=s(Re);Cc=l(Sp,"You can use SDXL as follows for "),ps=i(Sp,"EM",{});var Ob=s(ps);Nc=l(Ob,"text-to-image"),Ob.forEach(o),Bc=l(Sp,":"),Sp.forEach(o),ar=d(t),g(eo.$$.fragment,t),lr=d(t),Qn=i(t,"P",{});var Kb=s(Qn);zc=l(Kb,"You can additionally pass negative conditions about an image\u2019s size and position to avoid undesirable cropping behavior in the generated image, and improve image resolution. Let\u2019s take an example:"),Kb.forEach(o),rr=d(t),g(to.$$.fragment,t),pr=d(t),Fe=i(t,"P",{});var Lp=s(Fe);Ac=l(Lp,"Here is a comparative example that shows the influence of using three "),ds=i(Lp,"CODE",{});var ev=s(ds);Rc=l(ev,"negative_original_size"),ev.forEach(o),Fc=l(Lp,`s of
(128, 128), (256, 256), and (512, 512) respectively:`),Lp.forEach(o),dr=d(t),qn=i(t,"P",{});var tv=s(qn);cs=i(tv,"IMG",{src:!0}),tv.forEach(o),cr=d(t),g(Ve.$$.fragment,t),fr=d(t),we=i(t,"H3",{class:!0});var Up=s(we);Ye=i(Up,"A",{id:!0,class:!0,href:!0});var ov=s(Ye);fs=i(ov,"SPAN",{});var nv=s(fs);g(oo.$$.fragment,nv),nv.forEach(o),ov.forEach(o),Vc=d(Up),ms=i(Up,"SPAN",{});var iv=s(ms);Yc=l(iv,"Image-to-image"),iv.forEach(o),Up.forEach(o),mr=d(t),Qe=i(t,"P",{});var Xp=s(Qe);Qc=l(Xp,"You can use SDXL as follows for "),gs=i(Xp,"EM",{});var sv=s(gs);qc=l(sv,"image-to-image"),sv.forEach(o),Hc=l(Xp,":"),Xp.forEach(o),gr=d(t),g(no.$$.fragment,t),ur=d(t),Me=i(t,"H3",{class:!0});var kp=s(Me);qe=i(kp,"A",{id:!0,class:!0,href:!0});var av=s(qe);us=i(av,"SPAN",{});var lv=s(us);g(io.$$.fragment,lv),lv.forEach(o),av.forEach(o),Oc=d(kp),hs=i(kp,"SPAN",{});var rv=s(hs);Kc=l(rv,"Inpainting"),rv.forEach(o),kp.forEach(o),hr=d(t),so=i(t,"P",{});var nb=s(so);ef=l(nb,"You can use SDXL as follows for "),_s=i(nb,"EM",{});var pv=s(_s);tf=l(pv,"inpainting"),pv.forEach(o),nb.forEach(o),_r=d(t),g(ao.$$.fragment,t),br=d(t),Ie=i(t,"H3",{class:!0});var Dp=s(Ie);He=i(Dp,"A",{id:!0,class:!0,href:!0});var dv=s(He);bs=i(dv,"SPAN",{});var cv=s(bs);g(lo.$$.fragment,cv),cv.forEach(o),dv.forEach(o),of=d(Dp),vs=i(Dp,"SPAN",{});var fv=s(vs);nf=l(fv,"Refining the image output"),fv.forEach(o),Dp.forEach(o),vr=d(t),K=i(t,"P",{});var Si=s(K);sf=l(Si,"In addition to the "),ro=i(Si,"A",{href:!0,rel:!0});var mv=s(ro);af=l(mv,"base model checkpoint"),mv.forEach(o),lf=l(Si,`,
StableDiffusion-XL also includes a `),Hn=i(Si,"A",{href:!0});var gv=s(Hn);rf=l(gv,"refiner checkpoint"),gv.forEach(o),pf=l(Si,`
that is specialized in denoising low-noise stage images to generate images of improved high-frequency quality.
This refiner checkpoint can be used as a \u201Csecond-step\u201D pipeline after having run the base checkpoint to improve
image quality.`),Si.forEach(o),yr=d(t),On=i(t,"P",{});var uv=s(On);df=l(uv,"When using the refiner, one can easily"),uv.forEach(o),wr=d(t),Oe=i(t,"UL",{});var $p=s(Oe);Te=i($p,"LI",{});var Li=s(Te);cf=l(Li,"1.) employ the base model and refiner as an "),ys=i(Li,"EM",{});var hv=s(ys);ff=l(hv,"Ensemble of Expert Denoisers"),hv.forEach(o),mf=l(Li," as first proposed in "),po=i(Li,"A",{href:!0,rel:!0});var _v=s(po);gf=l(_v,"eDiff-I"),_v.forEach(o),uf=l(Li," or"),Li.forEach(o),hf=d($p),co=i($p,"LI",{});var Pp=s(co);_f=l(Pp,"2.) simply run the refiner in "),fo=i(Pp,"A",{href:!0,rel:!0});var bv=s(fo);bf=l(bv,"SDEdit"),bv.forEach(o),vf=l(Pp," fashion after the base model."),Pp.forEach(o),$p.forEach(o),Mr=d(t),xe=i(t,"P",{});var Nl=s(xe);ws=i(Nl,"STRONG",{});var vv=s(ws);yf=l(vv,"Note"),vv.forEach(o),wf=l(Nl,`: The idea of using SD-XL base & refiner as an ensemble of experts was first brought forward by
a couple community contributors which also helped shape the following `),Ms=i(Nl,"CODE",{});var yv=s(Ms);Mf=l(yv,"diffusers"),yv.forEach(o),If=l(Nl," implementation, namely:"),Nl.forEach(o),Ir=d(t),V=i(t,"UL",{});var Gt=s(V);Is=i(Gt,"LI",{});var wv=s(Is);mo=i(wv,"A",{href:!0,rel:!0});var Mv=s(mo);Tf=l(Mv,"SytanSD"),Mv.forEach(o),wv.forEach(o),xf=d(Gt),Ts=i(Gt,"LI",{});var Iv=s(Ts);go=i(Iv,"A",{href:!0,rel:!0});var Tv=s(go);Ef=l(Tv,"bghira"),Tv.forEach(o),Iv.forEach(o),Jf=d(Gt),xs=i(Gt,"LI",{});var xv=s(xs);uo=i(xv,"A",{href:!0,rel:!0});var Ev=s(uo);Sf=l(Ev,"Birch-san"),Ev.forEach(o),xv.forEach(o),Lf=d(Gt),Es=i(Gt,"LI",{});var Jv=s(Es);ho=i(Jv,"A",{href:!0,rel:!0});var Sv=s(ho);Uf=l(Sv,"AmericanPresidentJimmyCarter"),Sv.forEach(o),Jv.forEach(o),Gt.forEach(o),Tr=d(t),Ee=i(t,"H4",{class:!0});var Zp=s(Ee);Ke=i(Zp,"A",{id:!0,class:!0,href:!0});var Lv=s(Ke);Js=i(Lv,"SPAN",{});var Uv=s(Js);g(_o.$$.fragment,Uv),Uv.forEach(o),Lv.forEach(o),Xf=d(Zp),Ss=i(Zp,"SPAN",{});var Xv=s(Ss);kf=l(Xv,"1.) Ensemble of Expert Denoisers"),Xv.forEach(o),Zp.forEach(o),xr=d(t),Kn=i(t,"P",{});var kv=s(Kn);Df=l(kv,`When using the base and refiner model as an ensemble of expert of denoisers, the base model should serve as the
expert for the high-noise diffusion stage and the refiner serves as the expert for the low-noise diffusion stage.`),kv.forEach(o),Er=d(t),ei=i(t,"P",{});var Dv=s(ei);$f=l(Dv,`The advantage of 1.) over 2.) is that it requires less overall denoising steps and therefore should be significantly
faster. The drawback is that one cannot really inspect the output of the base model; it will still be heavily denoised.`),Dv.forEach(o),Jr=d(t),C=i(t,"P",{});var pe=s(C);Pf=l(pe,`To use the base model and refiner as an ensemble of expert denoisers, make sure to define the span
of timesteps which should be run through the high-noise denoising stage (`),Ls=i(pe,"EM",{});var $v=s(Ls);Zf=l($v,"i.e."),$v.forEach(o),jf=l(pe,` the base model) and the low-noise
denoising stage (`),Us=i(pe,"EM",{});var Pv=s(Us);Wf=l(Pv,"i.e."),Pv.forEach(o),Gf=l(pe," the refiner model) respectively. We can set the intervals using the "),bo=i(pe,"A",{href:!0,rel:!0});var Zv=s(bo);Xs=i(Zv,"CODE",{});var jv=s(Xs);Cf=l(jv,"denoising_end"),jv.forEach(o),Zv.forEach(o),Nf=l(pe,` of the base model
and `),vo=i(pe,"A",{href:!0,rel:!0});var Wv=s(vo);ks=i(Wv,"CODE",{});var Gv=s(ks);Bf=l(Gv,"denoising_start"),Gv.forEach(o),Wv.forEach(o),zf=l(pe," of the refiner model."),pe.forEach(o),Sr=d(t),Y=i(t,"P",{});var Ct=s(Y);Af=l(Ct,"For both "),Ds=i(Ct,"CODE",{});var Cv=s(Ds);Rf=l(Cv,"denoising_end"),Cv.forEach(o),Ff=l(Ct," and "),$s=i(Ct,"CODE",{});var Nv=s($s);Vf=l(Nv,"denoising_start"),Nv.forEach(o),Yf=l(Ct,` a float value between 0 and 1 should be passed.
When passed, the end and start of denoising will be defined by proportions of discrete timesteps as
defined by the model schedule.
Note that this will override `),Ps=i(Ct,"CODE",{});var Bv=s(Ps);Qf=l(Bv,"strength"),Bv.forEach(o),qf=l(Ct,` if it is also declared, since the number of denoising steps
is determined by the discrete timesteps the model was trained on and the declared fractional cutoff.`),Ct.forEach(o),Lr=d(t),ti=i(t,"P",{});var zv=s(ti);Hf=l(zv,`Let\u2019s look at an example.
First, we import the two pipelines. Since the text encoders and variational autoencoder are the same
you don\u2019t have to load those again for the refiner.`),zv.forEach(o),Ur=d(t),g(yo.$$.fragment,t),Xr=d(t),et=i(t,"P",{});var jp=s(et);Of=l(jp,`Now we define the number of inference steps and the point at which the model shall be run through the
high-noise denoising stage (`),Zs=i(jp,"EM",{});var Av=s(Zs);Kf=l(Av,"i.e."),Av.forEach(o),em=l(jp," the base model)."),jp.forEach(o),kr=d(t),g(wo.$$.fragment,t),Dr=d(t),tt=i(t,"P",{});var Wp=s(tt);tm=l(Wp,`Stable Diffusion XL base is trained on timesteps 0-999 and Stable Diffusion XL refiner is finetuned
from the base model on low noise timesteps 0-199 inclusive, so we use the base model for the first
800 timesteps (high noise) and the refiner for the last 200 timesteps (low noise). Hence, `),js=i(Wp,"CODE",{});var Rv=s(js);om=l(Rv,"high_noise_frac"),Rv.forEach(o),nm=l(Wp,`
is set to 0.8, so that all steps 200-999 (the first 80% of denoising timesteps) are performed by the
base model and steps 0-199 (the last 20% of denoising timesteps) are performed by the refiner model.`),Wp.forEach(o),$r=d(t),ee=i(t,"P",{});var Ui=s(ee);im=l(Ui,"Remember, the denoising process starts at "),Ws=i(Ui,"STRONG",{});var Fv=s(Ws);sm=l(Fv,"high value"),Fv.forEach(o),am=l(Ui,` (high noise) timesteps and ends at
`),Gs=i(Ui,"STRONG",{});var Vv=s(Gs);lm=l(Vv,"low value"),Vv.forEach(o),rm=l(Ui," (low noise) timesteps."),Ui.forEach(o),Pr=d(t),Q=i(t,"P",{});var Nt=s(Q);pm=l(Nt,"Let\u2019s run the two pipelines now. Make sure to set "),Cs=i(Nt,"CODE",{});var Yv=s(Cs);dm=l(Yv,"denoising_end"),Yv.forEach(o),cm=l(Nt,` and
`),Ns=i(Nt,"CODE",{});var Qv=s(Ns);fm=l(Qv,"denoising_start"),Qv.forEach(o),mm=l(Nt," to the same values and keep "),Bs=i(Nt,"CODE",{});var qv=s(Bs);gm=l(qv,"num_inference_steps"),qv.forEach(o),um=l(Nt,` constant. Also remember that
the output of the base model should be in latent space:`),Nt.forEach(o),Zr=d(t),g(Mo.$$.fragment,t),jr=d(t),oi=i(t,"P",{});var Hv=s(oi);hm=l(Hv,"Let\u2019s have a look at the images"),Hv.forEach(o),Wr=d(t),ot=i(t,"TABLE",{});var Gp=s(ot);zs=i(Gp,"THEAD",{});var Ov=s(zs);Io=i(Ov,"TR",{});var Cp=s(Io);As=i(Cp,"TH",{});var Kv=s(As);_m=l(Kv,"Original Image"),Kv.forEach(o),bm=d(Cp),Rs=i(Cp,"TH",{});var e2=s(Rs);vm=l(e2,"Ensemble of Denoisers Experts"),e2.forEach(o),Cp.forEach(o),Ov.forEach(o),ym=d(Gp),Fs=i(Gp,"TBODY",{});var t2=s(Fs);To=i(t2,"TR",{});var Np=s(To);Vs=i(Np,"TD",{});var o2=s(Vs);ni=i(o2,"IMG",{src:!0,alt:!0}),o2.forEach(o),wm=d(Np),Ys=i(Np,"TD",{});var n2=s(Ys);ii=i(n2,"IMG",{src:!0,alt:!0}),n2.forEach(o),Np.forEach(o),t2.forEach(o),Gp.forEach(o),Gr=d(t),si=i(t,"P",{});var i2=s(si);Mm=l(i2,"If we would have just run the base model on the same 40 steps, the image would have been arguably less detailed (e.g. the lion eyes and nose):"),i2.forEach(o),Cr=d(t),g(nt.$$.fragment,t),Nr=d(t),Je=i(t,"H4",{class:!0});var Bp=s(Je);it=i(Bp,"A",{id:!0,class:!0,href:!0});var s2=s(it);Qs=i(s2,"SPAN",{});var a2=s(Qs);g(xo.$$.fragment,a2),a2.forEach(o),s2.forEach(o),Im=d(Bp),qs=i(Bp,"SPAN",{});var l2=s(qs);Tm=l(l2,"2.) Refining the image output from fully denoised base image"),l2.forEach(o),Bp.forEach(o),Br=d(t),te=i(t,"P",{});var Xi=s(te);xm=l(Xi,"In standard "),ai=i(Xi,"A",{href:!0});var r2=s(ai);Em=l(r2,"StableDiffusionImg2ImgPipeline"),r2.forEach(o),Jm=l(Xi,`-fashion, the fully-denoised image generated of the base model
can be further improved using the `),li=i(Xi,"A",{href:!0});var p2=s(li);Sm=l(p2,"refiner checkpoint"),p2.forEach(o),Lm=l(Xi,"."),Xi.forEach(o),zr=d(t),ri=i(t,"P",{});var d2=s(ri);Um=l(d2,`For this, you simply run the refiner as a normal image-to-image pipeline after the \u201Cbase\u201D text-to-image
pipeline. You can leave the outputs of the base model in latent space.`),d2.forEach(o),Ar=d(t),g(Eo.$$.fragment,t),Rr=d(t),st=i(t,"TABLE",{});var zp=s(st);Hs=i(zp,"THEAD",{});var c2=s(Hs);Jo=i(c2,"TR",{});var Ap=s(Jo);Os=i(Ap,"TH",{});var f2=s(Os);Xm=l(f2,"Original Image"),f2.forEach(o),km=d(Ap),Ks=i(Ap,"TH",{});var m2=s(Ks);Dm=l(m2,"Refined Image"),m2.forEach(o),Ap.forEach(o),c2.forEach(o),$m=d(zp),ea=i(zp,"TBODY",{});var g2=s(ea);So=i(g2,"TR",{});var Rp=s(So);ta=i(Rp,"TD",{});var u2=s(ta);oa=i(u2,"IMG",{src:!0}),u2.forEach(o),Pm=d(Rp),na=i(Rp,"TD",{});var h2=s(na);ia=i(h2,"IMG",{src:!0}),h2.forEach(o),Rp.forEach(o),g2.forEach(o),zp.forEach(o),Fr=d(t),g(at.$$.fragment,t),Vr=d(t),pi=i(t,"P",{});var _2=s(pi);Zm=l(_2,"To use the refiner for inpainting in the Ensemble of Expert Denoisers setting you can do the following:"),_2.forEach(o),Yr=d(t),g(Lo.$$.fragment,t),Qr=d(t),oe=i(t,"P",{});var ki=s(oe);jm=l(ki,"To use the refiner for inpainting in the standard SDE-style setting, simply remove "),sa=i(ki,"CODE",{});var b2=s(sa);Wm=l(b2,"denoising_end"),b2.forEach(o),Gm=l(ki," and "),aa=i(ki,"CODE",{});var v2=s(aa);Cm=l(v2,"denoising_start"),v2.forEach(o),Nm=l(ki,` and choose a smaller
number of inference steps for the refiner.`),ki.forEach(o),qr=d(t),Se=i(t,"H3",{class:!0});var Fp=s(Se);lt=i(Fp,"A",{id:!0,class:!0,href:!0});var y2=s(lt);la=i(y2,"SPAN",{});var w2=s(la);g(Uo.$$.fragment,w2),w2.forEach(o),y2.forEach(o),Bm=d(Fp),ra=i(Fp,"SPAN",{});var M2=s(ra);zm=l(M2,"Loading single file checkpoints / original file format"),M2.forEach(o),Fp.forEach(o),Hr=d(t),ne=i(t,"P",{});var Di=s(ne);Am=l(Di,"By making use of "),di=i(Di,"A",{href:!0});var I2=s(di);Rm=l(I2,"from_single_file()"),I2.forEach(o),Fm=l(Di,` you can also load the
original file format into `),pa=i(Di,"CODE",{});var T2=s(pa);Vm=l(T2,"diffusers"),T2.forEach(o),Ym=l(Di,":"),Di.forEach(o),Or=d(t),g(Xo.$$.fragment,t),Kr=d(t),Le=i(t,"H3",{class:!0});var Vp=s(Le);rt=i(Vp,"A",{id:!0,class:!0,href:!0});var x2=s(rt);da=i(x2,"SPAN",{});var E2=s(da);g(ko.$$.fragment,E2),E2.forEach(o),x2.forEach(o),Qm=d(Vp),ca=i(Vp,"SPAN",{});var J2=s(ca);qm=l(J2,"Memory optimization via model offloading"),J2.forEach(o),Vp.forEach(o),ep=d(t),pt=i(t,"P",{});var Yp=s(pt);Hm=l(Yp,"If you are seeing out-of-memory errors, we recommend making use of "),ci=i(Yp,"A",{href:!0});var S2=s(ci);Om=l(S2,"StableDiffusionXLPipeline.enable_model_cpu_offload()"),S2.forEach(o),Km=l(Yp,"."),Yp.forEach(o),tp=d(t),g(Do.$$.fragment,t),op=d(t),fi=i(t,"P",{});var L2=s(fi);eg=l(L2,"and"),L2.forEach(o),np=d(t),g($o.$$.fragment,t),ip=d(t),Ue=i(t,"H3",{class:!0});var Qp=s(Ue);dt=i(Qp,"A",{id:!0,class:!0,href:!0});var U2=s(dt);fa=i(U2,"SPAN",{});var X2=s(fa);g(Po.$$.fragment,X2),X2.forEach(o),U2.forEach(o),tg=d(Qp),mi=i(Qp,"SPAN",{});var ib=s(mi);og=l(ib,"Speed-up inference with "),ma=i(ib,"CODE",{});var k2=s(ma);ng=l(k2,"torch.compile"),k2.forEach(o),ib.forEach(o),Qp.forEach(o),sp=d(t),ie=i(t,"P",{});var $i=s(ie);ig=l($i,"You can speed up inference by making use of "),ga=i($i,"CODE",{});var D2=s(ga);sg=l(D2,"torch.compile"),D2.forEach(o),ag=l($i,". This should give you "),ua=i($i,"STRONG",{});var $2=s(ua);lg=l($2,"ca."),$2.forEach(o),rg=l($i," 20% speed-up."),$i.forEach(o),ap=d(t),g(Zo.$$.fragment,t),lp=d(t),Xe=i(t,"H3",{class:!0});var qp=s(Xe);ct=i(qp,"A",{id:!0,class:!0,href:!0});var P2=s(ct);ha=i(P2,"SPAN",{});var Z2=s(ha);g(jo.$$.fragment,Z2),Z2.forEach(o),P2.forEach(o),pg=d(qp),gi=i(qp,"SPAN",{});var sb=s(gi);dg=l(sb,"Running with "),_a=i(sb,"CODE",{});var j2=s(_a);cg=l(j2,"torch < 2.0"),j2.forEach(o),sb.forEach(o),qp.forEach(o),rp=d(t),ke=i(t,"P",{});var Bl=s(ke);ba=i(Bl,"STRONG",{});var W2=s(ba);fg=l(W2,"Note"),W2.forEach(o),mg=l(Bl," that if you want to run Stable Diffusion XL with "),va=i(Bl,"CODE",{});var G2=s(va);gg=l(G2,"torch"),G2.forEach(o),ug=l(Bl,` < 2.0, please make sure to enable xformers
attention:`),Bl.forEach(o),pp=d(t),g(Wo.$$.fragment,t),dp=d(t),g(Go.$$.fragment,t),cp=d(t),De=i(t,"H2",{class:!0});var Hp=s(De);ft=i(Hp,"A",{id:!0,class:!0,href:!0});var C2=s(ft);ya=i(C2,"SPAN",{});var N2=s(ya);g(Co.$$.fragment,N2),N2.forEach(o),C2.forEach(o),hg=d(Hp),wa=i(Hp,"SPAN",{});var B2=s(wa);_g=l(B2,"StableDiffusionXLPipeline"),B2.forEach(o),Hp.forEach(o),fp=d(t),T=i(t,"DIV",{class:!0});var U=s(T);g(No.$$.fragment,U),bg=d(U),Ma=i(U,"P",{});var z2=s(Ma);vg=l(z2,"Pipeline for text-to-image generation using Stable Diffusion XL."),z2.forEach(o),yg=d(U),Bo=i(U,"P",{});var Op=s(Bo);wg=l(Op,"This model inherits from "),ui=i(Op,"A",{href:!0});var A2=s(ui);Mg=l(A2,"DiffusionPipeline"),A2.forEach(o),Ig=l(Op,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Op.forEach(o),Tg=d(U),Ia=i(U,"P",{});var R2=s(Ia);xg=l(R2,"In addition the pipeline inherits the following loading methods:"),R2.forEach(o),Eg=d(U),zo=i(U,"UL",{});var Kp=s(zo);Ao=i(Kp,"LI",{});var ed=s(Ao);Ta=i(ed,"EM",{});var F2=s(Ta);Jg=l(F2,"LoRA"),F2.forEach(o),Sg=l(ed,": "),xa=i(ed,"CODE",{});var V2=s(xa);Lg=l(V2,"StableDiffusionXLPipeline.load_lora_weights()"),V2.forEach(o),ed.forEach(o),Ug=d(Kp),Ro=i(Kp,"LI",{});var td=s(Ro);Ea=i(td,"EM",{});var Y2=s(Ea);Xg=l(Y2,"Ckpt"),Y2.forEach(o),kg=l(td,": "),hi=i(td,"A",{href:!0});var Q2=s(hi);Dg=l(Q2,"loaders.FromSingleFileMixin.from_single_file()"),Q2.forEach(o),td.forEach(o),Kp.forEach(o),$g=d(U),Ja=i(U,"P",{});var q2=s(Ja);Pg=l(q2,"as well as the following saving methods:"),q2.forEach(o),Zg=d(U),Sa=i(U,"UL",{});var H2=s(Sa);Fo=i(H2,"LI",{});var od=s(Fo);La=i(od,"EM",{});var O2=s(La);jg=l(O2,"LoRA"),O2.forEach(o),Wg=l(od,": "),Ua=i(od,"CODE",{});var K2=s(Ua);Gg=l(K2,"loaders.StableDiffusionXLPipeline.save_lora_weights"),K2.forEach(o),od.forEach(o),H2.forEach(o),Cg=d(U),se=i(U,"DIV",{class:!0});var Pi=s(se);g(Vo.$$.fragment,Pi),Ng=d(Pi),Xa=i(Pi,"P",{});var ey=s(Xa);Bg=l(ey,"Function invoked when calling the pipeline for generation."),ey.forEach(o),zg=d(Pi),g(mt.$$.fragment,Pi),Pi.forEach(o),Ag=d(U),gt=i(U,"DIV",{class:!0});var nd=s(gt);g(Yo.$$.fragment,nd),Rg=d(nd),Qo=i(nd,"P",{});var id=s(Qo);Fg=l(id,"Disable sliced VAE decoding. If "),ka=i(id,"CODE",{});var ty=s(ka);Vg=l(ty,"enable_vae_slicing"),ty.forEach(o),Yg=l(id,` was previously enabled, this method will go back to
computing decoding in one step.`),id.forEach(o),nd.forEach(o),Qg=d(U),ut=i(U,"DIV",{class:!0});var sd=s(ut);g(qo.$$.fragment,sd),qg=d(sd),Ho=i(sd,"P",{});var ad=s(Ho);Hg=l(ad,"Disable tiled VAE decoding. If "),Da=i(ad,"CODE",{});var oy=s(Da);Og=l(oy,"enable_vae_tiling"),oy.forEach(o),Kg=l(ad,` was previously enabled, this method will go back to
computing decoding in one step.`),ad.forEach(o),sd.forEach(o),eu=d(U),ht=i(U,"DIV",{class:!0});var ld=s(ht);g(Oo.$$.fragment,ld),tu=d(ld),N=i(ld,"P",{});var de=s(N);ou=l(de,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),$a=i(de,"CODE",{});var ny=s($a);nu=l(ny,"enable_sequential_cpu_offload"),ny.forEach(o),iu=l(de,", this method moves one whole model at a time to the GPU when its "),Pa=i(de,"CODE",{});var iy=s(Pa);su=l(iy,"forward"),iy.forEach(o),au=l(de,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Za=i(de,"CODE",{});var sy=s(Za);lu=l(sy,"enable_sequential_cpu_offload"),sy.forEach(o),ru=l(de,", but performance is much better due to the iterative execution of the "),ja=i(de,"CODE",{});var ay=s(ja);pu=l(ay,"unet"),ay.forEach(o),du=l(de,"."),de.forEach(o),ld.forEach(o),cu=d(U),_t=i(U,"DIV",{class:!0});var rd=s(_t);g(Ko.$$.fragment,rd),fu=d(rd),Wa=i(rd,"P",{});var ly=s(Wa);mu=l(ly,`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),ly.forEach(o),rd.forEach(o),gu=d(U),bt=i(U,"DIV",{class:!0});var pd=s(bt);g(en.$$.fragment,pd),uu=d(pd),Ga=i(pd,"P",{});var ry=s(Ga);hu=l(ry,`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),ry.forEach(o),pd.forEach(o),_u=d(U),vt=i(U,"DIV",{class:!0});var dd=s(vt);g(tn.$$.fragment,dd),bu=d(dd),Ca=i(dd,"P",{});var py=s(Ca);vu=l(py,"Encodes the prompt into text encoder hidden states."),py.forEach(o),dd.forEach(o),U.forEach(o),mp=d(t),$e=i(t,"H2",{class:!0});var cd=s($e);yt=i(cd,"A",{id:!0,class:!0,href:!0});var dy=s(yt);Na=i(dy,"SPAN",{});var cy=s(Na);g(on.$$.fragment,cy),cy.forEach(o),dy.forEach(o),yu=d(cd),Ba=i(cd,"SPAN",{});var fy=s(Ba);wu=l(fy,"StableDiffusionXLImg2ImgPipeline"),fy.forEach(o),cd.forEach(o),gp=d(t),x=i(t,"DIV",{class:!0});var X=s(x);g(nn.$$.fragment,X),Mu=d(X),za=i(X,"P",{});var my=s(za);Iu=l(my,"Pipeline for text-to-image generation using Stable Diffusion XL."),my.forEach(o),Tu=d(X),sn=i(X,"P",{});var fd=s(sn);xu=l(fd,"This model inherits from "),_i=i(fd,"A",{href:!0});var gy=s(_i);Eu=l(gy,"DiffusionPipeline"),gy.forEach(o),Ju=l(fd,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),fd.forEach(o),Su=d(X),Aa=i(X,"P",{});var uy=s(Aa);Lu=l(uy,"In addition the pipeline inherits the following loading methods:"),uy.forEach(o),Uu=d(X),an=i(X,"UL",{});var md=s(an);ln=i(md,"LI",{});var gd=s(ln);Ra=i(gd,"EM",{});var hy=s(Ra);Xu=l(hy,"LoRA"),hy.forEach(o),ku=l(gd,": "),bi=i(gd,"A",{href:!0});var _y=s(bi);Du=l(_y,"loaders.LoraLoaderMixin.load_lora_weights()"),_y.forEach(o),gd.forEach(o),$u=d(md),rn=i(md,"LI",{});var ud=s(rn);Fa=i(ud,"EM",{});var by=s(Fa);Pu=l(by,"Ckpt"),by.forEach(o),Zu=l(ud,": "),vi=i(ud,"A",{href:!0});var vy=s(vi);ju=l(vy,"loaders.FromSingleFileMixin.from_single_file()"),vy.forEach(o),ud.forEach(o),md.forEach(o),Wu=d(X),Va=i(X,"P",{});var yy=s(Va);Gu=l(yy,"as well as the following saving methods:"),yy.forEach(o),Cu=d(X),Ya=i(X,"UL",{});var wy=s(Ya);pn=i(wy,"LI",{});var hd=s(pn);Qa=i(hd,"EM",{});var My=s(Qa);Nu=l(My,"LoRA"),My.forEach(o),Bu=l(hd,": "),yi=i(hd,"A",{href:!0});var Iy=s(yi);zu=l(Iy,"loaders.LoraLoaderMixin.save_lora_weights()"),Iy.forEach(o),hd.forEach(o),wy.forEach(o),Au=d(X),ae=i(X,"DIV",{class:!0});var Zi=s(ae);g(dn.$$.fragment,Zi),Ru=d(Zi),qa=i(Zi,"P",{});var Ty=s(qa);Fu=l(Ty,"Function invoked when calling the pipeline for generation."),Ty.forEach(o),Vu=d(Zi),g(wt.$$.fragment,Zi),Zi.forEach(o),Yu=d(X),Mt=i(X,"DIV",{class:!0});var _d=s(Mt);g(cn.$$.fragment,_d),Qu=d(_d),fn=i(_d,"P",{});var bd=s(fn);qu=l(bd,"Disable sliced VAE decoding. If "),Ha=i(bd,"CODE",{});var xy=s(Ha);Hu=l(xy,"enable_vae_slicing"),xy.forEach(o),Ou=l(bd,` was previously enabled, this method will go back to
computing decoding in one step.`),bd.forEach(o),_d.forEach(o),Ku=d(X),It=i(X,"DIV",{class:!0});var vd=s(It);g(mn.$$.fragment,vd),eh=d(vd),gn=i(vd,"P",{});var yd=s(gn);th=l(yd,"Disable tiled VAE decoding. If "),Oa=i(yd,"CODE",{});var Ey=s(Oa);oh=l(Ey,"enable_vae_tiling"),Ey.forEach(o),nh=l(yd,` was previously enabled, this method will go back to
computing decoding in one step.`),yd.forEach(o),vd.forEach(o),ih=d(X),Tt=i(X,"DIV",{class:!0});var wd=s(Tt);g(un.$$.fragment,wd),sh=d(wd),B=i(wd,"P",{});var ce=s(B);ah=l(ce,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ka=i(ce,"CODE",{});var Jy=s(Ka);lh=l(Jy,"enable_sequential_cpu_offload"),Jy.forEach(o),rh=l(ce,", this method moves one whole model at a time to the GPU when its "),el=i(ce,"CODE",{});var Sy=s(el);ph=l(Sy,"forward"),Sy.forEach(o),dh=l(ce,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),tl=i(ce,"CODE",{});var Ly=s(tl);ch=l(Ly,"enable_sequential_cpu_offload"),Ly.forEach(o),fh=l(ce,", but performance is much better due to the iterative execution of the "),ol=i(ce,"CODE",{});var Uy=s(ol);mh=l(Uy,"unet"),Uy.forEach(o),gh=l(ce,"."),ce.forEach(o),wd.forEach(o),uh=d(X),xt=i(X,"DIV",{class:!0});var Md=s(xt);g(hn.$$.fragment,Md),hh=d(Md),nl=i(Md,"P",{});var Xy=s(nl);_h=l(Xy,`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),Xy.forEach(o),Md.forEach(o),bh=d(X),Et=i(X,"DIV",{class:!0});var Id=s(Et);g(_n.$$.fragment,Id),vh=d(Id),il=i(Id,"P",{});var ky=s(il);yh=l(ky,`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),ky.forEach(o),Id.forEach(o),wh=d(X),Jt=i(X,"DIV",{class:!0});var Td=s(Jt);g(bn.$$.fragment,Td),Mh=d(Td),sl=i(Td,"P",{});var Dy=s(sl);Ih=l(Dy,"Encodes the prompt into text encoder hidden states."),Dy.forEach(o),Td.forEach(o),X.forEach(o),up=d(t),Pe=i(t,"H2",{class:!0});var xd=s(Pe);St=i(xd,"A",{id:!0,class:!0,href:!0});var $y=s(St);al=i($y,"SPAN",{});var Py=s(al);g(vn.$$.fragment,Py),Py.forEach(o),$y.forEach(o),Th=d(xd),ll=i(xd,"SPAN",{});var Zy=s(ll);xh=l(Zy,"StableDiffusionXLInpaintPipeline"),Zy.forEach(o),xd.forEach(o),hp=d(t),E=i(t,"DIV",{class:!0});var k=s(E);g(yn.$$.fragment,k),Eh=d(k),rl=i(k,"P",{});var jy=s(rl);Jh=l(jy,"Pipeline for text-to-image generation using Stable Diffusion XL."),jy.forEach(o),Sh=d(k),wn=i(k,"P",{});var Ed=s(wn);Lh=l(Ed,"This model inherits from "),wi=i(Ed,"A",{href:!0});var Wy=s(wi);Uh=l(Wy,"DiffusionPipeline"),Wy.forEach(o),Xh=l(Ed,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Ed.forEach(o),kh=d(k),pl=i(k,"P",{});var Gy=s(pl);Dh=l(Gy,"In addition the pipeline inherits the following loading methods:"),Gy.forEach(o),$h=d(k),Mn=i(k,"UL",{});var Jd=s(Mn);In=i(Jd,"LI",{});var Sd=s(In);dl=i(Sd,"EM",{});var Cy=s(dl);Ph=l(Cy,"LoRA"),Cy.forEach(o),Zh=l(Sd,": "),Mi=i(Sd,"A",{href:!0});var Ny=s(Mi);jh=l(Ny,"loaders.LoraLoaderMixin.load_lora_weights()"),Ny.forEach(o),Sd.forEach(o),Wh=d(Jd),Tn=i(Jd,"LI",{});var Ld=s(Tn);cl=i(Ld,"EM",{});var By=s(cl);Gh=l(By,"Ckpt"),By.forEach(o),Ch=l(Ld,": "),Ii=i(Ld,"A",{href:!0});var zy=s(Ii);Nh=l(zy,"loaders.FromSingleFileMixin.from_single_file()"),zy.forEach(o),Ld.forEach(o),Jd.forEach(o),Bh=d(k),fl=i(k,"P",{});var Ay=s(fl);zh=l(Ay,"as well as the following saving methods:"),Ay.forEach(o),Ah=d(k),ml=i(k,"UL",{});var Ry=s(ml);xn=i(Ry,"LI",{});var Ud=s(xn);gl=i(Ud,"EM",{});var Fy=s(gl);Rh=l(Fy,"LoRA"),Fy.forEach(o),Fh=l(Ud,": "),Ti=i(Ud,"A",{href:!0});var Vy=s(Ti);Vh=l(Vy,"loaders.LoraLoaderMixin.save_lora_weights()"),Vy.forEach(o),Ud.forEach(o),Ry.forEach(o),Yh=d(k),le=i(k,"DIV",{class:!0});var ji=s(le);g(En.$$.fragment,ji),Qh=d(ji),ul=i(ji,"P",{});var Yy=s(ul);qh=l(Yy,"Function invoked when calling the pipeline for generation."),Yy.forEach(o),Hh=d(ji),g(Lt.$$.fragment,ji),ji.forEach(o),Oh=d(k),Ut=i(k,"DIV",{class:!0});var Xd=s(Ut);g(Jn.$$.fragment,Xd),Kh=d(Xd),Sn=i(Xd,"P",{});var kd=s(Sn);e_=l(kd,"Disable sliced VAE decoding. If "),hl=i(kd,"CODE",{});var Qy=s(hl);t_=l(Qy,"enable_vae_slicing"),Qy.forEach(o),o_=l(kd,` was previously enabled, this method will go back to
computing decoding in one step.`),kd.forEach(o),Xd.forEach(o),n_=d(k),Xt=i(k,"DIV",{class:!0});var Dd=s(Xt);g(Ln.$$.fragment,Dd),i_=d(Dd),Un=i(Dd,"P",{});var $d=s(Un);s_=l($d,"Disable tiled VAE decoding. If "),_l=i($d,"CODE",{});var qy=s(_l);a_=l(qy,"enable_vae_tiling"),qy.forEach(o),l_=l($d,` was previously enabled, this method will go back to
computing decoding in one step.`),$d.forEach(o),Dd.forEach(o),r_=d(k),kt=i(k,"DIV",{class:!0});var Pd=s(kt);g(Xn.$$.fragment,Pd),p_=d(Pd),z=i(Pd,"P",{});var fe=s(z);d_=l(fe,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),bl=i(fe,"CODE",{});var Hy=s(bl);c_=l(Hy,"enable_sequential_cpu_offload"),Hy.forEach(o),f_=l(fe,", this method moves one whole model at a time to the GPU when its "),vl=i(fe,"CODE",{});var Oy=s(vl);m_=l(Oy,"forward"),Oy.forEach(o),g_=l(fe,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),yl=i(fe,"CODE",{});var Ky=s(yl);u_=l(Ky,"enable_sequential_cpu_offload"),Ky.forEach(o),h_=l(fe,", but performance is much better due to the iterative execution of the "),wl=i(fe,"CODE",{});var ew=s(wl);__=l(ew,"unet"),ew.forEach(o),b_=l(fe,"."),fe.forEach(o),Pd.forEach(o),v_=d(k),Dt=i(k,"DIV",{class:!0});var Zd=s(Dt);g(kn.$$.fragment,Zd),y_=d(Zd),Ml=i(Zd,"P",{});var tw=s(Ml);w_=l(tw,`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),tw.forEach(o),Zd.forEach(o),M_=d(k),$t=i(k,"DIV",{class:!0});var jd=s($t);g(Dn.$$.fragment,jd),I_=d(jd),Il=i(jd,"P",{});var ow=s(Il);T_=l(ow,`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),ow.forEach(o),jd.forEach(o),x_=d(k),Pt=i(k,"DIV",{class:!0});var Wd=s(Pt);g($n.$$.fragment,Wd),E_=d(Wd),Tl=i(Wd,"P",{});var nw=s(Tl);J_=l(nw,"Encodes the prompt into text encoder hidden states."),nw.forEach(o),Wd.forEach(o),k.forEach(o),_p=d(t),Ze=i(t,"H3",{class:!0});var Gd=s(Ze);Zt=i(Gd,"A",{id:!0,class:!0,href:!0});var iw=s(Zt);xl=i(iw,"SPAN",{});var sw=s(xl);g(Pn.$$.fragment,sw),sw.forEach(o),iw.forEach(o),S_=d(Gd),El=i(Gd,"SPAN",{});var aw=s(El);L_=l(aw,"Passing different prompts to each text-encoder"),aw.forEach(o),Gd.forEach(o),bp=d(t),J=i(t,"P",{});var D=s(J);U_=l(D,"Stable Diffusion XL was trained on two text encoders. The default behavior is to pass the same prompt to each. But it is possible to pass a different prompt for each text-encoder, as "),Zn=i(D,"A",{href:!0,rel:!0});var lw=s(Zn);X_=l(lw,"some users"),lw.forEach(o),k_=l(D,` noted that it can boost quality.
To do so, you can pass `),Jl=i(D,"CODE",{});var rw=s(Jl);D_=l(rw,"prompt_2"),rw.forEach(o),$_=l(D," and "),Sl=i(D,"CODE",{});var pw=s(Sl);P_=l(pw,"negative_prompt_2"),pw.forEach(o),Z_=l(D," in addition to "),Ll=i(D,"CODE",{});var dw=s(Ll);j_=l(dw,"prompt"),dw.forEach(o),W_=l(D," and "),Ul=i(D,"CODE",{});var cw=s(Ul);G_=l(cw,"negative_prompt"),cw.forEach(o),C_=l(D,". By doing that, you will pass the original prompts and negative prompts (as in "),Xl=i(D,"CODE",{});var fw=s(Xl);N_=l(fw,"prompt"),fw.forEach(o),B_=l(D," and "),kl=i(D,"CODE",{});var mw=s(kl);z_=l(mw,"negative_prompt"),mw.forEach(o),A_=l(D,") to "),Dl=i(D,"CODE",{});var gw=s(Dl);R_=l(gw,"text_encoder"),gw.forEach(o),F_=l(D," (in official SDXL 0.9/1.0 that is "),jn=i(D,"A",{href:!0,rel:!0});var uw=s(jn);V_=l(uw,"OpenAI CLIP-ViT/L-14"),uw.forEach(o),Y_=l(D,`),
and `),$l=i(D,"CODE",{});var hw=s($l);Q_=l(hw,"prompt_2"),hw.forEach(o),q_=l(D," and "),Pl=i(D,"CODE",{});var _w=s(Pl);H_=l(_w,"negative_prompt_2"),_w.forEach(o),O_=l(D," to "),Zl=i(D,"CODE",{});var bw=s(Zl);K_=l(bw,"text_encoder_2"),bw.forEach(o),eb=l(D," (in official SDXL 0.9/1.0 that is "),Wn=i(D,"A",{href:!0,rel:!0});var vw=s(Wn);tb=l(vw,"OpenCLIP-ViT/bigG-14"),vw.forEach(o),ob=l(D,")."),D.forEach(o),vp=d(t),g(Gn.$$.fragment,t),this.h()},h(){c(y,"name","hf:doc:metadata"),c(y,"content",JSON.stringify(kw)),c(w,"id","stable-diffusion-xl"),c(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"),c(w,"href","#stable-diffusion-xl"),c(M,"class","relative group"),c(j,"href","https://arxiv.org/abs/2307.01952"),c(j,"rel","nofollow"),c(We,"id","tips"),c(We,"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(We,"href","#tips"),c(ge,"class","relative group"),c(Ge,"id","available-checkpoints"),c(Ge,"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(Ge,"href","#available-checkpoints"),c(ue,"class","relative group"),c(Rt,"href","https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0"),c(Rt,"rel","nofollow"),c(Fn,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/stable_diffusion_xl#diffusers.StableDiffusionXLPipeline"),c(Ft,"href","https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0"),c(Ft,"rel","nofollow"),c(Vn,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/stable_diffusion_xl#diffusers.StableDiffusionXLImg2ImgPipeline"),c(Ne,"id","usage-example"),c(Ne,"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(Ne,"href","#usage-example"),c(be,"class","relative group"),c(Be,"id","watermarker"),c(Be,"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(Be,"href","#watermarker"),c(ve,"class","relative group"),c(qt,"href","https://pypi.org/project/invisible-watermark/"),c(qt,"rel","nofollow"),c(Ae,"id","texttoimage"),c(Ae,"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(Ae,"href","#texttoimage"),c(ye,"class","relative group"),zl(cs.src,pb="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/sd_xl/negative_conditions.png")||c(cs,"src",pb),c(Ye,"id","imagetoimage"),c(Ye,"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(Ye,"href","#imagetoimage"),c(we,"class","relative group"),c(qe,"id","inpainting"),c(qe,"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(qe,"href","#inpainting"),c(Me,"class","relative group"),c(He,"id","refining-the-image-output"),c(He,"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(He,"href","#refining-the-image-output"),c(Ie,"class","relative group"),c(ro,"href","https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0"),c(ro,"rel","nofollow"),c(Hn,"href","huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0"),c(po,"href","https://research.nvidia.com/labs/dir/eDiff-I/"),c(po,"rel","nofollow"),c(fo,"href","https://arxiv.org/abs/2108.01073"),c(fo,"rel","nofollow"),c(mo,"href","https://github.com/SytanSD"),c(mo,"rel","nofollow"),c(go,"href","https://github.com/bghira"),c(go,"rel","nofollow"),c(uo,"href","https://github.com/Birch-san"),c(uo,"rel","nofollow"),c(ho,"href","https://github.com/AmericanPresidentJimmyCarter"),c(ho,"rel","nofollow"),c(Ke,"id","1-ensemble-of-expert-denoisers"),c(Ke,"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(Ke,"href","#1-ensemble-of-expert-denoisers"),c(Ee,"class","relative group"),c(bo,"href","https://huggingface.co/docs/diffusers/main/en/api/pipelines/stable_diffusion/stable_diffusion_xl#diffusers.StableDiffusionXLPipeline.__call__.denoising_end"),c(bo,"rel","nofollow"),c(vo,"href","https://huggingface.co/docs/diffusers/main/en/api/pipelines/stable_diffusion/stable_diffusion_xl#diffusers.StableDiffusionXLImg2ImgPipeline.__call__.denoising_start"),c(vo,"rel","nofollow"),zl(ni.src,db="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lion_base.png")||c(ni,"src",db),c(ni,"alt","lion_base_timesteps"),zl(ii.src,cb="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lion_refined.png")||c(ii,"src",cb),c(ii,"alt","lion_refined_timesteps"),c(it,"id","2-refining-the-image-output-from-fully-denoised-base-image"),c(it,"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(it,"href","#2-refining-the-image-output-from-fully-denoised-base-image"),c(Je,"class","relative group"),c(ai,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline"),c(li,"href","huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0"),zl(oa.src,fb="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/sd_xl/init_image.png")||c(oa,"src",fb),zl(ia.src,mb="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/sd_xl/refined_image.png")||c(ia,"src",mb),c(lt,"id","loading-single-file-checkpoints-original-file-format"),c(lt,"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(lt,"href","#loading-single-file-checkpoints-original-file-format"),c(Se,"class","relative group"),c(di,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.from_single_file"),c(rt,"id","memory-optimization-via-model-offloading"),c(rt,"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(rt,"href","#memory-optimization-via-model-offloading"),c(Le,"class","relative group"),c(ci,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/stable_diffusion_xl#diffusers.StableDiffusionXLPipeline.enable_model_cpu_offload"),c(dt,"id","speedup-inference-with-torchcompile"),c(dt,"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(dt,"href","#speedup-inference-with-torchcompile"),c(Ue,"class","relative group"),c(ct,"id","running-with-torch-amplt-20"),c(ct,"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(ct,"href","#running-with-torch-amplt-20"),c(Xe,"class","relative group"),c(ft,"id","diffusers.StableDiffusionXLPipeline"),c(ft,"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(ft,"href","#diffusers.StableDiffusionXLPipeline"),c(De,"class","relative group"),c(ui,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),c(hi,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.from_single_file"),c(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(yt,"id","diffusers.StableDiffusionXLImg2ImgPipeline"),c(yt,"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(yt,"href","#diffusers.StableDiffusionXLImg2ImgPipeline"),c($e,"class","relative group"),c(_i,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),c(bi,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights"),c(vi,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.from_single_file"),c(yi,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights"),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(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(St,"id","diffusers.StableDiffusionXLInpaintPipeline"),c(St,"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(St,"href","#diffusers.StableDiffusionXLInpaintPipeline"),c(Pe,"class","relative group"),c(wi,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),c(Mi,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights"),c(Ii,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.from_single_file"),c(Ti,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights"),c(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c($t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Zt,"id","passing-different-prompts-to-each-textencoder"),c(Zt,"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(Zt,"href","#passing-different-prompts-to-each-textencoder"),c(Ze,"class","relative group"),c(Zn,"href","https://github.com/huggingface/diffusers/issues/4004#issuecomment-1627764201"),c(Zn,"rel","nofollow"),c(jn,"href","https://huggingface.co/openai/clip-vit-large-patch14"),c(jn,"rel","nofollow"),c(Wn,"href","https://huggingface.co/laion/CLIP-ViT-bigG-14-laion2B-39B-b160k"),c(Wn,"rel","nofollow")},m(t,r){e(document.head,y),f(t,S,r),f(t,M,r),e(M,w),e(w,L),u(v,L,null),e(M,I),e(M,A),e(A,H),f(t,je,r),f(t,R,r),e(R,me),e(R,j),e(j,Bn),e(R,zn),f(t,Bt,r),f(t,An,r),e(An,Cd),f(t,Al,r),f(t,Rn,r),e(Rn,Wi),e(Wi,Nd),f(t,Rl,r),f(t,ge,r),e(ge,We),e(We,Gi),u(zt,Gi,null),e(ge,Bd),e(ge,Ci),e(Ci,zd),f(t,Fl,r),f(t,F,r),e(F,Ni),e(Ni,Ad),e(F,Rd),e(F,Bi),e(Bi,Fd),e(F,Vd),e(F,zi),e(zi,Yd),e(F,Qd),e(F,q),e(q,qd),e(q,Ai),e(Ai,Hd),e(q,Od),e(q,Ri),e(Ri,Kd),e(q,ec),e(q,Fi),e(Fi,tc),e(q,oc),f(t,Vl,r),f(t,ue,r),e(ue,Ge),e(Ge,Vi),u(At,Vi,null),e(ue,nc),e(ue,Yi),e(Yi,ic),f(t,Yl,r),f(t,Ce,r),e(Ce,he),e(he,Qi),e(Qi,sc),e(he,ac),e(he,Rt),e(Rt,lc),e(he,rc),e(he,Fn),e(Fn,pc),e(Ce,dc),e(Ce,_e),e(_e,qi),e(qi,cc),e(_e,fc),e(_e,Ft),e(Ft,mc),e(_e,gc),e(_e,Vn),e(Vn,uc),f(t,Ql,r),f(t,be,r),e(be,Ne),e(Ne,Hi),u(Vt,Hi,null),e(be,hc),e(be,Oi),e(Oi,_c),f(t,ql,r),f(t,G,r),e(G,bc),e(G,Ki),e(Ki,vc),e(G,yc),e(G,es),e(es,wc),e(G,Mc),e(G,ts),e(ts,Ic),e(G,Tc),e(G,os),e(os,xc),e(G,Ec),f(t,Hl,r),u(Yt,t,r),f(t,Ol,r),f(t,ve,r),e(ve,Be),e(Be,ns),u(Qt,ns,null),e(ve,Jc),e(ve,is),e(is,Sc),f(t,Kl,r),f(t,ze,r),e(ze,Lc),e(ze,qt),e(qt,Uc),e(ze,Xc),f(t,er,r),u(Ht,t,r),f(t,tr,r),f(t,O,r),e(O,kc),e(O,ss),e(ss,Dc),e(O,$c),e(O,as),e(as,Pc),e(O,Zc),f(t,or,r),f(t,Yn,r),e(Yn,jc),f(t,nr,r),u(Ot,t,r),f(t,ir,r),f(t,ye,r),e(ye,Ae),e(Ae,ls),u(Kt,ls,null),e(ye,Wc),e(ye,rs),e(rs,Gc),f(t,sr,r),f(t,Re,r),e(Re,Cc),e(Re,ps),e(ps,Nc),e(Re,Bc),f(t,ar,r),u(eo,t,r),f(t,lr,r),f(t,Qn,r),e(Qn,zc),f(t,rr,r),u(to,t,r),f(t,pr,r),f(t,Fe,r),e(Fe,Ac),e(Fe,ds),e(ds,Rc),e(Fe,Fc),f(t,dr,r),f(t,qn,r),e(qn,cs),f(t,cr,r),u(Ve,t,r),f(t,fr,r),f(t,we,r),e(we,Ye),e(Ye,fs),u(oo,fs,null),e(we,Vc),e(we,ms),e(ms,Yc),f(t,mr,r),f(t,Qe,r),e(Qe,Qc),e(Qe,gs),e(gs,qc),e(Qe,Hc),f(t,gr,r),u(no,t,r),f(t,ur,r),f(t,Me,r),e(Me,qe),e(qe,us),u(io,us,null),e(Me,Oc),e(Me,hs),e(hs,Kc),f(t,hr,r),f(t,so,r),e(so,ef),e(so,_s),e(_s,tf),f(t,_r,r),u(ao,t,r),f(t,br,r),f(t,Ie,r),e(Ie,He),e(He,bs),u(lo,bs,null),e(Ie,of),e(Ie,vs),e(vs,nf),f(t,vr,r),f(t,K,r),e(K,sf),e(K,ro),e(ro,af),e(K,lf),e(K,Hn),e(Hn,rf),e(K,pf),f(t,yr,r),f(t,On,r),e(On,df),f(t,wr,r),f(t,Oe,r),e(Oe,Te),e(Te,cf),e(Te,ys),e(ys,ff),e(Te,mf),e(Te,po),e(po,gf),e(Te,uf),e(Oe,hf),e(Oe,co),e(co,_f),e(co,fo),e(fo,bf),e(co,vf),f(t,Mr,r),f(t,xe,r),e(xe,ws),e(ws,yf),e(xe,wf),e(xe,Ms),e(Ms,Mf),e(xe,If),f(t,Ir,r),f(t,V,r),e(V,Is),e(Is,mo),e(mo,Tf),e(V,xf),e(V,Ts),e(Ts,go),e(go,Ef),e(V,Jf),e(V,xs),e(xs,uo),e(uo,Sf),e(V,Lf),e(V,Es),e(Es,ho),e(ho,Uf),f(t,Tr,r),f(t,Ee,r),e(Ee,Ke),e(Ke,Js),u(_o,Js,null),e(Ee,Xf),e(Ee,Ss),e(Ss,kf),f(t,xr,r),f(t,Kn,r),e(Kn,Df),f(t,Er,r),f(t,ei,r),e(ei,$f),f(t,Jr,r),f(t,C,r),e(C,Pf),e(C,Ls),e(Ls,Zf),e(C,jf),e(C,Us),e(Us,Wf),e(C,Gf),e(C,bo),e(bo,Xs),e(Xs,Cf),e(C,Nf),e(C,vo),e(vo,ks),e(ks,Bf),e(C,zf),f(t,Sr,r),f(t,Y,r),e(Y,Af),e(Y,Ds),e(Ds,Rf),e(Y,Ff),e(Y,$s),e($s,Vf),e(Y,Yf),e(Y,Ps),e(Ps,Qf),e(Y,qf),f(t,Lr,r),f(t,ti,r),e(ti,Hf),f(t,Ur,r),u(yo,t,r),f(t,Xr,r),f(t,et,r),e(et,Of),e(et,Zs),e(Zs,Kf),e(et,em),f(t,kr,r),u(wo,t,r),f(t,Dr,r),f(t,tt,r),e(tt,tm),e(tt,js),e(js,om),e(tt,nm),f(t,$r,r),f(t,ee,r),e(ee,im),e(ee,Ws),e(Ws,sm),e(ee,am),e(ee,Gs),e(Gs,lm),e(ee,rm),f(t,Pr,r),f(t,Q,r),e(Q,pm),e(Q,Cs),e(Cs,dm),e(Q,cm),e(Q,Ns),e(Ns,fm),e(Q,mm),e(Q,Bs),e(Bs,gm),e(Q,um),f(t,Zr,r),u(Mo,t,r),f(t,jr,r),f(t,oi,r),e(oi,hm),f(t,Wr,r),f(t,ot,r),e(ot,zs),e(zs,Io),e(Io,As),e(As,_m),e(Io,bm),e(Io,Rs),e(Rs,vm),e(ot,ym),e(ot,Fs),e(Fs,To),e(To,Vs),e(Vs,ni),e(To,wm),e(To,Ys),e(Ys,ii),f(t,Gr,r),f(t,si,r),e(si,Mm),f(t,Cr,r),u(nt,t,r),f(t,Nr,r),f(t,Je,r),e(Je,it),e(it,Qs),u(xo,Qs,null),e(Je,Im),e(Je,qs),e(qs,Tm),f(t,Br,r),f(t,te,r),e(te,xm),e(te,ai),e(ai,Em),e(te,Jm),e(te,li),e(li,Sm),e(te,Lm),f(t,zr,r),f(t,ri,r),e(ri,Um),f(t,Ar,r),u(Eo,t,r),f(t,Rr,r),f(t,st,r),e(st,Hs),e(Hs,Jo),e(Jo,Os),e(Os,Xm),e(Jo,km),e(Jo,Ks),e(Ks,Dm),e(st,$m),e(st,ea),e(ea,So),e(So,ta),e(ta,oa),e(So,Pm),e(So,na),e(na,ia),f(t,Fr,r),u(at,t,r),f(t,Vr,r),f(t,pi,r),e(pi,Zm),f(t,Yr,r),u(Lo,t,r),f(t,Qr,r),f(t,oe,r),e(oe,jm),e(oe,sa),e(sa,Wm),e(oe,Gm),e(oe,aa),e(aa,Cm),e(oe,Nm),f(t,qr,r),f(t,Se,r),e(Se,lt),e(lt,la),u(Uo,la,null),e(Se,Bm),e(Se,ra),e(ra,zm),f(t,Hr,r),f(t,ne,r),e(ne,Am),e(ne,di),e(di,Rm),e(ne,Fm),e(ne,pa),e(pa,Vm),e(ne,Ym),f(t,Or,r),u(Xo,t,r),f(t,Kr,r),f(t,Le,r),e(Le,rt),e(rt,da),u(ko,da,null),e(Le,Qm),e(Le,ca),e(ca,qm),f(t,ep,r),f(t,pt,r),e(pt,Hm),e(pt,ci),e(ci,Om),e(pt,Km),f(t,tp,r),u(Do,t,r),f(t,op,r),f(t,fi,r),e(fi,eg),f(t,np,r),u($o,t,r),f(t,ip,r),f(t,Ue,r),e(Ue,dt),e(dt,fa),u(Po,fa,null),e(Ue,tg),e(Ue,mi),e(mi,og),e(mi,ma),e(ma,ng),f(t,sp,r),f(t,ie,r),e(ie,ig),e(ie,ga),e(ga,sg),e(ie,ag),e(ie,ua),e(ua,lg),e(ie,rg),f(t,ap,r),u(Zo,t,r),f(t,lp,r),f(t,Xe,r),e(Xe,ct),e(ct,ha),u(jo,ha,null),e(Xe,pg),e(Xe,gi),e(gi,dg),e(gi,_a),e(_a,cg),f(t,rp,r),f(t,ke,r),e(ke,ba),e(ba,fg),e(ke,mg),e(ke,va),e(va,gg),e(ke,ug),f(t,pp,r),u(Wo,t,r),f(t,dp,r),u(Go,t,r),f(t,cp,r),f(t,De,r),e(De,ft),e(ft,ya),u(Co,ya,null),e(De,hg),e(De,wa),e(wa,_g),f(t,fp,r),f(t,T,r),u(No,T,null),e(T,bg),e(T,Ma),e(Ma,vg),e(T,yg),e(T,Bo),e(Bo,wg),e(Bo,ui),e(ui,Mg),e(Bo,Ig),e(T,Tg),e(T,Ia),e(Ia,xg),e(T,Eg),e(T,zo),e(zo,Ao),e(Ao,Ta),e(Ta,Jg),e(Ao,Sg),e(Ao,xa),e(xa,Lg),e(zo,Ug),e(zo,Ro),e(Ro,Ea),e(Ea,Xg),e(Ro,kg),e(Ro,hi),e(hi,Dg),e(T,$g),e(T,Ja),e(Ja,Pg),e(T,Zg),e(T,Sa),e(Sa,Fo),e(Fo,La),e(La,jg),e(Fo,Wg),e(Fo,Ua),e(Ua,Gg),e(T,Cg),e(T,se),u(Vo,se,null),e(se,Ng),e(se,Xa),e(Xa,Bg),e(se,zg),u(mt,se,null),e(T,Ag),e(T,gt),u(Yo,gt,null),e(gt,Rg),e(gt,Qo),e(Qo,Fg),e(Qo,ka),e(ka,Vg),e(Qo,Yg),e(T,Qg),e(T,ut),u(qo,ut,null),e(ut,qg),e(ut,Ho),e(Ho,Hg),e(Ho,Da),e(Da,Og),e(Ho,Kg),e(T,eu),e(T,ht),u(Oo,ht,null),e(ht,tu),e(ht,N),e(N,ou),e(N,$a),e($a,nu),e(N,iu),e(N,Pa),e(Pa,su),e(N,au),e(N,Za),e(Za,lu),e(N,ru),e(N,ja),e(ja,pu),e(N,du),e(T,cu),e(T,_t),u(Ko,_t,null),e(_t,fu),e(_t,Wa),e(Wa,mu),e(T,gu),e(T,bt),u(en,bt,null),e(bt,uu),e(bt,Ga),e(Ga,hu),e(T,_u),e(T,vt),u(tn,vt,null),e(vt,bu),e(vt,Ca),e(Ca,vu),f(t,mp,r),f(t,$e,r),e($e,yt),e(yt,Na),u(on,Na,null),e($e,yu),e($e,Ba),e(Ba,wu),f(t,gp,r),f(t,x,r),u(nn,x,null),e(x,Mu),e(x,za),e(za,Iu),e(x,Tu),e(x,sn),e(sn,xu),e(sn,_i),e(_i,Eu),e(sn,Ju),e(x,Su),e(x,Aa),e(Aa,Lu),e(x,Uu),e(x,an),e(an,ln),e(ln,Ra),e(Ra,Xu),e(ln,ku),e(ln,bi),e(bi,Du),e(an,$u),e(an,rn),e(rn,Fa),e(Fa,Pu),e(rn,Zu),e(rn,vi),e(vi,ju),e(x,Wu),e(x,Va),e(Va,Gu),e(x,Cu),e(x,Ya),e(Ya,pn),e(pn,Qa),e(Qa,Nu),e(pn,Bu),e(pn,yi),e(yi,zu),e(x,Au),e(x,ae),u(dn,ae,null),e(ae,Ru),e(ae,qa),e(qa,Fu),e(ae,Vu),u(wt,ae,null),e(x,Yu),e(x,Mt),u(cn,Mt,null),e(Mt,Qu),e(Mt,fn),e(fn,qu),e(fn,Ha),e(Ha,Hu),e(fn,Ou),e(x,Ku),e(x,It),u(mn,It,null),e(It,eh),e(It,gn),e(gn,th),e(gn,Oa),e(Oa,oh),e(gn,nh),e(x,ih),e(x,Tt),u(un,Tt,null),e(Tt,sh),e(Tt,B),e(B,ah),e(B,Ka),e(Ka,lh),e(B,rh),e(B,el),e(el,ph),e(B,dh),e(B,tl),e(tl,ch),e(B,fh),e(B,ol),e(ol,mh),e(B,gh),e(x,uh),e(x,xt),u(hn,xt,null),e(xt,hh),e(xt,nl),e(nl,_h),e(x,bh),e(x,Et),u(_n,Et,null),e(Et,vh),e(Et,il),e(il,yh),e(x,wh),e(x,Jt),u(bn,Jt,null),e(Jt,Mh),e(Jt,sl),e(sl,Ih),f(t,up,r),f(t,Pe,r),e(Pe,St),e(St,al),u(vn,al,null),e(Pe,Th),e(Pe,ll),e(ll,xh),f(t,hp,r),f(t,E,r),u(yn,E,null),e(E,Eh),e(E,rl),e(rl,Jh),e(E,Sh),e(E,wn),e(wn,Lh),e(wn,wi),e(wi,Uh),e(wn,Xh),e(E,kh),e(E,pl),e(pl,Dh),e(E,$h),e(E,Mn),e(Mn,In),e(In,dl),e(dl,Ph),e(In,Zh),e(In,Mi),e(Mi,jh),e(Mn,Wh),e(Mn,Tn),e(Tn,cl),e(cl,Gh),e(Tn,Ch),e(Tn,Ii),e(Ii,Nh),e(E,Bh),e(E,fl),e(fl,zh),e(E,Ah),e(E,ml),e(ml,xn),e(xn,gl),e(gl,Rh),e(xn,Fh),e(xn,Ti),e(Ti,Vh),e(E,Yh),e(E,le),u(En,le,null),e(le,Qh),e(le,ul),e(ul,qh),e(le,Hh),u(Lt,le,null),e(E,Oh),e(E,Ut),u(Jn,Ut,null),e(Ut,Kh),e(Ut,Sn),e(Sn,e_),e(Sn,hl),e(hl,t_),e(Sn,o_),e(E,n_),e(E,Xt),u(Ln,Xt,null),e(Xt,i_),e(Xt,Un),e(Un,s_),e(Un,_l),e(_l,a_),e(Un,l_),e(E,r_),e(E,kt),u(Xn,kt,null),e(kt,p_),e(kt,z),e(z,d_),e(z,bl),e(bl,c_),e(z,f_),e(z,vl),e(vl,m_),e(z,g_),e(z,yl),e(yl,u_),e(z,h_),e(z,wl),e(wl,__),e(z,b_),e(E,v_),e(E,Dt),u(kn,Dt,null),e(Dt,y_),e(Dt,Ml),e(Ml,w_),e(E,M_),e(E,$t),u(Dn,$t,null),e($t,I_),e($t,Il),e(Il,T_),e(E,x_),e(E,Pt),u($n,Pt,null),e(Pt,E_),e(Pt,Tl),e(Tl,J_),f(t,_p,r),f(t,Ze,r),e(Ze,Zt),e(Zt,xl),u(Pn,xl,null),e(Ze,S_),e(Ze,El),e(El,L_),f(t,bp,r),f(t,J,r),e(J,U_),e(J,Zn),e(Zn,X_),e(J,k_),e(J,Jl),e(Jl,D_),e(J,$_),e(J,Sl),e(Sl,P_),e(J,Z_),e(J,Ll),e(Ll,j_),e(J,W_),e(J,Ul),e(Ul,G_),e(J,C_),e(J,Xl),e(Xl,N_),e(J,B_),e(J,kl),e(kl,z_),e(J,A_),e(J,Dl),e(Dl,R_),e(J,F_),e(J,jn),e(jn,V_),e(J,Y_),e(J,$l),e($l,Q_),e(J,q_),e(J,Pl),e(Pl,H_),e(J,O_),e(J,Zl),e(Zl,K_),e(J,eb),e(J,Wn),e(Wn,tb),e(J,ob),f(t,vp,r),u(Gn,t,r),yp=!0},p(t,[r]){const Cn={};r&2&&(Cn.$$scope={dirty:r,ctx:t}),Ve.$set(Cn);const jl={};r&2&&(jl.$$scope={dirty:r,ctx:t}),nt.$set(jl);const Wl={};r&2&&(Wl.$$scope={dirty:r,ctx:t}),at.$set(Wl);const Gl={};r&2&&(Gl.$$scope={dirty:r,ctx:t}),mt.$set(Gl);const Nn={};r&2&&(Nn.$$scope={dirty:r,ctx:t}),wt.$set(Nn);const Cl={};r&2&&(Cl.$$scope={dirty:r,ctx:t}),Lt.$set(Cl)},i(t){yp||(h(v.$$.fragment,t),h(zt.$$.fragment,t),h(At.$$.fragment,t),h(Vt.$$.fragment,t),h(Yt.$$.fragment,t),h(Qt.$$.fragment,t),h(Ht.$$.fragment,t),h(Ot.$$.fragment,t),h(Kt.$$.fragment,t),h(eo.$$.fragment,t),h(to.$$.fragment,t),h(Ve.$$.fragment,t),h(oo.$$.fragment,t),h(no.$$.fragment,t),h(io.$$.fragment,t),h(ao.$$.fragment,t),h(lo.$$.fragment,t),h(_o.$$.fragment,t),h(yo.$$.fragment,t),h(wo.$$.fragment,t),h(Mo.$$.fragment,t),h(nt.$$.fragment,t),h(xo.$$.fragment,t),h(Eo.$$.fragment,t),h(at.$$.fragment,t),h(Lo.$$.fragment,t),h(Uo.$$.fragment,t),h(Xo.$$.fragment,t),h(ko.$$.fragment,t),h(Do.$$.fragment,t),h($o.$$.fragment,t),h(Po.$$.fragment,t),h(Zo.$$.fragment,t),h(jo.$$.fragment,t),h(Wo.$$.fragment,t),h(Go.$$.fragment,t),h(Co.$$.fragment,t),h(No.$$.fragment,t),h(Vo.$$.fragment,t),h(mt.$$.fragment,t),h(Yo.$$.fragment,t),h(qo.$$.fragment,t),h(Oo.$$.fragment,t),h(Ko.$$.fragment,t),h(en.$$.fragment,t),h(tn.$$.fragment,t),h(on.$$.fragment,t),h(nn.$$.fragment,t),h(dn.$$.fragment,t),h(wt.$$.fragment,t),h(cn.$$.fragment,t),h(mn.$$.fragment,t),h(un.$$.fragment,t),h(hn.$$.fragment,t),h(_n.$$.fragment,t),h(bn.$$.fragment,t),h(vn.$$.fragment,t),h(yn.$$.fragment,t),h(En.$$.fragment,t),h(Lt.$$.fragment,t),h(Jn.$$.fragment,t),h(Ln.$$.fragment,t),h(Xn.$$.fragment,t),h(kn.$$.fragment,t),h(Dn.$$.fragment,t),h($n.$$.fragment,t),h(Pn.$$.fragment,t),h(Gn.$$.fragment,t),yp=!0)},o(t){_(v.$$.fragment,t),_(zt.$$.fragment,t),_(At.$$.fragment,t),_(Vt.$$.fragment,t),_(Yt.$$.fragment,t),_(Qt.$$.fragment,t),_(Ht.$$.fragment,t),_(Ot.$$.fragment,t),_(Kt.$$.fragment,t),_(eo.$$.fragment,t),_(to.$$.fragment,t),_(Ve.$$.fragment,t),_(oo.$$.fragment,t),_(no.$$.fragment,t),_(io.$$.fragment,t),_(ao.$$.fragment,t),_(lo.$$.fragment,t),_(_o.$$.fragment,t),_(yo.$$.fragment,t),_(wo.$$.fragment,t),_(Mo.$$.fragment,t),_(nt.$$.fragment,t),_(xo.$$.fragment,t),_(Eo.$$.fragment,t),_(at.$$.fragment,t),_(Lo.$$.fragment,t),_(Uo.$$.fragment,t),_(Xo.$$.fragment,t),_(ko.$$.fragment,t),_(Do.$$.fragment,t),_($o.$$.fragment,t),_(Po.$$.fragment,t),_(Zo.$$.fragment,t),_(jo.$$.fragment,t),_(Wo.$$.fragment,t),_(Go.$$.fragment,t),_(Co.$$.fragment,t),_(No.$$.fragment,t),_(Vo.$$.fragment,t),_(mt.$$.fragment,t),_(Yo.$$.fragment,t),_(qo.$$.fragment,t),_(Oo.$$.fragment,t),_(Ko.$$.fragment,t),_(en.$$.fragment,t),_(tn.$$.fragment,t),_(on.$$.fragment,t),_(nn.$$.fragment,t),_(dn.$$.fragment,t),_(wt.$$.fragment,t),_(cn.$$.fragment,t),_(mn.$$.fragment,t),_(un.$$.fragment,t),_(hn.$$.fragment,t),_(_n.$$.fragment,t),_(bn.$$.fragment,t),_(vn.$$.fragment,t),_(yn.$$.fragment,t),_(En.$$.fragment,t),_(Lt.$$.fragment,t),_(Jn.$$.fragment,t),_(Ln.$$.fragment,t),_(Xn.$$.fragment,t),_(kn.$$.fragment,t),_(Dn.$$.fragment,t),_($n.$$.fragment,t),_(Pn.$$.fragment,t),_(Gn.$$.fragment,t),yp=!1},d(t){o(y),t&&o(S),t&&o(M),b(v),t&&o(je),t&&o(R),t&&o(Bt),t&&o(An),t&&o(Al),t&&o(Rn),t&&o(Rl),t&&o(ge),b(zt),t&&o(Fl),t&&o(F),t&&o(Vl),t&&o(ue),b(At),t&&o(Yl),t&&o(Ce),t&&o(Ql),t&&o(be),b(Vt),t&&o(ql),t&&o(G),t&&o(Hl),b(Yt,t),t&&o(Ol),t&&o(ve),b(Qt),t&&o(Kl),t&&o(ze),t&&o(er),b(Ht,t),t&&o(tr),t&&o(O),t&&o(or),t&&o(Yn),t&&o(nr),b(Ot,t),t&&o(ir),t&&o(ye),b(Kt),t&&o(sr),t&&o(Re),t&&o(ar),b(eo,t),t&&o(lr),t&&o(Qn),t&&o(rr),b(to,t),t&&o(pr),t&&o(Fe),t&&o(dr),t&&o(qn),t&&o(cr),b(Ve,t),t&&o(fr),t&&o(we),b(oo),t&&o(mr),t&&o(Qe),t&&o(gr),b(no,t),t&&o(ur),t&&o(Me),b(io),t&&o(hr),t&&o(so),t&&o(_r),b(ao,t),t&&o(br),t&&o(Ie),b(lo),t&&o(vr),t&&o(K),t&&o(yr),t&&o(On),t&&o(wr),t&&o(Oe),t&&o(Mr),t&&o(xe),t&&o(Ir),t&&o(V),t&&o(Tr),t&&o(Ee),b(_o),t&&o(xr),t&&o(Kn),t&&o(Er),t&&o(ei),t&&o(Jr),t&&o(C),t&&o(Sr),t&&o(Y),t&&o(Lr),t&&o(ti),t&&o(Ur),b(yo,t),t&&o(Xr),t&&o(et),t&&o(kr),b(wo,t),t&&o(Dr),t&&o(tt),t&&o($r),t&&o(ee),t&&o(Pr),t&&o(Q),t&&o(Zr),b(Mo,t),t&&o(jr),t&&o(oi),t&&o(Wr),t&&o(ot),t&&o(Gr),t&&o(si),t&&o(Cr),b(nt,t),t&&o(Nr),t&&o(Je),b(xo),t&&o(Br),t&&o(te),t&&o(zr),t&&o(ri),t&&o(Ar),b(Eo,t),t&&o(Rr),t&&o(st),t&&o(Fr),b(at,t),t&&o(Vr),t&&o(pi),t&&o(Yr),b(Lo,t),t&&o(Qr),t&&o(oe),t&&o(qr),t&&o(Se),b(Uo),t&&o(Hr),t&&o(ne),t&&o(Or),b(Xo,t),t&&o(Kr),t&&o(Le),b(ko),t&&o(ep),t&&o(pt),t&&o(tp),b(Do,t),t&&o(op),t&&o(fi),t&&o(np),b($o,t),t&&o(ip),t&&o(Ue),b(Po),t&&o(sp),t&&o(ie),t&&o(ap),b(Zo,t),t&&o(lp),t&&o(Xe),b(jo),t&&o(rp),t&&o(ke),t&&o(pp),b(Wo,t),t&&o(dp),b(Go,t),t&&o(cp),t&&o(De),b(Co),t&&o(fp),t&&o(T),b(No),b(Vo),b(mt),b(Yo),b(qo),b(Oo),b(Ko),b(en),b(tn),t&&o(mp),t&&o($e),b(on),t&&o(gp),t&&o(x),b(nn),b(dn),b(wt),b(cn),b(mn),b(un),b(hn),b(_n),b(bn),t&&o(up),t&&o(Pe),b(vn),t&&o(hp),t&&o(E),b(yn),b(En),b(Lt),b(Jn),b(Ln),b(Xn),b(kn),b(Dn),b($n),t&&o(_p),t&&o(Ze),b(Pn),t&&o(bp),t&&o(J),t&&o(vp),b(Gn,t)}}}const kw={local:"stable-diffusion-xl",sections:[{local:"tips",sections:[{local:"available-checkpoints",title:"Available checkpoints:"}],title:"Tips"},{local:"usage-example",sections:[{local:"watermarker",title:"Watermarker"},{local:"texttoimage",title:"Text-to-Image"},{local:"imagetoimage",title:"Image-to-image "},{local:"inpainting",title:"Inpainting"},{local:"refining-the-image-output",sections:[{local:"1-ensemble-of-expert-denoisers",title:"1.) Ensemble of Expert Denoisers"},{local:"2-refining-the-image-output-from-fully-denoised-base-image",title:"2.) Refining the image output from fully denoised base image"}],title:"Refining the image output"},{local:"loading-single-file-checkpoints-original-file-format",title:"Loading single file checkpoints / original file format"},{local:"memory-optimization-via-model-offloading",title:"Memory optimization via model offloading "},{local:"speedup-inference-with-torchcompile",title:"Speed-up inference with `torch.compile`"},{local:"running-with-torch-amplt-20",title:"Running with `torch &amp;lt; 2.0`"}],title:"Usage Example"},{local:"diffusers.StableDiffusionXLPipeline",title:"StableDiffusionXLPipeline"},{local:"diffusers.StableDiffusionXLImg2ImgPipeline",title:"StableDiffusionXLImg2ImgPipeline"},{local:"diffusers.StableDiffusionXLInpaintPipeline",sections:[{local:"passing-different-prompts-to-each-textencoder",title:"Passing different prompts to each text-encoder"}],title:"StableDiffusionXLInpaintPipeline"}],title:"Stable diffusion XL"};function Dw(W){return Tw(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Cw extends yw{constructor(y){super();ww(this,y,Dw,Xw,Mw,{})}}export{Cw as default,kw as metadata};
