import{S as Hd,i as Od,s as Kd,e as a,k as r,w as b,t as s,M as ep,c as o,d as n,m as d,a as i,x as _,h as l,b as c,G as e,g,y as v,q as y,o as w,B as I,v as tp,L as ko}from"../../../chunks/vendor-hf-doc-builder.js";import{T as yr}from"../../../chunks/Tip-hf-doc-builder.js";import{D as J}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as ce}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Se}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Wo}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function np(x){let f,P,h,u,C,p,U,ee;return{c(){f=a("p"),P=s("For text-to-image we use "),h=a("code"),u=s("stabilityai/stable-diffusion-2-1-unclip-small"),C=s(" as it was trained on CLIP ViT-L/14 embedding, the same as the Karlo model prior. "),p=a("a"),U=s("stabilityai/stable-diffusion-2-1-unclip"),ee=s(" was trained on OpenCLIP ViT-H, so we don\u2019t recommend its use."),this.h()},l(te){f=o(te,"P",{});var G=i(f);P=l(G,"For text-to-image we use "),h=o(G,"CODE",{});var N=i(h);u=l(N,"stabilityai/stable-diffusion-2-1-unclip-small"),N.forEach(n),C=l(G," as it was trained on CLIP ViT-L/14 embedding, the same as the Karlo model prior. "),p=o(G,"A",{href:!0,rel:!0});var Yt=i(p);U=l(Yt,"stabilityai/stable-diffusion-2-1-unclip"),Yt.forEach(n),ee=l(G," was trained on OpenCLIP ViT-H, so we don\u2019t recommend its use."),G.forEach(n),this.h()},h(){c(p,"href","https://hf.co/stabilityai/stable-diffusion-2-1-unclip"),c(p,"rel","nofollow")},m(te,G){g(te,f,G),e(f,P),e(f,h),e(h,u),e(f,C),e(f,p),e(p,U),e(f,ee)},d(te){te&&n(f)}}}function ap(x){let f,P,h,u,C;return u=new ce({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlVW5DTElQUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlVW5DTElQUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmZ1c2luZyUyRnN0YWJsZS11bmNsaXAtMi0xLWwlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTIwJTIwJTIzJTIwVE9ETyUyMHVwZGF0ZSUyMG1vZGVsJTIwcGF0aCUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhbiUyMGFzdHJvbmF1dCUyMHJpZGluZyUyMGElMjBob3JzZSUyMG9uJTIwbWFycyUyMiUwQWltYWdlcyUyMCUzRCUyMHBpcGUocHJvbXB0KS5pbWFnZXMlMEFpbWFnZXMlNUIwJTVELnNhdmUoJTIyYXN0cm9uYXV0X2hvcnNlLnBuZyUyMik=",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> StableUnCLIPPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableUnCLIPPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;fusing/stable-unclip-2-1-l&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)  <span class="hljs-comment"># TODO update model path</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>images = pipe(prompt).images
<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;astronaut_horse.png&quot;</span>)`}}),{c(){f=a("p"),P=s("Examples:"),h=r(),b(u.$$.fragment)},l(p){f=o(p,"P",{});var U=i(f);P=l(U,"Examples:"),U.forEach(n),h=d(p),_(u.$$.fragment,p)},m(p,U){g(p,f,U),e(f,P),g(p,h,U),v(u,p,U),C=!0},p:ko,i(p){C||(y(u.$$.fragment,p),C=!0)},o(p){w(u.$$.fragment,p),C=!1},d(p){p&&n(f),p&&n(h),I(u,p)}}}function op(x){let f,P;return{c(){f=a("p"),P=s(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(h){f=o(h,"P",{});var u=i(f);P=l(u,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),u.forEach(n)},m(h,u){g(h,f,u),e(f,P)},d(h){h&&n(f)}}}function ip(x){let f,P,h,u,C;return u=new ce({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(){f=a("p"),P=s("Examples:"),h=r(),b(u.$$.fragment)},l(p){f=o(p,"P",{});var U=i(f);P=l(U,"Examples:"),U.forEach(n),h=d(p),_(u.$$.fragment,p)},m(p,U){g(p,f,U),e(f,P),g(p,h,U),v(u,p,U),C=!0},p:ko,i(p){C||(y(u.$$.fragment,p),C=!0)},o(p){w(u.$$.fragment,p),C=!1},d(p){p&&n(f),p&&n(h),I(u,p)}}}function sp(x){let f,P,h,u,C;return u=new ce({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlVW5DTElQSW1nMkltZ1BpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyMFN0YWJsZVVuQ0xJUEltZzJJbWdQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyZnVzaW5nJTJGc3RhYmxlLXVuY2xpcC0yLTEtbC1pbWcyaW1nJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUyMCUyMCUyMyUyMFRPRE8lMjB1cGRhdGUlMjBtb2RlbCUyMHBhdGglMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uJTJGbWFpbiUyRmFzc2V0cyUyRnN0YWJsZS1zYW1wbGVzJTJGaW1nMmltZyUyRnNrZXRjaC1tb3VudGFpbnMtaW5wdXQuanBnJTIyJTBBJTBBcmVzcG9uc2UlMjAlM0QlMjByZXF1ZXN0cy5nZXQodXJsKSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKEJ5dGVzSU8ocmVzcG9uc2UuY29udGVudCkpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBpbml0X2ltYWdlLnJlc2l6ZSgoNzY4JTJDJTIwNTEyKSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwZmFudGFzeSUyMGxhbmRzY2FwZSUyQyUyMHRyZW5kaW5nJTIwb24lMjBhcnRzdGF0aW9uJTIyJTBBJTBBaW1hZ2VzJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBpbml0X2ltYWdlKS5pbWFnZXMlMEFpbWFnZXMlNUIwJTVELnNhdmUoJTIyZmFudGFzeV9sYW5kc2NhcGUucG5nJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<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> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableUnCLIPImg2ImgPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;fusing/stable-unclip-2-1-l-img2img&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)  <span class="hljs-comment"># TODO update model path</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://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>response = requests.get(url)
<span class="hljs-meta">&gt;&gt;&gt; </span>init_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>init_image = init_image.resize((<span class="hljs-number">768</span>, <span class="hljs-number">512</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A fantasy landscape, trending on artstation&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(prompt, init_image).images
<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;fantasy_landscape.png&quot;</span>)`}}),{c(){f=a("p"),P=s("Examples:"),h=r(),b(u.$$.fragment)},l(p){f=o(p,"P",{});var U=i(f);P=l(U,"Examples:"),U.forEach(n),h=d(p),_(u.$$.fragment,p)},m(p,U){g(p,f,U),e(f,P),g(p,h,U),v(u,p,U),C=!0},p:ko,i(p){C||(y(u.$$.fragment,p),C=!0)},o(p){w(u.$$.fragment,p),C=!1},d(p){p&&n(f),p&&n(h),I(u,p)}}}function lp(x){let f,P;return{c(){f=a("p"),P=s(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(h){f=o(h,"P",{});var u=i(f);P=l(u,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),u.forEach(n)},m(h,u){g(h,f,u),e(f,P)},d(h){h&&n(f)}}}function rp(x){let f,P,h,u,C;return u=new ce({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(){f=a("p"),P=s("Examples:"),h=r(),b(u.$$.fragment)},l(p){f=o(p,"P",{});var U=i(f);P=l(U,"Examples:"),U.forEach(n),h=d(p),_(u.$$.fragment,p)},m(p,U){g(p,f,U),e(f,P),g(p,h,U),v(u,p,U),C=!0},p:ko,i(p){C||(y(u.$$.fragment,p),C=!0)},o(p){w(u.$$.fragment,p),C=!1},d(p){p&&n(f),p&&n(h),I(u,p)}}}function dp(x){let f,P,h,u,C,p,U,ee,te,G,N,Yt,Qt,jo,Lo,Ca,Dt,Go,Ta,Be,Xe,So,Bo,Ea,ne,me,cn,Ve,Xo,mn,Vo,Ja,k,No,fn,Fo,zo,un,Ro,Ao,gn,Yo,Qo,hn,Do,qo,xa,ae,fe,bn,Ne,Ho,_n,Oo,Za,ue,qt,Ko,Fe,vn,ze,ei,ti,yn,Re,ni,ai,Ht,oi,wn,In,Ae,ii,Wa,oe,ge,Un,Ye,si,Pn,li,ka,Qe,ja,he,La,ie,be,Mn,De,ri,$n,di,Ga,qe,Sa,_e,pi,Cn,ci,mi,Ba,He,Xa,se,ve,Tn,Oe,fi,En,ui,Va,Ot,gi,Na,Ke,Fa,Kt,hi,za,et,Ra,le,ye,Jn,tt,bi,xn,_i,Aa,M,nt,vi,Zn,yi,wi,at,Ii,en,Ui,Pi,Mi,F,ot,$i,Wn,Ci,Ti,we,Ei,z,it,Ji,kn,xi,Zi,jn,Wi,ki,Ie,st,ji,lt,Li,Ln,Gi,Si,Bi,R,rt,Xi,Gn,Vi,Ni,Sn,Fi,zi,Ue,dt,Ri,pt,Ai,Bn,Yi,Qi,Di,j,ct,qi,mt,Hi,ft,Oi,Ki,es,Xn,ts,ns,Pe,as,Me,os,$e,ut,is,gt,ss,ht,ls,rs,ds,Ce,bt,ps,S,cs,Vn,ms,fs,Nn,us,gs,Fn,hs,bs,zn,_s,vs,ys,Te,_t,ws,vt,Is,Rn,Us,Ps,Ms,Z,yt,$s,re,Cs,An,Ts,Es,Yn,Js,xs,Zs,Qn,Ws,ks,wt,Dn,js,Ls,qn,Gs,Ss,It,Bs,Hn,Xs,Vs,Ns,On,Fs,Ya,de,Ee,Kn,Ut,zs,ea,Rs,Qa,$,Pt,As,ta,Ys,Qs,Mt,Ds,tn,qs,Hs,Os,A,$t,Ks,na,el,tl,Je,nl,Y,Ct,al,aa,ol,il,oa,sl,ll,xe,Tt,rl,Et,dl,ia,pl,cl,ml,Q,Jt,fl,sa,ul,gl,la,hl,bl,Ze,xt,_l,Zt,vl,ra,yl,wl,Il,L,Wt,Ul,kt,Pl,jt,Ml,$l,Cl,da,Tl,El,We,Jl,ke,xl,je,Lt,Zl,Gt,Wl,St,kl,jl,Ll,Le,Bt,Gl,B,Sl,pa,Bl,Xl,ca,Vl,Nl,ma,Fl,zl,fa,Rl,Al,Yl,Ge,Xt,Ql,Vt,Dl,ua,ql,Hl,Ol,W,Nt,Kl,pe,er,ga,tr,nr,ha,ar,or,ir,ba,sr,lr,Ft,_a,rr,dr,va,pr,cr,zt,mr,ya,fr,ur,gr,wa,hr,Da;return p=new Se({}),Ve=new Se({}),Ne=new Se({}),Ye=new Se({}),Qe=new ce({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwVW5DTElQU2NoZWR1bGVyJTJDJTIwRERQTVNjaGVkdWxlciUyQyUyMFN0YWJsZVVuQ0xJUFBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy5tb2RlbHMlMjBpbXBvcnQlMjBQcmlvclRyYW5zZm9ybWVyJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBUb2tlbml6ZXIlMkMlMjBDTElQVGV4dE1vZGVsV2l0aFByb2plY3Rpb24lMEElMEFwcmlvcl9tb2RlbF9pZCUyMCUzRCUyMCUyMmtha2FvYnJhaW4lMkZrYXJsby12MS1hbHBoYSUyMiUwQWRhdGFfdHlwZSUyMCUzRCUyMHRvcmNoLmZsb2F0MTYlMEFwcmlvciUyMCUzRCUyMFByaW9yVHJhbnNmb3JtZXIuZnJvbV9wcmV0cmFpbmVkKHByaW9yX21vZGVsX2lkJTJDJTIwc3ViZm9sZGVyJTNEJTIycHJpb3IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRGRhdGFfdHlwZSklMEElMEFwcmlvcl90ZXh0X21vZGVsX2lkJTIwJTNEJTIwJTIyb3BlbmFpJTJGY2xpcC12aXQtbGFyZ2UtcGF0Y2gxNCUyMiUwQXByaW9yX3Rva2VuaXplciUyMCUzRCUyMENMSVBUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKHByaW9yX3RleHRfbW9kZWxfaWQpJTBBcHJpb3JfdGV4dF9tb2RlbCUyMCUzRCUyMENMSVBUZXh0TW9kZWxXaXRoUHJvamVjdGlvbi5mcm9tX3ByZXRyYWluZWQocHJpb3JfdGV4dF9tb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEZGF0YV90eXBlKSUwQXByaW9yX3NjaGVkdWxlciUyMCUzRCUyMFVuQ0xJUFNjaGVkdWxlci5mcm9tX3ByZXRyYWluZWQocHJpb3JfbW9kZWxfaWQlMkMlMjBzdWJmb2xkZXIlM0QlMjJwcmlvcl9zY2hlZHVsZXIlMjIpJTBBcHJpb3Jfc2NoZWR1bGVyJTIwJTNEJTIwRERQTVNjaGVkdWxlci5mcm9tX2NvbmZpZyhwcmlvcl9zY2hlZHVsZXIuY29uZmlnKSUwQSUwQXN0YWJsZV91bmNsaXBfbW9kZWxfaWQlMjAlM0QlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24tMi0xLXVuY2xpcC1zbWFsbCUyMiUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVVbkNMSVBQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwc3RhYmxlX3VuY2xpcF9tb2RlbF9pZCUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEZGF0YV90eXBlJTJDJTBBJTIwJTIwJTIwJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIlMkMlMEElMjAlMjAlMjAlMjBwcmlvcl90b2tlbml6ZXIlM0Rwcmlvcl90b2tlbml6ZXIlMkMlMEElMjAlMjAlMjAlMjBwcmlvcl90ZXh0X2VuY29kZXIlM0Rwcmlvcl90ZXh0X21vZGVsJTJDJTBBJTIwJTIwJTIwJTIwcHJpb3IlM0RwcmlvciUyQyUwQSUyMCUyMCUyMCUyMHByaW9yX3NjaGVkdWxlciUzRHByaW9yX3NjaGVkdWxlciUyQyUwQSklMEElMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXdhdmVfcHJvbXB0JTIwJTNEJTIwJTIyZHJhbWF0aWMlMjB3YXZlJTJDJTIwdGhlJTIwT2NlYW5zJTIwcm9hciUyQyUyMFN0cm9uZyUyMHdhdmUlMjBzcGlyYWwlMjBhY3Jvc3MlMjB0aGUlMjBvY2VhbnMlMjBhcyUyMHRoZSUyMHdhdmVzJTIwdW5mdXJsJTIwaW50byUyMHJvYXJpbmclMjBjcmVzdHMlM0IlMjBwZXJmZWN0JTIwd2F2ZSUyMGZvcm0lM0IlMjBwZXJmZWN0JTIwd2F2ZSUyMHNoYXBlJTNCJTIwZHJhbWF0aWMlMjB3YXZlJTIwc2hhcGUlM0IlMjB3YXZlJTIwc2hhcGUlMjB1bmJlbGlldmFibGUlM0IlMjB3YXZlJTNCJTIwd2F2ZSUyMHNoYXBlJTIwc3BlY3RhY3VsYXIlMjIlMEElMEFpbWFnZXMlMjAlM0QlMjBwaXBlKHByb21wdCUzRHdhdmVfcHJvbXB0KS5pbWFnZXMlMEFpbWFnZXMlNUIwJTVELnNhdmUoJTIyd2F2ZXMucG5nJTIyKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UnCLIPScheduler, DDPMScheduler, StableUnCLIPPipeline
<span class="hljs-keyword">from</span> diffusers.models <span class="hljs-keyword">import</span> PriorTransformer
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPTokenizer, CLIPTextModelWithProjection

prior_model_id = <span class="hljs-string">&quot;kakaobrain/karlo-v1-alpha&quot;</span>
data_type = torch.float16
prior = PriorTransformer.from_pretrained(prior_model_id, subfolder=<span class="hljs-string">&quot;prior&quot;</span>, torch_dtype=data_type)

prior_text_model_id = <span class="hljs-string">&quot;openai/clip-vit-large-patch14&quot;</span>
prior_tokenizer = CLIPTokenizer.from_pretrained(prior_text_model_id)
prior_text_model = CLIPTextModelWithProjection.from_pretrained(prior_text_model_id, torch_dtype=data_type)
prior_scheduler = UnCLIPScheduler.from_pretrained(prior_model_id, subfolder=<span class="hljs-string">&quot;prior_scheduler&quot;</span>)
prior_scheduler = DDPMScheduler.from_config(prior_scheduler.config)

stable_unclip_model_id = <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1-unclip-small&quot;</span>

pipe = StableUnCLIPPipeline.from_pretrained(
    stable_unclip_model_id,
    torch_dtype=data_type,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
    prior_tokenizer=prior_tokenizer,
    prior_text_encoder=prior_text_model,
    prior=prior,
    prior_scheduler=prior_scheduler,
)

pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
wave_prompt = <span class="hljs-string">&quot;dramatic wave, the Oceans roar, Strong wave spiral across the oceans as the waves unfurl into roaring crests; perfect wave form; perfect wave shape; dramatic wave shape; wave shape unbelievable; wave; wave shape spectacular&quot;</span>

images = pipe(prompt=wave_prompt).images
images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;waves.png&quot;</span>)`}}),he=new yr({props:{warning:!0,$$slots:{default:[np]},$$scope:{ctx:x}}}),De=new Se({}),qe=new ce({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZVVuQ0xJUEltZzJJbWdQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlVW5DTElQSW1nMkltZ1BpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24tMi0xLXVuY2xpcCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHZhcmlhdGlvbiUzRCUyMmZwMTYlMjIlMEEpJTBBcGlwZSUyMCUzRCUyMHBpcGUudG8oJTIyY3VkYSUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZoZi1pbnRlcm5hbC10ZXN0aW5nJTJGZGlmZnVzZXJzLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGc3RhYmxlX3VuY2xpcCUyRnRhcnNpbGFfZG9fYW1hcmFsLnBuZyUyMiUwQWluaXRfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKHVybCklMEElMEFpbWFnZXMlMjAlM0QlMjBwaXBlKGluaXRfaW1hZ2UpLmltYWdlcyUwQWltYWdlcyU1QjAlNUQuc2F2ZSglMjJ2YXJpYXRpb25faW1hZ2UucG5nJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableUnCLIPImg2ImgPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">import</span> torch

pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1-unclip&quot;</span>, torch_dtype=torch.float16, variation=<span class="hljs-string">&quot;fp16&quot;</span>
)
pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

url = <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/tarsila_do_amaral.png&quot;</span>
init_image = load_image(url)

images = pipe(init_image).images
images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;variation_image.png&quot;</span>)`}}),He=new ce({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMGZhbnRhc3klMjBsYW5kc2NhcGUlMkMlMjB0cmVuZGluZyUyMG9uJTIwYXJ0c3RhdGlvbiUyMiUwQSUwQWltYWdlcyUyMCUzRCUyMHBpcGUoaW5pdF9pbWFnZSUyQyUyMHByb21wdCUzRHByb21wdCkuaW1hZ2VzJTBBaW1hZ2VzJTVCMCU1RC5zYXZlKCUyMnZhcmlhdGlvbl9pbWFnZV90d28ucG5nJTIyKQ==",highlighted:`prompt = <span class="hljs-string">&quot;A fantasy landscape, trending on artstation&quot;</span>

images = pipe(init_image, prompt=prompt).images
images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;variation_image_two.png&quot;</span>)`}}),Oe=new Se({}),Ke=new ce({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZVVuQ0xJUEltZzJJbWdQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlVW5DTElQSW1nMkltZ1BpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24tMi0xLXVuY2xpcCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHZhcmlhdGlvbiUzRCUyMmZwMTYlMjIlMEEpJTBBJTIzJTIwT2ZmbG9hZCUyMHRvJTIwQ1BVLiUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZoZi1pbnRlcm5hbC10ZXN0aW5nJTJGZGlmZnVzZXJzLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGc3RhYmxlX3VuY2xpcCUyRnRhcnNpbGFfZG9fYW1hcmFsLnBuZyUyMiUwQWluaXRfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKHVybCklMEElMEFpbWFnZXMlMjAlM0QlMjBwaXBlKGluaXRfaW1hZ2UpLmltYWdlcyUwQWltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableUnCLIPImg2ImgPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">import</span> torch

pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1-unclip&quot;</span>, torch_dtype=torch.float16, variation=<span class="hljs-string">&quot;fp16&quot;</span>
)
<span class="hljs-comment"># Offload to CPU.</span>
pipe.enable_model_cpu_offload()

url = <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/tarsila_do_amaral.png&quot;</span>
init_image = load_image(url)

images = pipe(init_image).images
images[<span class="hljs-number">0</span>]`}}),et=new ce({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZVVuQ0xJUEltZzJJbWdQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlVW5DTElQSW1nMkltZ1BpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24tMi0xLXVuY2xpcCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHZhcmlhdGlvbiUzRCUyMmZwMTYlMjIlMEEpJTBBcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQXBpcGUuZW5hYmxlX3ZhZV9zbGljaW5nKCklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZoZi1pbnRlcm5hbC10ZXN0aW5nJTJGZGlmZnVzZXJzLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGc3RhYmxlX3VuY2xpcCUyRnRhcnNpbGFfZG9fYW1hcmFsLnBuZyUyMiUwQWluaXRfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKHVybCklMEElMEFpbWFnZXMlMjAlM0QlMjBwaXBlKGluaXRfaW1hZ2UpLmltYWdlcyUwQWltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableUnCLIPImg2ImgPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">import</span> torch

pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1-unclip&quot;</span>, torch_dtype=torch.float16, variation=<span class="hljs-string">&quot;fp16&quot;</span>
)
pipe.enable_model_cpu_offload()
pipe.enable_vae_slicing()

url = <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/tarsila_do_amaral.png&quot;</span>
init_image = load_image(url)

images = pipe(init_image).images
images[<span class="hljs-number">0</span>]`}}),tt=new Se({}),nt=new J({props:{name:"class diffusers.StableUnCLIPPipeline",anchor:"diffusers.StableUnCLIPPipeline",parameters:[{name:"prior_tokenizer",val:": CLIPTokenizer"},{name:"prior_text_encoder",val:": CLIPTextModelWithProjection"},{name:"prior",val:": PriorTransformer"},{name:"prior_scheduler",val:": KarrasDiffusionSchedulers"},{name:"image_normalizer",val:": StableUnCLIPImageNormalizer"},{name:"image_noising_scheduler",val:": KarrasDiffusionSchedulers"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"text_encoder",val:": CLIPTextModelWithProjection"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"vae",val:": AutoencoderKL"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPPipeline.prior_tokenizer",description:`<strong>prior_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:"prior_tokenizer"},{anchor:"diffusers.StableUnCLIPPipeline.prior_text_encoder",description:`<strong>prior_text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"prior_text_encoder"},{anchor:"diffusers.StableUnCLIPPipeline.prior",description:`<strong>prior</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonincal unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior"},{anchor:"diffusers.StableUnCLIPPipeline.prior_scheduler",description:`<strong>prior_scheduler</strong> (<code>KarrasDiffusionSchedulers</code>) &#x2014;
Scheduler used in the prior denoising process.`,name:"prior_scheduler"},{anchor:"diffusers.StableUnCLIPPipeline.image_normalizer",description:`<strong>image_normalizer</strong> (<code>StableUnCLIPImageNormalizer</code>) &#x2014;
Used to normalize the predicted image embeddings before the noise is applied and un-normalize the image
embeddings after the noise has been applied.`,name:"image_normalizer"},{anchor:"diffusers.StableUnCLIPPipeline.image_noising_scheduler",description:`<strong>image_noising_scheduler</strong> (<code>KarrasDiffusionSchedulers</code>) &#x2014;
Noise schedule for adding noise to the predicted image embeddings. The amount of noise to add is determined
by <code>noise_level</code> in <code>StableUnCLIPPipeline.__call__</code>.`,name:"image_noising_scheduler"},{anchor:"diffusers.StableUnCLIPPipeline.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.StableUnCLIPPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.StableUnCLIPPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableUnCLIPPipeline.scheduler",description:`<strong>scheduler</strong> (<code>KarrasDiffusionSchedulers</code>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.StableUnCLIPPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L53"}}),ot=new J({props:{name:"__call__",anchor:"diffusers.StableUnCLIPPipeline.__call__",parameters:[{name:"prompt",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 = 20"},{name:"guidance_scale",val:": float = 10.0"},{name:"negative_prompt",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.Optional[torch._C.Generator] = 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:"noise_level",val:": int = 0"},{name:"prior_num_inference_steps",val:": int = 25"},{name:"prior_guidance_scale",val:": float = 4.0"},{name:"prior_latents",val:": typing.Optional[torch.FloatTensor] = None"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 20) &#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.StableUnCLIPPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 10.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.18.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.18.2/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__call__.noise_level",description:`<strong>noise_level</strong> (<code>int</code>, <em>optional</em>, defaults to <code>0</code>) &#x2014;
The amount of noise to add to the image embeddings. A higher <code>noise_level</code> increases the variance in
the final un-noised images. See <code>StableUnCLIPPipeline.noise_image_embeddings</code> for details.`,name:"noise_level"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.prior_num_inference_steps",description:`<strong>prior_num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 25) &#x2014;
The number of denoising steps in the prior denoising process. More denoising steps usually lead to a
higher quality image at the expense of slower inference.`,name:"prior_num_inference_steps"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.prior_guidance_scale",description:`<strong>prior_guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale for the prior denoising process as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion
Guidance</a>. <code>prior_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:"prior_guidance_scale"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.prior_latents",description:`<strong>prior_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
embedding generation in the prior denoising process. 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:"prior_latents"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L654",returnDescription:`
<p><code>~ pipeline_utils.ImagePipelineOutput</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><a
  href="/docs/diffusers/v0.18.2/en/api/outputs#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),we=new Wo({props:{anchor:"diffusers.StableUnCLIPPipeline.__call__.example",$$slots:{default:[ap]},$$scope:{ctx:x}}}),it=new J({props:{name:"enable_attention_slicing",anchor:"diffusers.StableUnCLIPPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPPipeline.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/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1470"}}),st=new J({props:{name:"disable_attention_slicing",anchor:"diffusers.StableUnCLIPPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1486"}}),rt=new J({props:{name:"enable_vae_slicing",anchor:"diffusers.StableUnCLIPPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L144"}}),dt=new J({props:{name:"disable_vae_slicing",anchor:"diffusers.StableUnCLIPPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L154"}}),ct=new J({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableUnCLIPPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPPipeline.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/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1408"}}),Pe=new yr({props:{warning:!0,$$slots:{default:[op]},$$scope:{ctx:x}}}),Me=new Wo({props:{anchor:"diffusers.StableUnCLIPPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[ip]},$$scope:{ctx:x}}}),ut=new J({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableUnCLIPPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1444"}}),bt=new J({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableUnCLIPPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L185"}}),_t=new J({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableUnCLIPPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L161"}}),yt=new J({props:{name:"noise_image_embeddings",anchor:"diffusers.StableUnCLIPPipeline.noise_image_embeddings",parameters:[{name:"image_embeds",val:": Tensor"},{name:"noise_level",val:": int"},{name:"noise",val:": typing.Optional[torch.FloatTensor] = None"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L608"}}),Ut=new Se({}),Pt=new J({props:{name:"class diffusers.StableUnCLIPImg2ImgPipeline",anchor:"diffusers.StableUnCLIPImg2ImgPipeline",parameters:[{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"image_encoder",val:": CLIPVisionModelWithProjection"},{name:"image_normalizer",val:": StableUnCLIPImageNormalizer"},{name:"image_noising_scheduler",val:": KarrasDiffusionSchedulers"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"text_encoder",val:": CLIPTextModel"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"vae",val:": AutoencoderKL"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Feature extractor for image pre-processing before being encoded.`,name:"feature_extractor"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.image_encoder",description:`<strong>image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
CLIP vision model for encoding images.`,name:"image_encoder"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.image_normalizer",description:`<strong>image_normalizer</strong> (<code>StableUnCLIPImageNormalizer</code>) &#x2014;
Used to normalize the predicted image embeddings before the noise is applied and un-normalize the image
embeddings after the noise has been applied.`,name:"image_normalizer"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.image_noising_scheduler",description:`<strong>image_noising_scheduler</strong> (<code>KarrasDiffusionSchedulers</code>) &#x2014;
Noise schedule for adding noise to the predicted image embeddings. The amount of noise to add is determined
by <code>noise_level</code> in <code>StableUnCLIPPipeline.__call__</code>.`,name:"image_noising_scheduler"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.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.StableUnCLIPImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<code>KarrasDiffusionSchedulers</code>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L66"}}),$t=new J({props:{name:"__call__",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__",parameters:[{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image] = None"},{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 20"},{name:"guidance_scale",val:": float = 10"},{name:"negative_prompt",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.Optional[torch._C.Generator] = 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:"noise_level",val:": int = 0"},{name:"image_embeds",val:": typing.Optional[torch.FloatTensor] = None"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__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, either <code>prompt_embeds</code> will be
used or prompt is initialized to <code>&quot;&quot;</code>.`,name:"prompt"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code> or <code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch. The image will be encoded to its CLIP embedding which
the unet will be conditioned on. Note that the image is <em>not</em> encoded by the vae and then used as the
latents in the denoising process such as in the standard stable diffusion text guided image variation
process.`,name:"image"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 20) &#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.StableUnCLIPImg2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 10.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.18.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.18.2/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__call__.noise_level",description:`<strong>noise_level</strong> (<code>int</code>, <em>optional</em>, defaults to <code>0</code>) &#x2014;
The amount of noise to add to the image embeddings. A higher <code>noise_level</code> increases the variance in
the final un-noised images. See <code>StableUnCLIPPipeline.noise_image_embeddings</code> for details.`,name:"noise_level"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated CLIP embeddings to condition the unet on. Note that these are not latents to be used in
the denoising process. If you want to provide pre-generated latents, pass them to <code>__call__</code> as
<code>latents</code>.`,name:"image_embeds"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L621",returnDescription:`
<p><code>~ pipeline_utils.ImagePipelineOutput</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><a
  href="/docs/diffusers/v0.18.2/en/api/outputs#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Je=new Wo({props:{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.example",$$slots:{default:[sp]},$$scope:{ctx:x}}}),Ct=new J({props:{name:"enable_attention_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.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/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1470"}}),Tt=new J({props:{name:"disable_attention_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1486"}}),Jt=new J({props:{name:"enable_vae_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L146"}}),xt=new J({props:{name:"disable_vae_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L156"}}),Wt=new J({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.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/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1408"}}),We=new yr({props:{warning:!0,$$slots:{default:[lp]},$$scope:{ctx:x}}}),ke=new Wo({props:{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[rp]},$$scope:{ctx:x}}}),Lt=new J({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1444"}}),Bt=new J({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L187"}}),Xt=new J({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L163"}}),Nt=new J({props:{name:"noise_image_embeddings",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.noise_image_embeddings",parameters:[{name:"image_embeds",val:": Tensor"},{name:"noise_level",val:": int"},{name:"noise",val:": typing.Optional[torch.FloatTensor] = None"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L575"}}),{c(){f=a("meta"),P=r(),h=a("h1"),u=a("a"),C=a("span"),b(p.$$.fragment),U=r(),ee=a("span"),te=s("Stable unCLIP"),G=r(),N=a("p"),Yt=s("Stable unCLIP checkpoints are finetuned from "),Qt=a("a"),jo=s("stable diffusion 2.1"),Lo=s(` checkpoints to condition on CLIP image embeddings.
Stable unCLIP also still conditions on text embeddings. Given the two separate conditionings, stable unCLIP can be used
for text guided image variation. When combined with an unCLIP prior, it can also be used for full text to image generation.`),Ca=r(),Dt=a("p"),Go=s("To know more about the unCLIP process, check out the following paper:"),Ta=r(),Be=a("p"),Xe=a("a"),So=s("Hierarchical Text-Conditional Image Generation with CLIP Latents"),Bo=s(" by Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, Mark Chen."),Ea=r(),ne=a("h2"),me=a("a"),cn=a("span"),b(Ve.$$.fragment),Xo=r(),mn=a("span"),Vo=s("Tips"),Ja=r(),k=a("p"),No=s("Stable unCLIP takes a "),fn=a("code"),Fo=s("noise_level"),zo=s(" as input during inference. "),un=a("code"),Ro=s("noise_level"),Ao=s(` determines how much noise is added
to the image embeddings. A higher `),gn=a("code"),Yo=s("noise_level"),Qo=s(` increases variation in the final un-noised images. By default,
we do not add any additional noise to the image embeddings i.e. `),hn=a("code"),Do=s("noise_level = 0"),qo=s("."),xa=r(),ae=a("h3"),fe=a("a"),bn=a("span"),b(Ne.$$.fragment),Ho=r(),_n=a("span"),Oo=s("Available checkpoints:"),Za=r(),ue=a("ul"),qt=a("li"),Ko=s("Image variation"),Fe=a("ul"),vn=a("li"),ze=a("a"),ei=s("stabilityai/stable-diffusion-2-1-unclip"),ti=r(),yn=a("li"),Re=a("a"),ni=s("stabilityai/stable-diffusion-2-1-unclip-small"),ai=r(),Ht=a("li"),oi=s("Text-to-image "),wn=a("ul"),In=a("li"),Ae=a("a"),ii=s("stabilityai/stable-diffusion-2-1-unclip-small"),Wa=r(),oe=a("h3"),ge=a("a"),Un=a("span"),b(Ye.$$.fragment),si=r(),Pn=a("span"),li=s("Text-to-Image Generation"),ka=s(`

Stable unCLIP can be leveraged for text-to-image generation by pipelining it with the prior model of KakaoBrain's open source DALL-E 2 replication [Karlo](https://huggingface.co/kakaobrain/karlo-v1-alpha)

	`),b(Qe.$$.fragment),ja=r(),b(he.$$.fragment),La=r(),ie=a("h3"),be=a("a"),Mn=a("span"),b(De.$$.fragment),ri=r(),$n=a("span"),di=s("Text guided Image-to-Image Variation"),Ga=r(),b(qe.$$.fragment),Sa=r(),_e=a("p"),pi=s("Optionally, you can also pass a prompt to "),Cn=a("code"),ci=s("pipe"),mi=s(" such as:"),Ba=r(),b(He.$$.fragment),Xa=r(),se=a("h3"),ve=a("a"),Tn=a("span"),b(Oe.$$.fragment),fi=r(),En=a("span"),ui=s("Memory optimization"),Va=r(),Ot=a("p"),gi=s(`If you are short on GPU memory, you can enable smart CPU offloading so that models that are not needed
immediately for a computation can be offloaded to CPU:`),Na=r(),b(Ke.$$.fragment),Fa=r(),Kt=a("p"),hi=s("Further memory optimizations are possible by enabling VAE slicing on the pipeline:"),za=r(),b(et.$$.fragment),Ra=r(),le=a("h3"),ye=a("a"),Jn=a("span"),b(tt.$$.fragment),bi=r(),xn=a("span"),_i=s("StableUnCLIPPipeline"),Aa=r(),M=a("div"),b(nt.$$.fragment),vi=r(),Zn=a("p"),yi=s("Pipeline for text-to-image generation using stable unCLIP."),wi=r(),at=a("p"),Ii=s("This model inherits from "),en=a("a"),Ui=s("DiffusionPipeline"),Pi=s(`. 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.)`),Mi=r(),F=a("div"),b(ot.$$.fragment),$i=r(),Wn=a("p"),Ci=s("Function invoked when calling the pipeline for generation."),Ti=r(),b(we.$$.fragment),Ei=r(),z=a("div"),b(it.$$.fragment),Ji=r(),kn=a("p"),xi=s("Enable sliced attention computation."),Zi=r(),jn=a("p"),Wi=s(`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.`),ki=r(),Ie=a("div"),b(st.$$.fragment),ji=r(),lt=a("p"),Li=s("Disable sliced attention computation. If "),Ln=a("code"),Gi=s("enable_attention_slicing"),Si=s(` was previously called, attention is
computed in one step.`),Bi=r(),R=a("div"),b(rt.$$.fragment),Xi=r(),Gn=a("p"),Vi=s("Enable sliced VAE decoding."),Ni=r(),Sn=a("p"),Fi=s(`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.`),zi=r(),Ue=a("div"),b(dt.$$.fragment),Ri=r(),pt=a("p"),Ai=s("Disable sliced VAE decoding. If "),Bn=a("code"),Yi=s("enable_vae_slicing"),Qi=s(` was previously invoked, this method will go back to
computing decoding in one step.`),Di=r(),j=a("div"),b(ct.$$.fragment),qi=r(),mt=a("p"),Hi=s("Enable memory efficient attention from "),ft=a("a"),Oi=s("xFormers"),Ki=s("."),es=r(),Xn=a("p"),ts=s(`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.`),ns=r(),b(Pe.$$.fragment),as=r(),b(Me.$$.fragment),os=r(),$e=a("div"),b(ut.$$.fragment),is=r(),gt=a("p"),ss=s("Disable memory efficient attention from "),ht=a("a"),ls=s("xFormers"),rs=s("."),ds=r(),Ce=a("div"),b(bt.$$.fragment),ps=r(),S=a("p"),cs=s(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Vn=a("code"),ms=s("enable_sequential_cpu_offload"),fs=s(", this method moves one whole model at a time to the GPU when its "),Nn=a("code"),us=s("forward"),gs=s(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Fn=a("code"),hs=s("enable_sequential_cpu_offload"),bs=s(", but performance is much better due to the iterative execution of the "),zn=a("code"),_s=s("unet"),vs=s("."),ys=r(),Te=a("div"),b(_t.$$.fragment),ws=r(),vt=a("p"),Is=s(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),Rn=a("code"),Us=s("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Ps=s("forward` method called."),Ms=r(),Z=a("div"),b(yt.$$.fragment),$s=r(),re=a("p"),Cs=s("Add noise to the image embeddings. The amount of noise is controlled by a "),An=a("code"),Ts=s("noise_level"),Es=s(` input. A higher
`),Yn=a("code"),Js=s("noise_level"),xs=s(" increases the variance in the final un-noised images."),Zs=r(),Qn=a("p"),Ws=s("The noise is applied in two ways"),ks=r(),wt=a("ol"),Dn=a("li"),js=s("A noise schedule is applied directly to the embeddings"),Ls=r(),qn=a("li"),Gs=s("A vector of sinusoidal time embeddings are appended to the output."),Ss=r(),It=a("p"),Bs=s("In both cases, the amount of noise is controlled by the same "),Hn=a("code"),Xs=s("noise_level"),Vs=s("."),Ns=r(),On=a("p"),Fs=s("The embeddings are normalized before the noise is applied and un-normalized after the noise is applied."),Ya=r(),de=a("h3"),Ee=a("a"),Kn=a("span"),b(Ut.$$.fragment),zs=r(),ea=a("span"),Rs=s("StableUnCLIPImg2ImgPipeline"),Qa=r(),$=a("div"),b(Pt.$$.fragment),As=r(),ta=a("p"),Ys=s("Pipeline for text-guided image to image generation using stable unCLIP."),Qs=r(),Mt=a("p"),Ds=s("This model inherits from "),tn=a("a"),qs=s("DiffusionPipeline"),Hs=s(`. 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.)`),Os=r(),A=a("div"),b($t.$$.fragment),Ks=r(),na=a("p"),el=s("Function invoked when calling the pipeline for generation."),tl=r(),b(Je.$$.fragment),nl=r(),Y=a("div"),b(Ct.$$.fragment),al=r(),aa=a("p"),ol=s("Enable sliced attention computation."),il=r(),oa=a("p"),sl=s(`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.`),ll=r(),xe=a("div"),b(Tt.$$.fragment),rl=r(),Et=a("p"),dl=s("Disable sliced attention computation. If "),ia=a("code"),pl=s("enable_attention_slicing"),cl=s(` was previously called, attention is
computed in one step.`),ml=r(),Q=a("div"),b(Jt.$$.fragment),fl=r(),sa=a("p"),ul=s("Enable sliced VAE decoding."),gl=r(),la=a("p"),hl=s(`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.`),bl=r(),Ze=a("div"),b(xt.$$.fragment),_l=r(),Zt=a("p"),vl=s("Disable sliced VAE decoding. If "),ra=a("code"),yl=s("enable_vae_slicing"),wl=s(` was previously invoked, this method will go back to
computing decoding in one step.`),Il=r(),L=a("div"),b(Wt.$$.fragment),Ul=r(),kt=a("p"),Pl=s("Enable memory efficient attention from "),jt=a("a"),Ml=s("xFormers"),$l=s("."),Cl=r(),da=a("p"),Tl=s(`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.`),El=r(),b(We.$$.fragment),Jl=r(),b(ke.$$.fragment),xl=r(),je=a("div"),b(Lt.$$.fragment),Zl=r(),Gt=a("p"),Wl=s("Disable memory efficient attention from "),St=a("a"),kl=s("xFormers"),jl=s("."),Ll=r(),Le=a("div"),b(Bt.$$.fragment),Gl=r(),B=a("p"),Sl=s(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),pa=a("code"),Bl=s("enable_sequential_cpu_offload"),Xl=s(", this method moves one whole model at a time to the GPU when its "),ca=a("code"),Vl=s("forward"),Nl=s(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),ma=a("code"),Fl=s("enable_sequential_cpu_offload"),zl=s(", but performance is much better due to the iterative execution of the "),fa=a("code"),Rl=s("unet"),Al=s("."),Yl=r(),Ge=a("div"),b(Xt.$$.fragment),Ql=r(),Vt=a("p"),Dl=s(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),ua=a("code"),ql=s("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Hl=s("forward` method called."),Ol=r(),W=a("div"),b(Nt.$$.fragment),Kl=r(),pe=a("p"),er=s("Add noise to the image embeddings. The amount of noise is controlled by a "),ga=a("code"),tr=s("noise_level"),nr=s(` input. A higher
`),ha=a("code"),ar=s("noise_level"),or=s(" increases the variance in the final un-noised images."),ir=r(),ba=a("p"),sr=s("The noise is applied in two ways"),lr=r(),Ft=a("ol"),_a=a("li"),rr=s("A noise schedule is applied directly to the embeddings"),dr=r(),va=a("li"),pr=s("A vector of sinusoidal time embeddings are appended to the output."),cr=r(),zt=a("p"),mr=s("In both cases, the amount of noise is controlled by the same "),ya=a("code"),fr=s("noise_level"),ur=s("."),gr=r(),wa=a("p"),hr=s("The embeddings are normalized before the noise is applied and un-normalized after the noise is applied."),this.h()},l(t){const m=ep('[data-svelte="svelte-1phssyn"]',document.head);f=o(m,"META",{name:!0,content:!0}),m.forEach(n),P=d(t),h=o(t,"H1",{class:!0});var Rt=i(h);u=o(Rt,"A",{id:!0,class:!0,href:!0});var Ia=i(u);C=o(Ia,"SPAN",{});var Ua=i(C);_(p.$$.fragment,Ua),Ua.forEach(n),Ia.forEach(n),U=d(Rt),ee=o(Rt,"SPAN",{});var Pa=i(ee);te=l(Pa,"Stable unCLIP"),Pa.forEach(n),Rt.forEach(n),G=d(t),N=o(t,"P",{});var At=i(N);Yt=l(At,"Stable unCLIP checkpoints are finetuned from "),Qt=o(At,"A",{href:!0});var Ma=i(Qt);jo=l(Ma,"stable diffusion 2.1"),Ma.forEach(n),Lo=l(At,` checkpoints to condition on CLIP image embeddings.
Stable unCLIP also still conditions on text embeddings. Given the two separate conditionings, stable unCLIP can be used
for text guided image variation. When combined with an unCLIP prior, it can also be used for full text to image generation.`),At.forEach(n),Ca=d(t),Dt=o(t,"P",{});var $a=i(Dt);Go=l($a,"To know more about the unCLIP process, check out the following paper:"),$a.forEach(n),Ta=d(t),Be=o(t,"P",{});var br=i(Be);Xe=o(br,"A",{href:!0,rel:!0});var wr=i(Xe);So=l(wr,"Hierarchical Text-Conditional Image Generation with CLIP Latents"),wr.forEach(n),Bo=l(br," by Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, Mark Chen."),br.forEach(n),Ea=d(t),ne=o(t,"H2",{class:!0});var qa=i(ne);me=o(qa,"A",{id:!0,class:!0,href:!0});var Ir=i(me);cn=o(Ir,"SPAN",{});var Ur=i(cn);_(Ve.$$.fragment,Ur),Ur.forEach(n),Ir.forEach(n),Xo=d(qa),mn=o(qa,"SPAN",{});var Pr=i(mn);Vo=l(Pr,"Tips"),Pr.forEach(n),qa.forEach(n),Ja=d(t),k=o(t,"P",{});var D=i(k);No=l(D,"Stable unCLIP takes a "),fn=o(D,"CODE",{});var Mr=i(fn);Fo=l(Mr,"noise_level"),Mr.forEach(n),zo=l(D," as input during inference. "),un=o(D,"CODE",{});var $r=i(un);Ro=l($r,"noise_level"),$r.forEach(n),Ao=l(D,` determines how much noise is added
to the image embeddings. A higher `),gn=o(D,"CODE",{});var Cr=i(gn);Yo=l(Cr,"noise_level"),Cr.forEach(n),Qo=l(D,` increases variation in the final un-noised images. By default,
we do not add any additional noise to the image embeddings i.e. `),hn=o(D,"CODE",{});var Tr=i(hn);Do=l(Tr,"noise_level = 0"),Tr.forEach(n),qo=l(D,"."),D.forEach(n),xa=d(t),ae=o(t,"H3",{class:!0});var Ha=i(ae);fe=o(Ha,"A",{id:!0,class:!0,href:!0});var Er=i(fe);bn=o(Er,"SPAN",{});var Jr=i(bn);_(Ne.$$.fragment,Jr),Jr.forEach(n),Er.forEach(n),Ho=d(Ha),_n=o(Ha,"SPAN",{});var xr=i(_n);Oo=l(xr,"Available checkpoints:"),xr.forEach(n),Ha.forEach(n),Za=d(t),ue=o(t,"UL",{});var Oa=i(ue);qt=o(Oa,"LI",{});var _r=i(qt);Ko=l(_r,"Image variation"),Fe=o(_r,"UL",{});var Ka=i(Fe);vn=o(Ka,"LI",{});var Zr=i(vn);ze=o(Zr,"A",{href:!0,rel:!0});var Wr=i(ze);ei=l(Wr,"stabilityai/stable-diffusion-2-1-unclip"),Wr.forEach(n),Zr.forEach(n),ti=d(Ka),yn=o(Ka,"LI",{});var kr=i(yn);Re=o(kr,"A",{href:!0,rel:!0});var jr=i(Re);ni=l(jr,"stabilityai/stable-diffusion-2-1-unclip-small"),jr.forEach(n),kr.forEach(n),Ka.forEach(n),_r.forEach(n),ai=d(Oa),Ht=o(Oa,"LI",{});var vr=i(Ht);oi=l(vr,"Text-to-image "),wn=o(vr,"UL",{});var Lr=i(wn);In=o(Lr,"LI",{});var Gr=i(In);Ae=o(Gr,"A",{href:!0,rel:!0});var Sr=i(Ae);ii=l(Sr,"stabilityai/stable-diffusion-2-1-unclip-small"),Sr.forEach(n),Gr.forEach(n),Lr.forEach(n),vr.forEach(n),Oa.forEach(n),Wa=d(t),oe=o(t,"H3",{class:!0});var eo=i(oe);ge=o(eo,"A",{id:!0,class:!0,href:!0});var Br=i(ge);Un=o(Br,"SPAN",{});var Xr=i(Un);_(Ye.$$.fragment,Xr),Xr.forEach(n),Br.forEach(n),si=d(eo),Pn=o(eo,"SPAN",{});var Vr=i(Pn);li=l(Vr,"Text-to-Image Generation"),Vr.forEach(n),eo.forEach(n),ka=l(t,`

Stable unCLIP can be leveraged for text-to-image generation by pipelining it with the prior model of KakaoBrain's open source DALL-E 2 replication [Karlo](https://huggingface.co/kakaobrain/karlo-v1-alpha)

	`),_(Qe.$$.fragment,t),ja=d(t),_(he.$$.fragment,t),La=d(t),ie=o(t,"H3",{class:!0});var to=i(ie);be=o(to,"A",{id:!0,class:!0,href:!0});var Nr=i(be);Mn=o(Nr,"SPAN",{});var Fr=i(Mn);_(De.$$.fragment,Fr),Fr.forEach(n),Nr.forEach(n),ri=d(to),$n=o(to,"SPAN",{});var zr=i($n);di=l(zr,"Text guided Image-to-Image Variation"),zr.forEach(n),to.forEach(n),Ga=d(t),_(qe.$$.fragment,t),Sa=d(t),_e=o(t,"P",{});var no=i(_e);pi=l(no,"Optionally, you can also pass a prompt to "),Cn=o(no,"CODE",{});var Rr=i(Cn);ci=l(Rr,"pipe"),Rr.forEach(n),mi=l(no," such as:"),no.forEach(n),Ba=d(t),_(He.$$.fragment,t),Xa=d(t),se=o(t,"H3",{class:!0});var ao=i(se);ve=o(ao,"A",{id:!0,class:!0,href:!0});var Ar=i(ve);Tn=o(Ar,"SPAN",{});var Yr=i(Tn);_(Oe.$$.fragment,Yr),Yr.forEach(n),Ar.forEach(n),fi=d(ao),En=o(ao,"SPAN",{});var Qr=i(En);ui=l(Qr,"Memory optimization"),Qr.forEach(n),ao.forEach(n),Va=d(t),Ot=o(t,"P",{});var Dr=i(Ot);gi=l(Dr,`If you are short on GPU memory, you can enable smart CPU offloading so that models that are not needed
immediately for a computation can be offloaded to CPU:`),Dr.forEach(n),Na=d(t),_(Ke.$$.fragment,t),Fa=d(t),Kt=o(t,"P",{});var qr=i(Kt);hi=l(qr,"Further memory optimizations are possible by enabling VAE slicing on the pipeline:"),qr.forEach(n),za=d(t),_(et.$$.fragment,t),Ra=d(t),le=o(t,"H3",{class:!0});var oo=i(le);ye=o(oo,"A",{id:!0,class:!0,href:!0});var Hr=i(ye);Jn=o(Hr,"SPAN",{});var Or=i(Jn);_(tt.$$.fragment,Or),Or.forEach(n),Hr.forEach(n),bi=d(oo),xn=o(oo,"SPAN",{});var Kr=i(xn);_i=l(Kr,"StableUnCLIPPipeline"),Kr.forEach(n),oo.forEach(n),Aa=d(t),M=o(t,"DIV",{class:!0});var T=i(M);_(nt.$$.fragment,T),vi=d(T),Zn=o(T,"P",{});var ed=i(Zn);yi=l(ed,"Pipeline for text-to-image generation using stable unCLIP."),ed.forEach(n),wi=d(T),at=o(T,"P",{});var io=i(at);Ii=l(io,"This model inherits from "),en=o(io,"A",{href:!0});var td=i(en);Ui=l(td,"DiffusionPipeline"),td.forEach(n),Pi=l(io,`. 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.)`),io.forEach(n),Mi=d(T),F=o(T,"DIV",{class:!0});var nn=i(F);_(ot.$$.fragment,nn),$i=d(nn),Wn=o(nn,"P",{});var nd=i(Wn);Ci=l(nd,"Function invoked when calling the pipeline for generation."),nd.forEach(n),Ti=d(nn),_(we.$$.fragment,nn),nn.forEach(n),Ei=d(T),z=o(T,"DIV",{class:!0});var an=i(z);_(it.$$.fragment,an),Ji=d(an),kn=o(an,"P",{});var ad=i(kn);xi=l(ad,"Enable sliced attention computation."),ad.forEach(n),Zi=d(an),jn=o(an,"P",{});var od=i(jn);Wi=l(od,`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.`),od.forEach(n),an.forEach(n),ki=d(T),Ie=o(T,"DIV",{class:!0});var so=i(Ie);_(st.$$.fragment,so),ji=d(so),lt=o(so,"P",{});var lo=i(lt);Li=l(lo,"Disable sliced attention computation. If "),Ln=o(lo,"CODE",{});var id=i(Ln);Gi=l(id,"enable_attention_slicing"),id.forEach(n),Si=l(lo,` was previously called, attention is
computed in one step.`),lo.forEach(n),so.forEach(n),Bi=d(T),R=o(T,"DIV",{class:!0});var on=i(R);_(rt.$$.fragment,on),Xi=d(on),Gn=o(on,"P",{});var sd=i(Gn);Vi=l(sd,"Enable sliced VAE decoding."),sd.forEach(n),Ni=d(on),Sn=o(on,"P",{});var ld=i(Sn);Fi=l(ld,`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.`),ld.forEach(n),on.forEach(n),zi=d(T),Ue=o(T,"DIV",{class:!0});var ro=i(Ue);_(dt.$$.fragment,ro),Ri=d(ro),pt=o(ro,"P",{});var po=i(pt);Ai=l(po,"Disable sliced VAE decoding. If "),Bn=o(po,"CODE",{});var rd=i(Bn);Yi=l(rd,"enable_vae_slicing"),rd.forEach(n),Qi=l(po,` was previously invoked, this method will go back to
computing decoding in one step.`),po.forEach(n),ro.forEach(n),Di=d(T),j=o(T,"DIV",{class:!0});var q=i(j);_(ct.$$.fragment,q),qi=d(q),mt=o(q,"P",{});var co=i(mt);Hi=l(co,"Enable memory efficient attention from "),ft=o(co,"A",{href:!0,rel:!0});var dd=i(ft);Oi=l(dd,"xFormers"),dd.forEach(n),Ki=l(co,"."),co.forEach(n),es=d(q),Xn=o(q,"P",{});var pd=i(Xn);ts=l(pd,`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.`),pd.forEach(n),ns=d(q),_(Pe.$$.fragment,q),as=d(q),_(Me.$$.fragment,q),q.forEach(n),os=d(T),$e=o(T,"DIV",{class:!0});var mo=i($e);_(ut.$$.fragment,mo),is=d(mo),gt=o(mo,"P",{});var fo=i(gt);ss=l(fo,"Disable memory efficient attention from "),ht=o(fo,"A",{href:!0,rel:!0});var cd=i(ht);ls=l(cd,"xFormers"),cd.forEach(n),rs=l(fo,"."),fo.forEach(n),mo.forEach(n),ds=d(T),Ce=o(T,"DIV",{class:!0});var uo=i(Ce);_(bt.$$.fragment,uo),ps=d(uo),S=o(uo,"P",{});var H=i(S);cs=l(H,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Vn=o(H,"CODE",{});var md=i(Vn);ms=l(md,"enable_sequential_cpu_offload"),md.forEach(n),fs=l(H,", this method moves one whole model at a time to the GPU when its "),Nn=o(H,"CODE",{});var fd=i(Nn);us=l(fd,"forward"),fd.forEach(n),gs=l(H,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Fn=o(H,"CODE",{});var ud=i(Fn);hs=l(ud,"enable_sequential_cpu_offload"),ud.forEach(n),bs=l(H,", but performance is much better due to the iterative execution of the "),zn=o(H,"CODE",{});var gd=i(zn);_s=l(gd,"unet"),gd.forEach(n),vs=l(H,"."),H.forEach(n),uo.forEach(n),ys=d(T),Te=o(T,"DIV",{class:!0});var go=i(Te);_(_t.$$.fragment,go),ws=d(go),vt=o(go,"P",{});var ho=i(vt);Is=l(ho,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),Rn=o(ho,"CODE",{});var hd=i(Rn);Us=l(hd,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),hd.forEach(n),Ps=l(ho,"forward` method called."),ho.forEach(n),go.forEach(n),Ms=d(T),Z=o(T,"DIV",{class:!0});var X=i(Z);_(yt.$$.fragment,X),$s=d(X),re=o(X,"P",{});var sn=i(re);Cs=l(sn,"Add noise to the image embeddings. The amount of noise is controlled by a "),An=o(sn,"CODE",{});var bd=i(An);Ts=l(bd,"noise_level"),bd.forEach(n),Es=l(sn,` input. A higher
`),Yn=o(sn,"CODE",{});var _d=i(Yn);Js=l(_d,"noise_level"),_d.forEach(n),xs=l(sn," increases the variance in the final un-noised images."),sn.forEach(n),Zs=d(X),Qn=o(X,"P",{});var vd=i(Qn);Ws=l(vd,"The noise is applied in two ways"),vd.forEach(n),ks=d(X),wt=o(X,"OL",{});var bo=i(wt);Dn=o(bo,"LI",{});var yd=i(Dn);js=l(yd,"A noise schedule is applied directly to the embeddings"),yd.forEach(n),Ls=d(bo),qn=o(bo,"LI",{});var wd=i(qn);Gs=l(wd,"A vector of sinusoidal time embeddings are appended to the output."),wd.forEach(n),bo.forEach(n),Ss=d(X),It=o(X,"P",{});var _o=i(It);Bs=l(_o,"In both cases, the amount of noise is controlled by the same "),Hn=o(_o,"CODE",{});var Id=i(Hn);Xs=l(Id,"noise_level"),Id.forEach(n),Vs=l(_o,"."),_o.forEach(n),Ns=d(X),On=o(X,"P",{});var Ud=i(On);Fs=l(Ud,"The embeddings are normalized before the noise is applied and un-normalized after the noise is applied."),Ud.forEach(n),X.forEach(n),T.forEach(n),Ya=d(t),de=o(t,"H3",{class:!0});var vo=i(de);Ee=o(vo,"A",{id:!0,class:!0,href:!0});var Pd=i(Ee);Kn=o(Pd,"SPAN",{});var Md=i(Kn);_(Ut.$$.fragment,Md),Md.forEach(n),Pd.forEach(n),zs=d(vo),ea=o(vo,"SPAN",{});var $d=i(ea);Rs=l($d,"StableUnCLIPImg2ImgPipeline"),$d.forEach(n),vo.forEach(n),Qa=d(t),$=o(t,"DIV",{class:!0});var E=i($);_(Pt.$$.fragment,E),As=d(E),ta=o(E,"P",{});var Cd=i(ta);Ys=l(Cd,"Pipeline for text-guided image to image generation using stable unCLIP."),Cd.forEach(n),Qs=d(E),Mt=o(E,"P",{});var yo=i(Mt);Ds=l(yo,"This model inherits from "),tn=o(yo,"A",{href:!0});var Td=i(tn);qs=l(Td,"DiffusionPipeline"),Td.forEach(n),Hs=l(yo,`. 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.)`),yo.forEach(n),Os=d(E),A=o(E,"DIV",{class:!0});var ln=i(A);_($t.$$.fragment,ln),Ks=d(ln),na=o(ln,"P",{});var Ed=i(na);el=l(Ed,"Function invoked when calling the pipeline for generation."),Ed.forEach(n),tl=d(ln),_(Je.$$.fragment,ln),ln.forEach(n),nl=d(E),Y=o(E,"DIV",{class:!0});var rn=i(Y);_(Ct.$$.fragment,rn),al=d(rn),aa=o(rn,"P",{});var Jd=i(aa);ol=l(Jd,"Enable sliced attention computation."),Jd.forEach(n),il=d(rn),oa=o(rn,"P",{});var xd=i(oa);sl=l(xd,`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.`),xd.forEach(n),rn.forEach(n),ll=d(E),xe=o(E,"DIV",{class:!0});var wo=i(xe);_(Tt.$$.fragment,wo),rl=d(wo),Et=o(wo,"P",{});var Io=i(Et);dl=l(Io,"Disable sliced attention computation. If "),ia=o(Io,"CODE",{});var Zd=i(ia);pl=l(Zd,"enable_attention_slicing"),Zd.forEach(n),cl=l(Io,` was previously called, attention is
computed in one step.`),Io.forEach(n),wo.forEach(n),ml=d(E),Q=o(E,"DIV",{class:!0});var dn=i(Q);_(Jt.$$.fragment,dn),fl=d(dn),sa=o(dn,"P",{});var Wd=i(sa);ul=l(Wd,"Enable sliced VAE decoding."),Wd.forEach(n),gl=d(dn),la=o(dn,"P",{});var kd=i(la);hl=l(kd,`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.`),kd.forEach(n),dn.forEach(n),bl=d(E),Ze=o(E,"DIV",{class:!0});var Uo=i(Ze);_(xt.$$.fragment,Uo),_l=d(Uo),Zt=o(Uo,"P",{});var Po=i(Zt);vl=l(Po,"Disable sliced VAE decoding. If "),ra=o(Po,"CODE",{});var jd=i(ra);yl=l(jd,"enable_vae_slicing"),jd.forEach(n),wl=l(Po,` was previously invoked, this method will go back to
computing decoding in one step.`),Po.forEach(n),Uo.forEach(n),Il=d(E),L=o(E,"DIV",{class:!0});var O=i(L);_(Wt.$$.fragment,O),Ul=d(O),kt=o(O,"P",{});var Mo=i(kt);Pl=l(Mo,"Enable memory efficient attention from "),jt=o(Mo,"A",{href:!0,rel:!0});var Ld=i(jt);Ml=l(Ld,"xFormers"),Ld.forEach(n),$l=l(Mo,"."),Mo.forEach(n),Cl=d(O),da=o(O,"P",{});var Gd=i(da);Tl=l(Gd,`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.`),Gd.forEach(n),El=d(O),_(We.$$.fragment,O),Jl=d(O),_(ke.$$.fragment,O),O.forEach(n),xl=d(E),je=o(E,"DIV",{class:!0});var $o=i(je);_(Lt.$$.fragment,$o),Zl=d($o),Gt=o($o,"P",{});var Co=i(Gt);Wl=l(Co,"Disable memory efficient attention from "),St=o(Co,"A",{href:!0,rel:!0});var Sd=i(St);kl=l(Sd,"xFormers"),Sd.forEach(n),jl=l(Co,"."),Co.forEach(n),$o.forEach(n),Ll=d(E),Le=o(E,"DIV",{class:!0});var To=i(Le);_(Bt.$$.fragment,To),Gl=d(To),B=o(To,"P",{});var K=i(B);Sl=l(K,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),pa=o(K,"CODE",{});var Bd=i(pa);Bl=l(Bd,"enable_sequential_cpu_offload"),Bd.forEach(n),Xl=l(K,", this method moves one whole model at a time to the GPU when its "),ca=o(K,"CODE",{});var Xd=i(ca);Vl=l(Xd,"forward"),Xd.forEach(n),Nl=l(K,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),ma=o(K,"CODE",{});var Vd=i(ma);Fl=l(Vd,"enable_sequential_cpu_offload"),Vd.forEach(n),zl=l(K,", but performance is much better due to the iterative execution of the "),fa=o(K,"CODE",{});var Nd=i(fa);Rl=l(Nd,"unet"),Nd.forEach(n),Al=l(K,"."),K.forEach(n),To.forEach(n),Yl=d(E),Ge=o(E,"DIV",{class:!0});var Eo=i(Ge);_(Xt.$$.fragment,Eo),Ql=d(Eo),Vt=o(Eo,"P",{});var Jo=i(Vt);Dl=l(Jo,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),ua=o(Jo,"CODE",{});var Fd=i(ua);ql=l(Fd,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),Fd.forEach(n),Hl=l(Jo,"forward` method called."),Jo.forEach(n),Eo.forEach(n),Ol=d(E),W=o(E,"DIV",{class:!0});var V=i(W);_(Nt.$$.fragment,V),Kl=d(V),pe=o(V,"P",{});var pn=i(pe);er=l(pn,"Add noise to the image embeddings. The amount of noise is controlled by a "),ga=o(pn,"CODE",{});var zd=i(ga);tr=l(zd,"noise_level"),zd.forEach(n),nr=l(pn,` input. A higher
`),ha=o(pn,"CODE",{});var Rd=i(ha);ar=l(Rd,"noise_level"),Rd.forEach(n),or=l(pn," increases the variance in the final un-noised images."),pn.forEach(n),ir=d(V),ba=o(V,"P",{});var Ad=i(ba);sr=l(Ad,"The noise is applied in two ways"),Ad.forEach(n),lr=d(V),Ft=o(V,"OL",{});var xo=i(Ft);_a=o(xo,"LI",{});var Yd=i(_a);rr=l(Yd,"A noise schedule is applied directly to the embeddings"),Yd.forEach(n),dr=d(xo),va=o(xo,"LI",{});var Qd=i(va);pr=l(Qd,"A vector of sinusoidal time embeddings are appended to the output."),Qd.forEach(n),xo.forEach(n),cr=d(V),zt=o(V,"P",{});var Zo=i(zt);mr=l(Zo,"In both cases, the amount of noise is controlled by the same "),ya=o(Zo,"CODE",{});var Dd=i(ya);fr=l(Dd,"noise_level"),Dd.forEach(n),ur=l(Zo,"."),Zo.forEach(n),gr=d(V),wa=o(V,"P",{});var qd=i(wa);hr=l(qd,"The embeddings are normalized before the noise is applied and un-normalized after the noise is applied."),qd.forEach(n),V.forEach(n),E.forEach(n),this.h()},h(){c(f,"name","hf:doc:metadata"),c(f,"content",JSON.stringify(pp)),c(u,"id","stable-unclip"),c(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"),c(u,"href","#stable-unclip"),c(h,"class","relative group"),c(Qt,"href","./stable_diffusion_2"),c(Xe,"href","https://arxiv.org/abs/2204.06125"),c(Xe,"rel","nofollow"),c(me,"id","tips"),c(me,"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(me,"href","#tips"),c(ne,"class","relative group"),c(fe,"id","available-checkpoints"),c(fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(fe,"href","#available-checkpoints"),c(ae,"class","relative group"),c(ze,"href","https://hf.co/stabilityai/stable-diffusion-2-1-unclip"),c(ze,"rel","nofollow"),c(Re,"href","https://hf.co/stabilityai/stable-diffusion-2-1-unclip-small"),c(Re,"rel","nofollow"),c(Ae,"href","https://hf.co/stabilityai/stable-diffusion-2-1-unclip-small"),c(Ae,"rel","nofollow"),c(ge,"id","texttoimage-generation"),c(ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ge,"href","#texttoimage-generation"),c(oe,"class","relative group"),c(be,"id","text-guided-imagetoimage-variation"),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","#text-guided-imagetoimage-variation"),c(ie,"class","relative group"),c(ve,"id","memory-optimization"),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","#memory-optimization"),c(se,"class","relative group"),c(ye,"id","diffusers.StableUnCLIPPipeline"),c(ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ye,"href","#diffusers.StableUnCLIPPipeline"),c(le,"class","relative group"),c(en,"href","/docs/diffusers/v0.18.2/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ue,"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,"href","https://facebookresearch.github.io/xformers/"),c(ft,"rel","nofollow"),c(j,"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,"href","https://facebookresearch.github.io/xformers/"),c(ht,"rel","nofollow"),c($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ee,"id","diffusers.StableUnCLIPImg2ImgPipeline"),c(Ee,"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(Ee,"href","#diffusers.StableUnCLIPImg2ImgPipeline"),c(de,"class","relative group"),c(tn,"href","/docs/diffusers/v0.18.2/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ze,"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,"href","https://facebookresearch.github.io/xformers/"),c(jt,"rel","nofollow"),c(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(St,"href","https://facebookresearch.github.io/xformers/"),c(St,"rel","nofollow"),c(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c($,"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,m){e(document.head,f),g(t,P,m),g(t,h,m),e(h,u),e(u,C),v(p,C,null),e(h,U),e(h,ee),e(ee,te),g(t,G,m),g(t,N,m),e(N,Yt),e(N,Qt),e(Qt,jo),e(N,Lo),g(t,Ca,m),g(t,Dt,m),e(Dt,Go),g(t,Ta,m),g(t,Be,m),e(Be,Xe),e(Xe,So),e(Be,Bo),g(t,Ea,m),g(t,ne,m),e(ne,me),e(me,cn),v(Ve,cn,null),e(ne,Xo),e(ne,mn),e(mn,Vo),g(t,Ja,m),g(t,k,m),e(k,No),e(k,fn),e(fn,Fo),e(k,zo),e(k,un),e(un,Ro),e(k,Ao),e(k,gn),e(gn,Yo),e(k,Qo),e(k,hn),e(hn,Do),e(k,qo),g(t,xa,m),g(t,ae,m),e(ae,fe),e(fe,bn),v(Ne,bn,null),e(ae,Ho),e(ae,_n),e(_n,Oo),g(t,Za,m),g(t,ue,m),e(ue,qt),e(qt,Ko),e(qt,Fe),e(Fe,vn),e(vn,ze),e(ze,ei),e(Fe,ti),e(Fe,yn),e(yn,Re),e(Re,ni),e(ue,ai),e(ue,Ht),e(Ht,oi),e(Ht,wn),e(wn,In),e(In,Ae),e(Ae,ii),g(t,Wa,m),g(t,oe,m),e(oe,ge),e(ge,Un),v(Ye,Un,null),e(oe,si),e(oe,Pn),e(Pn,li),g(t,ka,m),v(Qe,t,m),g(t,ja,m),v(he,t,m),g(t,La,m),g(t,ie,m),e(ie,be),e(be,Mn),v(De,Mn,null),e(ie,ri),e(ie,$n),e($n,di),g(t,Ga,m),v(qe,t,m),g(t,Sa,m),g(t,_e,m),e(_e,pi),e(_e,Cn),e(Cn,ci),e(_e,mi),g(t,Ba,m),v(He,t,m),g(t,Xa,m),g(t,se,m),e(se,ve),e(ve,Tn),v(Oe,Tn,null),e(se,fi),e(se,En),e(En,ui),g(t,Va,m),g(t,Ot,m),e(Ot,gi),g(t,Na,m),v(Ke,t,m),g(t,Fa,m),g(t,Kt,m),e(Kt,hi),g(t,za,m),v(et,t,m),g(t,Ra,m),g(t,le,m),e(le,ye),e(ye,Jn),v(tt,Jn,null),e(le,bi),e(le,xn),e(xn,_i),g(t,Aa,m),g(t,M,m),v(nt,M,null),e(M,vi),e(M,Zn),e(Zn,yi),e(M,wi),e(M,at),e(at,Ii),e(at,en),e(en,Ui),e(at,Pi),e(M,Mi),e(M,F),v(ot,F,null),e(F,$i),e(F,Wn),e(Wn,Ci),e(F,Ti),v(we,F,null),e(M,Ei),e(M,z),v(it,z,null),e(z,Ji),e(z,kn),e(kn,xi),e(z,Zi),e(z,jn),e(jn,Wi),e(M,ki),e(M,Ie),v(st,Ie,null),e(Ie,ji),e(Ie,lt),e(lt,Li),e(lt,Ln),e(Ln,Gi),e(lt,Si),e(M,Bi),e(M,R),v(rt,R,null),e(R,Xi),e(R,Gn),e(Gn,Vi),e(R,Ni),e(R,Sn),e(Sn,Fi),e(M,zi),e(M,Ue),v(dt,Ue,null),e(Ue,Ri),e(Ue,pt),e(pt,Ai),e(pt,Bn),e(Bn,Yi),e(pt,Qi),e(M,Di),e(M,j),v(ct,j,null),e(j,qi),e(j,mt),e(mt,Hi),e(mt,ft),e(ft,Oi),e(mt,Ki),e(j,es),e(j,Xn),e(Xn,ts),e(j,ns),v(Pe,j,null),e(j,as),v(Me,j,null),e(M,os),e(M,$e),v(ut,$e,null),e($e,is),e($e,gt),e(gt,ss),e(gt,ht),e(ht,ls),e(gt,rs),e(M,ds),e(M,Ce),v(bt,Ce,null),e(Ce,ps),e(Ce,S),e(S,cs),e(S,Vn),e(Vn,ms),e(S,fs),e(S,Nn),e(Nn,us),e(S,gs),e(S,Fn),e(Fn,hs),e(S,bs),e(S,zn),e(zn,_s),e(S,vs),e(M,ys),e(M,Te),v(_t,Te,null),e(Te,ws),e(Te,vt),e(vt,Is),e(vt,Rn),e(Rn,Us),e(vt,Ps),e(M,Ms),e(M,Z),v(yt,Z,null),e(Z,$s),e(Z,re),e(re,Cs),e(re,An),e(An,Ts),e(re,Es),e(re,Yn),e(Yn,Js),e(re,xs),e(Z,Zs),e(Z,Qn),e(Qn,Ws),e(Z,ks),e(Z,wt),e(wt,Dn),e(Dn,js),e(wt,Ls),e(wt,qn),e(qn,Gs),e(Z,Ss),e(Z,It),e(It,Bs),e(It,Hn),e(Hn,Xs),e(It,Vs),e(Z,Ns),e(Z,On),e(On,Fs),g(t,Ya,m),g(t,de,m),e(de,Ee),e(Ee,Kn),v(Ut,Kn,null),e(de,zs),e(de,ea),e(ea,Rs),g(t,Qa,m),g(t,$,m),v(Pt,$,null),e($,As),e($,ta),e(ta,Ys),e($,Qs),e($,Mt),e(Mt,Ds),e(Mt,tn),e(tn,qs),e(Mt,Hs),e($,Os),e($,A),v($t,A,null),e(A,Ks),e(A,na),e(na,el),e(A,tl),v(Je,A,null),e($,nl),e($,Y),v(Ct,Y,null),e(Y,al),e(Y,aa),e(aa,ol),e(Y,il),e(Y,oa),e(oa,sl),e($,ll),e($,xe),v(Tt,xe,null),e(xe,rl),e(xe,Et),e(Et,dl),e(Et,ia),e(ia,pl),e(Et,cl),e($,ml),e($,Q),v(Jt,Q,null),e(Q,fl),e(Q,sa),e(sa,ul),e(Q,gl),e(Q,la),e(la,hl),e($,bl),e($,Ze),v(xt,Ze,null),e(Ze,_l),e(Ze,Zt),e(Zt,vl),e(Zt,ra),e(ra,yl),e(Zt,wl),e($,Il),e($,L),v(Wt,L,null),e(L,Ul),e(L,kt),e(kt,Pl),e(kt,jt),e(jt,Ml),e(kt,$l),e(L,Cl),e(L,da),e(da,Tl),e(L,El),v(We,L,null),e(L,Jl),v(ke,L,null),e($,xl),e($,je),v(Lt,je,null),e(je,Zl),e(je,Gt),e(Gt,Wl),e(Gt,St),e(St,kl),e(Gt,jl),e($,Ll),e($,Le),v(Bt,Le,null),e(Le,Gl),e(Le,B),e(B,Sl),e(B,pa),e(pa,Bl),e(B,Xl),e(B,ca),e(ca,Vl),e(B,Nl),e(B,ma),e(ma,Fl),e(B,zl),e(B,fa),e(fa,Rl),e(B,Al),e($,Yl),e($,Ge),v(Xt,Ge,null),e(Ge,Ql),e(Ge,Vt),e(Vt,Dl),e(Vt,ua),e(ua,ql),e(Vt,Hl),e($,Ol),e($,W),v(Nt,W,null),e(W,Kl),e(W,pe),e(pe,er),e(pe,ga),e(ga,tr),e(pe,nr),e(pe,ha),e(ha,ar),e(pe,or),e(W,ir),e(W,ba),e(ba,sr),e(W,lr),e(W,Ft),e(Ft,_a),e(_a,rr),e(Ft,dr),e(Ft,va),e(va,pr),e(W,cr),e(W,zt),e(zt,mr),e(zt,ya),e(ya,fr),e(zt,ur),e(W,gr),e(W,wa),e(wa,hr),Da=!0},p(t,[m]){const Rt={};m&2&&(Rt.$$scope={dirty:m,ctx:t}),he.$set(Rt);const Ia={};m&2&&(Ia.$$scope={dirty:m,ctx:t}),we.$set(Ia);const Ua={};m&2&&(Ua.$$scope={dirty:m,ctx:t}),Pe.$set(Ua);const Pa={};m&2&&(Pa.$$scope={dirty:m,ctx:t}),Me.$set(Pa);const At={};m&2&&(At.$$scope={dirty:m,ctx:t}),Je.$set(At);const Ma={};m&2&&(Ma.$$scope={dirty:m,ctx:t}),We.$set(Ma);const $a={};m&2&&($a.$$scope={dirty:m,ctx:t}),ke.$set($a)},i(t){Da||(y(p.$$.fragment,t),y(Ve.$$.fragment,t),y(Ne.$$.fragment,t),y(Ye.$$.fragment,t),y(Qe.$$.fragment,t),y(he.$$.fragment,t),y(De.$$.fragment,t),y(qe.$$.fragment,t),y(He.$$.fragment,t),y(Oe.$$.fragment,t),y(Ke.$$.fragment,t),y(et.$$.fragment,t),y(tt.$$.fragment,t),y(nt.$$.fragment,t),y(ot.$$.fragment,t),y(we.$$.fragment,t),y(it.$$.fragment,t),y(st.$$.fragment,t),y(rt.$$.fragment,t),y(dt.$$.fragment,t),y(ct.$$.fragment,t),y(Pe.$$.fragment,t),y(Me.$$.fragment,t),y(ut.$$.fragment,t),y(bt.$$.fragment,t),y(_t.$$.fragment,t),y(yt.$$.fragment,t),y(Ut.$$.fragment,t),y(Pt.$$.fragment,t),y($t.$$.fragment,t),y(Je.$$.fragment,t),y(Ct.$$.fragment,t),y(Tt.$$.fragment,t),y(Jt.$$.fragment,t),y(xt.$$.fragment,t),y(Wt.$$.fragment,t),y(We.$$.fragment,t),y(ke.$$.fragment,t),y(Lt.$$.fragment,t),y(Bt.$$.fragment,t),y(Xt.$$.fragment,t),y(Nt.$$.fragment,t),Da=!0)},o(t){w(p.$$.fragment,t),w(Ve.$$.fragment,t),w(Ne.$$.fragment,t),w(Ye.$$.fragment,t),w(Qe.$$.fragment,t),w(he.$$.fragment,t),w(De.$$.fragment,t),w(qe.$$.fragment,t),w(He.$$.fragment,t),w(Oe.$$.fragment,t),w(Ke.$$.fragment,t),w(et.$$.fragment,t),w(tt.$$.fragment,t),w(nt.$$.fragment,t),w(ot.$$.fragment,t),w(we.$$.fragment,t),w(it.$$.fragment,t),w(st.$$.fragment,t),w(rt.$$.fragment,t),w(dt.$$.fragment,t),w(ct.$$.fragment,t),w(Pe.$$.fragment,t),w(Me.$$.fragment,t),w(ut.$$.fragment,t),w(bt.$$.fragment,t),w(_t.$$.fragment,t),w(yt.$$.fragment,t),w(Ut.$$.fragment,t),w(Pt.$$.fragment,t),w($t.$$.fragment,t),w(Je.$$.fragment,t),w(Ct.$$.fragment,t),w(Tt.$$.fragment,t),w(Jt.$$.fragment,t),w(xt.$$.fragment,t),w(Wt.$$.fragment,t),w(We.$$.fragment,t),w(ke.$$.fragment,t),w(Lt.$$.fragment,t),w(Bt.$$.fragment,t),w(Xt.$$.fragment,t),w(Nt.$$.fragment,t),Da=!1},d(t){n(f),t&&n(P),t&&n(h),I(p),t&&n(G),t&&n(N),t&&n(Ca),t&&n(Dt),t&&n(Ta),t&&n(Be),t&&n(Ea),t&&n(ne),I(Ve),t&&n(Ja),t&&n(k),t&&n(xa),t&&n(ae),I(Ne),t&&n(Za),t&&n(ue),t&&n(Wa),t&&n(oe),I(Ye),t&&n(ka),I(Qe,t),t&&n(ja),I(he,t),t&&n(La),t&&n(ie),I(De),t&&n(Ga),I(qe,t),t&&n(Sa),t&&n(_e),t&&n(Ba),I(He,t),t&&n(Xa),t&&n(se),I(Oe),t&&n(Va),t&&n(Ot),t&&n(Na),I(Ke,t),t&&n(Fa),t&&n(Kt),t&&n(za),I(et,t),t&&n(Ra),t&&n(le),I(tt),t&&n(Aa),t&&n(M),I(nt),I(ot),I(we),I(it),I(st),I(rt),I(dt),I(ct),I(Pe),I(Me),I(ut),I(bt),I(_t),I(yt),t&&n(Ya),t&&n(de),I(Ut),t&&n(Qa),t&&n($),I(Pt),I($t),I(Je),I(Ct),I(Tt),I(Jt),I(xt),I(Wt),I(We),I(ke),I(Lt),I(Bt),I(Xt),I(Nt)}}}const pp={local:"stable-unclip",sections:[{local:"tips",sections:[{local:"available-checkpoints",title:"Available checkpoints:"},{local:"texttoimage-generation",title:"Text-to-Image Generation"},{local:"text-guided-imagetoimage-variation",title:"Text guided Image-to-Image Variation"},{local:"memory-optimization",title:"Memory optimization"},{local:"diffusers.StableUnCLIPPipeline",title:"StableUnCLIPPipeline"},{local:"diffusers.StableUnCLIPImg2ImgPipeline",title:"StableUnCLIPImg2ImgPipeline"}],title:"Tips"}],title:"Stable unCLIP"};function cp(x){return tp(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _p extends Hd{constructor(f){super();Od(this,f,cp,dp,Kd,{})}}export{_p as default,pp as metadata};
