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