import{S as Ih,i as kh,s as Jh,e as s,k as i,w as g,t as d,M as $h,c as o,d as a,m as l,a as r,x as _,h as p,b as n,N as I,f as ps,G as e,g as f,y as v,q as b,o as y,B as w,v as Zh,L as Uh}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as Gh}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as oe}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as at}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as re}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ah}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ch(ne){let m,J,M,u,$;return u=new at({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBTdGFibGVEaWZmdXNpb25BZGFwdGVyUGlwZWxpbmUlMkMlMjBUMklBZGFwdGVyJTBBJTBBaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmRpZmZ1c2VycyUyRmRvY3MtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZ0MmktYWRhcHRlciUyRmNvbG9yX3JlZi5wbmclMjIlMEEpJTBBJTBBY29sb3JfcGFsZXR0ZSUyMCUzRCUyMGltYWdlLnJlc2l6ZSgoOCUyQyUyMDgpKSUwQWNvbG9yX3BhbGV0dGUlMjAlM0QlMjBjb2xvcl9wYWxldHRlLnJlc2l6ZSgoNTEyJTJDJTIwNTEyKSUyQyUyMHJlc2FtcGxlJTNESW1hZ2UuUmVzYW1wbGluZy5ORUFSRVNUKSUwQSUwQWFkYXB0ZXIlMjAlM0QlMjBUMklBZGFwdGVyLmZyb21fcHJldHJhaW5lZCglMjJUZW5jZW50QVJDJTJGdDJpYWRhcHRlcl9jb2xvcl9zZDE0djElMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvbkFkYXB0ZXJQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyQ29tcFZpcyUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNCUyMiUyQyUwQSUyMCUyMCUyMCUyMGFkYXB0ZXIlM0RhZGFwdGVyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBKSUwQSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFvdXRfaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMkF0JTIwbmlnaHQlMkMlMjBnbG93aW5nJTIwY3ViZXMlMjBpbiUyMGZyb250JTIwb2YlMjB0aGUlMjBiZWFjaCUyMiUyQyUwQSUyMCUyMCUyMCUyMGltYWdlJTNEY29sb3JfcGFsZXR0ZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<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><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> StableDiffusionAdapterPipeline, T2IAdapter

<span class="hljs-meta">&gt;&gt;&gt; </span>image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_ref.png&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>color_palette = image.resize((<span class="hljs-number">8</span>, <span class="hljs-number">8</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>color_palette = color_palette.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>), resample=Image.Resampling.NEAREST)

<span class="hljs-meta">&gt;&gt;&gt; </span>adapter = T2IAdapter.from_pretrained(<span class="hljs-string">&quot;TencentARC/t2iadapter_color_sd14v1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionAdapterPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>,
<span class="hljs-meta">... </span>    adapter=adapter,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<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>out_image = pipe(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;At night, glowing cubes in front of the beach&quot;</span>,
<span class="hljs-meta">... </span>    image=color_palette,
<span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>]`}}),{c(){m=s("p"),J=d("Examples:"),M=i(),g(u.$$.fragment)},l(h){m=o(h,"P",{});var k=r(m);J=p(k,"Examples:"),k.forEach(a),M=l(h),_(u.$$.fragment,h)},m(h,k){f(h,m,k),e(m,J),f(h,M,k),v(u,h,k),$=!0},p:Uh,i(h){$||(b(u.$$.fragment,h),$=!0)},o(h){y(u.$$.fragment,h),$=!1},d(h){h&&a(m),h&&a(M),w(u,h)}}}function xh(ne){let m,J;return{c(){m=s("p"),J=d(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(M){m=o(M,"P",{});var u=r(m);J=p(u,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),u.forEach(a)},m(M,u){f(M,m,u),e(m,J)},d(M){M&&a(m)}}}function Dh(ne){let m,J,M,u,$;return u=new at({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",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> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<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>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`}}),{c(){m=s("p"),J=d("Examples:"),M=i(),g(u.$$.fragment)},l(h){m=o(h,"P",{});var k=r(m);J=p(k,"Examples:"),k.forEach(a),M=l(h),_(u.$$.fragment,h)},m(h,k){f(h,m,k),e(m,J),f(h,M,k),v(u,h,k),$=!0},p:Uh,i(h){$||(b(u.$$.fragment,h),$=!0)},o(h){y(u.$$.fragment,h),$=!1},d(h){h&&a(m),h&&a(M),w(u,h)}}}function Rh(ne){let m,J,M,u,$,h,k,cs,wn,Bo,z,ie,fs,st,Tn,hs,Mn,Wo,ot,rt,En,An,No,fa,Un,Fo,ha,In,Vo,ma,ms,kn,Qo,le,Jn,nt,$n,Zn,Xo,L,de,us,it,Gn,gs,Cn,Yo,pe,_s,H,vs,xn,Dn,bs,Rn,Sn,ua,jn,Pn,ys,q,ws,lt,Bn,Wn,Ts,Ms,Nn,Fn,ga,Vn,zo,O,ce,Es,dt,Qn,As,Xn,Lo,fe,Yn,Us,zn,Ln,Ho,he,pt,Hn,Is,qn,On,Kn,C,ei,ks,ti,ai,Js,si,oi,_a,ri,ni,qo,me,ii,ct,li,di,Oo,ft,Ko,va,ba,Jp,er,ya,pi,tr,ht,ar,wa,ci,sr,Ta,Ma,$p,or,Ea,fi,rr,mt,nr,Aa,hi,ir,ut,lr,Ua,Ia,Zp,dr,K,ue,$s,gt,mi,Zs,ui,pr,ge,gi,_t,_i,vi,cr,ee,_e,Gs,vt,bi,Cs,yi,fr,ve,xs,x,Ds,wi,Ti,Rs,Mi,Ei,Ss,Ai,Ui,js,Ii,ki,E,D,be,bt,Ji,$i,Zi,Ps,Gi,Ci,Bs,xi,Di,Ws,ka,ye,Gp,Ri,Ns,Ja,$a,Cp,Si,R,we,yt,ji,Pi,Bi,Fs,Wi,Ni,Vs,Fi,Vi,Qs,Za,Te,xp,Qi,Xs,Ga,Ca,Dp,Xi,S,Me,wt,Yi,zi,Li,Tt,Hi,Mt,qi,Oi,Ki,Ys,el,tl,zs,xa,Ee,Rp,al,Ls,Da,Ra,Sp,sl,j,Ae,Et,ol,rl,nl,Hs,il,ll,qs,dl,pl,Os,Sa,ja,jp,cl,Ks,Pa,Ba,Pp,fl,P,Ue,At,hl,ml,ul,eo,gl,_l,Ut,vl,It,bl,yl,wl,to,Wa,Na,Bp,Tl,ao,Fa,Va,Wp,Ml,B,Ie,kt,El,Al,Ul,so,Il,kl,Jt,Jl,$t,$l,Zl,Gl,oo,Qa,Xa,Np,Cl,ro,Ya,za,Fp,xl,W,Zt,Gt,Dl,Rl,no,Sl,jl,Ct,Pl,xt,Bl,Wl,Nl,io,La,Ha,Vp,Fl,lo,qa,Oa,Qp,Vl,N,po,Dt,Ql,Xl,hr,Yl,mr,zl,ur,Ll,F,co,Rt,Hl,ql,gr,Ol,_r,Kl,vr,ed,V,fo,St,td,ad,br,sd,yr,od,wr,rd,Q,ho,jt,nd,id,Tr,ld,Mr,dd,Er,Ar,te,ke,mo,Pt,pd,uo,cd,Ur,Bt,go,fd,hd,Ir,Ka,md,kr,Wt,Jr,es,ud,$r,Je,ts,Xp,gd,as,Yp,Zr,Nt,_o,_d,vd,Gr,Ft,vo,bd,yd,Cr,Vt,xr,ss,os,zp,Dr,ae,$e,bo,Qt,wd,yo,Td,Rr,Ze,Md,Xt,Ed,Ad,Sr,se,Ge,wo,Yt,Ud,To,Id,jr,T,zt,kd,rs,Jd,Lt,$d,Zd,Ht,Gd,ns,Cd,xd,Dd,X,qt,Rd,Mo,Sd,jd,Ce,Pd,xe,Ot,Bd,Eo,Wd,Nd,De,Kt,Fd,ea,Vd,Ao,Qd,Xd,Yd,Re,ta,zd,Uo,Ld,Hd,Se,aa,qd,sa,Od,Io,Kd,ep,tp,G,oa,ap,ra,sp,na,op,rp,np,je,ip,Pe,lp,Be,ia,dp,la,pp,da,cp,fp,hp,We,pa,mp,Z,up,ko,gp,_p,Jo,vp,bp,$o,yp,wp,Zo,Tp,Mp,Pr;return h=new re({}),st=new re({}),it=new re({}),dt=new re({}),ft=new at({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEElMEFpbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGZGlmZnVzZXJzJTJGZG9jcy1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRnQyaS1hZGFwdGVyJTJGY29sb3JfcmVmLnBuZyUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

image = load_image(<span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_ref.png&quot;</span>)`}}),ht=new at({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBJTBBY29sb3JfcGFsZXR0ZSUyMCUzRCUyMGltYWdlLnJlc2l6ZSgoOCUyQyUyMDgpKSUwQWNvbG9yX3BhbGV0dGUlMjAlM0QlMjBjb2xvcl9wYWxldHRlLnJlc2l6ZSgoNTEyJTJDJTIwNTEyKSUyQyUyMHJlc2FtcGxlJTNESW1hZ2UuUmVzYW1wbGluZy5ORUFSRVNUKQ==",highlighted:`<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

color_palette = image.resize((<span class="hljs-number">8</span>, <span class="hljs-number">8</span>))
color_palette = color_palette.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>), resample=Image.Resampling.NEAREST)`}}),mt=new at({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uQWRhcHRlclBpcGVsaW5lJTJDJTIwVDJJQWRhcHRlciUwQSUwQWFkYXB0ZXIlMjAlM0QlMjBUMklBZGFwdGVyLmZyb21fcHJldHJhaW5lZCglMjJUZW5jZW50QVJDJTJGdDJpYWRhcHRlcl9jb2xvcl9zZDE0djElMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvbkFkYXB0ZXJQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyQ29tcFZpcyUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNCUyMiUyQyUwQSUyMCUyMCUyMCUyMGFkYXB0ZXIlM0RhZGFwdGVyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBKSUwQXBpcGUudG8oJTIyY3VkYSUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionAdapterPipeline, T2IAdapter

adapter = T2IAdapter.from_pretrained(<span class="hljs-string">&quot;TencentARC/t2iadapter_color_sd14v1&quot;</span>, torch_dtype=torch.float16)
pipe = StableDiffusionAdapterPipeline.from_pretrained(
    <span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>,
    adapter=adapter,
    torch_dtype=torch.float16,
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),ut=new at({props:{code:"JTIzJTIwZml4JTIwdGhlJTIwcmFuZG9tJTIwc2VlZCUyQyUyMHNvJTIweW91JTIwd2lsbCUyMGdldCUyMHRoZSUyMHNhbWUlMjByZXN1bHQlMjBhcyUyMHRoZSUyMGV4YW1wbGUlMEFnZW5lcmF0b3IlMjAlM0QlMjB0b3JjaC5tYW51YWxfc2VlZCg3KSUwQSUwQW91dF9pbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwJTIyQXQlMjBuaWdodCUyQyUyMGdsb3dpbmclMjBjdWJlcyUyMGluJTIwZnJvbnQlMjBvZiUyMHRoZSUyMGJlYWNoJTIyJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0Rjb2xvcl9wYWxldHRlJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBKS5pbWFnZXMlNUIwJTVE",highlighted:`<span class="hljs-comment"># fix the random seed, so you will get the same result as the example</span>
generator = torch.manual_seed(<span class="hljs-number">7</span>)

out_image = pipe(
    <span class="hljs-string">&quot;At night, glowing cubes in front of the beach&quot;</span>,
    image=color_palette,
    generator=generator,
).images[<span class="hljs-number">0</span>]`}}),gt=new re({}),vt=new re({}),Pt=new re({}),Wt=new at({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQWNvbmRfa2V5cG9zZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGZGlmZnVzZXJzJTJGZG9jcy1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRnQyaS1hZGFwdGVyJTJGa2V5cG9zZV9zYW1wbGVfaW5wdXQucG5nJTIyJTBBKSUwQWNvbmRfZGVwdGglMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmRpZmZ1c2VycyUyRmRvY3MtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZ0MmktYWRhcHRlciUyRmRlcHRoX3NhbXBsZV9pbnB1dC5wbmclMjIlMEEpJTBBY29uZCUyMCUzRCUyMCU1QiU1QmNvbmRfa2V5cG9zZSUyQyUyMGNvbmRfZGVwdGglNUQlNUQlMEElMEFwcm9tcHQlMjAlM0QlMjAlNUIlMjJBJTIwbWFuJTIwd2Fsa2luZyUyMGluJTIwYW4lMjBvZmZpY2UlMjByb29tJTIwd2l0aCUyMGElMjBuaWNlJTIwdmlldyUyMiU1RA==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

cond_keypose = load_image(
    <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/keypose_sample_input.png&quot;</span>
)
cond_depth = load_image(
    <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/depth_sample_input.png&quot;</span>
)
cond = [[cond_keypose, cond_depth]]

prompt = [<span class="hljs-string">&quot;A man walking in an office room with a nice view&quot;</span>]`}}),Vt=new at({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkFkYXB0ZXJQaXBlbGluZSUyQyUyME11bHRpQWRhcHRlciUwQSUwQWFkYXB0ZXJzJTIwJTNEJTIwTXVsdGlBZGFwdGVyKCUwQSUyMCUyMCUyMCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMFQySUFkYXB0ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMlRlbmNlbnRBUkMlMkZ0MmlhZGFwdGVyX2tleXBvc2Vfc2QxNHYxJTIyKSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMFQySUFkYXB0ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMlRlbmNlbnRBUkMlMkZ0MmlhZGFwdGVyX2RlcHRoX3NkMTR2MSUyMiklMkMlMEElMjAlMjAlMjAlMjAlNUQlMEEpJTBBYWRhcHRlcnMlMjAlM0QlMjBhZGFwdGVycy50byh0b3JjaC5mbG9hdDE2KSUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25BZGFwdGVyUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTQlMjIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMEElMjAlMjAlMjAlMjBhZGFwdGVyJTNEYWRhcHRlcnMlMkMlMEEpJTBBJTBBaW1hZ2VzJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBjb25kJTJDJTIwYWRhcHRlcl9jb25kaXRpb25pbmdfc2NhbGUlM0QlNUIwLjglMkMlMjAwLjglNUQp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionAdapterPipeline, MultiAdapter

adapters = MultiAdapter(
    [
        T2IAdapter.from_pretrained(<span class="hljs-string">&quot;TencentARC/t2iadapter_keypose_sd14v1&quot;</span>),
        T2IAdapter.from_pretrained(<span class="hljs-string">&quot;TencentARC/t2iadapter_depth_sd14v1&quot;</span>),
    ]
)
adapters = adapters.to(torch.float16)

pipe = StableDiffusionAdapterPipeline.from_pretrained(
    <span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>,
    torch_dtype=torch.float16,
    adapter=adapters,
)

images = pipe(prompt, cond, adapter_conditioning_scale=[<span class="hljs-number">0.8</span>, <span class="hljs-number">0.8</span>])`}}),Qt=new re({}),Yt=new re({}),zt=new oe({props:{name:"class diffusers.StableDiffusionAdapterPipeline",anchor:"diffusers.StableDiffusionAdapterPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"adapter",val:": typing.Union[diffusers.models.adapter.T2IAdapter, diffusers.models.adapter.MultiAdapter, typing.List[diffusers.models.adapter.T2IAdapter]]"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPFeatureExtractor"},{name:"adapter_weights",val:": typing.Optional[typing.List[float]] = None"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionAdapterPipeline.adapter",description:`<strong>adapter</strong> (<code>T2IAdapter</code> or <code>MultiAdapter</code> or <code>List[T2IAdapter]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple Adapter as a
list, the outputs from each Adapter are added together to create one combined additional conditioning.`,name:"adapter"},{anchor:"diffusers.StableDiffusionAdapterPipeline.adapter_weights",description:`<strong>adapter_weights</strong> (<code>List[float]</code>, <em>optional</em>, defaults to None) &#x2014;
List of floats representing the weight which will be multiply to each adapter&#x2019;s output before adding them
together.`,name:"adapter_weights"},{anchor:"diffusers.StableDiffusionAdapterPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionAdapterPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion 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.StableDiffusionAdapterPipeline.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.StableDiffusionAdapterPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionAdapterPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionAdapterPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionAdapterPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py#L119"}}),qt=new oe({props:{name:"__call__",anchor:"diffusers.StableDiffusionAdapterPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[torch.Tensor, PIL.Image.Image, typing.List[PIL.Image.Image]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"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:"adapter_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 1.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>List[torch.FloatTensor]</code> or <code>List[PIL.Image.Image]</code> or <code>List[List[PIL.Image.Image]]</code>) &#x2014;
The Adapter input condition. Adapter uses this input condition to generate guidance to Unet. If the
type is specified as <code>Torch.FloatTensor</code>, it is passed to Adapter as is. PIL.Image.Image\` can also be
accepted as an image. The control image is automatically resized to fit the output image.`,name:"image"},{anchor:"diffusers.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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. 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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipelineOutput</code> instead
of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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>AttnProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionAdapterPipeline.__call__.adapter_conditioning_scale",description:`<strong>adapter_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the adapter are multiplied by <code>adapter_conditioning_scale</code> before they are added to the
residual in the original unet. If multiple adapters are specified in init, you can set the
corresponding scale as a list.`,name:"adapter_conditioning_scale"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py#L542",returnDescription:`
<p><code>~pipelines.stable_diffusion.StableDiffusionAdapterPipelineOutput</code> if <code>return_dict</code> is True, otherwise a
<code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><code>~pipelines.stable_diffusion.StableDiffusionAdapterPipelineOutput</code> or <code>tuple</code></p>
`}}),Ce=new Ah({props:{anchor:"diffusers.StableDiffusionAdapterPipeline.__call__.example",$$slots:{default:[Ch]},$$scope:{ctx:ne}}}),Ot=new oe({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionAdapterPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionAdapterPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1669"}}),Kt=new oe({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionAdapterPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1684"}}),ta=new oe({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionAdapterPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py#L204"}}),aa=new oe({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionAdapterPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py#L212"}}),oa=new oe({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionAdapterPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionAdapterPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1608"}}),je=new Gh({props:{warning:!0,$$slots:{default:[xh]},$$scope:{ctx:ne}}}),Pe=new Ah({props:{anchor:"diffusers.StableDiffusionAdapterPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Dh]},$$scope:{ctx:ne}}}),ia=new oe({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionAdapterPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1643"}}),pa=new oe({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionAdapterPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py#L219"}}),{c(){m=s("meta"),J=i(),M=s("h1"),u=s("a"),$=s("span"),g(h.$$.fragment),k=i(),cs=s("span"),wn=d("Text-to-Image Generation with Adapter Conditioning"),Bo=i(),z=s("h2"),ie=s("a"),fs=s("span"),g(st.$$.fragment),Tn=i(),hs=s("span"),Mn=d("Overview"),Wo=i(),ot=s("p"),rt=s("a"),En=d("T2I-Adapter: Learning Adapters to Dig out More Controllable Ability for Text-to-Image Diffusion Models"),An=d(" by Chong Mou, Xintao Wang, Liangbin Xie, Jian Zhang, Zhongang Qi, Ying Shan, Xiaohu Qie."),No=i(),fa=s("p"),Un=d("Using the pretrained models we can provide control images (for example, a depth map) to control Stable Diffusion text-to-image generation so that it follows the structure of the depth image and fills in the details."),Fo=i(),ha=s("p"),In=d("The abstract of the paper is the following:"),Vo=i(),ma=s("p"),ms=s("em"),kn=d("The incredible generative ability of large-scale text-to-image (T2I) models has demonstrated strong power of learning complex structures and meaningful semantics. However, relying solely on text prompts cannot fully take advantage of the knowledge learned by the model, especially when flexible and accurate structure control is needed. In this paper, we aim to \u201Cdig out\u201D the capabilities that T2I models have implicitly learned, and then explicitly use them to control the generation more granularly. Specifically, we propose to learn simple and small T2I-Adapters to align internal knowledge in T2I models with external control signals, while freezing the original large T2I models. In this way, we can train various adapters according to different conditions, and achieve rich control and editing effects. Further, the proposed T2I-Adapters have attractive properties of practical value, such as composability and generalization ability. Extensive experiments demonstrate that our T2I-Adapter has promising generation quality and a wide range of applications."),Qo=i(),le=s("p"),Jn=d("This model was contributed by the community contributor "),nt=s("a"),$n=d("HimariO"),Zn=d(" \u2764\uFE0F ."),Xo=i(),L=s("h2"),de=s("a"),us=s("span"),g(it.$$.fragment),Gn=i(),gs=s("span"),Cn=d("Available Pipelines:"),Yo=i(),pe=s("table"),_s=s("thead"),H=s("tr"),vs=s("th"),xn=d("Pipeline"),Dn=i(),bs=s("th"),Rn=d("Tasks"),Sn=i(),ua=s("th"),jn=d("Demo"),Pn=i(),ys=s("tbody"),q=s("tr"),ws=s("td"),lt=s("a"),Bn=d("StableDiffusionAdapterPipeline"),Wn=i(),Ts=s("td"),Ms=s("em"),Nn=d("Text-to-Image Generation with T2I-Adapter Conditioning"),Fn=i(),ga=s("td"),Vn=d("-"),zo=i(),O=s("h2"),ce=s("a"),Es=s("span"),g(dt.$$.fragment),Qn=i(),As=s("span"),Xn=d("Usage example"),Lo=i(),fe=s("p"),Yn=d("In the following we give a simple example of how to use a "),Us=s("em"),zn=d("T2IAdapter"),Ln=d(` checkpoint with Diffusers for inference.
All adapters use the same pipeline.`),Ho=i(),he=s("ol"),pt=s("li"),Hn=d("Images are first converted into the appropriate "),Is=s("em"),qn=d("control image"),On=d(" format."),Kn=i(),C=s("li"),ei=d("The "),ks=s("em"),ti=d("control image"),ai=d(" and "),Js=s("em"),si=d("prompt"),oi=d(" are passed to the "),_a=s("a"),ri=d("StableDiffusionAdapterPipeline"),ni=d("."),qo=i(),me=s("p"),ii=d("Let\u2019s have a look at a simple example using the "),ct=s("a"),li=d("Color Adapter"),di=d("."),Oo=i(),g(ft.$$.fragment),Ko=i(),va=s("p"),ba=s("img"),er=i(),ya=s("p"),pi=d("Then we can create our color palette by simply resizing it to 8 by 8 pixels and then scaling it back to original size."),tr=i(),g(ht.$$.fragment),ar=i(),wa=s("p"),ci=d("Let\u2019s take a look at the processed image."),sr=i(),Ta=s("p"),Ma=s("img"),or=i(),Ea=s("p"),fi=d("Next, create the adapter pipeline"),rr=i(),g(mt.$$.fragment),nr=i(),Aa=s("p"),hi=d("Finally, pass the prompt and control image to the pipeline"),ir=i(),g(ut.$$.fragment),lr=i(),Ua=s("p"),Ia=s("img"),dr=i(),K=s("h2"),ue=s("a"),$s=s("span"),g(gt.$$.fragment),mi=i(),Zs=s("span"),ui=d("Available checkpoints"),pr=i(),ge=s("p"),gi=d("Non-diffusers checkpoints can be found under "),_t=s("a"),_i=d("TencentARC/T2I-Adapter"),vi=d("."),cr=i(),ee=s("h3"),_e=s("a"),Gs=s("span"),g(vt.$$.fragment),bi=i(),Cs=s("span"),yi=d("T2I-Adapter with Stable Diffusion 1.4"),fr=i(),ve=s("table"),xs=s("thead"),x=s("tr"),Ds=s("th"),wi=d("Model Name"),Ti=i(),Rs=s("th"),Mi=d("Control Image Overview"),Ei=i(),Ss=s("th"),Ai=d("Control Image Example"),Ui=i(),js=s("th"),Ii=d("Generated Image Example"),ki=i(),E=s("tbody"),D=s("tr"),be=s("td"),bt=s("a"),Ji=d("TencentARC/t2iadapter_color_sd14v1"),$i=s("br"),Zi=i(),Ps=s("em"),Gi=d("Trained with spatial color palette"),Ci=i(),Bs=s("td"),xi=d("A image with 8x8 color palette."),Di=i(),Ws=s("td"),ka=s("a"),ye=s("img"),Ri=i(),Ns=s("td"),Ja=s("a"),$a=s("img"),Si=i(),R=s("tr"),we=s("td"),yt=s("a"),ji=d("TencentARC/t2iadapter_canny_sd14v1"),Pi=s("br"),Bi=i(),Fs=s("em"),Wi=d("Trained with canny edge detection"),Ni=i(),Vs=s("td"),Fi=d("A monochrome image with white edges on a black background."),Vi=i(),Qs=s("td"),Za=s("a"),Te=s("img"),Qi=i(),Xs=s("td"),Ga=s("a"),Ca=s("img"),Xi=i(),S=s("tr"),Me=s("td"),wt=s("a"),Yi=d("TencentARC/t2iadapter_sketch_sd14v1"),zi=s("br"),Li=i(),Tt=s("em"),Hi=d("Trained with "),Mt=s("a"),qi=d("PidiNet"),Oi=d(" edge detection"),Ki=i(),Ys=s("td"),el=d("A hand-drawn monochrome image with white outlines on a black background."),tl=i(),zs=s("td"),xa=s("a"),Ee=s("img"),al=i(),Ls=s("td"),Da=s("a"),Ra=s("img"),sl=i(),j=s("tr"),Ae=s("td"),Et=s("a"),ol=d("TencentARC/t2iadapter_depth_sd14v1"),rl=s("br"),nl=i(),Hs=s("em"),il=d("Trained with Midas depth estimation"),ll=i(),qs=s("td"),dl=d("A grayscale image with black representing deep areas and white representing shallow areas."),pl=i(),Os=s("td"),Sa=s("a"),ja=s("img"),cl=i(),Ks=s("td"),Pa=s("a"),Ba=s("img"),fl=i(),P=s("tr"),Ue=s("td"),At=s("a"),hl=d("TencentARC/t2iadapter_openpose_sd14v1"),ml=s("br"),ul=i(),eo=s("em"),gl=d("Trained with OpenPose bone image"),_l=i(),Ut=s("td"),vl=d("A "),It=s("a"),bl=d("OpenPose bone"),yl=d(" image."),wl=i(),to=s("td"),Wa=s("a"),Na=s("img"),Tl=i(),ao=s("td"),Fa=s("a"),Va=s("img"),Ml=i(),B=s("tr"),Ie=s("td"),kt=s("a"),El=d("TencentARC/t2iadapter_keypose_sd14v1"),Al=s("br"),Ul=i(),so=s("em"),Il=d("Trained with mmpose skeleton image"),kl=i(),Jt=s("td"),Jl=d("A "),$t=s("a"),$l=d("mmpose skeleton"),Zl=d(" image."),Gl=i(),oo=s("td"),Qa=s("a"),Xa=s("img"),Cl=i(),ro=s("td"),Ya=s("a"),za=s("img"),xl=i(),W=s("tr"),Zt=s("td"),Gt=s("a"),Dl=d("TencentARC/t2iadapter_seg_sd14v1"),Rl=s("br"),no=s("em"),Sl=d("Trained with semantic segmentation"),jl=i(),Ct=s("td"),Pl=d("An "),xt=s("a"),Bl=d("custom"),Wl=d(" segmentation protocol image."),Nl=i(),io=s("td"),La=s("a"),Ha=s("img"),Fl=i(),lo=s("td"),qa=s("a"),Oa=s("img"),Vl=i(),N=s("tr"),po=s("td"),Dt=s("a"),Ql=d("TencentARC/t2iadapter_canny_sd15v2"),Xl=i(),hr=s("td"),Yl=i(),mr=s("td"),zl=i(),ur=s("td"),Ll=i(),F=s("tr"),co=s("td"),Rt=s("a"),Hl=d("TencentARC/t2iadapter_depth_sd15v2"),ql=i(),gr=s("td"),Ol=i(),_r=s("td"),Kl=i(),vr=s("td"),ed=i(),V=s("tr"),fo=s("td"),St=s("a"),td=d("TencentARC/t2iadapter_sketch_sd15v2"),ad=i(),br=s("td"),sd=i(),yr=s("td"),od=i(),wr=s("td"),rd=i(),Q=s("tr"),ho=s("td"),jt=s("a"),nd=d("TencentARC/t2iadapter_zoedepth_sd15v1"),id=i(),Tr=s("td"),ld=i(),Mr=s("td"),dd=i(),Er=s("td"),Ar=i(),te=s("h2"),ke=s("a"),mo=s("span"),g(Pt.$$.fragment),pd=i(),uo=s("span"),cd=d("Combining multiple adapters"),Ur=i(),Bt=s("p"),go=s("code"),fd=d("MultiAdapter"),hd=d(" can be used for applying multiple conditionings at once."),Ir=i(),Ka=s("p"),md=d("Here we use the keypose adapter for the character posture and the depth adapter for creating the scene."),kr=i(),g(Wt.$$.fragment),Jr=i(),es=s("p"),ud=d("The two control images look as such:"),$r=i(),Je=s("p"),ts=s("img"),gd=i(),as=s("img"),Zr=i(),Nt=s("p"),_o=s("code"),_d=d("MultiAdapter"),vd=d(" combines keypose and depth adapters."),Gr=i(),Ft=s("p"),vo=s("code"),bd=d("adapter_conditioning_scale"),yd=d(" balances the relative influence of the different adapters."),Cr=i(),g(Vt.$$.fragment),xr=i(),ss=s("p"),os=s("img"),Dr=i(),ae=s("h2"),$e=s("a"),bo=s("span"),g(Qt.$$.fragment),wd=i(),yo=s("span"),Td=d("T2I Adapter vs ControlNet"),Rr=i(),Ze=s("p"),Md=d("T2I-Adapter is similar to "),Xt=s("a"),Ed=d("ControlNet"),Ad=d(`.
T2i-Adapter uses a smaller auxiliary network which is only run once for the entire diffusion process.
However, T2I-Adapter performs slightly worse than ControlNet.`),Sr=i(),se=s("h2"),Ge=s("a"),wo=s("span"),g(Yt.$$.fragment),Ud=i(),To=s("span"),Id=d("StableDiffusionAdapterPipeline"),jr=i(),T=s("div"),g(zt.$$.fragment),kd=i(),rs=s("p"),Jd=d(`Pipeline for text-to-image generation using Stable Diffusion augmented with T2I-Adapter
`),Lt=s("a"),$d=d("https://arxiv.org/abs/2302.08453"),Zd=i(),Ht=s("p"),Gd=d("This model inherits from "),ns=s("a"),Cd=d("DiffusionPipeline"),xd=d(`. 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.)`),Dd=i(),X=s("div"),g(qt.$$.fragment),Rd=i(),Mo=s("p"),Sd=d("Function invoked when calling the pipeline for generation."),jd=i(),g(Ce.$$.fragment),Pd=i(),xe=s("div"),g(Ot.$$.fragment),Bd=i(),Eo=s("p"),Wd=d(`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. This is useful to save some memory in exchange for a small
speed decrease.`),Nd=i(),De=s("div"),g(Kt.$$.fragment),Fd=i(),ea=s("p"),Vd=d("Disable sliced attention computation. If "),Ao=s("code"),Qd=d("enable_attention_slicing"),Xd=d(` was previously called, attention is
computed in one step.`),Yd=i(),Re=s("div"),g(ta.$$.fragment),zd=i(),Uo=s("p"),Ld=d(`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.`),Hd=i(),Se=s("div"),g(aa.$$.fragment),qd=i(),sa=s("p"),Od=d("Disable sliced VAE decoding. If "),Io=s("code"),Kd=d("enable_vae_slicing"),ep=d(` was previously enabled, this method will go back to
computing decoding in one step.`),tp=i(),G=s("div"),g(oa.$$.fragment),ap=i(),ra=s("p"),sp=d("Enable memory efficient attention from "),na=s("a"),op=d("xFormers"),rp=d(`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),np=i(),g(je.$$.fragment),ip=i(),g(Pe.$$.fragment),lp=i(),Be=s("div"),g(ia.$$.fragment),dp=i(),la=s("p"),pp=d("Disable memory efficient attention from "),da=s("a"),cp=d("xFormers"),fp=d("."),hp=i(),We=s("div"),g(pa.$$.fragment),mp=i(),Z=s("p"),up=d(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ko=s("code"),gp=d("enable_sequential_cpu_offload"),_p=d(", this method moves one whole model at a time to the GPU when its "),Jo=s("code"),vp=d("forward"),bp=d(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),$o=s("code"),yp=d("enable_sequential_cpu_offload"),wp=d(", but performance is much better due to the iterative execution of the "),Zo=s("code"),Tp=d("unet"),Mp=d("."),this.h()},l(t){const c=$h('[data-svelte="svelte-1phssyn"]',document.head);m=o(c,"META",{name:!0,content:!0}),c.forEach(a),J=l(t),M=o(t,"H1",{class:!0});var ca=r(M);u=o(ca,"A",{id:!0,class:!0,href:!0});var Go=r(u);$=o(Go,"SPAN",{});var Co=r($);_(h.$$.fragment,Co),Co.forEach(a),Go.forEach(a),k=l(ca),cs=o(ca,"SPAN",{});var Lp=r(cs);wn=p(Lp,"Text-to-Image Generation with Adapter Conditioning"),Lp.forEach(a),ca.forEach(a),Bo=l(t),z=o(t,"H2",{class:!0});var Br=r(z);ie=o(Br,"A",{id:!0,class:!0,href:!0});var Hp=r(ie);fs=o(Hp,"SPAN",{});var qp=r(fs);_(st.$$.fragment,qp),qp.forEach(a),Hp.forEach(a),Tn=l(Br),hs=o(Br,"SPAN",{});var Op=r(hs);Mn=p(Op,"Overview"),Op.forEach(a),Br.forEach(a),Wo=l(t),ot=o(t,"P",{});var Ep=r(ot);rt=o(Ep,"A",{href:!0,rel:!0});var Kp=r(rt);En=p(Kp,"T2I-Adapter: Learning Adapters to Dig out More Controllable Ability for Text-to-Image Diffusion Models"),Kp.forEach(a),An=p(Ep," by Chong Mou, Xintao Wang, Liangbin Xie, Jian Zhang, Zhongang Qi, Ying Shan, Xiaohu Qie."),Ep.forEach(a),No=l(t),fa=o(t,"P",{});var ec=r(fa);Un=p(ec,"Using the pretrained models we can provide control images (for example, a depth map) to control Stable Diffusion text-to-image generation so that it follows the structure of the depth image and fills in the details."),ec.forEach(a),Fo=l(t),ha=o(t,"P",{});var tc=r(ha);In=p(tc,"The abstract of the paper is the following:"),tc.forEach(a),Vo=l(t),ma=o(t,"P",{});var ac=r(ma);ms=o(ac,"EM",{});var sc=r(ms);kn=p(sc,"The incredible generative ability of large-scale text-to-image (T2I) models has demonstrated strong power of learning complex structures and meaningful semantics. However, relying solely on text prompts cannot fully take advantage of the knowledge learned by the model, especially when flexible and accurate structure control is needed. In this paper, we aim to \u201Cdig out\u201D the capabilities that T2I models have implicitly learned, and then explicitly use them to control the generation more granularly. Specifically, we propose to learn simple and small T2I-Adapters to align internal knowledge in T2I models with external control signals, while freezing the original large T2I models. In this way, we can train various adapters according to different conditions, and achieve rich control and editing effects. Further, the proposed T2I-Adapters have attractive properties of practical value, such as composability and generalization ability. Extensive experiments demonstrate that our T2I-Adapter has promising generation quality and a wide range of applications."),sc.forEach(a),ac.forEach(a),Qo=l(t),le=o(t,"P",{});var Wr=r(le);Jn=p(Wr,"This model was contributed by the community contributor "),nt=o(Wr,"A",{href:!0,rel:!0});var oc=r(nt);$n=p(oc,"HimariO"),oc.forEach(a),Zn=p(Wr," \u2764\uFE0F ."),Wr.forEach(a),Xo=l(t),L=o(t,"H2",{class:!0});var Nr=r(L);de=o(Nr,"A",{id:!0,class:!0,href:!0});var rc=r(de);us=o(rc,"SPAN",{});var nc=r(us);_(it.$$.fragment,nc),nc.forEach(a),rc.forEach(a),Gn=l(Nr),gs=o(Nr,"SPAN",{});var ic=r(gs);Cn=p(ic,"Available Pipelines:"),ic.forEach(a),Nr.forEach(a),Yo=l(t),pe=o(t,"TABLE",{});var Fr=r(pe);_s=o(Fr,"THEAD",{});var lc=r(_s);H=o(lc,"TR",{});var is=r(H);vs=o(is,"TH",{});var dc=r(vs);xn=p(dc,"Pipeline"),dc.forEach(a),Dn=l(is),bs=o(is,"TH",{});var pc=r(bs);Rn=p(pc,"Tasks"),pc.forEach(a),Sn=l(is),ua=o(is,"TH",{align:!0});var cc=r(ua);jn=p(cc,"Demo"),cc.forEach(a),is.forEach(a),lc.forEach(a),Pn=l(Fr),ys=o(Fr,"TBODY",{});var fc=r(ys);q=o(fc,"TR",{});var ls=r(q);ws=o(ls,"TD",{});var hc=r(ws);lt=o(hc,"A",{href:!0,rel:!0});var mc=r(lt);Bn=p(mc,"StableDiffusionAdapterPipeline"),mc.forEach(a),hc.forEach(a),Wn=l(ls),Ts=o(ls,"TD",{});var uc=r(Ts);Ms=o(uc,"EM",{});var gc=r(Ms);Nn=p(gc,"Text-to-Image Generation with T2I-Adapter Conditioning"),gc.forEach(a),uc.forEach(a),Fn=l(ls),ga=o(ls,"TD",{align:!0});var _c=r(ga);Vn=p(_c,"-"),_c.forEach(a),ls.forEach(a),fc.forEach(a),Fr.forEach(a),zo=l(t),O=o(t,"H2",{class:!0});var Vr=r(O);ce=o(Vr,"A",{id:!0,class:!0,href:!0});var vc=r(ce);Es=o(vc,"SPAN",{});var bc=r(Es);_(dt.$$.fragment,bc),bc.forEach(a),vc.forEach(a),Qn=l(Vr),As=o(Vr,"SPAN",{});var yc=r(As);Xn=p(yc,"Usage example"),yc.forEach(a),Vr.forEach(a),Lo=l(t),fe=o(t,"P",{});var Qr=r(fe);Yn=p(Qr,"In the following we give a simple example of how to use a "),Us=o(Qr,"EM",{});var wc=r(Us);zn=p(wc,"T2IAdapter"),wc.forEach(a),Ln=p(Qr,` checkpoint with Diffusers for inference.
All adapters use the same pipeline.`),Qr.forEach(a),Ho=l(t),he=o(t,"OL",{});var Xr=r(he);pt=o(Xr,"LI",{});var Yr=r(pt);Hn=p(Yr,"Images are first converted into the appropriate "),Is=o(Yr,"EM",{});var Tc=r(Is);qn=p(Tc,"control image"),Tc.forEach(a),On=p(Yr," format."),Yr.forEach(a),Kn=l(Xr),C=o(Xr,"LI",{});var Ne=r(C);ei=p(Ne,"The "),ks=o(Ne,"EM",{});var Mc=r(ks);ti=p(Mc,"control image"),Mc.forEach(a),ai=p(Ne," and "),Js=o(Ne,"EM",{});var Ec=r(Js);si=p(Ec,"prompt"),Ec.forEach(a),oi=p(Ne," are passed to the "),_a=o(Ne,"A",{href:!0});var Ac=r(_a);ri=p(Ac,"StableDiffusionAdapterPipeline"),Ac.forEach(a),ni=p(Ne,"."),Ne.forEach(a),Xr.forEach(a),qo=l(t),me=o(t,"P",{});var zr=r(me);ii=p(zr,"Let\u2019s have a look at a simple example using the "),ct=o(zr,"A",{href:!0,rel:!0});var Uc=r(ct);li=p(Uc,"Color Adapter"),Uc.forEach(a),di=p(zr,"."),zr.forEach(a),Oo=l(t),_(ft.$$.fragment,t),Ko=l(t),va=o(t,"P",{});var Ic=r(va);ba=o(Ic,"IMG",{src:!0,alt:!0}),Ic.forEach(a),er=l(t),ya=o(t,"P",{});var kc=r(ya);pi=p(kc,"Then we can create our color palette by simply resizing it to 8 by 8 pixels and then scaling it back to original size."),kc.forEach(a),tr=l(t),_(ht.$$.fragment,t),ar=l(t),wa=o(t,"P",{});var Jc=r(wa);ci=p(Jc,"Let\u2019s take a look at the processed image."),Jc.forEach(a),sr=l(t),Ta=o(t,"P",{});var $c=r(Ta);Ma=o($c,"IMG",{src:!0,alt:!0}),$c.forEach(a),or=l(t),Ea=o(t,"P",{});var Zc=r(Ea);fi=p(Zc,"Next, create the adapter pipeline"),Zc.forEach(a),rr=l(t),_(mt.$$.fragment,t),nr=l(t),Aa=o(t,"P",{});var Gc=r(Aa);hi=p(Gc,"Finally, pass the prompt and control image to the pipeline"),Gc.forEach(a),ir=l(t),_(ut.$$.fragment,t),lr=l(t),Ua=o(t,"P",{});var Cc=r(Ua);Ia=o(Cc,"IMG",{src:!0,alt:!0}),Cc.forEach(a),dr=l(t),K=o(t,"H2",{class:!0});var Lr=r(K);ue=o(Lr,"A",{id:!0,class:!0,href:!0});var xc=r(ue);$s=o(xc,"SPAN",{});var Dc=r($s);_(gt.$$.fragment,Dc),Dc.forEach(a),xc.forEach(a),mi=l(Lr),Zs=o(Lr,"SPAN",{});var Rc=r(Zs);ui=p(Rc,"Available checkpoints"),Rc.forEach(a),Lr.forEach(a),pr=l(t),ge=o(t,"P",{});var Hr=r(ge);gi=p(Hr,"Non-diffusers checkpoints can be found under "),_t=o(Hr,"A",{href:!0,rel:!0});var Sc=r(_t);_i=p(Sc,"TencentARC/T2I-Adapter"),Sc.forEach(a),vi=p(Hr,"."),Hr.forEach(a),cr=l(t),ee=o(t,"H3",{class:!0});var qr=r(ee);_e=o(qr,"A",{id:!0,class:!0,href:!0});var jc=r(_e);Gs=o(jc,"SPAN",{});var Pc=r(Gs);_(vt.$$.fragment,Pc),Pc.forEach(a),jc.forEach(a),bi=l(qr),Cs=o(qr,"SPAN",{});var Bc=r(Cs);yi=p(Bc,"T2I-Adapter with Stable Diffusion 1.4"),Bc.forEach(a),qr.forEach(a),fr=l(t),ve=o(t,"TABLE",{});var Or=r(ve);xs=o(Or,"THEAD",{});var Wc=r(xs);x=o(Wc,"TR",{});var Fe=r(x);Ds=o(Fe,"TH",{});var Nc=r(Ds);wi=p(Nc,"Model Name"),Nc.forEach(a),Ti=l(Fe),Rs=o(Fe,"TH",{});var Fc=r(Rs);Mi=p(Fc,"Control Image Overview"),Fc.forEach(a),Ei=l(Fe),Ss=o(Fe,"TH",{});var Vc=r(Ss);Ai=p(Vc,"Control Image Example"),Vc.forEach(a),Ui=l(Fe),js=o(Fe,"TH",{});var Qc=r(js);Ii=p(Qc,"Generated Image Example"),Qc.forEach(a),Fe.forEach(a),Wc.forEach(a),ki=l(Or),E=o(Or,"TBODY",{});var A=r(E);D=o(A,"TR",{});var Ve=r(D);be=o(Ve,"TD",{});var xo=r(be);bt=o(xo,"A",{href:!0,rel:!0});var Xc=r(bt);Ji=p(Xc,"TencentARC/t2iadapter_color_sd14v1"),Xc.forEach(a),$i=o(xo,"BR",{}),Zi=l(xo),Ps=o(xo,"EM",{});var Yc=r(Ps);Gi=p(Yc,"Trained with spatial color palette"),Yc.forEach(a),xo.forEach(a),Ci=l(Ve),Bs=o(Ve,"TD",{});var zc=r(Bs);xi=p(zc,"A image with 8x8 color palette."),zc.forEach(a),Di=l(Ve),Ws=o(Ve,"TD",{});var Lc=r(Ws);ka=o(Lc,"A",{href:!0});var Hc=r(ka);ye=o(Hc,"IMG",{width:!0,style:!0,src:!0}),Hc.forEach(a),Lc.forEach(a),Ri=l(Ve),Ns=o(Ve,"TD",{});var qc=r(Ns);Ja=o(qc,"A",{href:!0});var Oc=r(Ja);$a=o(Oc,"IMG",{width:!0,src:!0}),Oc.forEach(a),qc.forEach(a),Ve.forEach(a),Si=l(A),R=o(A,"TR",{});var Qe=r(R);we=o(Qe,"TD",{});var Do=r(we);yt=o(Do,"A",{href:!0,rel:!0});var Kc=r(yt);ji=p(Kc,"TencentARC/t2iadapter_canny_sd14v1"),Kc.forEach(a),Pi=o(Do,"BR",{}),Bi=l(Do),Fs=o(Do,"EM",{});var ef=r(Fs);Wi=p(ef,"Trained with canny edge detection"),ef.forEach(a),Do.forEach(a),Ni=l(Qe),Vs=o(Qe,"TD",{});var tf=r(Vs);Fi=p(tf,"A monochrome image with white edges on a black background."),tf.forEach(a),Vi=l(Qe),Qs=o(Qe,"TD",{});var af=r(Qs);Za=o(af,"A",{href:!0});var sf=r(Za);Te=o(sf,"IMG",{width:!0,style:!0,src:!0}),sf.forEach(a),af.forEach(a),Qi=l(Qe),Xs=o(Qe,"TD",{});var of=r(Xs);Ga=o(of,"A",{href:!0});var rf=r(Ga);Ca=o(rf,"IMG",{width:!0,src:!0}),rf.forEach(a),of.forEach(a),Qe.forEach(a),Xi=l(A),S=o(A,"TR",{});var Xe=r(S);Me=o(Xe,"TD",{});var Ro=r(Me);wt=o(Ro,"A",{href:!0,rel:!0});var nf=r(wt);Yi=p(nf,"TencentARC/t2iadapter_sketch_sd14v1"),nf.forEach(a),zi=o(Ro,"BR",{}),Li=l(Ro),Tt=o(Ro,"EM",{});var Kr=r(Tt);Hi=p(Kr,"Trained with "),Mt=o(Kr,"A",{href:!0,rel:!0});var lf=r(Mt);qi=p(lf,"PidiNet"),lf.forEach(a),Oi=p(Kr," edge detection"),Kr.forEach(a),Ro.forEach(a),Ki=l(Xe),Ys=o(Xe,"TD",{});var df=r(Ys);el=p(df,"A hand-drawn monochrome image with white outlines on a black background."),df.forEach(a),tl=l(Xe),zs=o(Xe,"TD",{});var pf=r(zs);xa=o(pf,"A",{href:!0});var cf=r(xa);Ee=o(cf,"IMG",{width:!0,style:!0,src:!0}),cf.forEach(a),pf.forEach(a),al=l(Xe),Ls=o(Xe,"TD",{});var ff=r(Ls);Da=o(ff,"A",{href:!0});var hf=r(Da);Ra=o(hf,"IMG",{width:!0,src:!0}),hf.forEach(a),ff.forEach(a),Xe.forEach(a),sl=l(A),j=o(A,"TR",{});var Ye=r(j);Ae=o(Ye,"TD",{});var So=r(Ae);Et=o(So,"A",{href:!0,rel:!0});var mf=r(Et);ol=p(mf,"TencentARC/t2iadapter_depth_sd14v1"),mf.forEach(a),rl=o(So,"BR",{}),nl=l(So),Hs=o(So,"EM",{});var uf=r(Hs);il=p(uf,"Trained with Midas depth estimation"),uf.forEach(a),So.forEach(a),ll=l(Ye),qs=o(Ye,"TD",{});var gf=r(qs);dl=p(gf,"A grayscale image with black representing deep areas and white representing shallow areas."),gf.forEach(a),pl=l(Ye),Os=o(Ye,"TD",{});var _f=r(Os);Sa=o(_f,"A",{href:!0});var vf=r(Sa);ja=o(vf,"IMG",{width:!0,src:!0}),vf.forEach(a),_f.forEach(a),cl=l(Ye),Ks=o(Ye,"TD",{});var bf=r(Ks);Pa=o(bf,"A",{href:!0});var yf=r(Pa);Ba=o(yf,"IMG",{width:!0,src:!0}),yf.forEach(a),bf.forEach(a),Ye.forEach(a),fl=l(A),P=o(A,"TR",{});var ze=r(P);Ue=o(ze,"TD",{});var jo=r(Ue);At=o(jo,"A",{href:!0,rel:!0});var wf=r(At);hl=p(wf,"TencentARC/t2iadapter_openpose_sd14v1"),wf.forEach(a),ml=o(jo,"BR",{}),ul=l(jo),eo=o(jo,"EM",{});var Tf=r(eo);gl=p(Tf,"Trained with OpenPose bone image"),Tf.forEach(a),jo.forEach(a),_l=l(ze),Ut=o(ze,"TD",{});var en=r(Ut);vl=p(en,"A "),It=o(en,"A",{href:!0,rel:!0});var Mf=r(It);bl=p(Mf,"OpenPose bone"),Mf.forEach(a),yl=p(en," image."),en.forEach(a),wl=l(ze),to=o(ze,"TD",{});var Ef=r(to);Wa=o(Ef,"A",{href:!0});var Af=r(Wa);Na=o(Af,"IMG",{width:!0,src:!0}),Af.forEach(a),Ef.forEach(a),Tl=l(ze),ao=o(ze,"TD",{});var Uf=r(ao);Fa=o(Uf,"A",{href:!0});var If=r(Fa);Va=o(If,"IMG",{width:!0,src:!0}),If.forEach(a),Uf.forEach(a),ze.forEach(a),Ml=l(A),B=o(A,"TR",{});var Le=r(B);Ie=o(Le,"TD",{});var Po=r(Ie);kt=o(Po,"A",{href:!0,rel:!0});var kf=r(kt);El=p(kf,"TencentARC/t2iadapter_keypose_sd14v1"),kf.forEach(a),Al=o(Po,"BR",{}),Ul=l(Po),so=o(Po,"EM",{});var Jf=r(so);Il=p(Jf,"Trained with mmpose skeleton image"),Jf.forEach(a),Po.forEach(a),kl=l(Le),Jt=o(Le,"TD",{});var tn=r(Jt);Jl=p(tn,"A "),$t=o(tn,"A",{href:!0,rel:!0});var $f=r($t);$l=p($f,"mmpose skeleton"),$f.forEach(a),Zl=p(tn," image."),tn.forEach(a),Gl=l(Le),oo=o(Le,"TD",{});var Zf=r(oo);Qa=o(Zf,"A",{href:!0});var Gf=r(Qa);Xa=o(Gf,"IMG",{width:!0,src:!0}),Gf.forEach(a),Zf.forEach(a),Cl=l(Le),ro=o(Le,"TD",{});var Cf=r(ro);Ya=o(Cf,"A",{href:!0});var xf=r(Ya);za=o(xf,"IMG",{width:!0,src:!0}),xf.forEach(a),Cf.forEach(a),Le.forEach(a),xl=l(A),W=o(A,"TR",{});var He=r(W);Zt=o(He,"TD",{});var an=r(Zt);Gt=o(an,"A",{href:!0,rel:!0});var Df=r(Gt);Dl=p(Df,"TencentARC/t2iadapter_seg_sd14v1"),Df.forEach(a),Rl=o(an,"BR",{}),no=o(an,"EM",{});var Rf=r(no);Sl=p(Rf,"Trained with semantic segmentation"),Rf.forEach(a),an.forEach(a),jl=l(He),Ct=o(He,"TD",{});var sn=r(Ct);Pl=p(sn,"An "),xt=o(sn,"A",{href:!0,rel:!0});var Sf=r(xt);Bl=p(Sf,"custom"),Sf.forEach(a),Wl=p(sn," segmentation protocol image."),sn.forEach(a),Nl=l(He),io=o(He,"TD",{});var jf=r(io);La=o(jf,"A",{href:!0});var Pf=r(La);Ha=o(Pf,"IMG",{width:!0,src:!0}),Pf.forEach(a),jf.forEach(a),Fl=l(He),lo=o(He,"TD",{});var Bf=r(lo);qa=o(Bf,"A",{href:!0});var Wf=r(qa);Oa=o(Wf,"IMG",{width:!0,src:!0}),Wf.forEach(a),Bf.forEach(a),He.forEach(a),Vl=l(A),N=o(A,"TR",{});var qe=r(N);po=o(qe,"TD",{});var Nf=r(po);Dt=o(Nf,"A",{href:!0,rel:!0});var Ff=r(Dt);Ql=p(Ff,"TencentARC/t2iadapter_canny_sd15v2"),Ff.forEach(a),Nf.forEach(a),Xl=l(qe),hr=o(qe,"TD",{}),r(hr).forEach(a),Yl=l(qe),mr=o(qe,"TD",{}),r(mr).forEach(a),zl=l(qe),ur=o(qe,"TD",{}),r(ur).forEach(a),qe.forEach(a),Ll=l(A),F=o(A,"TR",{});var Oe=r(F);co=o(Oe,"TD",{});var Vf=r(co);Rt=o(Vf,"A",{href:!0,rel:!0});var Qf=r(Rt);Hl=p(Qf,"TencentARC/t2iadapter_depth_sd15v2"),Qf.forEach(a),Vf.forEach(a),ql=l(Oe),gr=o(Oe,"TD",{}),r(gr).forEach(a),Ol=l(Oe),_r=o(Oe,"TD",{}),r(_r).forEach(a),Kl=l(Oe),vr=o(Oe,"TD",{}),r(vr).forEach(a),Oe.forEach(a),ed=l(A),V=o(A,"TR",{});var Ke=r(V);fo=o(Ke,"TD",{});var Xf=r(fo);St=o(Xf,"A",{href:!0,rel:!0});var Yf=r(St);td=p(Yf,"TencentARC/t2iadapter_sketch_sd15v2"),Yf.forEach(a),Xf.forEach(a),ad=l(Ke),br=o(Ke,"TD",{}),r(br).forEach(a),sd=l(Ke),yr=o(Ke,"TD",{}),r(yr).forEach(a),od=l(Ke),wr=o(Ke,"TD",{}),r(wr).forEach(a),Ke.forEach(a),rd=l(A),Q=o(A,"TR",{});var et=r(Q);ho=o(et,"TD",{});var zf=r(ho);jt=o(zf,"A",{href:!0,rel:!0});var Lf=r(jt);nd=p(Lf,"TencentARC/t2iadapter_zoedepth_sd15v1"),Lf.forEach(a),zf.forEach(a),id=l(et),Tr=o(et,"TD",{}),r(Tr).forEach(a),ld=l(et),Mr=o(et,"TD",{}),r(Mr).forEach(a),dd=l(et),Er=o(et,"TD",{}),r(Er).forEach(a),et.forEach(a),A.forEach(a),Or.forEach(a),Ar=l(t),te=o(t,"H2",{class:!0});var on=r(te);ke=o(on,"A",{id:!0,class:!0,href:!0});var Hf=r(ke);mo=o(Hf,"SPAN",{});var qf=r(mo);_(Pt.$$.fragment,qf),qf.forEach(a),Hf.forEach(a),pd=l(on),uo=o(on,"SPAN",{});var Of=r(uo);cd=p(Of,"Combining multiple adapters"),Of.forEach(a),on.forEach(a),Ur=l(t),Bt=o(t,"P",{});var Ap=r(Bt);go=o(Ap,"CODE",{});var Kf=r(go);fd=p(Kf,"MultiAdapter"),Kf.forEach(a),hd=p(Ap," can be used for applying multiple conditionings at once."),Ap.forEach(a),Ir=l(t),Ka=o(t,"P",{});var eh=r(Ka);md=p(eh,"Here we use the keypose adapter for the character posture and the depth adapter for creating the scene."),eh.forEach(a),kr=l(t),_(Wt.$$.fragment,t),Jr=l(t),es=o(t,"P",{});var th=r(es);ud=p(th,"The two control images look as such:"),th.forEach(a),$r=l(t),Je=o(t,"P",{});var rn=r(Je);ts=o(rn,"IMG",{src:!0,alt:!0}),gd=l(rn),as=o(rn,"IMG",{src:!0,alt:!0}),rn.forEach(a),Zr=l(t),Nt=o(t,"P",{});var Up=r(Nt);_o=o(Up,"CODE",{});var ah=r(_o);_d=p(ah,"MultiAdapter"),ah.forEach(a),vd=p(Up," combines keypose and depth adapters."),Up.forEach(a),Gr=l(t),Ft=o(t,"P",{});var Ip=r(Ft);vo=o(Ip,"CODE",{});var sh=r(vo);bd=p(sh,"adapter_conditioning_scale"),sh.forEach(a),yd=p(Ip," balances the relative influence of the different adapters."),Ip.forEach(a),Cr=l(t),_(Vt.$$.fragment,t),xr=l(t),ss=o(t,"P",{});var oh=r(ss);os=o(oh,"IMG",{src:!0,alt:!0}),oh.forEach(a),Dr=l(t),ae=o(t,"H2",{class:!0});var nn=r(ae);$e=o(nn,"A",{id:!0,class:!0,href:!0});var rh=r($e);bo=o(rh,"SPAN",{});var nh=r(bo);_(Qt.$$.fragment,nh),nh.forEach(a),rh.forEach(a),wd=l(nn),yo=o(nn,"SPAN",{});var ih=r(yo);Td=p(ih,"T2I Adapter vs ControlNet"),ih.forEach(a),nn.forEach(a),Rr=l(t),Ze=o(t,"P",{});var ln=r(Ze);Md=p(ln,"T2I-Adapter is similar to "),Xt=o(ln,"A",{href:!0,rel:!0});var lh=r(Xt);Ed=p(lh,"ControlNet"),lh.forEach(a),Ad=p(ln,`.
T2i-Adapter uses a smaller auxiliary network which is only run once for the entire diffusion process.
However, T2I-Adapter performs slightly worse than ControlNet.`),ln.forEach(a),Sr=l(t),se=o(t,"H2",{class:!0});var dn=r(se);Ge=o(dn,"A",{id:!0,class:!0,href:!0});var dh=r(Ge);wo=o(dh,"SPAN",{});var ph=r(wo);_(Yt.$$.fragment,ph),ph.forEach(a),dh.forEach(a),Ud=l(dn),To=o(dn,"SPAN",{});var ch=r(To);Id=p(ch,"StableDiffusionAdapterPipeline"),ch.forEach(a),dn.forEach(a),jr=l(t),T=o(t,"DIV",{class:!0});var U=r(T);_(zt.$$.fragment,U),kd=l(U),rs=o(U,"P",{});var kp=r(rs);Jd=p(kp,`Pipeline for text-to-image generation using Stable Diffusion augmented with T2I-Adapter
`),Lt=o(kp,"A",{href:!0,rel:!0});var fh=r(Lt);$d=p(fh,"https://arxiv.org/abs/2302.08453"),fh.forEach(a),kp.forEach(a),Zd=l(U),Ht=o(U,"P",{});var pn=r(Ht);Gd=p(pn,"This model inherits from "),ns=o(pn,"A",{href:!0});var hh=r(ns);Cd=p(hh,"DiffusionPipeline"),hh.forEach(a),xd=p(pn,`. 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.)`),pn.forEach(a),Dd=l(U),X=o(U,"DIV",{class:!0});var ds=r(X);_(qt.$$.fragment,ds),Rd=l(ds),Mo=o(ds,"P",{});var mh=r(Mo);Sd=p(mh,"Function invoked when calling the pipeline for generation."),mh.forEach(a),jd=l(ds),_(Ce.$$.fragment,ds),ds.forEach(a),Pd=l(U),xe=o(U,"DIV",{class:!0});var cn=r(xe);_(Ot.$$.fragment,cn),Bd=l(cn),Eo=o(cn,"P",{});var uh=r(Eo);Wd=p(uh,`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. This is useful to save some memory in exchange for a small
speed decrease.`),uh.forEach(a),cn.forEach(a),Nd=l(U),De=o(U,"DIV",{class:!0});var fn=r(De);_(Kt.$$.fragment,fn),Fd=l(fn),ea=o(fn,"P",{});var hn=r(ea);Vd=p(hn,"Disable sliced attention computation. If "),Ao=o(hn,"CODE",{});var gh=r(Ao);Qd=p(gh,"enable_attention_slicing"),gh.forEach(a),Xd=p(hn,` was previously called, attention is
computed in one step.`),hn.forEach(a),fn.forEach(a),Yd=l(U),Re=o(U,"DIV",{class:!0});var mn=r(Re);_(ta.$$.fragment,mn),zd=l(mn),Uo=o(mn,"P",{});var _h=r(Uo);Ld=p(_h,`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),_h.forEach(a),mn.forEach(a),Hd=l(U),Se=o(U,"DIV",{class:!0});var un=r(Se);_(aa.$$.fragment,un),qd=l(un),sa=o(un,"P",{});var gn=r(sa);Od=p(gn,"Disable sliced VAE decoding. If "),Io=o(gn,"CODE",{});var vh=r(Io);Kd=p(vh,"enable_vae_slicing"),vh.forEach(a),ep=p(gn,` was previously enabled, this method will go back to
computing decoding in one step.`),gn.forEach(a),un.forEach(a),tp=l(U),G=o(U,"DIV",{class:!0});var tt=r(G);_(oa.$$.fragment,tt),ap=l(tt),ra=o(tt,"P",{});var _n=r(ra);sp=p(_n,"Enable memory efficient attention from "),na=o(_n,"A",{href:!0,rel:!0});var bh=r(na);op=p(bh,"xFormers"),bh.forEach(a),rp=p(_n,`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),_n.forEach(a),np=l(tt),_(je.$$.fragment,tt),ip=l(tt),_(Pe.$$.fragment,tt),tt.forEach(a),lp=l(U),Be=o(U,"DIV",{class:!0});var vn=r(Be);_(ia.$$.fragment,vn),dp=l(vn),la=o(vn,"P",{});var bn=r(la);pp=p(bn,"Disable memory efficient attention from "),da=o(bn,"A",{href:!0,rel:!0});var yh=r(da);cp=p(yh,"xFormers"),yh.forEach(a),fp=p(bn,"."),bn.forEach(a),vn.forEach(a),hp=l(U),We=o(U,"DIV",{class:!0});var yn=r(We);_(pa.$$.fragment,yn),mp=l(yn),Z=o(yn,"P",{});var Y=r(Z);up=p(Y,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ko=o(Y,"CODE",{});var wh=r(ko);gp=p(wh,"enable_sequential_cpu_offload"),wh.forEach(a),_p=p(Y,", this method moves one whole model at a time to the GPU when its "),Jo=o(Y,"CODE",{});var Th=r(Jo);vp=p(Th,"forward"),Th.forEach(a),bp=p(Y,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),$o=o(Y,"CODE",{});var Mh=r($o);yp=p(Mh,"enable_sequential_cpu_offload"),Mh.forEach(a),wp=p(Y,", but performance is much better due to the iterative execution of the "),Zo=o(Y,"CODE",{});var Eh=r(Zo);Tp=p(Eh,"unet"),Eh.forEach(a),Mp=p(Y,"."),Y.forEach(a),yn.forEach(a),U.forEach(a),this.h()},h(){n(m,"name","hf:doc:metadata"),n(m,"content",JSON.stringify(Sh)),n(u,"id","texttoimage-generation-with-adapter-conditioning"),n(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),n(u,"href","#texttoimage-generation-with-adapter-conditioning"),n(M,"class","relative group"),n(ie,"id","overview"),n(ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),n(ie,"href","#overview"),n(z,"class","relative group"),n(rt,"href","https://arxiv.org/abs/2302.08453"),n(rt,"rel","nofollow"),n(nt,"href","https://github.com/HimariO"),n(nt,"rel","nofollow"),n(de,"id","available-pipelines"),n(de,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),n(de,"href","#available-pipelines"),n(L,"class","relative group"),n(ua,"align","center"),n(lt,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_adapter.py"),n(lt,"rel","nofollow"),n(ga,"align","center"),n(ce,"id","usage-example"),n(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"),n(ce,"href","#usage-example"),n(O,"class","relative group"),n(_a,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/adapter#diffusers.StableDiffusionAdapterPipeline"),n(ct,"href","https://huggingface.co/TencentARC/t2iadapter_color_sd14v1"),n(ct,"rel","nofollow"),I(ba.src,Jp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_ref.png")||n(ba,"src",Jp),n(ba,"alt","img"),I(Ma.src,$p="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_palette.png")||n(Ma,"src",$p),n(Ma,"alt","img"),I(Ia.src,Zp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_output.png")||n(Ia,"src",Zp),n(Ia,"alt","img"),n(ue,"id","available-checkpoints"),n(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),n(ue,"href","#available-checkpoints"),n(K,"class","relative group"),n(_t,"href","https://huggingface.co/TencentARC/T2I-Adapter/tree/main/models"),n(_t,"rel","nofollow"),n(_e,"id","t2iadapter-with-stable-diffusion-14"),n(_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"),n(_e,"href","#t2iadapter-with-stable-diffusion-14"),n(ee,"class","relative group"),n(bt,"href","https://huggingface.co/TencentARC/t2iadapter_color_sd14v1"),n(bt,"rel","nofollow"),n(ye,"width","64"),ps(ye,"margin","0"),ps(ye,"padding","0"),I(ye.src,Gp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_sample_input.png")||n(ye,"src",Gp),n(ka,"href","https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_sample_input.png"),n($a,"width","64"),I($a.src,Cp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_sample_output.png")||n($a,"src",Cp),n(Ja,"href","https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_sample_output.png"),n(yt,"href","https://huggingface.co/TencentARC/t2iadapter_canny_sd14v1"),n(yt,"rel","nofollow"),n(Te,"width","64"),ps(Te,"margin","0"),ps(Te,"padding","0"),I(Te.src,xp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/canny_sample_input.png")||n(Te,"src",xp),n(Za,"href","https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/canny_sample_input.png"),n(Ca,"width","64"),I(Ca.src,Dp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/canny_sample_output.png")||n(Ca,"src",Dp),n(Ga,"href","https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/canny_sample_output.png"),n(wt,"href","https://huggingface.co/TencentARC/t2iadapter_sketch_sd14v1"),n(wt,"rel","nofollow"),n(Mt,"href","https://github.com/zhuoinoulu/pidinet"),n(Mt,"rel","nofollow"),n(Ee,"width","64"),ps(Ee,"margin","0"),ps(Ee,"padding","0"),I(Ee.src,Rp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/sketch_sample_input.png")||n(Ee,"src",Rp),n(xa,"href","https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/sketch_sample_input.png"),n(Ra,"width","64"),I(Ra.src,Sp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/sketch_sample_output.png")||n(Ra,"src",Sp),n(Da,"href","https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/sketch_sample_output.png"),n(Et,"href","https://huggingface.co/TencentARC/t2iadapter_depth_sd14v1"),n(Et,"rel","nofollow"),n(ja,"width","64"),I(ja.src,jp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/depth_sample_input.png")||n(ja,"src",jp),n(Sa,"href","https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/depth_sample_input.png"),n(Ba,"width","64"),I(Ba.src,Pp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/depth_sample_output.png")||n(Ba,"src",Pp),n(Pa,"href","https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/depth_sample_output.png"),n(At,"href","https://huggingface.co/TencentARC/t2iadapter_openpose_sd14v1"),n(At,"rel","nofollow"),n(It,"href","https://github.com/CMU-Perceptual-Computing-Lab/openpose"),n(It,"rel","nofollow"),n(Na,"width","64"),I(Na.src,Bp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/openpose_sample_input.png")||n(Na,"src",Bp),n(Wa,"href","https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/openpose_sample_input.png"),n(Va,"width","64"),I(Va.src,Wp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/openpose_sample_output.png")||n(Va,"src",Wp),n(Fa,"href","https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/openpose_sample_output.png"),n(kt,"href","https://huggingface.co/TencentARC/t2iadapter_keypose_sd14v1"),n(kt,"rel","nofollow"),n($t,"href","https://github.com/open-mmlab/mmpose"),n($t,"rel","nofollow"),n(Xa,"width","64"),I(Xa.src,Np="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/keypose_sample_input.png")||n(Xa,"src",Np),n(Qa,"href","https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/keypose_sample_input.png"),n(za,"width","64"),I(za.src,Fp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/keypose_sample_output.png")||n(za,"src",Fp),n(Ya,"href","https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/keypose_sample_output.png"),n(Gt,"href","https://huggingface.co/TencentARC/t2iadapter_seg_sd14v1"),n(Gt,"rel","nofollow"),n(xt,"href","https://github.com/TencentARC/T2I-Adapter/discussions/25"),n(xt,"rel","nofollow"),n(Ha,"width","64"),I(Ha.src,Vp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/seg_sample_input.png")||n(Ha,"src",Vp),n(La,"href","https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/seg_sample_input.png"),n(Oa,"width","64"),I(Oa.src,Qp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/seg_sample_output.png")||n(Oa,"src",Qp),n(qa,"href","https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/seg_sample_output.png"),n(Dt,"href","https://huggingface.co/TencentARC/t2iadapter_canny_sd15v2"),n(Dt,"rel","nofollow"),n(Rt,"href","https://huggingface.co/TencentARC/t2iadapter_depth_sd15v2"),n(Rt,"rel","nofollow"),n(St,"href","https://huggingface.co/TencentARC/t2iadapter_sketch_sd15v2"),n(St,"rel","nofollow"),n(jt,"href","https://huggingface.co/TencentARC/t2iadapter_zoedepth_sd15v1"),n(jt,"rel","nofollow"),n(ke,"id","combining-multiple-adapters"),n(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"),n(ke,"href","#combining-multiple-adapters"),n(te,"class","relative group"),I(ts.src,Xp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/keypose_sample_input.png")||n(ts,"src",Xp),n(ts,"alt","img"),I(as.src,Yp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/depth_sample_input.png")||n(as,"src",Yp),n(as,"alt","img"),I(os.src,zp="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/keypose_depth_sample_output.png")||n(os,"src",zp),n(os,"alt","img"),n($e,"id","t2i-adapter-vs-controlnet"),n($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"),n($e,"href","#t2i-adapter-vs-controlnet"),n(ae,"class","relative group"),n(Xt,"href","https://huggingface.co/docs/diffusers/main/en/api/pipelines/controlnet"),n(Xt,"rel","nofollow"),n(Ge,"id","diffusers.StableDiffusionAdapterPipeline"),n(Ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),n(Ge,"href","#diffusers.StableDiffusionAdapterPipeline"),n(se,"class","relative group"),n(Lt,"href","https://arxiv.org/abs/2302.08453"),n(Lt,"rel","nofollow"),n(ns,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),n(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),n(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),n(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),n(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),n(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),n(na,"href","https://facebookresearch.github.io/xformers/"),n(na,"rel","nofollow"),n(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),n(da,"href","https://facebookresearch.github.io/xformers/"),n(da,"rel","nofollow"),n(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),n(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),n(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,c){e(document.head,m),f(t,J,c),f(t,M,c),e(M,u),e(u,$),v(h,$,null),e(M,k),e(M,cs),e(cs,wn),f(t,Bo,c),f(t,z,c),e(z,ie),e(ie,fs),v(st,fs,null),e(z,Tn),e(z,hs),e(hs,Mn),f(t,Wo,c),f(t,ot,c),e(ot,rt),e(rt,En),e(ot,An),f(t,No,c),f(t,fa,c),e(fa,Un),f(t,Fo,c),f(t,ha,c),e(ha,In),f(t,Vo,c),f(t,ma,c),e(ma,ms),e(ms,kn),f(t,Qo,c),f(t,le,c),e(le,Jn),e(le,nt),e(nt,$n),e(le,Zn),f(t,Xo,c),f(t,L,c),e(L,de),e(de,us),v(it,us,null),e(L,Gn),e(L,gs),e(gs,Cn),f(t,Yo,c),f(t,pe,c),e(pe,_s),e(_s,H),e(H,vs),e(vs,xn),e(H,Dn),e(H,bs),e(bs,Rn),e(H,Sn),e(H,ua),e(ua,jn),e(pe,Pn),e(pe,ys),e(ys,q),e(q,ws),e(ws,lt),e(lt,Bn),e(q,Wn),e(q,Ts),e(Ts,Ms),e(Ms,Nn),e(q,Fn),e(q,ga),e(ga,Vn),f(t,zo,c),f(t,O,c),e(O,ce),e(ce,Es),v(dt,Es,null),e(O,Qn),e(O,As),e(As,Xn),f(t,Lo,c),f(t,fe,c),e(fe,Yn),e(fe,Us),e(Us,zn),e(fe,Ln),f(t,Ho,c),f(t,he,c),e(he,pt),e(pt,Hn),e(pt,Is),e(Is,qn),e(pt,On),e(he,Kn),e(he,C),e(C,ei),e(C,ks),e(ks,ti),e(C,ai),e(C,Js),e(Js,si),e(C,oi),e(C,_a),e(_a,ri),e(C,ni),f(t,qo,c),f(t,me,c),e(me,ii),e(me,ct),e(ct,li),e(me,di),f(t,Oo,c),v(ft,t,c),f(t,Ko,c),f(t,va,c),e(va,ba),f(t,er,c),f(t,ya,c),e(ya,pi),f(t,tr,c),v(ht,t,c),f(t,ar,c),f(t,wa,c),e(wa,ci),f(t,sr,c),f(t,Ta,c),e(Ta,Ma),f(t,or,c),f(t,Ea,c),e(Ea,fi),f(t,rr,c),v(mt,t,c),f(t,nr,c),f(t,Aa,c),e(Aa,hi),f(t,ir,c),v(ut,t,c),f(t,lr,c),f(t,Ua,c),e(Ua,Ia),f(t,dr,c),f(t,K,c),e(K,ue),e(ue,$s),v(gt,$s,null),e(K,mi),e(K,Zs),e(Zs,ui),f(t,pr,c),f(t,ge,c),e(ge,gi),e(ge,_t),e(_t,_i),e(ge,vi),f(t,cr,c),f(t,ee,c),e(ee,_e),e(_e,Gs),v(vt,Gs,null),e(ee,bi),e(ee,Cs),e(Cs,yi),f(t,fr,c),f(t,ve,c),e(ve,xs),e(xs,x),e(x,Ds),e(Ds,wi),e(x,Ti),e(x,Rs),e(Rs,Mi),e(x,Ei),e(x,Ss),e(Ss,Ai),e(x,Ui),e(x,js),e(js,Ii),e(ve,ki),e(ve,E),e(E,D),e(D,be),e(be,bt),e(bt,Ji),e(be,$i),e(be,Zi),e(be,Ps),e(Ps,Gi),e(D,Ci),e(D,Bs),e(Bs,xi),e(D,Di),e(D,Ws),e(Ws,ka),e(ka,ye),e(D,Ri),e(D,Ns),e(Ns,Ja),e(Ja,$a),e(E,Si),e(E,R),e(R,we),e(we,yt),e(yt,ji),e(we,Pi),e(we,Bi),e(we,Fs),e(Fs,Wi),e(R,Ni),e(R,Vs),e(Vs,Fi),e(R,Vi),e(R,Qs),e(Qs,Za),e(Za,Te),e(R,Qi),e(R,Xs),e(Xs,Ga),e(Ga,Ca),e(E,Xi),e(E,S),e(S,Me),e(Me,wt),e(wt,Yi),e(Me,zi),e(Me,Li),e(Me,Tt),e(Tt,Hi),e(Tt,Mt),e(Mt,qi),e(Tt,Oi),e(S,Ki),e(S,Ys),e(Ys,el),e(S,tl),e(S,zs),e(zs,xa),e(xa,Ee),e(S,al),e(S,Ls),e(Ls,Da),e(Da,Ra),e(E,sl),e(E,j),e(j,Ae),e(Ae,Et),e(Et,ol),e(Ae,rl),e(Ae,nl),e(Ae,Hs),e(Hs,il),e(j,ll),e(j,qs),e(qs,dl),e(j,pl),e(j,Os),e(Os,Sa),e(Sa,ja),e(j,cl),e(j,Ks),e(Ks,Pa),e(Pa,Ba),e(E,fl),e(E,P),e(P,Ue),e(Ue,At),e(At,hl),e(Ue,ml),e(Ue,ul),e(Ue,eo),e(eo,gl),e(P,_l),e(P,Ut),e(Ut,vl),e(Ut,It),e(It,bl),e(Ut,yl),e(P,wl),e(P,to),e(to,Wa),e(Wa,Na),e(P,Tl),e(P,ao),e(ao,Fa),e(Fa,Va),e(E,Ml),e(E,B),e(B,Ie),e(Ie,kt),e(kt,El),e(Ie,Al),e(Ie,Ul),e(Ie,so),e(so,Il),e(B,kl),e(B,Jt),e(Jt,Jl),e(Jt,$t),e($t,$l),e(Jt,Zl),e(B,Gl),e(B,oo),e(oo,Qa),e(Qa,Xa),e(B,Cl),e(B,ro),e(ro,Ya),e(Ya,za),e(E,xl),e(E,W),e(W,Zt),e(Zt,Gt),e(Gt,Dl),e(Zt,Rl),e(Zt,no),e(no,Sl),e(W,jl),e(W,Ct),e(Ct,Pl),e(Ct,xt),e(xt,Bl),e(Ct,Wl),e(W,Nl),e(W,io),e(io,La),e(La,Ha),e(W,Fl),e(W,lo),e(lo,qa),e(qa,Oa),e(E,Vl),e(E,N),e(N,po),e(po,Dt),e(Dt,Ql),e(N,Xl),e(N,hr),e(N,Yl),e(N,mr),e(N,zl),e(N,ur),e(E,Ll),e(E,F),e(F,co),e(co,Rt),e(Rt,Hl),e(F,ql),e(F,gr),e(F,Ol),e(F,_r),e(F,Kl),e(F,vr),e(E,ed),e(E,V),e(V,fo),e(fo,St),e(St,td),e(V,ad),e(V,br),e(V,sd),e(V,yr),e(V,od),e(V,wr),e(E,rd),e(E,Q),e(Q,ho),e(ho,jt),e(jt,nd),e(Q,id),e(Q,Tr),e(Q,ld),e(Q,Mr),e(Q,dd),e(Q,Er),f(t,Ar,c),f(t,te,c),e(te,ke),e(ke,mo),v(Pt,mo,null),e(te,pd),e(te,uo),e(uo,cd),f(t,Ur,c),f(t,Bt,c),e(Bt,go),e(go,fd),e(Bt,hd),f(t,Ir,c),f(t,Ka,c),e(Ka,md),f(t,kr,c),v(Wt,t,c),f(t,Jr,c),f(t,es,c),e(es,ud),f(t,$r,c),f(t,Je,c),e(Je,ts),e(Je,gd),e(Je,as),f(t,Zr,c),f(t,Nt,c),e(Nt,_o),e(_o,_d),e(Nt,vd),f(t,Gr,c),f(t,Ft,c),e(Ft,vo),e(vo,bd),e(Ft,yd),f(t,Cr,c),v(Vt,t,c),f(t,xr,c),f(t,ss,c),e(ss,os),f(t,Dr,c),f(t,ae,c),e(ae,$e),e($e,bo),v(Qt,bo,null),e(ae,wd),e(ae,yo),e(yo,Td),f(t,Rr,c),f(t,Ze,c),e(Ze,Md),e(Ze,Xt),e(Xt,Ed),e(Ze,Ad),f(t,Sr,c),f(t,se,c),e(se,Ge),e(Ge,wo),v(Yt,wo,null),e(se,Ud),e(se,To),e(To,Id),f(t,jr,c),f(t,T,c),v(zt,T,null),e(T,kd),e(T,rs),e(rs,Jd),e(rs,Lt),e(Lt,$d),e(T,Zd),e(T,Ht),e(Ht,Gd),e(Ht,ns),e(ns,Cd),e(Ht,xd),e(T,Dd),e(T,X),v(qt,X,null),e(X,Rd),e(X,Mo),e(Mo,Sd),e(X,jd),v(Ce,X,null),e(T,Pd),e(T,xe),v(Ot,xe,null),e(xe,Bd),e(xe,Eo),e(Eo,Wd),e(T,Nd),e(T,De),v(Kt,De,null),e(De,Fd),e(De,ea),e(ea,Vd),e(ea,Ao),e(Ao,Qd),e(ea,Xd),e(T,Yd),e(T,Re),v(ta,Re,null),e(Re,zd),e(Re,Uo),e(Uo,Ld),e(T,Hd),e(T,Se),v(aa,Se,null),e(Se,qd),e(Se,sa),e(sa,Od),e(sa,Io),e(Io,Kd),e(sa,ep),e(T,tp),e(T,G),v(oa,G,null),e(G,ap),e(G,ra),e(ra,sp),e(ra,na),e(na,op),e(ra,rp),e(G,np),v(je,G,null),e(G,ip),v(Pe,G,null),e(T,lp),e(T,Be),v(ia,Be,null),e(Be,dp),e(Be,la),e(la,pp),e(la,da),e(da,cp),e(la,fp),e(T,hp),e(T,We),v(pa,We,null),e(We,mp),e(We,Z),e(Z,up),e(Z,ko),e(ko,gp),e(Z,_p),e(Z,Jo),e(Jo,vp),e(Z,bp),e(Z,$o),e($o,yp),e(Z,wp),e(Z,Zo),e(Zo,Tp),e(Z,Mp),Pr=!0},p(t,[c]){const ca={};c&2&&(ca.$$scope={dirty:c,ctx:t}),Ce.$set(ca);const Go={};c&2&&(Go.$$scope={dirty:c,ctx:t}),je.$set(Go);const Co={};c&2&&(Co.$$scope={dirty:c,ctx:t}),Pe.$set(Co)},i(t){Pr||(b(h.$$.fragment,t),b(st.$$.fragment,t),b(it.$$.fragment,t),b(dt.$$.fragment,t),b(ft.$$.fragment,t),b(ht.$$.fragment,t),b(mt.$$.fragment,t),b(ut.$$.fragment,t),b(gt.$$.fragment,t),b(vt.$$.fragment,t),b(Pt.$$.fragment,t),b(Wt.$$.fragment,t),b(Vt.$$.fragment,t),b(Qt.$$.fragment,t),b(Yt.$$.fragment,t),b(zt.$$.fragment,t),b(qt.$$.fragment,t),b(Ce.$$.fragment,t),b(Ot.$$.fragment,t),b(Kt.$$.fragment,t),b(ta.$$.fragment,t),b(aa.$$.fragment,t),b(oa.$$.fragment,t),b(je.$$.fragment,t),b(Pe.$$.fragment,t),b(ia.$$.fragment,t),b(pa.$$.fragment,t),Pr=!0)},o(t){y(h.$$.fragment,t),y(st.$$.fragment,t),y(it.$$.fragment,t),y(dt.$$.fragment,t),y(ft.$$.fragment,t),y(ht.$$.fragment,t),y(mt.$$.fragment,t),y(ut.$$.fragment,t),y(gt.$$.fragment,t),y(vt.$$.fragment,t),y(Pt.$$.fragment,t),y(Wt.$$.fragment,t),y(Vt.$$.fragment,t),y(Qt.$$.fragment,t),y(Yt.$$.fragment,t),y(zt.$$.fragment,t),y(qt.$$.fragment,t),y(Ce.$$.fragment,t),y(Ot.$$.fragment,t),y(Kt.$$.fragment,t),y(ta.$$.fragment,t),y(aa.$$.fragment,t),y(oa.$$.fragment,t),y(je.$$.fragment,t),y(Pe.$$.fragment,t),y(ia.$$.fragment,t),y(pa.$$.fragment,t),Pr=!1},d(t){a(m),t&&a(J),t&&a(M),w(h),t&&a(Bo),t&&a(z),w(st),t&&a(Wo),t&&a(ot),t&&a(No),t&&a(fa),t&&a(Fo),t&&a(ha),t&&a(Vo),t&&a(ma),t&&a(Qo),t&&a(le),t&&a(Xo),t&&a(L),w(it),t&&a(Yo),t&&a(pe),t&&a(zo),t&&a(O),w(dt),t&&a(Lo),t&&a(fe),t&&a(Ho),t&&a(he),t&&a(qo),t&&a(me),t&&a(Oo),w(ft,t),t&&a(Ko),t&&a(va),t&&a(er),t&&a(ya),t&&a(tr),w(ht,t),t&&a(ar),t&&a(wa),t&&a(sr),t&&a(Ta),t&&a(or),t&&a(Ea),t&&a(rr),w(mt,t),t&&a(nr),t&&a(Aa),t&&a(ir),w(ut,t),t&&a(lr),t&&a(Ua),t&&a(dr),t&&a(K),w(gt),t&&a(pr),t&&a(ge),t&&a(cr),t&&a(ee),w(vt),t&&a(fr),t&&a(ve),t&&a(Ar),t&&a(te),w(Pt),t&&a(Ur),t&&a(Bt),t&&a(Ir),t&&a(Ka),t&&a(kr),w(Wt,t),t&&a(Jr),t&&a(es),t&&a($r),t&&a(Je),t&&a(Zr),t&&a(Nt),t&&a(Gr),t&&a(Ft),t&&a(Cr),w(Vt,t),t&&a(xr),t&&a(ss),t&&a(Dr),t&&a(ae),w(Qt),t&&a(Rr),t&&a(Ze),t&&a(Sr),t&&a(se),w(Yt),t&&a(jr),t&&a(T),w(zt),w(qt),w(Ce),w(Ot),w(Kt),w(ta),w(aa),w(oa),w(je),w(Pe),w(ia),w(pa)}}}const Sh={local:"texttoimage-generation-with-adapter-conditioning",sections:[{local:"overview",title:"Overview"},{local:"available-pipelines",title:"Available Pipelines:"},{local:"usage-example",title:"Usage example"},{local:"available-checkpoints",sections:[{local:"t2iadapter-with-stable-diffusion-14",title:"T2I-Adapter with Stable Diffusion 1.4"}],title:"Available checkpoints"},{local:"combining-multiple-adapters",title:"Combining multiple adapters"},{local:"t2i-adapter-vs-controlnet",title:"T2I Adapter vs ControlNet"},{local:"diffusers.StableDiffusionAdapterPipeline",title:"StableDiffusionAdapterPipeline"}],title:"Text-to-Image Generation with Adapter Conditioning"};function jh(ne){return Zh(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Qh extends Ih{constructor(m){super();kh(this,m,jh,Rh,Jh,{})}}export{Qh as default,Sh as metadata};
