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