import{S as Gd,i as Bd,s as Xd,e as a,k as r,w as h,t as s,M as Vd,c as o,d as n,m as d,a as i,x as b,h as l,b as c,G as e,g as f,y as _,q as v,o as y,B as w,v as Nd,L as Po}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Fd}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 Le}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Uo}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function zd(B){let u,E,I,g,C,p,U,ee;return{c(){u=a("p"),E=s("For text-to-image we use "),I=a("code"),g=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){u=o(te,"P",{});var L=i(u);E=l(L,"For text-to-image we use "),I=o(L,"CODE",{});var N=i(I);g=l(N,"stabilityai/stable-diffusion-2-1-unclip-small"),N.forEach(n),C=l(L," as it was trained on CLIP ViT-L/14 embedding, the same as the Karlo model prior. "),p=o(L,"A",{href:!0,rel:!0});var St=i(p);U=l(St,"stabilityai/stable-diffusion-2-1-unclip"),St.forEach(n),ee=l(L," was trained on OpenCLIP ViT-H, so we don\u2019t recommend its use."),L.forEach(n),this.h()},h(){c(p,"href","https://hf.co/stabilityai/stable-diffusion-2-1-unclip"),c(p,"rel","nofollow")},m(te,L){f(te,u,L),e(u,E),e(u,I),e(I,g),e(u,C),e(u,p),e(p,U),e(u,ee)},d(te){te&&n(u)}}}function Rd(B){let u,E,I,g,C;return g=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(){u=a("p"),E=s("Examples:"),I=r(),h(g.$$.fragment)},l(p){u=o(p,"P",{});var U=i(u);E=l(U,"Examples:"),U.forEach(n),I=d(p),b(g.$$.fragment,p)},m(p,U){f(p,u,U),e(u,E),f(p,I,U),_(g,p,U),C=!0},p:Po,i(p){C||(v(g.$$.fragment,p),C=!0)},o(p){y(g.$$.fragment,p),C=!1},d(p){p&&n(u),p&&n(I),w(g,p)}}}function Ad(B){let u,E,I,g,C;return g=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(){u=a("p"),E=s("Examples:"),I=r(),h(g.$$.fragment)},l(p){u=o(p,"P",{});var U=i(u);E=l(U,"Examples:"),U.forEach(n),I=d(p),b(g.$$.fragment,p)},m(p,U){f(p,u,U),e(u,E),f(p,I,U),_(g,p,U),C=!0},p:Po,i(p){C||(v(g.$$.fragment,p),C=!0)},o(p){y(g.$$.fragment,p),C=!1},d(p){p&&n(u),p&&n(I),w(g,p)}}}function Yd(B){let u,E,I,g,C;return g=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(){u=a("p"),E=s("Examples:"),I=r(),h(g.$$.fragment)},l(p){u=o(p,"P",{});var U=i(u);E=l(U,"Examples:"),U.forEach(n),I=d(p),b(g.$$.fragment,p)},m(p,U){f(p,u,U),e(u,E),f(p,I,U),_(g,p,U),C=!0},p:Po,i(p){C||(v(g.$$.fragment,p),C=!0)},o(p){y(g.$$.fragment,p),C=!1},d(p){p&&n(u),p&&n(I),w(g,p)}}}function Qd(B){let u,E,I,g,C;return g=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(){u=a("p"),E=s("Examples:"),I=r(),h(g.$$.fragment)},l(p){u=o(p,"P",{});var U=i(u);E=l(U,"Examples:"),U.forEach(n),I=d(p),b(g.$$.fragment,p)},m(p,U){f(p,u,U),e(u,E),f(p,I,U),_(g,p,U),C=!0},p:Po,i(p){C||(v(g.$$.fragment,p),C=!0)},o(p){y(g.$$.fragment,p),C=!1},d(p){p&&n(u),p&&n(I),w(g,p)}}}function Dd(B){let u,E,I,g,C,p,U,ee,te,L,N,St,Gt,Mo,Co,wa,Bt,$o,Ia,Se,Ge,To,Eo,Ua,ne,me,en,Be,Jo,tn,xo,Pa,W,Zo,nn,Wo,ko,an,jo,Lo,on,So,Go,sn,Bo,Xo,Ma,ae,fe,ln,Xe,Vo,rn,No,Ca,ue,Xt,Fo,Ve,dn,Ne,zo,Ro,pn,Fe,Ao,Yo,Vt,Qo,cn,mn,ze,Do,$a,oe,ge,fn,Re,qo,un,Ho,Ta,Ae,Ea,he,Ja,ie,be,gn,Ye,Oo,hn,Ko,xa,Qe,Za,_e,ei,bn,ti,ni,Wa,De,ka,se,ve,_n,qe,ai,vn,oi,ja,Nt,ii,La,He,Sa,Ft,si,Ga,Oe,Ba,le,ye,yn,Ke,li,wn,ri,Xa,P,et,di,In,pi,ci,tt,mi,zt,fi,ui,gi,F,nt,hi,Un,bi,_i,we,vi,z,at,yi,Pn,wi,Ii,Mn,Ui,Pi,Ie,ot,Mi,it,Ci,Cn,$i,Ti,Ei,R,st,Ji,$n,xi,Zi,Tn,Wi,ki,Ue,lt,ji,rt,Li,En,Si,Gi,Bi,k,dt,Xi,Jn,Vi,Ni,xn,Fi,zi,Zn,Ri,Ai,Pe,Yi,Me,pt,Qi,Wn,Di,qi,Ce,ct,Hi,S,Oi,kn,Ki,es,jn,ts,ns,Ln,as,os,Sn,is,ss,ls,$e,mt,rs,ft,ds,Gn,ps,cs,ms,x,ut,fs,re,us,Bn,gs,hs,Xn,bs,_s,vs,Vn,ys,ws,gt,Nn,Is,Us,Fn,Ps,Ms,ht,Cs,zn,$s,Ts,Es,Rn,Js,Va,de,Te,An,bt,xs,Yn,Zs,Na,M,_t,Ws,Qn,ks,js,vt,Ls,Rt,Ss,Gs,Bs,A,yt,Xs,Dn,Vs,Ns,Ee,Fs,Y,wt,zs,qn,Rs,As,Hn,Ys,Qs,Je,It,Ds,Ut,qs,On,Hs,Os,Ks,Q,Pt,el,Kn,tl,nl,ea,al,ol,xe,Mt,il,Ct,sl,ta,ll,rl,dl,j,$t,pl,na,cl,ml,aa,fl,ul,oa,gl,hl,Ze,bl,We,Tt,_l,ia,vl,yl,ke,Et,wl,G,Il,sa,Ul,Pl,la,Ml,Cl,ra,$l,Tl,da,El,Jl,xl,je,Jt,Zl,xt,Wl,pa,kl,jl,Ll,Z,Zt,Sl,pe,Gl,ca,Bl,Xl,ma,Vl,Nl,Fl,fa,zl,Rl,Wt,ua,Al,Yl,ga,Ql,Dl,kt,ql,ha,Hl,Ol,Kl,ba,er,Fa;return p=new Le({}),Be=new Le({}),Xe=new Le({}),Re=new Le({}),Ae=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 Fd({props:{warning:!0,$$slots:{default:[zd]},$$scope:{ctx:B}}}),Ye=new Le({}),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>)`}}),De=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>)`}}),qe=new Le({}),He=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>]`}}),Oe=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>]`}}),Ke=new Le({}),et=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.17.1/en/api/models#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.17.1/en/api/models#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.17.1/en/api/models#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.17.1/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L53"}}),nt=new J({props:{name:"__call__",anchor:"diffusers.StableUnCLIPPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 20"},{name:"guidance_scale",val:": float = 10.0"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.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.17.1/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.17.1/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.17.1/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.17.1/en/api/outputs#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),we=new Uo({props:{anchor:"diffusers.StableUnCLIPPipeline.__call__.example",$$slots:{default:[Rd]},$$scope:{ctx:B}}}),at=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.17.1/src/diffusers/pipelines/pipeline_utils.py#L1492"}}),ot=new J({props:{name:"disable_attention_slicing",anchor:"diffusers.StableUnCLIPPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/pipeline_utils.py#L1508"}}),st=new J({props:{name:"enable_vae_slicing",anchor:"diffusers.StableUnCLIPPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L144"}}),lt=new J({props:{name:"disable_vae_slicing",anchor:"diffusers.StableUnCLIPPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L154"}}),dt=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.17.1/src/diffusers/pipelines/pipeline_utils.py#L1434"}}),Pe=new Uo({props:{anchor:"diffusers.StableUnCLIPPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Ad]},$$scope:{ctx:B}}}),pt=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.17.1/src/diffusers/pipelines/pipeline_utils.py#L1466"}}),ct=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.17.1/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L185"}}),mt=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.17.1/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L161"}}),ut=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.17.1/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L608"}}),bt=new Le({}),_t=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.17.1/en/api/models#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.17.1/en/api/models#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.17.1/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L66"}}),yt=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[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.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.17.1/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.17.1/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.17.1/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.17.1/en/api/outputs#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Ee=new Uo({props:{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.example",$$slots:{default:[Yd]},$$scope:{ctx:B}}}),wt=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.17.1/src/diffusers/pipelines/pipeline_utils.py#L1492"}}),It=new J({props:{name:"disable_attention_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/pipeline_utils.py#L1508"}}),Pt=new J({props:{name:"enable_vae_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L146"}}),Mt=new J({props:{name:"disable_vae_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L156"}}),$t=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.17.1/src/diffusers/pipelines/pipeline_utils.py#L1434"}}),Ze=new Uo({props:{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Qd]},$$scope:{ctx:B}}}),Tt=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.17.1/src/diffusers/pipelines/pipeline_utils.py#L1466"}}),Et=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.17.1/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L187"}}),Jt=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.17.1/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L163"}}),Zt=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.17.1/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L575"}}),{c(){u=a("meta"),E=r(),I=a("h1"),g=a("a"),C=a("span"),h(p.$$.fragment),U=r(),ee=a("span"),te=s("Stable unCLIP"),L=r(),N=a("p"),St=s("Stable unCLIP checkpoints are finetuned from "),Gt=a("a"),Mo=s("stable diffusion 2.1"),Co=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.`),wa=r(),Bt=a("p"),$o=s("To know more about the unCLIP process, check out the following paper:"),Ia=r(),Se=a("p"),Ge=a("a"),To=s("Hierarchical Text-Conditional Image Generation with CLIP Latents"),Eo=s(" by Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, Mark Chen."),Ua=r(),ne=a("h2"),me=a("a"),en=a("span"),h(Be.$$.fragment),Jo=r(),tn=a("span"),xo=s("Tips"),Pa=r(),W=a("p"),Zo=s("Stable unCLIP takes a "),nn=a("code"),Wo=s("noise_level"),ko=s(" as input during inference. "),an=a("code"),jo=s("noise_level"),Lo=s(` determines how much noise is added
to the image embeddings. A higher `),on=a("code"),So=s("noise_level"),Go=s(` increases variation in the final un-noised images. By default,
we do not add any additional noise to the image embeddings i.e. `),sn=a("code"),Bo=s("noise_level = 0"),Xo=s("."),Ma=r(),ae=a("h3"),fe=a("a"),ln=a("span"),h(Xe.$$.fragment),Vo=r(),rn=a("span"),No=s("Available checkpoints:"),Ca=r(),ue=a("ul"),Xt=a("li"),Fo=s("Image variation"),Ve=a("ul"),dn=a("li"),Ne=a("a"),zo=s("stabilityai/stable-diffusion-2-1-unclip"),Ro=r(),pn=a("li"),Fe=a("a"),Ao=s("stabilityai/stable-diffusion-2-1-unclip-small"),Yo=r(),Vt=a("li"),Qo=s("Text-to-image "),cn=a("ul"),mn=a("li"),ze=a("a"),Do=s("stabilityai/stable-diffusion-2-1-unclip-small"),$a=r(),oe=a("h3"),ge=a("a"),fn=a("span"),h(Re.$$.fragment),qo=r(),un=a("span"),Ho=s("Text-to-Image Generation"),Ta=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)

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

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