import{S as Jy,i as Ly,s as Sy,e as n,k as r,w as m,t as a,M as Xy,c as i,d as o,m as p,a as s,x as u,h as l,b as c,N as ad,G as e,g as f,y as h,q as g,o as _,B as b,v as Uy,L as w_}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as Ey}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 y_}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Dy(B){let y,D;return{c(){y=n("p"),D=a("The ensemble-of-experts method works well on all available schedulers!")},l(M){y=i(M,"P",{});var w=s(y);D=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,D)},d(M){M&&o(y)}}}function ky(B){let y,D,M,w,k;return{c(){y=n("p"),D=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"),k=a(" classes as shown below"),this.h()},l(v){y=i(v,"P",{});var J=s(y);D=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 De=s(M);w=l(De,"StableDiffusionXLInpaintPipeline"),De.forEach(o),k=l(J," classes as shown below"),J.forEach(o),this.h()},h(){c(M,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/stable_diffusion_xl#diffusers.StableDiffusionXLInpaintPipeline")},m(v,J){f(v,y,J),e(y,D),e(y,M),e(M,w),e(y,k)},d(v){v&&o(y)}}}function $y(B){let y,D,M,w,k;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"),D=a("Examples:"),M=r(),m(w.$$.fragment)},l(v){y=i(v,"P",{});var J=s(y);D=l(J,"Examples:"),J.forEach(o),M=p(v),u(w.$$.fragment,v)},m(v,J){f(v,y,J),e(y,D),f(v,M,J),h(w,v,J),k=!0},p:w_,i(v){k||(g(w.$$.fragment,v),k=!0)},o(v){_(w.$$.fragment,v),k=!1},d(v){v&&o(y),v&&o(M),b(w,v)}}}function Py(B){let y,D,M,w,k;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"),D=a("Examples:"),M=r(),m(w.$$.fragment)},l(v){y=i(v,"P",{});var J=s(y);D=l(J,"Examples:"),J.forEach(o),M=p(v),u(w.$$.fragment,v)},m(v,J){f(v,y,J),e(y,D),f(v,M,J),h(w,v,J),k=!0},p:w_,i(v){k||(g(w.$$.fragment,v),k=!0)},o(v){_(w.$$.fragment,v),k=!1},d(v){v&&o(y),v&&o(M),b(w,v)}}}function Zy(B){let y,D,M,w,k;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"),D=a("Examples:"),M=r(),m(w.$$.fragment)},l(v){y=i(v,"P",{});var J=s(y);D=l(J,"Examples:"),J.forEach(o),M=p(v),u(w.$$.fragment,v)},m(v,J){f(v,y,J),e(y,D),f(v,M,J),h(w,v,J),k=!0},p:w_,i(v){k||(g(w.$$.fragment,v),k=!0)},o(v){_(w.$$.fragment,v),k=!1},d(v){v&&o(y),v&&o(M),b(w,v)}}}function jy(B){let y,D,M,w,k,v,J,De,ld,Ml,ke,rd,Dt,pd,dd,Il,Jn,cd,Tl,Ln,Ei,fd,xl,le,$e,Ji,kt,md,Li,ud,El,F,Si,hd,gd,Xi,_d,bd,Ui,vd,Jl,re,Pe,Di,$t,yd,ki,wd,Ll,Ze,pe,$i,Md,Id,Pt,Td,xd,Sn,Ed,Jd,de,Pi,Ld,Sd,Zt,Xd,Ud,Xn,Dd,Sl,ce,je,Zi,jt,kd,ji,$d,Xl,j,Pd,Wi,Zd,jd,Gi,Wd,Gd,Ci,Cd,Nd,Ni,Bd,Ad,Ul,Wt,Dl,fe,We,Bi,Gt,Rd,Ai,Vd,kl,Ge,Fd,Ri,zd,Yd,$l,Ct,Pl,me,Ce,Vi,Nt,Qd,Fi,qd,Zl,Ne,Hd,zi,Od,Kd,jl,Bt,Wl,ue,Be,Yi,At,ec,Qi,tc,Gl,Rt,oc,qi,nc,Cl,Vt,Nl,he,Ae,Hi,Ft,ic,Oi,sc,Bl,z,ac,zt,lc,rc,Un,pc,dc,Al,Dn,cc,Rl,Re,ge,fc,Ki,mc,uc,Yt,hc,gc,_c,Qt,bc,qt,vc,yc,Vl,_e,es,wc,Mc,ts,Ic,Tc,Fl,A,os,Ht,xc,Ec,ns,Ot,Jc,Lc,is,Kt,Sc,Xc,ss,eo,Uc,zl,be,Ve,as,to,Dc,ls,kc,Yl,kn,$c,Ql,$n,Pc,ql,W,Zc,rs,jc,Wc,ps,Gc,Cc,oo,ds,Nc,Bc,no,cs,Ac,Rc,Hl,R,Vc,fs,Fc,zc,ms,Yc,Qc,us,qc,Hc,Ol,Pn,Oc,Kl,io,er,Fe,Kc,hs,ef,tf,tr,so,or,ze,of,gs,nf,sf,nr,Y,af,_s,lf,rf,bs,pf,df,ir,V,cf,vs,ff,mf,ys,uf,hf,ws,gf,_f,sr,ao,ar,Zn,bf,lr,Ye,Ms,lo,Is,vf,yf,Ts,wf,Mf,xs,ro,Es,jn,M_,If,Js,Wn,I_,rr,Gn,Tf,pr,Qe,dr,ve,qe,Ls,po,xf,Ss,Ef,cr,Q,Jf,Cn,Lf,Sf,Nn,Xf,Uf,fr,Bn,Df,mr,co,ur,He,Xs,fo,Us,kf,$f,Ds,Pf,Zf,ks,mo,$s,Ps,T_,jf,Zs,js,x_,hr,Oe,gr,An,Wf,_r,uo,br,q,Gf,Ws,Cf,Nf,Gs,Bf,Af,vr,ye,Ke,Cs,ho,Rf,Ns,Vf,yr,H,Ff,Rn,zf,Yf,Bs,Qf,qf,wr,go,Mr,we,et,As,_o,Hf,Rs,Of,Ir,tt,Kf,Vn,em,tm,Tr,bo,xr,Fn,om,Er,vo,Jr,Me,ot,Vs,yo,nm,zn,im,Fs,sm,Lr,O,am,zs,lm,rm,Ys,pm,dm,Sr,wo,Xr,Ie,nt,Qs,Mo,cm,Yn,fm,qs,mm,Ur,Te,Hs,um,hm,Os,gm,_m,Dr,Io,kr,To,$r,xe,it,Ks,xo,bm,ea,vm,Pr,I,Eo,ym,ta,wm,Mm,Jo,Im,Qn,Tm,xm,Em,oa,Jm,Lm,Ee,Lo,na,Sm,Xm,qn,Um,Dm,So,ia,km,$m,Hn,Pm,Zm,Xo,sa,jm,Wm,On,Gm,Cm,aa,Nm,Bm,la,Uo,ra,Am,Rm,Kn,Vm,Fm,K,Do,zm,pa,Ym,Qm,st,qm,at,ko,Hm,$o,Om,da,Km,eu,tu,lt,Po,ou,Zo,nu,ca,iu,su,au,rt,jo,lu,G,ru,fa,pu,du,ma,cu,fu,ua,mu,uu,ha,hu,gu,_u,pt,Wo,bu,ga,vu,yu,dt,Go,wu,_a,Mu,Iu,ct,Co,Tu,ba,xu,Zr,Je,ft,va,No,Eu,ya,Ju,jr,T,Bo,Lu,wa,Su,Xu,Ao,Uu,ei,Du,ku,$u,Ma,Pu,Zu,Le,Ro,Ia,ju,Wu,ti,Gu,Cu,Vo,Ta,Nu,Bu,oi,Au,Ru,Fo,xa,Vu,Fu,ni,zu,Yu,Ea,Qu,qu,Ja,zo,La,Hu,Ou,ii,Ku,eh,ee,Yo,th,Sa,oh,nh,mt,ih,ut,Qo,sh,qo,ah,Xa,lh,rh,ph,ht,Ho,dh,Oo,ch,Ua,fh,mh,uh,gt,Ko,hh,C,gh,Da,_h,bh,ka,vh,yh,$a,wh,Mh,Pa,Ih,Th,xh,_t,en,Eh,Za,Jh,Lh,bt,tn,Sh,ja,Xh,Uh,vt,on,Dh,Wa,kh,Wr,Se,yt,Ga,nn,$h,Ca,Ph,Gr,x,sn,Zh,Na,jh,Wh,an,Gh,si,Ch,Nh,Bh,Ba,Ah,Rh,Xe,ln,Aa,Vh,Fh,ai,zh,Yh,rn,Ra,Qh,qh,li,Hh,Oh,pn,Va,Kh,eg,ri,tg,og,Fa,ng,ig,za,dn,Ya,sg,ag,pi,lg,rg,te,cn,pg,Qa,dg,cg,wt,fg,Mt,fn,mg,mn,ug,qa,hg,gg,_g,It,un,bg,hn,vg,Ha,yg,wg,Mg,Tt,gn,Ig,N,Tg,Oa,xg,Eg,Ka,Jg,Lg,el,Sg,Xg,tl,Ug,Dg,kg,xt,_n,$g,ol,Pg,Zg,Et,bn,jg,nl,Wg,Gg,Jt,vn,Cg,il,Ng,Cr,Ue,Lt,sl,yn,Bg,al,Ag,Nr,E,Rg,wn,Vg,Fg,ll,zg,Yg,rl,Qg,qg,pl,Hg,Og,dl,Kg,e_,cl,t_,o_,fl,n_,i_,ml,s_,a_,Mn,l_,r_,ul,p_,d_,hl,c_,f_,gl,m_,u_,In,h_,g_,Br,Tn,Ar;return v=new Z({}),kt=new Z({}),$t=new Z({}),jt=new Z({}),Wt=new P({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUwQXBpcCUyMGluc3RhbGwlMjBhY2NlbGVyYXRlJTBBcGlwJTIwaW5zdGFsbCUyMHNhZmV0ZW5zb3JzJTBBcGlwJTIwaW5zdGFsbCUyMGludmlzaWJsZS13YXRlcm1hcmslM0UlM0QwLjIuMA==",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
pip <span class="hljs-keyword">install</span> invisible-watermark&gt;=<span class="hljs-number">0.2</span>.<span class="hljs-number">0</span>`}}),Gt=new Z({}),Ct=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>]`}}),Nt=new Z({}),Bt=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>]`}}),At=new Z({}),Vt=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>]`}}),Ft=new Z({}),to=new Z({}),io=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>)`}}),so=new P({props:{code:"bl9zdGVwcyUyMCUzRCUyMDQwJTBBaGlnaF9ub2lzZV9mcmFjJTIwJTNEJTIwMC44",highlighted:`n_steps = <span class="hljs-number">40</span>
high_noise_frac = <span class="hljs-number">0.8</span>`}}),ao=new P({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMG1hamVzdGljJTIwbGlvbiUyMGp1bXBpbmclMjBmcm9tJTIwYSUyMGJpZyUyMHN0b25lJTIwYXQlMjBuaWdodCUyMiUwQSUwQWltYWdlJTIwJTNEJTIwYmFzZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0Rwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEbl9zdGVwcyUyQyUwQSUyMCUyMCUyMCUyMGRlbm9pc2luZ19lbmQlM0RoaWdoX25vaXNlX2ZyYWMlMkMlMEElMjAlMjAlMjAlMjBvdXRwdXRfdHlwZSUzRCUyMmxhdGVudCUyMiUyQyUwQSkuaW1hZ2VzJTBBaW1hZ2UlMjAlM0QlMjByZWZpbmVyKCUwQSUyMCUyMCUyMCUyMHByb21wdCUzRHByb21wdCUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0RuX3N0ZXBzJTJDJTBBJTIwJTIwJTIwJTIwZGVub2lzaW5nX3N0YXJ0JTNEaGlnaF9ub2lzZV9mcmFjJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0RpbWFnZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`prompt = <span class="hljs-string">&quot;A majestic lion jumping from a big stone at night&quot;</span>

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