import{S as Ac,i as Rc,s as Lc,e as s,k as l,w as m,t as i,M as Fc,c as n,d as o,m as d,x as u,a,h as r,b as p,N as _d,f as vd,G as e,g as f,y as g,q as _,o as v,B as b,v as Hc,L as Nc}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Yc}from"../../../chunks/Tip-hf-doc-builder.js";import{D as P}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as pe}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Y}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as zc}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function qc(ce){let w,D;return{c(){w=s("p"),D=i("This pipeline is for research purposes only.")},l(E){w=n(E,"P",{});var y=a(w);D=r(y,"This pipeline is for research purposes only."),y.forEach(o)},m(E,y){f(E,w,y),e(w,D)},d(E){E&&o(w)}}}function Qc(ce){let w,D,E,y,Z;return y=new pe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwVGV4dFRvVmlkZW9TRFBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b192aWRlbyUwQSUwQXBpcGUlMjAlM0QlMjBUZXh0VG9WaWRlb1NEUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmRhbW8tdmlsYWIlMkZ0ZXh0LXRvLXZpZGVvLW1zLTEuN2IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUwQSklMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyU3BpZGVybWFuJTIwaXMlMjBzdXJmaW5nJTIyJTBBdmlkZW9fZnJhbWVzJTIwJTNEJTIwcGlwZShwcm9tcHQpLmZyYW1lcyUwQXZpZGVvX3BhdGglMjAlM0QlMjBleHBvcnRfdG9fdmlkZW8odmlkZW9fZnJhbWVzKSUwQXZpZGVvX3BhdGg=",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> TextToVideoSDPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = TextToVideoSDPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;damo-vilab/text-to-video-ms-1.7b&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;Spiderman is surfing&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>video_frames = pipe(prompt).frames
<span class="hljs-meta">&gt;&gt;&gt; </span>video_path = export_to_video(video_frames)
<span class="hljs-meta">&gt;&gt;&gt; </span>video_path`}}),{c(){w=s("p"),D=i("Examples:"),E=l(),m(y.$$.fragment)},l(h){w=n(h,"P",{});var J=a(w);D=r(J,"Examples:"),J.forEach(o),E=d(h),u(y.$$.fragment,h)},m(h,J){f(h,w,J),e(w,D),f(h,E,J),g(y,h,J),Z=!0},p:Nc,i(h){Z||(_(y.$$.fragment,h),Z=!0)},o(h){v(y.$$.fragment,h),Z=!1},d(h){h&&o(w),h&&o(E),b(y,h)}}}function Oc(ce){let w,D,E,y,Z;return y=new pe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMkMlMjBEUE1Tb2x2ZXJNdWx0aXN0ZXBTY2hlZHVsZXIlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX3ZpZGVvJTBBJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJjZXJzcGVuc2UlMkZ6ZXJvc2NvcGVfdjJfNTc2dyUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlLnNjaGVkdWxlciUyMCUzRCUyMERQTVNvbHZlck11bHRpc3RlcFNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMnNwaWRlcm1hbiUyMHJ1bm5pbmclMjBpbiUyMHRoZSUyMGRlc2VydCUyMiUwQXZpZGVvX2ZyYW1lcyUyMCUzRCUyMHBpcGUocHJvbXB0JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDQwJTJDJTIwaGVpZ2h0JTNEMzIwJTJDJTIwd2lkdGglM0Q1NzYlMkMlMjBudW1fZnJhbWVzJTNEMjQpLmZyYW1lcyUwQSUyMyUyMHNhZmUlMjBsb3ctcmVzJTIwdmlkZW8lMEF2aWRlb19wYXRoJTIwJTNEJTIwZXhwb3J0X3RvX3ZpZGVvKHZpZGVvX2ZyYW1lcyUyQyUyMG91dHB1dF92aWRlb19wYXRoJTNEJTIyLiUyRnZpZGVvXzU3Nl9zcGlkZXJtYW4ubXA0JTIyKSUwQSUwQSUyMyUyMGxldCdzJTIwb2ZmbG9hZCUyMHRoZSUyMHRleHQtdG8taW1hZ2UlMjBtb2RlbCUwQXBpcGUudG8oJTIyY3B1JTIyKSUwQSUwQSUyMyUyMGFuZCUyMGxvYWQlMjB0aGUlMjBpbWFnZS10by1pbWFnZSUyMG1vZGVsJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJjZXJzcGVuc2UlMkZ6ZXJvc2NvcGVfdjJfWEwlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjByZXZpc2lvbiUzRCUyMnJlZnMlMkZwciUyRjE1JTIyJTBBKSUwQXBpcGUuc2NoZWR1bGVyJTIwJTNEJTIwRFBNU29sdmVyTXVsdGlzdGVwU2NoZWR1bGVyLmZyb21fY29uZmlnKHBpcGUuc2NoZWR1bGVyLmNvbmZpZyklMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBJTIzJTIwVGhlJTIwVkFFJTIwY29uc3VtZXMlMjBBJTIwTE9UJTIwb2YlMjBtZW1vcnklMkMlMjBsZXQncyUyMG1ha2UlMjBzdXJlJTIwd2UlMjBydW4lMjBpdCUyMGluJTIwc2xpY2VkJTIwbW9kZSUwQXBpcGUudmFlLmVuYWJsZV9zbGljaW5nKCklMEElMEElMjMlMjBub3clMjBsZXQncyUyMHVwc2NhbGUlMjBpdCUwQXZpZGVvJTIwJTNEJTIwJTVCSW1hZ2UuZnJvbWFycmF5KGZyYW1lKS5yZXNpemUoKDEwMjQlMkMlMjA1NzYpKSUyMGZvciUyMGZyYW1lJTIwaW4lMjB2aWRlb19mcmFtZXMlNUQlMEElMEElMjMlMjBhbmQlMjBkZW5vaXNlJTIwaXQlMEF2aWRlb19mcmFtZXMlMjAlM0QlMjBwaXBlKHByb21wdCUyQyUyMHZpZGVvJTNEdmlkZW8lMkMlMjBzdHJlbmd0aCUzRDAuNikuZnJhbWVzJTBBdmlkZW9fcGF0aCUyMCUzRCUyMGV4cG9ydF90b192aWRlbyh2aWRlb19mcmFtZXMlMkMlMjBvdXRwdXRfdmlkZW9fcGF0aCUzRCUyMi4lMkZ2aWRlb18xMDI0X3NwaWRlcm1hbi5tcDQlMjIpJTBBdmlkZW9fcGF0aA==",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, DPMSolverMultistepScheduler
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;cerspense/zeroscope_v2_576w&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;spiderman running in the desert&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>video_frames = pipe(prompt, num_inference_steps=<span class="hljs-number">40</span>, height=<span class="hljs-number">320</span>, width=<span class="hljs-number">576</span>, num_frames=<span class="hljs-number">24</span>).frames
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># safe low-res video</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>video_path = export_to_video(video_frames, output_video_path=<span class="hljs-string">&quot;./video_576_spiderman.mp4&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># let&#x27;s offload the text-to-image model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cpu&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># and load the image-to-image model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;cerspense/zeroscope_v2_XL&quot;</span>, torch_dtype=torch.float16, revision=<span class="hljs-string">&quot;refs/pr/15&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># The VAE consumes A LOT of memory, let&#x27;s make sure we run it in sliced mode</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_slicing()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># now let&#x27;s upscale it</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>video = [Image.fromarray(frame).resize((<span class="hljs-number">1024</span>, <span class="hljs-number">576</span>)) <span class="hljs-keyword">for</span> frame <span class="hljs-keyword">in</span> video_frames]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># and denoise it</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>video_frames = pipe(prompt, video=video, strength=<span class="hljs-number">0.6</span>).frames
<span class="hljs-meta">&gt;&gt;&gt; </span>video_path = export_to_video(video_frames, output_video_path=<span class="hljs-string">&quot;./video_1024_spiderman.mp4&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>video_path`}}),{c(){w=s("p"),D=i("Examples:"),E=l(),m(y.$$.fragment)},l(h){w=n(h,"P",{});var J=a(w);D=r(J,"Examples:"),J.forEach(o),E=d(h),u(y.$$.fragment,h)},m(h,J){f(h,w,J),e(w,D),f(h,E,J),g(y,h,J),Z=!0},p:Nc,i(h){Z||(_(y.$$.fragment,h),Z=!0)},o(h){v(y.$$.fragment,h),Z=!1},d(h){h&&o(w),h&&o(E),b(y,h)}}}function Kc(ce){let w,D,E,y,Z,h,J,Ie,Ta,Po,Ma,ln,q,fe,Uo,Be,Ea,Go,xa,dn,Ce,Xe,Va,Za,pn,Rt,Ja,cn,Lt,jo,$a,fn,Ft,ka,hn,B,So,ze,Da,Pa,Wo,Ne,Ua,Ga,Io,Ae,ja,mn,Q,he,Bo,Re,Sa,Co,Wa,un,me,Xo,O,zo,Ia,Ba,No,Ca,Xa,Ht,za,Na,Le,K,Ao,Fe,Aa,Ra,Ro,Lo,La,Fa,Yt,He,Ha,Ya,ee,Fo,Ye,qa,Qa,Ho,Yo,Oa,Ka,qt,Qt,ei,gn,te,ue,qo,qe,ti,Qo,oi,_n,oe,ge,Oo,Qe,si,Ko,es,ni,vn,Ot,ai,bn,Oe,wn,Kt,ii,yn,eo,ri,Tn,Ke,Mn,_e,li,ts,di,pi,En,to,ci,xn,et,Vn,oo,fi,Zn,so,tt,os,ve,hi,mi,ui,ot,bd,gi,ss,be,_i,vi,bi,st,wd,Jn,se,we,ns,nt,wi,at,as,yi,Ti,is,Mi,$n,$,Ei,rs,xi,Vi,ls,Zi,Ji,it,ds,$i,ki,no,Di,Pi,ao,Ui,Gi,rt,ps,ji,Si,kn,lt,Dn,io,Wi,Pn,dt,Un,ro,Ii,Gn,lo,cs,fs,ye,Bi,Ci,Xi,pt,yd,jn,ne,Te,hs,ct,zi,ms,Ni,Sn,k,Ai,po,Ri,Li,co,Fi,Hi,fo,Yi,qi,ho,Qi,Oi,us,Ki,er,gs,tr,or,Wn,W,sr,mo,nr,ar,ft,ir,rr,_s,lr,dr,In,ht,Bn,C,pr,uo,cr,fr,go,hr,mr,Cn,mt,Xn,ae,Me,vs,ut,ur,bs,gr,zn,I,ws,gt,_r,vr,ys,_t,br,wr,Ts,vt,yr,Tr,Ms,bt,Mr,Nn,ie,Ee,Es,wt,Er,xs,xr,An,T,yt,Vr,Vs,Zr,Jr,Tt,$r,_o,kr,Dr,Pr,X,Mt,Ur,Zs,Gr,jr,xe,Sr,Ve,Et,Wr,xt,Ir,Js,Br,Cr,Xr,Ze,Vt,zr,Zt,Nr,$s,Ar,Rr,Lr,Je,Jt,Fr,j,Hr,ks,Yr,qr,Ds,Qr,Or,Ps,Kr,el,Us,tl,ol,sl,$e,$t,nl,re,al,Gs,il,rl,js,ll,dl,pl,z,kt,cl,Ss,fl,hl,Ws,ml,ul,N,Dt,gl,Is,_l,vl,Bs,bl,Rn,le,ke,Cs,Pt,wl,Xs,yl,Ln,M,Ut,Tl,zs,Ml,El,Gt,xl,vo,Vl,Zl,Jl,A,jt,$l,Ns,kl,Dl,De,Pl,Pe,St,Ul,Wt,Gl,As,jl,Sl,Wl,Ue,It,Il,Bt,Bl,Rs,Cl,Xl,zl,Ge,Ct,Nl,S,Al,Ls,Rl,Ll,Fs,Fl,Hl,Hs,Yl,ql,Ys,Ql,Ol,Kl,je,Xt,ed,de,td,qs,od,sd,Qs,nd,ad,id,R,zt,rd,Os,ld,dd,Ks,pd,cd,L,Nt,fd,en,hd,md,tn,ud,Fn;return E=new Yc({props:{warning:!0,$$slots:{default:[qc]},$$scope:{ctx:ce}}}),Ie=new Y({}),Be=new Y({}),Re=new Y({}),qe=new Y({}),Qe=new Y({}),Oe=new pe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX3ZpZGVvJTBBJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJkYW1vLXZpbGFiJTJGdGV4dC10by12aWRlby1tcy0xLjdiJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIpJTBBcGlwZSUyMCUzRCUyMHBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJTcGlkZXJtYW4lMjBpcyUyMHN1cmZpbmclMjIlMEF2aWRlb19mcmFtZXMlMjAlM0QlMjBwaXBlKHByb21wdCkuZnJhbWVzJTBBdmlkZW9fcGF0aCUyMCUzRCUyMGV4cG9ydF90b192aWRlbyh2aWRlb19mcmFtZXMpJTBBdmlkZW9fcGF0aA==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;damo-vilab/text-to-video-ms-1.7b&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>)
pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;Spiderman is surfing&quot;</span>
video_frames = pipe(prompt).frames
video_path = export_to_video(video_frames)
video_path`}}),Ke=new pe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX3ZpZGVvJTBBJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJkYW1vLXZpbGFiJTJGdGV4dC10by12aWRlby1tcy0xLjdiJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIpJTBBcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQSUyMyUyMG1lbW9yeSUyMG9wdGltaXphdGlvbiUwQXBpcGUuZW5hYmxlX3ZhZV9zbGljaW5nKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJEYXJ0aCUyMFZhZGVyJTIwc3VyZmluZyUyMGElMjB3YXZlJTIyJTBBdmlkZW9fZnJhbWVzJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1fZnJhbWVzJTNENjQpLmZyYW1lcyUwQXZpZGVvX3BhdGglMjAlM0QlMjBleHBvcnRfdG9fdmlkZW8odmlkZW9fZnJhbWVzKSUwQXZpZGVvX3BhdGg=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;damo-vilab/text-to-video-ms-1.7b&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>)
pipe.enable_model_cpu_offload()

<span class="hljs-comment"># memory optimization</span>
pipe.enable_vae_slicing()

prompt = <span class="hljs-string">&quot;Darth Vader surfing a wave&quot;</span>
video_frames = pipe(prompt, num_frames=<span class="hljs-number">64</span>).frames
video_path = export_to_video(video_frames)
video_path`}}),et=new pe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMkMlMjBEUE1Tb2x2ZXJNdWx0aXN0ZXBTY2hlZHVsZXIlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX3ZpZGVvJTBBJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJkYW1vLXZpbGFiJTJGdGV4dC10by12aWRlby1tcy0xLjdiJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIpJTBBcGlwZS5zY2hlZHVsZXIlMjAlM0QlMjBEUE1Tb2x2ZXJNdWx0aXN0ZXBTY2hlZHVsZXIuZnJvbV9jb25maWcocGlwZS5zY2hlZHVsZXIuY29uZmlnKSUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJTcGlkZXJtYW4lMjBpcyUyMHN1cmZpbmclMjIlMEF2aWRlb19mcmFtZXMlMjAlM0QlMjBwaXBlKHByb21wdCUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QyNSkuZnJhbWVzJTBBdmlkZW9fcGF0aCUyMCUzRCUyMGV4cG9ydF90b192aWRlbyh2aWRlb19mcmFtZXMpJTBBdmlkZW9fcGF0aA==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline, DPMSolverMultistepScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;damo-vilab/text-to-video-ms-1.7b&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>)
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
pipe.enable_model_cpu_offload()

prompt = <span class="hljs-string">&quot;Spiderman is surfing&quot;</span>
video_frames = pipe(prompt, num_inference_steps=<span class="hljs-number">25</span>).frames
video_path = export_to_video(video_frames)
video_path`}}),nt=new Y({}),lt=new pe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX3ZpZGVvJTBBJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJjZXJzcGVuc2UlMkZ6ZXJvc2NvcGVfdjJfNTc2dyUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBJTIzJTIwbWVtb3J5JTIwb3B0aW1pemF0aW9uJTBBcGlwZS51bmV0LmVuYWJsZV9mb3J3YXJkX2NodW5raW5nKGNodW5rX3NpemUlM0QxJTJDJTIwZGltJTNEMSklMEFwaXBlLmVuYWJsZV92YWVfc2xpY2luZygpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyRGFydGglMjBWYWRlciUyMHN1cmZpbmclMjBhJTIwd2F2ZSUyMiUwQXZpZGVvX2ZyYW1lcyUyMCUzRCUyMHBpcGUocHJvbXB0JTJDJTIwbnVtX2ZyYW1lcyUzRDI0KS5mcmFtZXMlMEF2aWRlb19wYXRoJTIwJTNEJTIwZXhwb3J0X3RvX3ZpZGVvKHZpZGVvX2ZyYW1lcyklMEF2aWRlb19wYXRo",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;cerspense/zeroscope_v2_576w&quot;</span>, torch_dtype=torch.float16)
pipe.enable_model_cpu_offload()

<span class="hljs-comment"># memory optimization</span>
pipe.unet.enable_forward_chunking(chunk_size=<span class="hljs-number">1</span>, dim=<span class="hljs-number">1</span>)
pipe.enable_vae_slicing()

prompt = <span class="hljs-string">&quot;Darth Vader surfing a wave&quot;</span>
video_frames = pipe(prompt, num_frames=<span class="hljs-number">24</span>).frames
video_path = export_to_video(video_frames)
video_path`}}),dt=new pe({props:{code:"cGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJjZXJzcGVuc2UlMkZ6ZXJvc2NvcGVfdjJfWEwlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBcGlwZS5zY2hlZHVsZXIlMjAlM0QlMjBEUE1Tb2x2ZXJNdWx0aXN0ZXBTY2hlZHVsZXIuZnJvbV9jb25maWcocGlwZS5zY2hlZHVsZXIuY29uZmlnKSUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEElMjMlMjBtZW1vcnklMjBvcHRpbWl6YXRpb24lMEFwaXBlLnVuZXQuZW5hYmxlX2ZvcndhcmRfY2h1bmtpbmcoY2h1bmtfc2l6ZSUzRDElMkMlMjBkaW0lM0QxKSUwQXBpcGUuZW5hYmxlX3ZhZV9zbGljaW5nKCklMEElMEF2aWRlbyUyMCUzRCUyMCU1QkltYWdlLmZyb21hcnJheShmcmFtZSkucmVzaXplKCgxMDI0JTJDJTIwNTc2KSklMjBmb3IlMjBmcmFtZSUyMGluJTIwdmlkZW9fZnJhbWVzJTVEJTBBJTBBdmlkZW9fZnJhbWVzJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjB2aWRlbyUzRHZpZGVvJTJDJTIwc3RyZW5ndGglM0QwLjYpLmZyYW1lcyUwQXZpZGVvX3BhdGglMjAlM0QlMjBleHBvcnRfdG9fdmlkZW8odmlkZW9fZnJhbWVzKSUwQXZpZGVvX3BhdGg=",highlighted:`pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;cerspense/zeroscope_v2_XL&quot;</span>, torch_dtype=torch.float16)
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
pipe.enable_model_cpu_offload()

<span class="hljs-comment"># memory optimization</span>
pipe.unet.enable_forward_chunking(chunk_size=<span class="hljs-number">1</span>, dim=<span class="hljs-number">1</span>)
pipe.enable_vae_slicing()

video = [Image.fromarray(frame).resize((<span class="hljs-number">1024</span>, <span class="hljs-number">576</span>)) <span class="hljs-keyword">for</span> frame <span class="hljs-keyword">in</span> video_frames]

video_frames = pipe(prompt, video=video, strength=<span class="hljs-number">0.6</span>).frames
video_path = export_to_video(video_frames)
video_path`}}),ct=new Y({}),ht=new pe({props:{code:"cGlwZS51bmV0LmVuYWJsZV9mb3J3YXJkX2NodW5raW5nKGNodW5rX3NpemUlM0QxJTJDJTIwZGltJTNEMSk=",highlighted:'pipe.unet.enable_forward_chunking(chunk_size=<span class="hljs-number">1</span>, dim=<span class="hljs-number">1</span>)'}}),mt=new pe({props:{code:"cGlwZS5lbmFibGVfdmFlX3NsaWNpbmcoKQ==",highlighted:"pipe.enable_vae_slicing()"}}),ut=new Y({}),wt=new Y({}),yt=new P({props:{name:"class diffusers.TextToVideoSDPipeline",anchor:"diffusers.TextToVideoSDPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet3DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"}],parametersDescription:[{anchor:"diffusers.TextToVideoSDPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.18.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.TextToVideoSDPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Same as Stable Diffusion 2.`,name:"text_encoder"},{anchor:"diffusers.TextToVideoSDPipeline.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.TextToVideoSDPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.18.0/en/api/models/unet3d-cond#diffusers.UNet3DConditionModel">UNet3DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded video latents.',name:"unet"},{anchor:"diffusers.TextToVideoSDPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.18.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.18.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.18.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.18.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L76"}}),Mt=new P({props:{name:"__call__",anchor:"diffusers.TextToVideoSDPipeline.__call__",parameters:[{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_frames",val:": int = 16"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 9.0"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'np'"},{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"}],parametersDescription:[{anchor:"diffusers.TextToVideoSDPipeline.__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 video generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.TextToVideoSDPipeline.__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 video.`,name:"height"},{anchor:"diffusers.TextToVideoSDPipeline.__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 video.`,name:"width"},{anchor:"diffusers.TextToVideoSDPipeline.__call__.num_frames",description:`<strong>num_frames</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The number of video frames that are generated. Defaults to 16 frames which at 8 frames per seconds
amounts to 2 seconds of video.`,name:"num_frames"},{anchor:"diffusers.TextToVideoSDPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality videos at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.TextToVideoSDPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate videos that are closely linked to the text <code>prompt</code>,
usually at the expense of lower video quality.`,name:"guidance_scale"},{anchor:"diffusers.TextToVideoSDPipeline.__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 video 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.TextToVideoSDPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.18.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.TextToVideoSDPipeline.__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.TextToVideoSDPipeline.__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 video
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>. Latents should be of shape
<code>(batch_size, num_channel, num_frames, height, width)</code>.`,name:"latents"},{anchor:"diffusers.TextToVideoSDPipeline.__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.TextToVideoSDPipeline.__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.TextToVideoSDPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;np&quot;</code>) &#x2014;
The output format of the generate video. Choose between <code>torch.FloatTensor</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.TextToVideoSDPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>~pipelines.stable_diffusion.TextToVideoSDPipelineOutput</code> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.TextToVideoSDPipeline.__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.TextToVideoSDPipeline.__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.TextToVideoSDPipeline.__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"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L486",returnDescription:`
<p><code>~pipelines.stable_diffusion.TextToVideoSDPipelineOutput</code> if <code>return_dict</code> is True, otherwise a \`tuple.
When returning a tuple, the first element is a list with the generated frames.</p>
`,returnType:`
<p><code>~pipelines.stable_diffusion.TextToVideoSDPipelineOutput</code> or <code>tuple</code></p>
`}}),xe=new zc({props:{anchor:"diffusers.TextToVideoSDPipeline.__call__.example",$$slots:{default:[Qc]},$$scope:{ctx:ce}}}),Et=new P({props:{name:"disable_vae_slicing",anchor:"diffusers.TextToVideoSDPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L127"}}),Vt=new P({props:{name:"disable_vae_tiling",anchor:"diffusers.TextToVideoSDPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L145"}}),Jt=new P({props:{name:"enable_model_cpu_offload",anchor:"diffusers.TextToVideoSDPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L173"}}),$t=new P({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.TextToVideoSDPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L152"}}),kt=new P({props:{name:"enable_vae_slicing",anchor:"diffusers.TextToVideoSDPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L117"}}),Dt=new P({props:{name:"enable_vae_tiling",anchor:"diffusers.TextToVideoSDPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L135"}}),Pt=new Y({}),Ut=new P({props:{name:"class diffusers.VideoToVideoSDPipeline",anchor:"diffusers.VideoToVideoSDPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet3DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"}],parametersDescription:[{anchor:"diffusers.VideoToVideoSDPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.18.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode videos to and from latent representations.`,name:"vae"},{anchor:"diffusers.VideoToVideoSDPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Same as Stable Diffusion 2.`,name:"text_encoder"},{anchor:"diffusers.VideoToVideoSDPipeline.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.VideoToVideoSDPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.18.0/en/api/models/unet3d-cond#diffusers.UNet3DConditionModel">UNet3DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded video latents.',name:"unet"},{anchor:"diffusers.VideoToVideoSDPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.18.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.18.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.18.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.18.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L138"}}),jt=new P({props:{name:"__call__",anchor:"diffusers.VideoToVideoSDPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"video",val:": typing.Union[typing.List[numpy.ndarray], torch.FloatTensor] = None"},{name:"strength",val:": float = 0.6"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 15.0"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'np'"},{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"}],parametersDescription:[{anchor:"diffusers.VideoToVideoSDPipeline.__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 video generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.
video &#x2014; (<code>List[np.ndarray]</code> or <code>torch.FloatTensor</code>):
<code>video</code> frames or tensor representing a video batch, that will be used as the starting point for the
process. Can also accpet video latents as <code>image</code>, if passing latents directly, it will not be encoded
again.`,name:"prompt"},{anchor:"diffusers.VideoToVideoSDPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Conceptually, indicates how much to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code>
will be used as a starting point, adding more noise to it the larger the <code>strength</code>. The number of
denoising steps depends on the amount of noise initially added. When <code>strength</code> is 1, added noise will
be maximum and the denoising process will run for the full number of iterations specified in
<code>num_inference_steps</code>. A value of 1, therefore, essentially ignores <code>image</code>.`,name:"strength"},{anchor:"diffusers.VideoToVideoSDPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality videos at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.VideoToVideoSDPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate videos that are closely linked to the text <code>prompt</code>,
usually at the expense of lower video quality.`,name:"guidance_scale"},{anchor:"diffusers.VideoToVideoSDPipeline.__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 video 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.VideoToVideoSDPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.18.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.VideoToVideoSDPipeline.__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.VideoToVideoSDPipeline.__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 video
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>. Latents should be of shape
<code>(batch_size, num_channel, num_frames, height, width)</code>.`,name:"latents"},{anchor:"diffusers.VideoToVideoSDPipeline.__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.VideoToVideoSDPipeline.__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.VideoToVideoSDPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;np&quot;</code>) &#x2014;
The output format of the generate video. Choose between <code>torch.FloatTensor</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.VideoToVideoSDPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>~pipelines.stable_diffusion.TextToVideoSDPipelineOutput</code> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.VideoToVideoSDPipeline.__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.VideoToVideoSDPipeline.__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.VideoToVideoSDPipeline.__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"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L571",returnDescription:`
<p><code>~pipelines.stable_diffusion.TextToVideoSDPipelineOutput</code> if <code>return_dict</code> is True, otherwise a \`tuple.
When returning a tuple, the first element is a list with the generated frames.</p>
`,returnType:`
<p><code>~pipelines.stable_diffusion.TextToVideoSDPipelineOutput</code> or <code>tuple</code></p>
`}}),De=new zc({props:{anchor:"diffusers.VideoToVideoSDPipeline.__call__.example",$$slots:{default:[Oc]},$$scope:{ctx:ce}}}),St=new P({props:{name:"disable_vae_slicing",anchor:"diffusers.VideoToVideoSDPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L189"}}),It=new P({props:{name:"disable_vae_tiling",anchor:"diffusers.VideoToVideoSDPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L207"}}),Ct=new P({props:{name:"enable_model_cpu_offload",anchor:"diffusers.VideoToVideoSDPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L235"}}),Xt=new P({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.VideoToVideoSDPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L214"}}),zt=new P({props:{name:"enable_vae_slicing",anchor:"diffusers.VideoToVideoSDPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L179"}}),Nt=new P({props:{name:"enable_vae_tiling",anchor:"diffusers.VideoToVideoSDPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L197"}}),{c(){w=s("meta"),D=l(),m(E.$$.fragment),y=l(),Z=s("h1"),h=s("a"),J=s("span"),m(Ie.$$.fragment),Ta=l(),Po=s("span"),Ma=i("Text-to-video synthesis"),ln=l(),q=s("h2"),fe=s("a"),Uo=s("span"),m(Be.$$.fragment),Ea=l(),Go=s("span"),xa=i("Overview"),dn=l(),Ce=s("p"),Xe=s("a"),Va=i("VideoFusion: Decomposed Diffusion Models for High-Quality Video Generation"),Za=i(" by Zhengxiong Luo, Dayou Chen, Yingya Zhang, Yan Huang, Liang Wang, Yujun Shen, Deli Zhao, Jingren Zhou, Tieniu Tan."),pn=l(),Rt=s("p"),Ja=i("The abstract of the paper is the following:"),cn=l(),Lt=s("p"),jo=s("em"),$a=i("A diffusion probabilistic model (DPM), which constructs a forward diffusion process by gradually adding noise to data points and learns the reverse denoising process to generate new samples, has been shown to handle complex data distribution. Despite its recent success in image synthesis, applying DPMs to video generation is still challenging due to high-dimensional data spaces. Previous methods usually adopt a standard diffusion process, where frames in the same video clip are destroyed with independent noises, ignoring the content redundancy and temporal correlation. This work presents a decomposed diffusion process via resolving the per-frame noise into a base noise that is shared among all frames and a residual noise that varies along the time axis. The denoising pipeline employs two jointly-learned networks to match the noise decomposition accordingly. Experiments on various datasets confirm that our approach, termed as VideoFusion, surpasses both GAN-based and diffusion-based alternatives in high-quality video generation. We further show that our decomposed formulation can benefit from pre-trained image diffusion models and well-support text-conditioned video creation."),fn=l(),Ft=s("p"),ka=i("Resources:"),hn=l(),B=s("ul"),So=s("li"),ze=s("a"),Da=i("Website"),Pa=l(),Wo=s("li"),Ne=s("a"),Ua=i("GitHub repository"),Ga=l(),Io=s("li"),Ae=s("a"),ja=i("\u{1F917} Spaces"),mn=l(),Q=s("h2"),he=s("a"),Bo=s("span"),m(Re.$$.fragment),Sa=l(),Co=s("span"),Wa=i("Available Pipelines:"),un=l(),me=s("table"),Xo=s("thead"),O=s("tr"),zo=s("th"),Ia=i("Pipeline"),Ba=l(),No=s("th"),Ca=i("Tasks"),Xa=l(),Ht=s("th"),za=i("Demo"),Na=l(),Le=s("tbody"),K=s("tr"),Ao=s("td"),Fe=s("a"),Aa=i("TextToVideoSDPipeline"),Ra=l(),Ro=s("td"),Lo=s("em"),La=i("Text-to-Video Generation"),Fa=l(),Yt=s("td"),He=s("a"),Ha=i("\u{1F917} Spaces"),Ya=l(),ee=s("tr"),Fo=s("td"),Ye=s("a"),qa=i("VideoToVideoSDPipeline"),Qa=l(),Ho=s("td"),Yo=s("em"),Oa=i("Text-Guided Video-to-Video Generation"),Ka=l(),qt=s("td"),Qt=s("a"),ei=i("(TODO)\u{1F917} Spaces"),gn=l(),te=s("h2"),ue=s("a"),qo=s("span"),m(qe.$$.fragment),ti=l(),Qo=s("span"),oi=i("Usage example"),_n=l(),oe=s("h3"),ge=s("a"),Oo=s("span"),m(Qe.$$.fragment),si=l(),Ko=s("span"),es=s("code"),ni=i("text-to-video-ms-1.7b"),vn=l(),Ot=s("p"),ai=i("Let\u2019s start by generating a short video with the default length of 16 frames (2s at 8 fps):"),bn=l(),m(Oe.$$.fragment),wn=l(),Kt=s("p"),ii=i(`Diffusers supports different optimization techniques to improve the latency
and memory footprint of a pipeline. Since videos are often more memory-heavy than images,
we can enable CPU offloading and VAE slicing to keep the memory footprint at bay.`),yn=l(),eo=s("p"),ri=i("Let\u2019s generate a video of 8 seconds (64 frames) on the same GPU using CPU offloading and VAE slicing:"),Tn=l(),m(Ke.$$.fragment),Mn=l(),_e=s("p"),li=i("It just takes "),ts=s("strong"),di=i("7 GBs of GPU memory"),pi=i(" to generate the 64 video frames using PyTorch 2.0, \u201Cfp16\u201D precision and the techniques mentioned above."),En=l(),to=s("p"),ci=i("We can also use a different scheduler easily, using the same method we\u2019d use for Stable Diffusion:"),xn=l(),m(et.$$.fragment),Vn=l(),oo=s("p"),fi=i("Here are some sample outputs:"),Zn=l(),so=s("table"),tt=s("tr"),os=s("td"),ve=s("center"),hi=i(`An astronaut riding a horse.
        `),mi=s("br"),ui=l(),ot=s("img"),gi=l(),ss=s("td"),be=s("center"),_i=i(`Darth vader surfing in waves.
        `),vi=s("br"),bi=l(),st=s("img"),Jn=l(),se=s("h3"),we=s("a"),ns=s("span"),m(nt.$$.fragment),wi=l(),at=s("span"),as=s("code"),yi=i("cerspense/zeroscope_v2_576w"),Ti=i(" & "),is=s("code"),Mi=i("cerspense/zeroscope_v2_XL"),$n=l(),$=s("p"),Ei=i("Zeroscope are watermark-free model and have been trained on specific sizes such as "),rs=s("code"),xi=i("576x320"),Vi=i(" and "),ls=s("code"),Zi=i("1024x576"),Ji=i(`.
One should first generate a video using the lower resolution checkpoint `),it=s("a"),ds=s("code"),$i=i("cerspense/zeroscope_v2_576w"),ki=i(" with "),no=s("a"),Di=i("TextToVideoSDPipeline"),Pi=i(`,
which can then be upscaled using `),ao=s("a"),Ui=i("VideoToVideoSDPipeline"),Gi=i(" and "),rt=s("a"),ps=s("code"),ji=i("cerspense/zeroscope_v2_XL"),Si=i("."),kn=l(),m(lt.$$.fragment),Dn=l(),io=s("p"),Wi=i("Now the video can be upscaled:"),Pn=l(),m(dt.$$.fragment),Un=l(),ro=s("p"),Ii=i("Here are some sample outputs:"),Gn=l(),lo=s("table"),cs=s("tr"),fs=s("td"),ye=s("center"),Bi=i(`Darth vader surfing in waves.
        `),Ci=s("br"),Xi=l(),pt=s("img"),jn=l(),ne=s("h3"),Te=s("a"),hs=s("span"),m(ct.$$.fragment),zi=l(),ms=s("span"),Ni=i("Memory optimizations"),Sn=l(),k=s("p"),Ai=i("Text-guided video generation with "),po=s("a"),Ri=i("~TextToVideoSDPipeline"),Li=i(" and "),co=s("a"),Fi=i("~VideoToVideoSDPipeline"),Hi=i(` is very memory intensive both
when denoising with `),fo=s("a"),Yi=i("~UNet3DConditionModel"),qi=i(" and when decoding with "),ho=s("a"),Qi=i("~AutoencoderKL"),Oi=i(`. It is possible though to reduce
memory usage at the cost of increased runtime to achieve the exact same result. To do so, it is recommended to enable
`),us=s("strong"),Ki=i("forward chunking"),er=i(" and "),gs=s("strong"),tr=i("vae slicing"),or=i(":"),Wn=l(),W=s("p"),sr=i("Forward chunking via "),mo=s("a"),nr=i("enable_forward_chunking()"),ar=i("is explained in "),ft=s("a"),ir=i("this blog post"),rr=i(` and
allows to significantly reduce the required memory for the unet. You can chunk the feed forward layer over the `),_s=s("code"),lr=i("num_frames"),dr=i(`
dimension by doing:`),In=l(),m(ht.$$.fragment),Bn=l(),C=s("p"),pr=i("Vae slicing via "),uo=s("a"),cr=i("enable_vae_slicing()"),fr=i(" and "),go=s("a"),hr=i("enable_vae_slicing()"),mr=i(` also
gives significant memory savings since the two pipelines decode all image frames at once.`),Cn=l(),m(mt.$$.fragment),Xn=l(),ae=s("h2"),Me=s("a"),vs=s("span"),m(ut.$$.fragment),ur=l(),bs=s("span"),gr=i("Available checkpoints"),zn=l(),I=s("ul"),ws=s("li"),gt=s("a"),_r=i("damo-vilab/text-to-video-ms-1.7b"),vr=l(),ys=s("li"),_t=s("a"),br=i("damo-vilab/text-to-video-ms-1.7b-legacy"),wr=l(),Ts=s("li"),vt=s("a"),yr=i("cerspense/zeroscope_v2_576w"),Tr=l(),Ms=s("li"),bt=s("a"),Mr=i("cerspense/zeroscope_v2_XL"),Nn=l(),ie=s("h2"),Ee=s("a"),Es=s("span"),m(wt.$$.fragment),Er=l(),xs=s("span"),xr=i("TextToVideoSDPipeline"),An=l(),T=s("div"),m(yt.$$.fragment),Vr=l(),Vs=s("p"),Zr=i("Pipeline for text-to-video generation."),Jr=l(),Tt=s("p"),$r=i("This model inherits from "),_o=s("a"),kr=i("DiffusionPipeline"),Dr=i(`. 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.)`),Pr=l(),X=s("div"),m(Mt.$$.fragment),Ur=l(),Zs=s("p"),Gr=i("Function invoked when calling the pipeline for generation."),jr=l(),m(xe.$$.fragment),Sr=l(),Ve=s("div"),m(Et.$$.fragment),Wr=l(),xt=s("p"),Ir=i("Disable sliced VAE decoding. If "),Js=s("code"),Br=i("enable_vae_slicing"),Cr=i(` was previously invoked, this method will go back to
computing decoding in one step.`),Xr=l(),Ze=s("div"),m(Vt.$$.fragment),zr=l(),Zt=s("p"),Nr=i("Disable tiled VAE decoding. If "),$s=s("code"),Ar=i("enable_vae_tiling"),Rr=i(` was previously invoked, this method will go back to
computing decoding in one step.`),Lr=l(),Je=s("div"),m(Jt.$$.fragment),Fr=l(),j=s("p"),Hr=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ks=s("code"),Yr=i("enable_sequential_cpu_offload"),qr=i(", this method moves one whole model at a time to the GPU when its "),Ds=s("code"),Qr=i("forward"),Or=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Ps=s("code"),Kr=i("enable_sequential_cpu_offload"),el=i(", but performance is much better due to the iterative execution of the "),Us=s("code"),tl=i("unet"),ol=i("."),sl=l(),$e=s("div"),m($t.$$.fragment),nl=l(),re=s("p"),al=i(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae have their state dicts saved to CPU and then are moved to a `),Gs=s("code"),il=i("torch.device('meta') and loaded to GPU only when their specific submodule has its "),rl=i("forward"),js=s("code"),ll=i("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),dl=i("enable_model_cpu_offload`, but performance is lower."),pl=l(),z=s("div"),m(kt.$$.fragment),cl=l(),Ss=s("p"),fl=i("Enable sliced VAE decoding."),hl=l(),Ws=s("p"),ml=i(`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.`),ul=l(),N=s("div"),m(Dt.$$.fragment),gl=l(),Is=s("p"),_l=i("Enable tiled VAE decoding."),vl=l(),Bs=s("p"),bl=i(`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),Rn=l(),le=s("h2"),ke=s("a"),Cs=s("span"),m(Pt.$$.fragment),wl=l(),Xs=s("span"),yl=i("VideoToVideoSDPipeline"),Ln=l(),M=s("div"),m(Ut.$$.fragment),Tl=l(),zs=s("p"),Ml=i("Pipeline for text-to-video generation."),El=l(),Gt=s("p"),xl=i("This model inherits from "),vo=s("a"),Vl=i("DiffusionPipeline"),Zl=i(`. 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.)`),Jl=l(),A=s("div"),m(jt.$$.fragment),$l=l(),Ns=s("p"),kl=i("Function invoked when calling the pipeline for generation."),Dl=l(),m(De.$$.fragment),Pl=l(),Pe=s("div"),m(St.$$.fragment),Ul=l(),Wt=s("p"),Gl=i("Disable sliced VAE decoding. If "),As=s("code"),jl=i("enable_vae_slicing"),Sl=i(` was previously invoked, this method will go back to
computing decoding in one step.`),Wl=l(),Ue=s("div"),m(It.$$.fragment),Il=l(),Bt=s("p"),Bl=i("Disable tiled VAE decoding. If "),Rs=s("code"),Cl=i("enable_vae_tiling"),Xl=i(` was previously invoked, this method will go back to
computing decoding in one step.`),zl=l(),Ge=s("div"),m(Ct.$$.fragment),Nl=l(),S=s("p"),Al=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ls=s("code"),Rl=i("enable_sequential_cpu_offload"),Ll=i(", this method moves one whole model at a time to the GPU when its "),Fs=s("code"),Fl=i("forward"),Hl=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Hs=s("code"),Yl=i("enable_sequential_cpu_offload"),ql=i(", but performance is much better due to the iterative execution of the "),Ys=s("code"),Ql=i("unet"),Ol=i("."),Kl=l(),je=s("div"),m(Xt.$$.fragment),ed=l(),de=s("p"),td=i(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae have their state dicts saved to CPU and then are moved to a `),qs=s("code"),od=i("torch.device('meta') and loaded to GPU only when their specific submodule has its "),sd=i("forward"),Qs=s("code"),nd=i("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),ad=i("enable_model_cpu_offload`, but performance is lower."),id=l(),R=s("div"),m(zt.$$.fragment),rd=l(),Os=s("p"),ld=i("Enable sliced VAE decoding."),dd=l(),Ks=s("p"),pd=i(`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.`),cd=l(),L=s("div"),m(Nt.$$.fragment),fd=l(),en=s("p"),hd=i("Enable tiled VAE decoding."),md=l(),tn=s("p"),ud=i(`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),this.h()},l(t){const c=Fc('[data-svelte="svelte-1phssyn"]',document.head);w=n(c,"META",{name:!0,content:!0}),c.forEach(o),D=d(t),u(E.$$.fragment,t),y=d(t),Z=n(t,"H1",{class:!0});var At=a(Z);h=n(At,"A",{id:!0,class:!0,href:!0});var on=a(h);J=n(on,"SPAN",{});var sn=a(J);u(Ie.$$.fragment,sn),sn.forEach(o),on.forEach(o),Ta=d(At),Po=n(At,"SPAN",{});var Td=a(Po);Ma=r(Td,"Text-to-video synthesis"),Td.forEach(o),At.forEach(o),ln=d(t),q=n(t,"H2",{class:!0});var Hn=a(q);fe=n(Hn,"A",{id:!0,class:!0,href:!0});var Md=a(fe);Uo=n(Md,"SPAN",{});var Ed=a(Uo);u(Be.$$.fragment,Ed),Ed.forEach(o),Md.forEach(o),Ea=d(Hn),Go=n(Hn,"SPAN",{});var xd=a(Go);xa=r(xd,"Overview"),xd.forEach(o),Hn.forEach(o),dn=d(t),Ce=n(t,"P",{});var gd=a(Ce);Xe=n(gd,"A",{href:!0,rel:!0});var Vd=a(Xe);Va=r(Vd,"VideoFusion: Decomposed Diffusion Models for High-Quality Video Generation"),Vd.forEach(o),Za=r(gd," by Zhengxiong Luo, Dayou Chen, Yingya Zhang, Yan Huang, Liang Wang, Yujun Shen, Deli Zhao, Jingren Zhou, Tieniu Tan."),gd.forEach(o),pn=d(t),Rt=n(t,"P",{});var Zd=a(Rt);Ja=r(Zd,"The abstract of the paper is the following:"),Zd.forEach(o),cn=d(t),Lt=n(t,"P",{});var Jd=a(Lt);jo=n(Jd,"EM",{});var $d=a(jo);$a=r($d,"A diffusion probabilistic model (DPM), which constructs a forward diffusion process by gradually adding noise to data points and learns the reverse denoising process to generate new samples, has been shown to handle complex data distribution. Despite its recent success in image synthesis, applying DPMs to video generation is still challenging due to high-dimensional data spaces. Previous methods usually adopt a standard diffusion process, where frames in the same video clip are destroyed with independent noises, ignoring the content redundancy and temporal correlation. This work presents a decomposed diffusion process via resolving the per-frame noise into a base noise that is shared among all frames and a residual noise that varies along the time axis. The denoising pipeline employs two jointly-learned networks to match the noise decomposition accordingly. Experiments on various datasets confirm that our approach, termed as VideoFusion, surpasses both GAN-based and diffusion-based alternatives in high-quality video generation. We further show that our decomposed formulation can benefit from pre-trained image diffusion models and well-support text-conditioned video creation."),$d.forEach(o),Jd.forEach(o),fn=d(t),Ft=n(t,"P",{});var kd=a(Ft);ka=r(kd,"Resources:"),kd.forEach(o),hn=d(t),B=n(t,"UL",{});var bo=a(B);So=n(bo,"LI",{});var Dd=a(So);ze=n(Dd,"A",{href:!0,rel:!0});var Pd=a(ze);Da=r(Pd,"Website"),Pd.forEach(o),Dd.forEach(o),Pa=d(bo),Wo=n(bo,"LI",{});var Ud=a(Wo);Ne=n(Ud,"A",{href:!0,rel:!0});var Gd=a(Ne);Ua=r(Gd,"GitHub repository"),Gd.forEach(o),Ud.forEach(o),Ga=d(bo),Io=n(bo,"LI",{});var jd=a(Io);Ae=n(jd,"A",{href:!0,rel:!0});var Sd=a(Ae);ja=r(Sd,"\u{1F917} Spaces"),Sd.forEach(o),jd.forEach(o),bo.forEach(o),mn=d(t),Q=n(t,"H2",{class:!0});var Yn=a(Q);he=n(Yn,"A",{id:!0,class:!0,href:!0});var Wd=a(he);Bo=n(Wd,"SPAN",{});var Id=a(Bo);u(Re.$$.fragment,Id),Id.forEach(o),Wd.forEach(o),Sa=d(Yn),Co=n(Yn,"SPAN",{});var Bd=a(Co);Wa=r(Bd,"Available Pipelines:"),Bd.forEach(o),Yn.forEach(o),un=d(t),me=n(t,"TABLE",{});var qn=a(me);Xo=n(qn,"THEAD",{});var Cd=a(Xo);O=n(Cd,"TR",{});var wo=a(O);zo=n(wo,"TH",{});var Xd=a(zo);Ia=r(Xd,"Pipeline"),Xd.forEach(o),Ba=d(wo),No=n(wo,"TH",{});var zd=a(No);Ca=r(zd,"Tasks"),zd.forEach(o),Xa=d(wo),Ht=n(wo,"TH",{align:!0});var Nd=a(Ht);za=r(Nd,"Demo"),Nd.forEach(o),wo.forEach(o),Cd.forEach(o),Na=d(qn),Le=n(qn,"TBODY",{});var Qn=a(Le);K=n(Qn,"TR",{});var yo=a(K);Ao=n(yo,"TD",{});var Ad=a(Ao);Fe=n(Ad,"A",{href:!0,rel:!0});var Rd=a(Fe);Aa=r(Rd,"TextToVideoSDPipeline"),Rd.forEach(o),Ad.forEach(o),Ra=d(yo),Ro=n(yo,"TD",{});var Ld=a(Ro);Lo=n(Ld,"EM",{});var Fd=a(Lo);La=r(Fd,"Text-to-Video Generation"),Fd.forEach(o),Ld.forEach(o),Fa=d(yo),Yt=n(yo,"TD",{align:!0});var Hd=a(Yt);He=n(Hd,"A",{href:!0,rel:!0});var Yd=a(He);Ha=r(Yd,"\u{1F917} Spaces"),Yd.forEach(o),Hd.forEach(o),yo.forEach(o),Ya=d(Qn),ee=n(Qn,"TR",{});var To=a(ee);Fo=n(To,"TD",{});var qd=a(Fo);Ye=n(qd,"A",{href:!0,rel:!0});var Qd=a(Ye);qa=r(Qd,"VideoToVideoSDPipeline"),Qd.forEach(o),qd.forEach(o),Qa=d(To),Ho=n(To,"TD",{});var Od=a(Ho);Yo=n(Od,"EM",{});var Kd=a(Yo);Oa=r(Kd,"Text-Guided Video-to-Video Generation"),Kd.forEach(o),Od.forEach(o),Ka=d(To),qt=n(To,"TD",{align:!0});var ep=a(qt);Qt=n(ep,"A",{href:!0});var tp=a(Qt);ei=r(tp,"(TODO)\u{1F917} Spaces"),tp.forEach(o),ep.forEach(o),To.forEach(o),Qn.forEach(o),qn.forEach(o),gn=d(t),te=n(t,"H2",{class:!0});var On=a(te);ue=n(On,"A",{id:!0,class:!0,href:!0});var op=a(ue);qo=n(op,"SPAN",{});var sp=a(qo);u(qe.$$.fragment,sp),sp.forEach(o),op.forEach(o),ti=d(On),Qo=n(On,"SPAN",{});var np=a(Qo);oi=r(np,"Usage example"),np.forEach(o),On.forEach(o),_n=d(t),oe=n(t,"H3",{class:!0});var Kn=a(oe);ge=n(Kn,"A",{id:!0,class:!0,href:!0});var ap=a(ge);Oo=n(ap,"SPAN",{});var ip=a(Oo);u(Qe.$$.fragment,ip),ip.forEach(o),ap.forEach(o),si=d(Kn),Ko=n(Kn,"SPAN",{});var rp=a(Ko);es=n(rp,"CODE",{});var lp=a(es);ni=r(lp,"text-to-video-ms-1.7b"),lp.forEach(o),rp.forEach(o),Kn.forEach(o),vn=d(t),Ot=n(t,"P",{});var dp=a(Ot);ai=r(dp,"Let\u2019s start by generating a short video with the default length of 16 frames (2s at 8 fps):"),dp.forEach(o),bn=d(t),u(Oe.$$.fragment,t),wn=d(t),Kt=n(t,"P",{});var pp=a(Kt);ii=r(pp,`Diffusers supports different optimization techniques to improve the latency
and memory footprint of a pipeline. Since videos are often more memory-heavy than images,
we can enable CPU offloading and VAE slicing to keep the memory footprint at bay.`),pp.forEach(o),yn=d(t),eo=n(t,"P",{});var cp=a(eo);ri=r(cp,"Let\u2019s generate a video of 8 seconds (64 frames) on the same GPU using CPU offloading and VAE slicing:"),cp.forEach(o),Tn=d(t),u(Ke.$$.fragment,t),Mn=d(t),_e=n(t,"P",{});var ea=a(_e);li=r(ea,"It just takes "),ts=n(ea,"STRONG",{});var fp=a(ts);di=r(fp,"7 GBs of GPU memory"),fp.forEach(o),pi=r(ea," to generate the 64 video frames using PyTorch 2.0, \u201Cfp16\u201D precision and the techniques mentioned above."),ea.forEach(o),En=d(t),to=n(t,"P",{});var hp=a(to);ci=r(hp,"We can also use a different scheduler easily, using the same method we\u2019d use for Stable Diffusion:"),hp.forEach(o),xn=d(t),u(et.$$.fragment,t),Vn=d(t),oo=n(t,"P",{});var mp=a(oo);fi=r(mp,"Here are some sample outputs:"),mp.forEach(o),Zn=d(t),so=n(t,"TABLE",{});var up=a(so);tt=n(up,"TR",{});var ta=a(tt);os=n(ta,"TD",{});var gp=a(os);ve=n(gp,"CENTER",{});var nn=a(ve);hi=r(nn,`An astronaut riding a horse.
        `),mi=n(nn,"BR",{}),ui=d(nn),ot=n(nn,"IMG",{src:!0,alt:!0,style:!0}),nn.forEach(o),gp.forEach(o),gi=d(ta),ss=n(ta,"TD",{});var _p=a(ss);be=n(_p,"CENTER",{});var an=a(be);_i=r(an,`Darth vader surfing in waves.
        `),vi=n(an,"BR",{}),bi=d(an),st=n(an,"IMG",{src:!0,alt:!0,style:!0}),an.forEach(o),_p.forEach(o),ta.forEach(o),up.forEach(o),Jn=d(t),se=n(t,"H3",{class:!0});var oa=a(se);we=n(oa,"A",{id:!0,class:!0,href:!0});var vp=a(we);ns=n(vp,"SPAN",{});var bp=a(ns);u(nt.$$.fragment,bp),bp.forEach(o),vp.forEach(o),wi=d(oa),at=n(oa,"SPAN",{});var sa=a(at);as=n(sa,"CODE",{});var wp=a(as);yi=r(wp,"cerspense/zeroscope_v2_576w"),wp.forEach(o),Ti=r(sa," & "),is=n(sa,"CODE",{});var yp=a(is);Mi=r(yp,"cerspense/zeroscope_v2_XL"),yp.forEach(o),sa.forEach(o),oa.forEach(o),$n=d(t),$=n(t,"P",{});var U=a($);Ei=r(U,"Zeroscope are watermark-free model and have been trained on specific sizes such as "),rs=n(U,"CODE",{});var Tp=a(rs);xi=r(Tp,"576x320"),Tp.forEach(o),Vi=r(U," and "),ls=n(U,"CODE",{});var Mp=a(ls);Zi=r(Mp,"1024x576"),Mp.forEach(o),Ji=r(U,`.
One should first generate a video using the lower resolution checkpoint `),it=n(U,"A",{href:!0,rel:!0});var Ep=a(it);ds=n(Ep,"CODE",{});var xp=a(ds);$i=r(xp,"cerspense/zeroscope_v2_576w"),xp.forEach(o),Ep.forEach(o),ki=r(U," with "),no=n(U,"A",{href:!0});var Vp=a(no);Di=r(Vp,"TextToVideoSDPipeline"),Vp.forEach(o),Pi=r(U,`,
which can then be upscaled using `),ao=n(U,"A",{href:!0});var Zp=a(ao);Ui=r(Zp,"VideoToVideoSDPipeline"),Zp.forEach(o),Gi=r(U," and "),rt=n(U,"A",{href:!0,rel:!0});var Jp=a(rt);ps=n(Jp,"CODE",{});var $p=a(ps);ji=r($p,"cerspense/zeroscope_v2_XL"),$p.forEach(o),Jp.forEach(o),Si=r(U,"."),U.forEach(o),kn=d(t),u(lt.$$.fragment,t),Dn=d(t),io=n(t,"P",{});var kp=a(io);Wi=r(kp,"Now the video can be upscaled:"),kp.forEach(o),Pn=d(t),u(dt.$$.fragment,t),Un=d(t),ro=n(t,"P",{});var Dp=a(ro);Ii=r(Dp,"Here are some sample outputs:"),Dp.forEach(o),Gn=d(t),lo=n(t,"TABLE",{});var Pp=a(lo);cs=n(Pp,"TR",{});var Up=a(cs);fs=n(Up,"TD",{});var Gp=a(fs);ye=n(Gp,"CENTER",{});var rn=a(ye);Bi=r(rn,`Darth vader surfing in waves.
        `),Ci=n(rn,"BR",{}),Xi=d(rn),pt=n(rn,"IMG",{src:!0,alt:!0,style:!0}),rn.forEach(o),Gp.forEach(o),Up.forEach(o),Pp.forEach(o),jn=d(t),ne=n(t,"H3",{class:!0});var na=a(ne);Te=n(na,"A",{id:!0,class:!0,href:!0});var jp=a(Te);hs=n(jp,"SPAN",{});var Sp=a(hs);u(ct.$$.fragment,Sp),Sp.forEach(o),jp.forEach(o),zi=d(na),ms=n(na,"SPAN",{});var Wp=a(ms);Ni=r(Wp,"Memory optimizations"),Wp.forEach(o),na.forEach(o),Sn=d(t),k=n(t,"P",{});var G=a(k);Ai=r(G,"Text-guided video generation with "),po=n(G,"A",{href:!0});var Ip=a(po);Ri=r(Ip,"~TextToVideoSDPipeline"),Ip.forEach(o),Li=r(G," and "),co=n(G,"A",{href:!0});var Bp=a(co);Fi=r(Bp,"~VideoToVideoSDPipeline"),Bp.forEach(o),Hi=r(G,` is very memory intensive both
when denoising with `),fo=n(G,"A",{href:!0});var Cp=a(fo);Yi=r(Cp,"~UNet3DConditionModel"),Cp.forEach(o),qi=r(G," and when decoding with "),ho=n(G,"A",{href:!0});var Xp=a(ho);Qi=r(Xp,"~AutoencoderKL"),Xp.forEach(o),Oi=r(G,`. It is possible though to reduce
memory usage at the cost of increased runtime to achieve the exact same result. To do so, it is recommended to enable
`),us=n(G,"STRONG",{});var zp=a(us);Ki=r(zp,"forward chunking"),zp.forEach(o),er=r(G," and "),gs=n(G,"STRONG",{});var Np=a(gs);tr=r(Np,"vae slicing"),Np.forEach(o),or=r(G,":"),G.forEach(o),Wn=d(t),W=n(t,"P",{});var Se=a(W);sr=r(Se,"Forward chunking via "),mo=n(Se,"A",{href:!0});var Ap=a(mo);nr=r(Ap,"enable_forward_chunking()"),Ap.forEach(o),ar=r(Se,"is explained in "),ft=n(Se,"A",{href:!0,rel:!0});var Rp=a(ft);ir=r(Rp,"this blog post"),Rp.forEach(o),rr=r(Se,` and
allows to significantly reduce the required memory for the unet. You can chunk the feed forward layer over the `),_s=n(Se,"CODE",{});var Lp=a(_s);lr=r(Lp,"num_frames"),Lp.forEach(o),dr=r(Se,`
dimension by doing:`),Se.forEach(o),In=d(t),u(ht.$$.fragment,t),Bn=d(t),C=n(t,"P",{});var Mo=a(C);pr=r(Mo,"Vae slicing via "),uo=n(Mo,"A",{href:!0});var Fp=a(uo);cr=r(Fp,"enable_vae_slicing()"),Fp.forEach(o),fr=r(Mo," and "),go=n(Mo,"A",{href:!0});var Hp=a(go);hr=r(Hp,"enable_vae_slicing()"),Hp.forEach(o),mr=r(Mo,` also
gives significant memory savings since the two pipelines decode all image frames at once.`),Mo.forEach(o),Cn=d(t),u(mt.$$.fragment,t),Xn=d(t),ae=n(t,"H2",{class:!0});var aa=a(ae);Me=n(aa,"A",{id:!0,class:!0,href:!0});var Yp=a(Me);vs=n(Yp,"SPAN",{});var qp=a(vs);u(ut.$$.fragment,qp),qp.forEach(o),Yp.forEach(o),ur=d(aa),bs=n(aa,"SPAN",{});var Qp=a(bs);gr=r(Qp,"Available checkpoints"),Qp.forEach(o),aa.forEach(o),zn=d(t),I=n(t,"UL",{});var We=a(I);ws=n(We,"LI",{});var Op=a(ws);gt=n(Op,"A",{href:!0,rel:!0});var Kp=a(gt);_r=r(Kp,"damo-vilab/text-to-video-ms-1.7b"),Kp.forEach(o),Op.forEach(o),vr=d(We),ys=n(We,"LI",{});var ec=a(ys);_t=n(ec,"A",{href:!0,rel:!0});var tc=a(_t);br=r(tc,"damo-vilab/text-to-video-ms-1.7b-legacy"),tc.forEach(o),ec.forEach(o),wr=d(We),Ts=n(We,"LI",{});var oc=a(Ts);vt=n(oc,"A",{href:!0,rel:!0});var sc=a(vt);yr=r(sc,"cerspense/zeroscope_v2_576w"),sc.forEach(o),oc.forEach(o),Tr=d(We),Ms=n(We,"LI",{});var nc=a(Ms);bt=n(nc,"A",{href:!0,rel:!0});var ac=a(bt);Mr=r(ac,"cerspense/zeroscope_v2_XL"),ac.forEach(o),nc.forEach(o),We.forEach(o),Nn=d(t),ie=n(t,"H2",{class:!0});var ia=a(ie);Ee=n(ia,"A",{id:!0,class:!0,href:!0});var ic=a(Ee);Es=n(ic,"SPAN",{});var rc=a(Es);u(wt.$$.fragment,rc),rc.forEach(o),ic.forEach(o),Er=d(ia),xs=n(ia,"SPAN",{});var lc=a(xs);xr=r(lc,"TextToVideoSDPipeline"),lc.forEach(o),ia.forEach(o),An=d(t),T=n(t,"DIV",{class:!0});var x=a(T);u(yt.$$.fragment,x),Vr=d(x),Vs=n(x,"P",{});var dc=a(Vs);Zr=r(dc,"Pipeline for text-to-video generation."),dc.forEach(o),Jr=d(x),Tt=n(x,"P",{});var ra=a(Tt);$r=r(ra,"This model inherits from "),_o=n(ra,"A",{href:!0});var pc=a(_o);kr=r(pc,"DiffusionPipeline"),pc.forEach(o),Dr=r(ra,`. 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.)`),ra.forEach(o),Pr=d(x),X=n(x,"DIV",{class:!0});var Eo=a(X);u(Mt.$$.fragment,Eo),Ur=d(Eo),Zs=n(Eo,"P",{});var cc=a(Zs);Gr=r(cc,"Function invoked when calling the pipeline for generation."),cc.forEach(o),jr=d(Eo),u(xe.$$.fragment,Eo),Eo.forEach(o),Sr=d(x),Ve=n(x,"DIV",{class:!0});var la=a(Ve);u(Et.$$.fragment,la),Wr=d(la),xt=n(la,"P",{});var da=a(xt);Ir=r(da,"Disable sliced VAE decoding. If "),Js=n(da,"CODE",{});var fc=a(Js);Br=r(fc,"enable_vae_slicing"),fc.forEach(o),Cr=r(da,` was previously invoked, this method will go back to
computing decoding in one step.`),da.forEach(o),la.forEach(o),Xr=d(x),Ze=n(x,"DIV",{class:!0});var pa=a(Ze);u(Vt.$$.fragment,pa),zr=d(pa),Zt=n(pa,"P",{});var ca=a(Zt);Nr=r(ca,"Disable tiled VAE decoding. If "),$s=n(ca,"CODE",{});var hc=a($s);Ar=r(hc,"enable_vae_tiling"),hc.forEach(o),Rr=r(ca,` was previously invoked, this method will go back to
computing decoding in one step.`),ca.forEach(o),pa.forEach(o),Lr=d(x),Je=n(x,"DIV",{class:!0});var fa=a(Je);u(Jt.$$.fragment,fa),Fr=d(fa),j=n(fa,"P",{});var F=a(j);Hr=r(F,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ks=n(F,"CODE",{});var mc=a(ks);Yr=r(mc,"enable_sequential_cpu_offload"),mc.forEach(o),qr=r(F,", this method moves one whole model at a time to the GPU when its "),Ds=n(F,"CODE",{});var uc=a(Ds);Qr=r(uc,"forward"),uc.forEach(o),Or=r(F,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Ps=n(F,"CODE",{});var gc=a(Ps);Kr=r(gc,"enable_sequential_cpu_offload"),gc.forEach(o),el=r(F,", but performance is much better due to the iterative execution of the "),Us=n(F,"CODE",{});var _c=a(Us);tl=r(_c,"unet"),_c.forEach(o),ol=r(F,"."),F.forEach(o),fa.forEach(o),sl=d(x),$e=n(x,"DIV",{class:!0});var ha=a($e);u($t.$$.fragment,ha),nl=d(ha),re=n(ha,"P",{});var xo=a(re);al=r(xo,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae have their state dicts saved to CPU and then are moved to a `),Gs=n(xo,"CODE",{});var vc=a(Gs);il=r(vc,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),vc.forEach(o),rl=r(xo,"forward"),js=n(xo,"CODE",{});var bc=a(js);ll=r(bc,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),bc.forEach(o),dl=r(xo,"enable_model_cpu_offload`, but performance is lower."),xo.forEach(o),ha.forEach(o),pl=d(x),z=n(x,"DIV",{class:!0});var Vo=a(z);u(kt.$$.fragment,Vo),cl=d(Vo),Ss=n(Vo,"P",{});var wc=a(Ss);fl=r(wc,"Enable sliced VAE decoding."),wc.forEach(o),hl=d(Vo),Ws=n(Vo,"P",{});var yc=a(Ws);ml=r(yc,`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.`),yc.forEach(o),Vo.forEach(o),ul=d(x),N=n(x,"DIV",{class:!0});var Zo=a(N);u(Dt.$$.fragment,Zo),gl=d(Zo),Is=n(Zo,"P",{});var Tc=a(Is);_l=r(Tc,"Enable tiled VAE decoding."),Tc.forEach(o),vl=d(Zo),Bs=n(Zo,"P",{});var Mc=a(Bs);bl=r(Mc,`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),Mc.forEach(o),Zo.forEach(o),x.forEach(o),Rn=d(t),le=n(t,"H2",{class:!0});var ma=a(le);ke=n(ma,"A",{id:!0,class:!0,href:!0});var Ec=a(ke);Cs=n(Ec,"SPAN",{});var xc=a(Cs);u(Pt.$$.fragment,xc),xc.forEach(o),Ec.forEach(o),wl=d(ma),Xs=n(ma,"SPAN",{});var Vc=a(Xs);yl=r(Vc,"VideoToVideoSDPipeline"),Vc.forEach(o),ma.forEach(o),Ln=d(t),M=n(t,"DIV",{class:!0});var V=a(M);u(Ut.$$.fragment,V),Tl=d(V),zs=n(V,"P",{});var Zc=a(zs);Ml=r(Zc,"Pipeline for text-to-video generation."),Zc.forEach(o),El=d(V),Gt=n(V,"P",{});var ua=a(Gt);xl=r(ua,"This model inherits from "),vo=n(ua,"A",{href:!0});var Jc=a(vo);Vl=r(Jc,"DiffusionPipeline"),Jc.forEach(o),Zl=r(ua,`. 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.)`),ua.forEach(o),Jl=d(V),A=n(V,"DIV",{class:!0});var Jo=a(A);u(jt.$$.fragment,Jo),$l=d(Jo),Ns=n(Jo,"P",{});var $c=a(Ns);kl=r($c,"Function invoked when calling the pipeline for generation."),$c.forEach(o),Dl=d(Jo),u(De.$$.fragment,Jo),Jo.forEach(o),Pl=d(V),Pe=n(V,"DIV",{class:!0});var ga=a(Pe);u(St.$$.fragment,ga),Ul=d(ga),Wt=n(ga,"P",{});var _a=a(Wt);Gl=r(_a,"Disable sliced VAE decoding. If "),As=n(_a,"CODE",{});var kc=a(As);jl=r(kc,"enable_vae_slicing"),kc.forEach(o),Sl=r(_a,` was previously invoked, this method will go back to
computing decoding in one step.`),_a.forEach(o),ga.forEach(o),Wl=d(V),Ue=n(V,"DIV",{class:!0});var va=a(Ue);u(It.$$.fragment,va),Il=d(va),Bt=n(va,"P",{});var ba=a(Bt);Bl=r(ba,"Disable tiled VAE decoding. If "),Rs=n(ba,"CODE",{});var Dc=a(Rs);Cl=r(Dc,"enable_vae_tiling"),Dc.forEach(o),Xl=r(ba,` was previously invoked, this method will go back to
computing decoding in one step.`),ba.forEach(o),va.forEach(o),zl=d(V),Ge=n(V,"DIV",{class:!0});var wa=a(Ge);u(Ct.$$.fragment,wa),Nl=d(wa),S=n(wa,"P",{});var H=a(S);Al=r(H,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ls=n(H,"CODE",{});var Pc=a(Ls);Rl=r(Pc,"enable_sequential_cpu_offload"),Pc.forEach(o),Ll=r(H,", this method moves one whole model at a time to the GPU when its "),Fs=n(H,"CODE",{});var Uc=a(Fs);Fl=r(Uc,"forward"),Uc.forEach(o),Hl=r(H,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Hs=n(H,"CODE",{});var Gc=a(Hs);Yl=r(Gc,"enable_sequential_cpu_offload"),Gc.forEach(o),ql=r(H,", but performance is much better due to the iterative execution of the "),Ys=n(H,"CODE",{});var jc=a(Ys);Ql=r(jc,"unet"),jc.forEach(o),Ol=r(H,"."),H.forEach(o),wa.forEach(o),Kl=d(V),je=n(V,"DIV",{class:!0});var ya=a(je);u(Xt.$$.fragment,ya),ed=d(ya),de=n(ya,"P",{});var $o=a(de);td=r($o,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae have their state dicts saved to CPU and then are moved to a `),qs=n($o,"CODE",{});var Sc=a(qs);od=r(Sc,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),Sc.forEach(o),sd=r($o,"forward"),Qs=n($o,"CODE",{});var Wc=a(Qs);nd=r(Wc,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Wc.forEach(o),ad=r($o,"enable_model_cpu_offload`, but performance is lower."),$o.forEach(o),ya.forEach(o),id=d(V),R=n(V,"DIV",{class:!0});var ko=a(R);u(zt.$$.fragment,ko),rd=d(ko),Os=n(ko,"P",{});var Ic=a(Os);ld=r(Ic,"Enable sliced VAE decoding."),Ic.forEach(o),dd=d(ko),Ks=n(ko,"P",{});var Bc=a(Ks);pd=r(Bc,`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.`),Bc.forEach(o),ko.forEach(o),cd=d(V),L=n(V,"DIV",{class:!0});var Do=a(L);u(Nt.$$.fragment,Do),fd=d(Do),en=n(Do,"P",{});var Cc=a(en);hd=r(Cc,"Enable tiled VAE decoding."),Cc.forEach(o),md=d(Do),tn=n(Do,"P",{});var Xc=a(tn);ud=r(Xc,`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),Xc.forEach(o),Do.forEach(o),V.forEach(o),this.h()},h(){p(w,"name","hf:doc:metadata"),p(w,"content",JSON.stringify(ef)),p(h,"id","texttovideo-synthesis"),p(h,"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"),p(h,"href","#texttovideo-synthesis"),p(Z,"class","relative group"),p(fe,"id","overview"),p(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"),p(fe,"href","#overview"),p(q,"class","relative group"),p(Xe,"href","https://arxiv.org/abs/2303.08320"),p(Xe,"rel","nofollow"),p(ze,"href","https://modelscope.cn/models/damo/text-to-video-synthesis/summary"),p(ze,"rel","nofollow"),p(Ne,"href","https://github.com/modelscope/modelscope/"),p(Ne,"rel","nofollow"),p(Ae,"href","https://huggingface.co/spaces/damo-vilab/modelscope-text-to-video-synthesis"),p(Ae,"rel","nofollow"),p(he,"id","available-pipelines"),p(he,"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"),p(he,"href","#available-pipelines"),p(Q,"class","relative group"),p(Ht,"align","center"),p(Fe,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py"),p(Fe,"rel","nofollow"),p(He,"href","https://huggingface.co/spaces/damo-vilab/modelscope-text-to-video-synthesis"),p(He,"rel","nofollow"),p(Yt,"align","center"),p(Ye,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py"),p(Ye,"rel","nofollow"),p(Qt,"href",""),p(qt,"align","center"),p(ue,"id","usage-example"),p(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(ue,"href","#usage-example"),p(te,"class","relative group"),p(ge,"id","texttovideoms17b"),p(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"),p(ge,"href","#texttovideoms17b"),p(oe,"class","relative group"),_d(ot.src,bd="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/astr.gif")||p(ot,"src",bd),p(ot,"alt","An astronaut riding a horse."),vd(ot,"width","300px"),_d(st.src,wd="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/vader.gif")||p(st,"src",wd),p(st,"alt","Darth vader surfing in waves."),vd(st,"width","300px"),p(we,"id","cerspensezeroscopev2576w-cerspensezeroscopev2xl"),p(we,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(we,"href","#cerspensezeroscopev2576w-cerspensezeroscopev2xl"),p(se,"class","relative group"),p(it,"href","https://huggingface.co/cerspense/zeroscope_v2_576w"),p(it,"rel","nofollow"),p(no,"href","/docs/diffusers/v0.18.0/en/api/pipelines/text_to_video#diffusers.TextToVideoSDPipeline"),p(ao,"href","/docs/diffusers/v0.18.0/en/api/pipelines/text_to_video#diffusers.VideoToVideoSDPipeline"),p(rt,"href","https://huggingface.co/cerspense/zeroscope_v2_XL"),p(rt,"rel","nofollow"),_d(pt.src,yd="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/darthvader_cerpense.gif")||p(pt,"src",yd),p(pt,"alt","Darth vader surfing in waves."),vd(pt,"width","576px"),p(Te,"id","memory-optimizations"),p(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"),p(Te,"href","#memory-optimizations"),p(ne,"class","relative group"),p(po,"href","/docs/diffusers/v0.18.0/en/api/pipelines/text_to_video#diffusers.TextToVideoSDPipeline"),p(co,"href","/docs/diffusers/v0.18.0/en/api/pipelines/text_to_video#diffusers.VideoToVideoSDPipeline"),p(fo,"href","/docs/diffusers/v0.18.0/en/api/models/unet3d-cond#diffusers.UNet3DConditionModel"),p(ho,"href","/docs/diffusers/v0.18.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL"),p(mo,"href","/docs/diffusers/v0.18.0/en/api/models/unet3d-cond#diffusers.UNet3DConditionModel.enable_forward_chunking"),p(ft,"href","https://huggingface.co/blog/reformer#2-chunked-feed-forward-layers"),p(ft,"rel","nofollow"),p(uo,"href","/docs/diffusers/v0.18.0/en/api/pipelines/text_to_video#diffusers.TextToVideoSDPipeline.enable_vae_slicing"),p(go,"href","/docs/diffusers/v0.18.0/en/api/pipelines/text_to_video#diffusers.VideoToVideoSDPipeline.enable_vae_slicing"),p(Me,"id","available-checkpoints"),p(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"),p(Me,"href","#available-checkpoints"),p(ae,"class","relative group"),p(gt,"href","https://huggingface.co/damo-vilab/text-to-video-ms-1.7b/"),p(gt,"rel","nofollow"),p(_t,"href","https://huggingface.co/damo-vilab/text-to-video-ms-1.7b-legacy"),p(_t,"rel","nofollow"),p(vt,"href","https://huggingface.co/cerspense/zeroscope_v2_576w"),p(vt,"rel","nofollow"),p(bt,"href","https://huggingface.co/cerspense/zeroscope_v2_XL"),p(bt,"rel","nofollow"),p(Ee,"id","diffusers.TextToVideoSDPipeline"),p(Ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Ee,"href","#diffusers.TextToVideoSDPipeline"),p(ie,"class","relative group"),p(_o,"href","/docs/diffusers/v0.18.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),p(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ke,"id","diffusers.VideoToVideoSDPipeline"),p(ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(ke,"href","#diffusers.VideoToVideoSDPipeline"),p(le,"class","relative group"),p(vo,"href","/docs/diffusers/v0.18.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),p(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(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,c){e(document.head,w),f(t,D,c),g(E,t,c),f(t,y,c),f(t,Z,c),e(Z,h),e(h,J),g(Ie,J,null),e(Z,Ta),e(Z,Po),e(Po,Ma),f(t,ln,c),f(t,q,c),e(q,fe),e(fe,Uo),g(Be,Uo,null),e(q,Ea),e(q,Go),e(Go,xa),f(t,dn,c),f(t,Ce,c),e(Ce,Xe),e(Xe,Va),e(Ce,Za),f(t,pn,c),f(t,Rt,c),e(Rt,Ja),f(t,cn,c),f(t,Lt,c),e(Lt,jo),e(jo,$a),f(t,fn,c),f(t,Ft,c),e(Ft,ka),f(t,hn,c),f(t,B,c),e(B,So),e(So,ze),e(ze,Da),e(B,Pa),e(B,Wo),e(Wo,Ne),e(Ne,Ua),e(B,Ga),e(B,Io),e(Io,Ae),e(Ae,ja),f(t,mn,c),f(t,Q,c),e(Q,he),e(he,Bo),g(Re,Bo,null),e(Q,Sa),e(Q,Co),e(Co,Wa),f(t,un,c),f(t,me,c),e(me,Xo),e(Xo,O),e(O,zo),e(zo,Ia),e(O,Ba),e(O,No),e(No,Ca),e(O,Xa),e(O,Ht),e(Ht,za),e(me,Na),e(me,Le),e(Le,K),e(K,Ao),e(Ao,Fe),e(Fe,Aa),e(K,Ra),e(K,Ro),e(Ro,Lo),e(Lo,La),e(K,Fa),e(K,Yt),e(Yt,He),e(He,Ha),e(Le,Ya),e(Le,ee),e(ee,Fo),e(Fo,Ye),e(Ye,qa),e(ee,Qa),e(ee,Ho),e(Ho,Yo),e(Yo,Oa),e(ee,Ka),e(ee,qt),e(qt,Qt),e(Qt,ei),f(t,gn,c),f(t,te,c),e(te,ue),e(ue,qo),g(qe,qo,null),e(te,ti),e(te,Qo),e(Qo,oi),f(t,_n,c),f(t,oe,c),e(oe,ge),e(ge,Oo),g(Qe,Oo,null),e(oe,si),e(oe,Ko),e(Ko,es),e(es,ni),f(t,vn,c),f(t,Ot,c),e(Ot,ai),f(t,bn,c),g(Oe,t,c),f(t,wn,c),f(t,Kt,c),e(Kt,ii),f(t,yn,c),f(t,eo,c),e(eo,ri),f(t,Tn,c),g(Ke,t,c),f(t,Mn,c),f(t,_e,c),e(_e,li),e(_e,ts),e(ts,di),e(_e,pi),f(t,En,c),f(t,to,c),e(to,ci),f(t,xn,c),g(et,t,c),f(t,Vn,c),f(t,oo,c),e(oo,fi),f(t,Zn,c),f(t,so,c),e(so,tt),e(tt,os),e(os,ve),e(ve,hi),e(ve,mi),e(ve,ui),e(ve,ot),e(tt,gi),e(tt,ss),e(ss,be),e(be,_i),e(be,vi),e(be,bi),e(be,st),f(t,Jn,c),f(t,se,c),e(se,we),e(we,ns),g(nt,ns,null),e(se,wi),e(se,at),e(at,as),e(as,yi),e(at,Ti),e(at,is),e(is,Mi),f(t,$n,c),f(t,$,c),e($,Ei),e($,rs),e(rs,xi),e($,Vi),e($,ls),e(ls,Zi),e($,Ji),e($,it),e(it,ds),e(ds,$i),e($,ki),e($,no),e(no,Di),e($,Pi),e($,ao),e(ao,Ui),e($,Gi),e($,rt),e(rt,ps),e(ps,ji),e($,Si),f(t,kn,c),g(lt,t,c),f(t,Dn,c),f(t,io,c),e(io,Wi),f(t,Pn,c),g(dt,t,c),f(t,Un,c),f(t,ro,c),e(ro,Ii),f(t,Gn,c),f(t,lo,c),e(lo,cs),e(cs,fs),e(fs,ye),e(ye,Bi),e(ye,Ci),e(ye,Xi),e(ye,pt),f(t,jn,c),f(t,ne,c),e(ne,Te),e(Te,hs),g(ct,hs,null),e(ne,zi),e(ne,ms),e(ms,Ni),f(t,Sn,c),f(t,k,c),e(k,Ai),e(k,po),e(po,Ri),e(k,Li),e(k,co),e(co,Fi),e(k,Hi),e(k,fo),e(fo,Yi),e(k,qi),e(k,ho),e(ho,Qi),e(k,Oi),e(k,us),e(us,Ki),e(k,er),e(k,gs),e(gs,tr),e(k,or),f(t,Wn,c),f(t,W,c),e(W,sr),e(W,mo),e(mo,nr),e(W,ar),e(W,ft),e(ft,ir),e(W,rr),e(W,_s),e(_s,lr),e(W,dr),f(t,In,c),g(ht,t,c),f(t,Bn,c),f(t,C,c),e(C,pr),e(C,uo),e(uo,cr),e(C,fr),e(C,go),e(go,hr),e(C,mr),f(t,Cn,c),g(mt,t,c),f(t,Xn,c),f(t,ae,c),e(ae,Me),e(Me,vs),g(ut,vs,null),e(ae,ur),e(ae,bs),e(bs,gr),f(t,zn,c),f(t,I,c),e(I,ws),e(ws,gt),e(gt,_r),e(I,vr),e(I,ys),e(ys,_t),e(_t,br),e(I,wr),e(I,Ts),e(Ts,vt),e(vt,yr),e(I,Tr),e(I,Ms),e(Ms,bt),e(bt,Mr),f(t,Nn,c),f(t,ie,c),e(ie,Ee),e(Ee,Es),g(wt,Es,null),e(ie,Er),e(ie,xs),e(xs,xr),f(t,An,c),f(t,T,c),g(yt,T,null),e(T,Vr),e(T,Vs),e(Vs,Zr),e(T,Jr),e(T,Tt),e(Tt,$r),e(Tt,_o),e(_o,kr),e(Tt,Dr),e(T,Pr),e(T,X),g(Mt,X,null),e(X,Ur),e(X,Zs),e(Zs,Gr),e(X,jr),g(xe,X,null),e(T,Sr),e(T,Ve),g(Et,Ve,null),e(Ve,Wr),e(Ve,xt),e(xt,Ir),e(xt,Js),e(Js,Br),e(xt,Cr),e(T,Xr),e(T,Ze),g(Vt,Ze,null),e(Ze,zr),e(Ze,Zt),e(Zt,Nr),e(Zt,$s),e($s,Ar),e(Zt,Rr),e(T,Lr),e(T,Je),g(Jt,Je,null),e(Je,Fr),e(Je,j),e(j,Hr),e(j,ks),e(ks,Yr),e(j,qr),e(j,Ds),e(Ds,Qr),e(j,Or),e(j,Ps),e(Ps,Kr),e(j,el),e(j,Us),e(Us,tl),e(j,ol),e(T,sl),e(T,$e),g($t,$e,null),e($e,nl),e($e,re),e(re,al),e(re,Gs),e(Gs,il),e(re,rl),e(re,js),e(js,ll),e(re,dl),e(T,pl),e(T,z),g(kt,z,null),e(z,cl),e(z,Ss),e(Ss,fl),e(z,hl),e(z,Ws),e(Ws,ml),e(T,ul),e(T,N),g(Dt,N,null),e(N,gl),e(N,Is),e(Is,_l),e(N,vl),e(N,Bs),e(Bs,bl),f(t,Rn,c),f(t,le,c),e(le,ke),e(ke,Cs),g(Pt,Cs,null),e(le,wl),e(le,Xs),e(Xs,yl),f(t,Ln,c),f(t,M,c),g(Ut,M,null),e(M,Tl),e(M,zs),e(zs,Ml),e(M,El),e(M,Gt),e(Gt,xl),e(Gt,vo),e(vo,Vl),e(Gt,Zl),e(M,Jl),e(M,A),g(jt,A,null),e(A,$l),e(A,Ns),e(Ns,kl),e(A,Dl),g(De,A,null),e(M,Pl),e(M,Pe),g(St,Pe,null),e(Pe,Ul),e(Pe,Wt),e(Wt,Gl),e(Wt,As),e(As,jl),e(Wt,Sl),e(M,Wl),e(M,Ue),g(It,Ue,null),e(Ue,Il),e(Ue,Bt),e(Bt,Bl),e(Bt,Rs),e(Rs,Cl),e(Bt,Xl),e(M,zl),e(M,Ge),g(Ct,Ge,null),e(Ge,Nl),e(Ge,S),e(S,Al),e(S,Ls),e(Ls,Rl),e(S,Ll),e(S,Fs),e(Fs,Fl),e(S,Hl),e(S,Hs),e(Hs,Yl),e(S,ql),e(S,Ys),e(Ys,Ql),e(S,Ol),e(M,Kl),e(M,je),g(Xt,je,null),e(je,ed),e(je,de),e(de,td),e(de,qs),e(qs,od),e(de,sd),e(de,Qs),e(Qs,nd),e(de,ad),e(M,id),e(M,R),g(zt,R,null),e(R,rd),e(R,Os),e(Os,ld),e(R,dd),e(R,Ks),e(Ks,pd),e(M,cd),e(M,L),g(Nt,L,null),e(L,fd),e(L,en),e(en,hd),e(L,md),e(L,tn),e(tn,ud),Fn=!0},p(t,[c]){const At={};c&2&&(At.$$scope={dirty:c,ctx:t}),E.$set(At);const on={};c&2&&(on.$$scope={dirty:c,ctx:t}),xe.$set(on);const sn={};c&2&&(sn.$$scope={dirty:c,ctx:t}),De.$set(sn)},i(t){Fn||(_(E.$$.fragment,t),_(Ie.$$.fragment,t),_(Be.$$.fragment,t),_(Re.$$.fragment,t),_(qe.$$.fragment,t),_(Qe.$$.fragment,t),_(Oe.$$.fragment,t),_(Ke.$$.fragment,t),_(et.$$.fragment,t),_(nt.$$.fragment,t),_(lt.$$.fragment,t),_(dt.$$.fragment,t),_(ct.$$.fragment,t),_(ht.$$.fragment,t),_(mt.$$.fragment,t),_(ut.$$.fragment,t),_(wt.$$.fragment,t),_(yt.$$.fragment,t),_(Mt.$$.fragment,t),_(xe.$$.fragment,t),_(Et.$$.fragment,t),_(Vt.$$.fragment,t),_(Jt.$$.fragment,t),_($t.$$.fragment,t),_(kt.$$.fragment,t),_(Dt.$$.fragment,t),_(Pt.$$.fragment,t),_(Ut.$$.fragment,t),_(jt.$$.fragment,t),_(De.$$.fragment,t),_(St.$$.fragment,t),_(It.$$.fragment,t),_(Ct.$$.fragment,t),_(Xt.$$.fragment,t),_(zt.$$.fragment,t),_(Nt.$$.fragment,t),Fn=!0)},o(t){v(E.$$.fragment,t),v(Ie.$$.fragment,t),v(Be.$$.fragment,t),v(Re.$$.fragment,t),v(qe.$$.fragment,t),v(Qe.$$.fragment,t),v(Oe.$$.fragment,t),v(Ke.$$.fragment,t),v(et.$$.fragment,t),v(nt.$$.fragment,t),v(lt.$$.fragment,t),v(dt.$$.fragment,t),v(ct.$$.fragment,t),v(ht.$$.fragment,t),v(mt.$$.fragment,t),v(ut.$$.fragment,t),v(wt.$$.fragment,t),v(yt.$$.fragment,t),v(Mt.$$.fragment,t),v(xe.$$.fragment,t),v(Et.$$.fragment,t),v(Vt.$$.fragment,t),v(Jt.$$.fragment,t),v($t.$$.fragment,t),v(kt.$$.fragment,t),v(Dt.$$.fragment,t),v(Pt.$$.fragment,t),v(Ut.$$.fragment,t),v(jt.$$.fragment,t),v(De.$$.fragment,t),v(St.$$.fragment,t),v(It.$$.fragment,t),v(Ct.$$.fragment,t),v(Xt.$$.fragment,t),v(zt.$$.fragment,t),v(Nt.$$.fragment,t),Fn=!1},d(t){o(w),t&&o(D),b(E,t),t&&o(y),t&&o(Z),b(Ie),t&&o(ln),t&&o(q),b(Be),t&&o(dn),t&&o(Ce),t&&o(pn),t&&o(Rt),t&&o(cn),t&&o(Lt),t&&o(fn),t&&o(Ft),t&&o(hn),t&&o(B),t&&o(mn),t&&o(Q),b(Re),t&&o(un),t&&o(me),t&&o(gn),t&&o(te),b(qe),t&&o(_n),t&&o(oe),b(Qe),t&&o(vn),t&&o(Ot),t&&o(bn),b(Oe,t),t&&o(wn),t&&o(Kt),t&&o(yn),t&&o(eo),t&&o(Tn),b(Ke,t),t&&o(Mn),t&&o(_e),t&&o(En),t&&o(to),t&&o(xn),b(et,t),t&&o(Vn),t&&o(oo),t&&o(Zn),t&&o(so),t&&o(Jn),t&&o(se),b(nt),t&&o($n),t&&o($),t&&o(kn),b(lt,t),t&&o(Dn),t&&o(io),t&&o(Pn),b(dt,t),t&&o(Un),t&&o(ro),t&&o(Gn),t&&o(lo),t&&o(jn),t&&o(ne),b(ct),t&&o(Sn),t&&o(k),t&&o(Wn),t&&o(W),t&&o(In),b(ht,t),t&&o(Bn),t&&o(C),t&&o(Cn),b(mt,t),t&&o(Xn),t&&o(ae),b(ut),t&&o(zn),t&&o(I),t&&o(Nn),t&&o(ie),b(wt),t&&o(An),t&&o(T),b(yt),b(Mt),b(xe),b(Et),b(Vt),b(Jt),b($t),b(kt),b(Dt),t&&o(Rn),t&&o(le),b(Pt),t&&o(Ln),t&&o(M),b(Ut),b(jt),b(De),b(St),b(It),b(Ct),b(Xt),b(zt),b(Nt)}}}const ef={local:"texttovideo-synthesis",sections:[{local:"overview",title:"Overview"},{local:"available-pipelines",title:"Available Pipelines:"},{local:"usage-example",sections:[{local:"texttovideoms17b",title:"`text-to-video-ms-1.7b`"},{local:"cerspensezeroscopev2576w-cerspensezeroscopev2xl",title:"`cerspense/zeroscope_v2_576w` & `cerspense/zeroscope_v2_XL`"},{local:"memory-optimizations",title:"Memory optimizations"}],title:"Usage example "},{local:"available-checkpoints",title:"Available checkpoints "},{local:"diffusers.TextToVideoSDPipeline",title:"TextToVideoSDPipeline"},{local:"diffusers.VideoToVideoSDPipeline",title:"VideoToVideoSDPipeline"}],title:"Text-to-video synthesis"};function tf(ce){return Hc(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class df extends Ac{constructor(w){super();Rc(this,w,tf,Kc,Lc,{})}}export{df as default,ef as metadata};
