import{S as Lr,i as Fr,s as Yr,e as n,k as l,w as h,t as a,M as Hr,c as s,d as o,m as d,x as u,a as i,h as r,b as p,N as va,f as ba,G as t,g as m,y as g,q as _,o as v,B as b,v as Qr,L as Ar}from"../../../chunks/vendor-hf-doc-builder.js";import{T as qr}from"../../../chunks/Tip-hf-doc-builder.js";import{D}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as gt}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as ut}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Rr}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Or(L){let y,j;return{c(){y=n("p"),j=a("\u{1F9EA} This pipeline is for research purposes only.")},l(V){y=s(V,"P",{});var w=i(y);j=r(w,"\u{1F9EA} This pipeline is for research purposes only."),w.forEach(o)},m(V,w){m(V,y,w),t(y,j)},d(V){V&&o(y)}}}function Kr(L){let y,j,V,w,J;return w=new gt({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(){y=n("p"),j=a("Examples:"),V=l(),h(w.$$.fragment)},l(f){y=s(f,"P",{});var E=i(y);j=r(E,"Examples:"),E.forEach(o),V=d(f),u(w.$$.fragment,f)},m(f,E){m(f,y,E),t(y,j),m(f,V,E),g(w,f,E),J=!0},p:Ar,i(f){J||(_(w.$$.fragment,f),J=!0)},o(f){v(w.$$.fragment,f),J=!1},d(f){f&&o(y),f&&o(V),b(w,f)}}}function el(L){let y,j,V,w,J;return w=new gt({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(){y=n("p"),j=a("Examples:"),V=l(),h(w.$$.fragment)},l(f){y=s(f,"P",{});var E=i(y);j=r(E,"Examples:"),E.forEach(o),V=d(f),u(w.$$.fragment,f)},m(f,E){m(f,y,E),t(y,j),m(f,V,E),g(w,f,E),J=!0},p:Ar,i(f){J||(_(w.$$.fragment,f),J=!0)},o(f){v(w.$$.fragment,f),J=!1},d(f){f&&o(y),f&&o(V),b(w,f)}}}function tl(L){let y,j,V,w,J,f,E,be,In,St,Wn,ko,ye,we,Bn,Xn,Po,_t,Cn,So,vt,Ut,zn,Uo,k,Nn,Te,Rn,An,xe,Ln,Fn,Ve,Yn,Hn,Me,Qn,qn,Ze,On,Kn,Go,B,F,Gt,Je,es,It,ts,Io,X,Y,Wt,Ee,os,Bt,Xt,ns,Wo,bt,ss,Bo,$e,Xo,yt,is,Co,wt,as,zo,De,No,H,rs,Ct,ls,ds,Ro,Tt,ps,Ao,je,Lo,xt,cs,Fo,Vt,ke,zt,Q,ms,fs,hs,Pe,ya,us,Nt,q,gs,_s,vs,Se,wa,Yo,C,O,Rt,Ue,bs,Ge,At,ys,ws,Lt,Ts,Ho,$,xs,Ft,Vs,Ms,Yt,Zs,Js,Ie,Ht,Es,$s,Mt,Ds,js,Zt,ks,Ps,We,Qt,Ss,Us,Qo,Be,qo,Jt,Gs,Oo,Xe,Ko,Et,Is,en,$t,qt,Ot,K,Ws,Bs,Xs,Ce,Ta,tn,z,ee,Kt,ze,Cs,eo,zs,on,T,Ne,Ns,to,Rs,As,Re,Ls,Dt,Fs,Ys,Hs,I,Ae,Qs,oo,qs,Os,te,Ks,oe,Le,ei,Fe,ti,no,oi,ni,si,ne,Ye,ii,He,ai,so,ri,li,di,se,Qe,pi,U,ci,io,mi,fi,ao,hi,ui,ro,gi,_i,vi,ie,qe,bi,lo,yi,wi,ae,Oe,Ti,po,xi,Vi,re,Ke,Mi,co,Zi,nn,N,le,mo,et,Ji,fo,Ei,sn,x,tt,$i,ho,Di,ji,ot,ki,jt,Pi,Si,Ui,W,nt,Gi,uo,Ii,Wi,de,Bi,pe,st,Xi,it,Ci,go,zi,Ni,Ri,ce,at,Ai,rt,Li,_o,Fi,Yi,Hi,me,lt,Qi,G,qi,vo,Oi,Ki,bo,ea,ta,yo,oa,na,sa,fe,dt,ia,wo,aa,ra,he,pt,la,To,da,pa,ue,ct,ca,xo,ma,an,R,ge,Vo,mt,fa,Mo,ha,rn,A,ft,ua,Zo,ga,ln;return V=new qr({props:{warning:!0,$$slots:{default:[Or]},$$scope:{ctx:L}}}),be=new ut({}),Je=new ut({}),Ee=new ut({}),$e=new gt({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`}}),De=new gt({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`}}),je=new gt({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`}}),Ue=new ut({}),Be=new gt({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`}}),Xe=new gt({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`}}),ze=new ut({}),Ne=new D({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/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.TextToVideoSDPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.TextToVideoSDPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
A <a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.TextToVideoSDPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet3d-cond#diffusers.UNet3DConditionModel">UNet3DConditionModel</a>) &#x2014;
A <a href="/docs/diffusers/main/en/api/models/unet3d-cond#diffusers.UNet3DConditionModel">UNet3DConditionModel</a> to denoise the encoded video latents.`,name:"unet"},{anchor:"diffusers.TextToVideoSDPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L77"}}),Ae=new D({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 image generation. If not defined, you need to pass <code>prompt_embeds</code>.`,name:"prompt"},{anchor:"diffusers.TextToVideoSDPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#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 <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#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;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,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 to guide what to not include in image generation. If not defined, you need to
pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale &lt; 1</code>).`,name:"negative_prompt"},{anchor:"diffusers.TextToVideoSDPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.TextToVideoSDPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies
to the <a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,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;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></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 is 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 (prompt weighting). If not
provided, text embeddings are generated from the <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 (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <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 generated 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 <a href="/docs/diffusers/main/en/api/pipelines/text_to_video#diffusers.pipelines.text_to_video_synthesis.TextToVideoSDPipelineOutput">TextToVideoSDPipelineOutput</a> 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 calls every <code>callback_steps</code> steps during inference. The function is 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 is called. If not specified, the callback is 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 in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow"><code>self.processor</code></a>.`,name:"cross_attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L477",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/pipelines/text_to_video#diffusers.pipelines.text_to_video_synthesis.TextToVideoSDPipelineOutput"
>TextToVideoSDPipelineOutput</a> is
returned, otherwise a <code>tuple</code> is returned where the first element is a list with the generated frames.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/text_to_video#diffusers.pipelines.text_to_video_synthesis.TextToVideoSDPipelineOutput"
>TextToVideoSDPipelineOutput</a> or <code>tuple</code></p>
`}}),te=new Rr({props:{anchor:"diffusers.TextToVideoSDPipeline.__call__.example",$$slots:{default:[Kr]},$$scope:{ctx:L}}}),Le=new D({props:{name:"disable_vae_slicing",anchor:"diffusers.TextToVideoSDPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L126"}}),Ye=new D({props:{name:"disable_vae_tiling",anchor:"diffusers.TextToVideoSDPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L143"}}),Qe=new D({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/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L150"}}),qe=new D({props:{name:"enable_vae_slicing",anchor:"diffusers.TextToVideoSDPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L118"}}),Oe=new D({props:{name:"enable_vae_tiling",anchor:"diffusers.TextToVideoSDPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L134"}}),Ke=new D({props:{name:"encode_prompt",anchor:"diffusers.TextToVideoSDPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.TextToVideoSDPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.TextToVideoSDPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.TextToVideoSDPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.TextToVideoSDPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.TextToVideoSDPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.TextToVideoSDPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.TextToVideoSDPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py#L207"}}),et=new ut({}),tt=new D({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/main/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 (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.VideoToVideoSDPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
A <a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.VideoToVideoSDPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet3d-cond#diffusers.UNet3DConditionModel">UNet3DConditionModel</a>) &#x2014;
A <a href="/docs/diffusers/main/en/api/models/unet3d-cond#diffusers.UNet3DConditionModel">UNet3DConditionModel</a> to denoise the encoded video latents.`,name:"unet"},{anchor:"diffusers.VideoToVideoSDPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L139"}}),nt=new D({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 image generation. If not defined, you need to pass <code>prompt_embeds</code>.`,name:"prompt"},{anchor:"diffusers.VideoToVideoSDPipeline.__call__.video",description:`<strong>video</strong> (<code>List[np.ndarray]</code> or <code>torch.FloatTensor</code>) &#x2014;
<code>video</code> frames or tensor representing a video batch to be used as the starting point for the process.
Can also accept video latents as <code>image</code>, if passing latents directly, it will not be encoded again.`,name:"video"},{anchor:"diffusers.VideoToVideoSDPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Indicates extent to transform the reference <code>video</code>. Must be between 0 and 1. <code>video</code> is 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 is maximum and the
denoising process runs for the full number of iterations specified in <code>num_inference_steps</code>. A value of
1 essentially ignores <code>video</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;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,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 to guide what to not include in video generation. If not defined, you need to
pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale &lt; 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;) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies
to the <a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,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;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></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 is 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 (prompt weighting). If not
provided, text embeddings are generated from the <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 (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <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 generated 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 <a href="/docs/diffusers/main/en/api/pipelines/text_to_video#diffusers.pipelines.text_to_video_synthesis.TextToVideoSDPipelineOutput">TextToVideoSDPipelineOutput</a> 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 calls every <code>callback_steps</code> steps during inference. The function is 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 is called. If not specified, the callback is 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 in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow"><code>self.processor</code></a>.`,name:"cross_attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L562",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/pipelines/text_to_video#diffusers.pipelines.text_to_video_synthesis.TextToVideoSDPipelineOutput"
>TextToVideoSDPipelineOutput</a> is
returned, otherwise a <code>tuple</code> is returned where the first element is a list with the generated frames.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/text_to_video#diffusers.pipelines.text_to_video_synthesis.TextToVideoSDPipelineOutput"
>TextToVideoSDPipelineOutput</a> or <code>tuple</code></p>
`}}),de=new Rr({props:{anchor:"diffusers.VideoToVideoSDPipeline.__call__.example",$$slots:{default:[el]},$$scope:{ctx:L}}}),st=new D({props:{name:"disable_vae_slicing",anchor:"diffusers.VideoToVideoSDPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L188"}}),at=new D({props:{name:"disable_vae_tiling",anchor:"diffusers.VideoToVideoSDPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L205"}}),lt=new D({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/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L212"}}),dt=new D({props:{name:"enable_vae_slicing",anchor:"diffusers.VideoToVideoSDPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L180"}}),pt=new D({props:{name:"enable_vae_tiling",anchor:"diffusers.VideoToVideoSDPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L196"}}),ct=new D({props:{name:"encode_prompt",anchor:"diffusers.VideoToVideoSDPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.VideoToVideoSDPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.VideoToVideoSDPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.VideoToVideoSDPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.VideoToVideoSDPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.VideoToVideoSDPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.VideoToVideoSDPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.VideoToVideoSDPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py#L269"}}),mt=new ut({}),ft=new D({props:{name:"class diffusers.pipelines.text_to_video_synthesis.TextToVideoSDPipelineOutput",anchor:"diffusers.pipelines.text_to_video_synthesis.TextToVideoSDPipelineOutput",parameters:[{name:"frames",val:": typing.Union[typing.List[numpy.ndarray], torch.FloatTensor]"}],parametersDescription:[{anchor:"diffusers.pipelines.text_to_video_synthesis.TextToVideoSDPipelineOutput.frames",description:`<strong>frames</strong> (<code>List[np.ndarray]</code> or <code>torch.FloatTensor</code>) &#x2014;
List of denoised frames (essentially images) as NumPy arrays of shape <code>(height, width, num_channels)</code> or as
a <code>torch</code> tensor. The length of the list denotes the video length (the number of frames).`,name:"frames"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/__init__.py#L11"}}),{c(){y=n("meta"),j=l(),h(V.$$.fragment),w=l(),J=n("h1"),f=n("a"),E=n("span"),h(be.$$.fragment),In=l(),St=n("span"),Wn=a("Text-to-video"),ko=l(),ye=n("p"),we=n("a"),Bn=a("VideoFusion: Decomposed Diffusion Models for High-Quality Video Generation"),Xn=a(" is by Zhengxiong Luo, Dayou Chen, Yingya Zhang, Yan Huang, Liang Wang, Yujun Shen, Deli Zhao, Jingren Zhou, Tieniu Tan."),Po=l(),_t=n("p"),Cn=a("The abstract from the paper is:"),So=l(),vt=n("p"),Ut=n("em"),zn=a("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."),Uo=l(),k=n("p"),Nn=a("You can find additional information about Text-to-Video on the "),Te=n("a"),Rn=a("project page"),An=a(", "),xe=n("a"),Ln=a("original codebase"),Fn=a(", and try it out in a "),Ve=n("a"),Yn=a("demo"),Hn=a(". Official checkpoints can be found at "),Me=n("a"),Qn=a("damo-vilab"),qn=a(" and "),Ze=n("a"),On=a("cerspense"),Kn=a("."),Go=l(),B=n("h2"),F=n("a"),Gt=n("span"),h(Je.$$.fragment),es=l(),It=n("span"),ts=a("Usage example"),Io=l(),X=n("h3"),Y=n("a"),Wt=n("span"),h(Ee.$$.fragment),os=l(),Bt=n("span"),Xt=n("code"),ns=a("text-to-video-ms-1.7b"),Wo=l(),bt=n("p"),ss=a("Let\u2019s start by generating a short video with the default length of 16 frames (2s at 8 fps):"),Bo=l(),h($e.$$.fragment),Xo=l(),yt=n("p"),is=a(`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.`),Co=l(),wt=n("p"),as=a("Let\u2019s generate a video of 8 seconds (64 frames) on the same GPU using CPU offloading and VAE slicing:"),zo=l(),h(De.$$.fragment),No=l(),H=n("p"),rs=a("It just takes "),Ct=n("strong"),ls=a("7 GBs of GPU memory"),ds=a(" to generate the 64 video frames using PyTorch 2.0, \u201Cfp16\u201D precision and the techniques mentioned above."),Ro=l(),Tt=n("p"),ps=a("We can also use a different scheduler easily, using the same method we\u2019d use for Stable Diffusion:"),Ao=l(),h(je.$$.fragment),Lo=l(),xt=n("p"),cs=a("Here are some sample outputs:"),Fo=l(),Vt=n("table"),ke=n("tr"),zt=n("td"),Q=n("center"),ms=a(`An astronaut riding a horse.
        `),fs=n("br"),hs=l(),Pe=n("img"),us=l(),Nt=n("td"),q=n("center"),gs=a(`Darth vader surfing in waves.
        `),_s=n("br"),vs=l(),Se=n("img"),Yo=l(),C=n("h3"),O=n("a"),Rt=n("span"),h(Ue.$$.fragment),bs=l(),Ge=n("span"),At=n("code"),ys=a("cerspense/zeroscope_v2_576w"),ws=a(" & "),Lt=n("code"),Ts=a("cerspense/zeroscope_v2_XL"),Ho=l(),$=n("p"),xs=a("Zeroscope are watermark-free model and have been trained on specific sizes such as "),Ft=n("code"),Vs=a("576x320"),Ms=a(" and "),Yt=n("code"),Zs=a("1024x576"),Js=a(`.
One should first generate a video using the lower resolution checkpoint `),Ie=n("a"),Ht=n("code"),Es=a("cerspense/zeroscope_v2_576w"),$s=a(" with "),Mt=n("a"),Ds=a("TextToVideoSDPipeline"),js=a(`,
which can then be upscaled using `),Zt=n("a"),ks=a("VideoToVideoSDPipeline"),Ps=a(" and "),We=n("a"),Qt=n("code"),Ss=a("cerspense/zeroscope_v2_XL"),Us=a("."),Qo=l(),h(Be.$$.fragment),qo=l(),Jt=n("p"),Gs=a("Now the video can be upscaled:"),Oo=l(),h(Xe.$$.fragment),Ko=l(),Et=n("p"),Is=a("Here are some sample outputs:"),en=l(),$t=n("table"),qt=n("tr"),Ot=n("td"),K=n("center"),Ws=a(`Darth vader surfing in waves.
        `),Bs=n("br"),Xs=l(),Ce=n("img"),tn=l(),z=n("h2"),ee=n("a"),Kt=n("span"),h(ze.$$.fragment),Cs=l(),eo=n("span"),zs=a("TextToVideoSDPipeline"),on=l(),T=n("div"),h(Ne.$$.fragment),Ns=l(),to=n("p"),Rs=a("Pipeline for text-to-video generation."),As=l(),Re=n("p"),Ls=a("This model inherits from "),Dt=n("a"),Fs=a("DiffusionPipeline"),Ys=a(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Hs=l(),I=n("div"),h(Ae.$$.fragment),Qs=l(),oo=n("p"),qs=a("The call function to the pipeline for generation."),Os=l(),h(te.$$.fragment),Ks=l(),oe=n("div"),h(Le.$$.fragment),ei=l(),Fe=n("p"),ti=a("Disable sliced VAE decoding. If "),no=n("code"),oi=a("enable_vae_slicing"),ni=a(` was previously enabled, this method will go back to
computing decoding in one step.`),si=l(),ne=n("div"),h(Ye.$$.fragment),ii=l(),He=n("p"),ai=a("Disable tiled VAE decoding. If "),so=n("code"),ri=a("enable_vae_tiling"),li=a(` was previously enabled, this method will go back to
computing decoding in one step.`),di=l(),se=n("div"),h(Qe.$$.fragment),pi=l(),U=n("p"),ci=a(`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),io=n("code"),mi=a("forward"),fi=a(` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),ao=n("code"),hi=a("enable_sequential_cpu_offload"),ui=a(`, but performance is much better due to the
iterative execution of the `),ro=n("code"),gi=a("unet"),_i=a("."),vi=l(),ie=n("div"),h(qe.$$.fragment),bi=l(),lo=n("p"),yi=a(`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),wi=l(),ae=n("div"),h(Oe.$$.fragment),Ti=l(),po=n("p"),xi=a(`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),Vi=l(),re=n("div"),h(Ke.$$.fragment),Mi=l(),co=n("p"),Zi=a("Encodes the prompt into text encoder hidden states."),nn=l(),N=n("h2"),le=n("a"),mo=n("span"),h(et.$$.fragment),Ji=l(),fo=n("span"),Ei=a("VideoToVideoSDPipeline"),sn=l(),x=n("div"),h(tt.$$.fragment),$i=l(),ho=n("p"),Di=a("Pipeline for text-guided video-to-video generation."),ji=l(),ot=n("p"),ki=a("This model inherits from "),jt=n("a"),Pi=a("DiffusionPipeline"),Si=a(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Ui=l(),W=n("div"),h(nt.$$.fragment),Gi=l(),uo=n("p"),Ii=a("The call function to the pipeline for generation."),Wi=l(),h(de.$$.fragment),Bi=l(),pe=n("div"),h(st.$$.fragment),Xi=l(),it=n("p"),Ci=a("Disable sliced VAE decoding. If "),go=n("code"),zi=a("enable_vae_slicing"),Ni=a(` was previously enabled, this method will go back to
computing decoding in one step.`),Ri=l(),ce=n("div"),h(at.$$.fragment),Ai=l(),rt=n("p"),Li=a("Disable tiled VAE decoding. If "),_o=n("code"),Fi=a("enable_vae_tiling"),Yi=a(` was previously enabled, this method will go back to
computing decoding in one step.`),Hi=l(),me=n("div"),h(lt.$$.fragment),Qi=l(),G=n("p"),qi=a(`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),vo=n("code"),Oi=a("forward"),Ki=a(` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),bo=n("code"),ea=a("enable_sequential_cpu_offload"),ta=a(`, but performance is much better due to the
iterative execution of the `),yo=n("code"),oa=a("unet"),na=a("."),sa=l(),fe=n("div"),h(dt.$$.fragment),ia=l(),wo=n("p"),aa=a(`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),ra=l(),he=n("div"),h(pt.$$.fragment),la=l(),To=n("p"),da=a(`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),pa=l(),ue=n("div"),h(ct.$$.fragment),ca=l(),xo=n("p"),ma=a("Encodes the prompt into text encoder hidden states."),an=l(),R=n("h2"),ge=n("a"),Vo=n("span"),h(mt.$$.fragment),fa=l(),Mo=n("span"),ha=a("TextToVideoSDPipelineOutput"),rn=l(),A=n("div"),h(ft.$$.fragment),ua=l(),Zo=n("p"),ga=a("Output class for text-to-video pipelines."),this.h()},l(e){const c=Hr('[data-svelte="svelte-1phssyn"]',document.head);y=s(c,"META",{name:!0,content:!0}),c.forEach(o),j=d(e),u(V.$$.fragment,e),w=d(e),J=s(e,"H1",{class:!0});var ht=i(J);f=s(ht,"A",{id:!0,class:!0,href:!0});var Jo=i(f);E=s(Jo,"SPAN",{});var Eo=i(E);u(be.$$.fragment,Eo),Eo.forEach(o),Jo.forEach(o),In=d(ht),St=s(ht,"SPAN",{});var xa=i(St);Wn=r(xa,"Text-to-video"),xa.forEach(o),ht.forEach(o),ko=d(e),ye=s(e,"P",{});var _a=i(ye);we=s(_a,"A",{href:!0,rel:!0});var Va=i(we);Bn=r(Va,"VideoFusion: Decomposed Diffusion Models for High-Quality Video Generation"),Va.forEach(o),Xn=r(_a," is by Zhengxiong Luo, Dayou Chen, Yingya Zhang, Yan Huang, Liang Wang, Yujun Shen, Deli Zhao, Jingren Zhou, Tieniu Tan."),_a.forEach(o),Po=d(e),_t=s(e,"P",{});var Ma=i(_t);Cn=r(Ma,"The abstract from the paper is:"),Ma.forEach(o),So=d(e),vt=s(e,"P",{});var Za=i(vt);Ut=s(Za,"EM",{});var Ja=i(Ut);zn=r(Ja,"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."),Ja.forEach(o),Za.forEach(o),Uo=d(e),k=s(e,"P",{});var S=i(k);Nn=r(S,"You can find additional information about Text-to-Video on the "),Te=s(S,"A",{href:!0,rel:!0});var Ea=i(Te);Rn=r(Ea,"project page"),Ea.forEach(o),An=r(S,", "),xe=s(S,"A",{href:!0,rel:!0});var $a=i(xe);Ln=r($a,"original codebase"),$a.forEach(o),Fn=r(S,", and try it out in a "),Ve=s(S,"A",{href:!0,rel:!0});var Da=i(Ve);Yn=r(Da,"demo"),Da.forEach(o),Hn=r(S,". Official checkpoints can be found at "),Me=s(S,"A",{href:!0,rel:!0});var ja=i(Me);Qn=r(ja,"damo-vilab"),ja.forEach(o),qn=r(S," and "),Ze=s(S,"A",{href:!0,rel:!0});var ka=i(Ze);On=r(ka,"cerspense"),ka.forEach(o),Kn=r(S,"."),S.forEach(o),Go=d(e),B=s(e,"H2",{class:!0});var dn=i(B);F=s(dn,"A",{id:!0,class:!0,href:!0});var Pa=i(F);Gt=s(Pa,"SPAN",{});var Sa=i(Gt);u(Je.$$.fragment,Sa),Sa.forEach(o),Pa.forEach(o),es=d(dn),It=s(dn,"SPAN",{});var Ua=i(It);ts=r(Ua,"Usage example"),Ua.forEach(o),dn.forEach(o),Io=d(e),X=s(e,"H3",{class:!0});var pn=i(X);Y=s(pn,"A",{id:!0,class:!0,href:!0});var Ga=i(Y);Wt=s(Ga,"SPAN",{});var Ia=i(Wt);u(Ee.$$.fragment,Ia),Ia.forEach(o),Ga.forEach(o),os=d(pn),Bt=s(pn,"SPAN",{});var Wa=i(Bt);Xt=s(Wa,"CODE",{});var Ba=i(Xt);ns=r(Ba,"text-to-video-ms-1.7b"),Ba.forEach(o),Wa.forEach(o),pn.forEach(o),Wo=d(e),bt=s(e,"P",{});var Xa=i(bt);ss=r(Xa,"Let\u2019s start by generating a short video with the default length of 16 frames (2s at 8 fps):"),Xa.forEach(o),Bo=d(e),u($e.$$.fragment,e),Xo=d(e),yt=s(e,"P",{});var Ca=i(yt);is=r(Ca,`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.`),Ca.forEach(o),Co=d(e),wt=s(e,"P",{});var za=i(wt);as=r(za,"Let\u2019s generate a video of 8 seconds (64 frames) on the same GPU using CPU offloading and VAE slicing:"),za.forEach(o),zo=d(e),u(De.$$.fragment,e),No=d(e),H=s(e,"P",{});var cn=i(H);rs=r(cn,"It just takes "),Ct=s(cn,"STRONG",{});var Na=i(Ct);ls=r(Na,"7 GBs of GPU memory"),Na.forEach(o),ds=r(cn," to generate the 64 video frames using PyTorch 2.0, \u201Cfp16\u201D precision and the techniques mentioned above."),cn.forEach(o),Ro=d(e),Tt=s(e,"P",{});var Ra=i(Tt);ps=r(Ra,"We can also use a different scheduler easily, using the same method we\u2019d use for Stable Diffusion:"),Ra.forEach(o),Ao=d(e),u(je.$$.fragment,e),Lo=d(e),xt=s(e,"P",{});var Aa=i(xt);cs=r(Aa,"Here are some sample outputs:"),Aa.forEach(o),Fo=d(e),Vt=s(e,"TABLE",{});var La=i(Vt);ke=s(La,"TR",{});var mn=i(ke);zt=s(mn,"TD",{});var Fa=i(zt);Q=s(Fa,"CENTER",{});var $o=i(Q);ms=r($o,`An astronaut riding a horse.
        `),fs=s($o,"BR",{}),hs=d($o),Pe=s($o,"IMG",{src:!0,alt:!0,style:!0}),$o.forEach(o),Fa.forEach(o),us=d(mn),Nt=s(mn,"TD",{});var Ya=i(Nt);q=s(Ya,"CENTER",{});var Do=i(q);gs=r(Do,`Darth vader surfing in waves.
        `),_s=s(Do,"BR",{}),vs=d(Do),Se=s(Do,"IMG",{src:!0,alt:!0,style:!0}),Do.forEach(o),Ya.forEach(o),mn.forEach(o),La.forEach(o),Yo=d(e),C=s(e,"H3",{class:!0});var fn=i(C);O=s(fn,"A",{id:!0,class:!0,href:!0});var Ha=i(O);Rt=s(Ha,"SPAN",{});var Qa=i(Rt);u(Ue.$$.fragment,Qa),Qa.forEach(o),Ha.forEach(o),bs=d(fn),Ge=s(fn,"SPAN",{});var hn=i(Ge);At=s(hn,"CODE",{});var qa=i(At);ys=r(qa,"cerspense/zeroscope_v2_576w"),qa.forEach(o),ws=r(hn," & "),Lt=s(hn,"CODE",{});var Oa=i(Lt);Ts=r(Oa,"cerspense/zeroscope_v2_XL"),Oa.forEach(o),hn.forEach(o),fn.forEach(o),Ho=d(e),$=s(e,"P",{});var P=i($);xs=r(P,"Zeroscope are watermark-free model and have been trained on specific sizes such as "),Ft=s(P,"CODE",{});var Ka=i(Ft);Vs=r(Ka,"576x320"),Ka.forEach(o),Ms=r(P," and "),Yt=s(P,"CODE",{});var er=i(Yt);Zs=r(er,"1024x576"),er.forEach(o),Js=r(P,`.
One should first generate a video using the lower resolution checkpoint `),Ie=s(P,"A",{href:!0,rel:!0});var tr=i(Ie);Ht=s(tr,"CODE",{});var or=i(Ht);Es=r(or,"cerspense/zeroscope_v2_576w"),or.forEach(o),tr.forEach(o),$s=r(P," with "),Mt=s(P,"A",{href:!0});var nr=i(Mt);Ds=r(nr,"TextToVideoSDPipeline"),nr.forEach(o),js=r(P,`,
which can then be upscaled using `),Zt=s(P,"A",{href:!0});var sr=i(Zt);ks=r(sr,"VideoToVideoSDPipeline"),sr.forEach(o),Ps=r(P," and "),We=s(P,"A",{href:!0,rel:!0});var ir=i(We);Qt=s(ir,"CODE",{});var ar=i(Qt);Ss=r(ar,"cerspense/zeroscope_v2_XL"),ar.forEach(o),ir.forEach(o),Us=r(P,"."),P.forEach(o),Qo=d(e),u(Be.$$.fragment,e),qo=d(e),Jt=s(e,"P",{});var rr=i(Jt);Gs=r(rr,"Now the video can be upscaled:"),rr.forEach(o),Oo=d(e),u(Xe.$$.fragment,e),Ko=d(e),Et=s(e,"P",{});var lr=i(Et);Is=r(lr,"Here are some sample outputs:"),lr.forEach(o),en=d(e),$t=s(e,"TABLE",{});var dr=i($t);qt=s(dr,"TR",{});var pr=i(qt);Ot=s(pr,"TD",{});var cr=i(Ot);K=s(cr,"CENTER",{});var jo=i(K);Ws=r(jo,`Darth vader surfing in waves.
        `),Bs=s(jo,"BR",{}),Xs=d(jo),Ce=s(jo,"IMG",{src:!0,alt:!0,style:!0}),jo.forEach(o),cr.forEach(o),pr.forEach(o),dr.forEach(o),tn=d(e),z=s(e,"H2",{class:!0});var un=i(z);ee=s(un,"A",{id:!0,class:!0,href:!0});var mr=i(ee);Kt=s(mr,"SPAN",{});var fr=i(Kt);u(ze.$$.fragment,fr),fr.forEach(o),mr.forEach(o),Cs=d(un),eo=s(un,"SPAN",{});var hr=i(eo);zs=r(hr,"TextToVideoSDPipeline"),hr.forEach(o),un.forEach(o),on=d(e),T=s(e,"DIV",{class:!0});var M=i(T);u(Ne.$$.fragment,M),Ns=d(M),to=s(M,"P",{});var ur=i(to);Rs=r(ur,"Pipeline for text-to-video generation."),ur.forEach(o),As=d(M),Re=s(M,"P",{});var gn=i(Re);Ls=r(gn,"This model inherits from "),Dt=s(gn,"A",{href:!0});var gr=i(Dt);Fs=r(gr,"DiffusionPipeline"),gr.forEach(o),Ys=r(gn,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),gn.forEach(o),Hs=d(M),I=s(M,"DIV",{class:!0});var kt=i(I);u(Ae.$$.fragment,kt),Qs=d(kt),oo=s(kt,"P",{});var _r=i(oo);qs=r(_r,"The call function to the pipeline for generation."),_r.forEach(o),Os=d(kt),u(te.$$.fragment,kt),kt.forEach(o),Ks=d(M),oe=s(M,"DIV",{class:!0});var _n=i(oe);u(Le.$$.fragment,_n),ei=d(_n),Fe=s(_n,"P",{});var vn=i(Fe);ti=r(vn,"Disable sliced VAE decoding. If "),no=s(vn,"CODE",{});var vr=i(no);oi=r(vr,"enable_vae_slicing"),vr.forEach(o),ni=r(vn,` was previously enabled, this method will go back to
computing decoding in one step.`),vn.forEach(o),_n.forEach(o),si=d(M),ne=s(M,"DIV",{class:!0});var bn=i(ne);u(Ye.$$.fragment,bn),ii=d(bn),He=s(bn,"P",{});var yn=i(He);ai=r(yn,"Disable tiled VAE decoding. If "),so=s(yn,"CODE",{});var br=i(so);ri=r(br,"enable_vae_tiling"),br.forEach(o),li=r(yn,` was previously enabled, this method will go back to
computing decoding in one step.`),yn.forEach(o),bn.forEach(o),di=d(M),se=s(M,"DIV",{class:!0});var wn=i(se);u(Qe.$$.fragment,wn),pi=d(wn),U=s(wn,"P",{});var _e=i(U);ci=r(_e,`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),io=s(_e,"CODE",{});var yr=i(io);mi=r(yr,"forward"),yr.forEach(o),fi=r(_e,` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),ao=s(_e,"CODE",{});var wr=i(ao);hi=r(wr,"enable_sequential_cpu_offload"),wr.forEach(o),ui=r(_e,`, but performance is much better due to the
iterative execution of the `),ro=s(_e,"CODE",{});var Tr=i(ro);gi=r(Tr,"unet"),Tr.forEach(o),_i=r(_e,"."),_e.forEach(o),wn.forEach(o),vi=d(M),ie=s(M,"DIV",{class:!0});var Tn=i(ie);u(qe.$$.fragment,Tn),bi=d(Tn),lo=s(Tn,"P",{});var xr=i(lo);yi=r(xr,`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),xr.forEach(o),Tn.forEach(o),wi=d(M),ae=s(M,"DIV",{class:!0});var xn=i(ae);u(Oe.$$.fragment,xn),Ti=d(xn),po=s(xn,"P",{});var Vr=i(po);xi=r(Vr,`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),Vr.forEach(o),xn.forEach(o),Vi=d(M),re=s(M,"DIV",{class:!0});var Vn=i(re);u(Ke.$$.fragment,Vn),Mi=d(Vn),co=s(Vn,"P",{});var Mr=i(co);Zi=r(Mr,"Encodes the prompt into text encoder hidden states."),Mr.forEach(o),Vn.forEach(o),M.forEach(o),nn=d(e),N=s(e,"H2",{class:!0});var Mn=i(N);le=s(Mn,"A",{id:!0,class:!0,href:!0});var Zr=i(le);mo=s(Zr,"SPAN",{});var Jr=i(mo);u(et.$$.fragment,Jr),Jr.forEach(o),Zr.forEach(o),Ji=d(Mn),fo=s(Mn,"SPAN",{});var Er=i(fo);Ei=r(Er,"VideoToVideoSDPipeline"),Er.forEach(o),Mn.forEach(o),sn=d(e),x=s(e,"DIV",{class:!0});var Z=i(x);u(tt.$$.fragment,Z),$i=d(Z),ho=s(Z,"P",{});var $r=i(ho);Di=r($r,"Pipeline for text-guided video-to-video generation."),$r.forEach(o),ji=d(Z),ot=s(Z,"P",{});var Zn=i(ot);ki=r(Zn,"This model inherits from "),jt=s(Zn,"A",{href:!0});var Dr=i(jt);Pi=r(Dr,"DiffusionPipeline"),Dr.forEach(o),Si=r(Zn,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Zn.forEach(o),Ui=d(Z),W=s(Z,"DIV",{class:!0});var Pt=i(W);u(nt.$$.fragment,Pt),Gi=d(Pt),uo=s(Pt,"P",{});var jr=i(uo);Ii=r(jr,"The call function to the pipeline for generation."),jr.forEach(o),Wi=d(Pt),u(de.$$.fragment,Pt),Pt.forEach(o),Bi=d(Z),pe=s(Z,"DIV",{class:!0});var Jn=i(pe);u(st.$$.fragment,Jn),Xi=d(Jn),it=s(Jn,"P",{});var En=i(it);Ci=r(En,"Disable sliced VAE decoding. If "),go=s(En,"CODE",{});var kr=i(go);zi=r(kr,"enable_vae_slicing"),kr.forEach(o),Ni=r(En,` was previously enabled, this method will go back to
computing decoding in one step.`),En.forEach(o),Jn.forEach(o),Ri=d(Z),ce=s(Z,"DIV",{class:!0});var $n=i(ce);u(at.$$.fragment,$n),Ai=d($n),rt=s($n,"P",{});var Dn=i(rt);Li=r(Dn,"Disable tiled VAE decoding. If "),_o=s(Dn,"CODE",{});var Pr=i(_o);Fi=r(Pr,"enable_vae_tiling"),Pr.forEach(o),Yi=r(Dn,` was previously enabled, this method will go back to
computing decoding in one step.`),Dn.forEach(o),$n.forEach(o),Hi=d(Z),me=s(Z,"DIV",{class:!0});var jn=i(me);u(lt.$$.fragment,jn),Qi=d(jn),G=s(jn,"P",{});var ve=i(G);qi=r(ve,`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),vo=s(ve,"CODE",{});var Sr=i(vo);Oi=r(Sr,"forward"),Sr.forEach(o),Ki=r(ve,` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),bo=s(ve,"CODE",{});var Ur=i(bo);ea=r(Ur,"enable_sequential_cpu_offload"),Ur.forEach(o),ta=r(ve,`, but performance is much better due to the
iterative execution of the `),yo=s(ve,"CODE",{});var Gr=i(yo);oa=r(Gr,"unet"),Gr.forEach(o),na=r(ve,"."),ve.forEach(o),jn.forEach(o),sa=d(Z),fe=s(Z,"DIV",{class:!0});var kn=i(fe);u(dt.$$.fragment,kn),ia=d(kn),wo=s(kn,"P",{});var Ir=i(wo);aa=r(Ir,`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),Ir.forEach(o),kn.forEach(o),ra=d(Z),he=s(Z,"DIV",{class:!0});var Pn=i(he);u(pt.$$.fragment,Pn),la=d(Pn),To=s(Pn,"P",{});var Wr=i(To);da=r(Wr,`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),Wr.forEach(o),Pn.forEach(o),pa=d(Z),ue=s(Z,"DIV",{class:!0});var Sn=i(ue);u(ct.$$.fragment,Sn),ca=d(Sn),xo=s(Sn,"P",{});var Br=i(xo);ma=r(Br,"Encodes the prompt into text encoder hidden states."),Br.forEach(o),Sn.forEach(o),Z.forEach(o),an=d(e),R=s(e,"H2",{class:!0});var Un=i(R);ge=s(Un,"A",{id:!0,class:!0,href:!0});var Xr=i(ge);Vo=s(Xr,"SPAN",{});var Cr=i(Vo);u(mt.$$.fragment,Cr),Cr.forEach(o),Xr.forEach(o),fa=d(Un),Mo=s(Un,"SPAN",{});var zr=i(Mo);ha=r(zr,"TextToVideoSDPipelineOutput"),zr.forEach(o),Un.forEach(o),rn=d(e),A=s(e,"DIV",{class:!0});var Gn=i(A);u(ft.$$.fragment,Gn),ua=d(Gn),Zo=s(Gn,"P",{});var Nr=i(Zo);ga=r(Nr,"Output class for text-to-video pipelines."),Nr.forEach(o),Gn.forEach(o),this.h()},h(){p(y,"name","hf:doc:metadata"),p(y,"content",JSON.stringify(ol)),p(f,"id","texttovideo"),p(f,"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(f,"href","#texttovideo"),p(J,"class","relative group"),p(we,"href","https://huggingface.co/papers/2303.08320"),p(we,"rel","nofollow"),p(Te,"href","https://modelscope.cn/models/damo/text-to-video-synthesis/summary"),p(Te,"rel","nofollow"),p(xe,"href","https://github.com/modelscope/modelscope/"),p(xe,"rel","nofollow"),p(Ve,"href","https://huggingface.co/spaces/damo-vilab/modelscope-text-to-video-synthesis"),p(Ve,"rel","nofollow"),p(Me,"href","https://huggingface.co/damo-vilab"),p(Me,"rel","nofollow"),p(Ze,"href","https://huggingface.co/cerspense"),p(Ze,"rel","nofollow"),p(F,"id","usage-example"),p(F,"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(F,"href","#usage-example"),p(B,"class","relative group"),p(Y,"id","texttovideoms17b"),p(Y,"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(Y,"href","#texttovideoms17b"),p(X,"class","relative group"),va(Pe.src,ya="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/astr.gif")||p(Pe,"src",ya),p(Pe,"alt","An astronaut riding a horse."),ba(Pe,"width","300px"),va(Se.src,wa="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/vader.gif")||p(Se,"src",wa),p(Se,"alt","Darth vader surfing in waves."),ba(Se,"width","300px"),p(O,"id","cerspensezeroscopev2576w-cerspensezeroscopev2xl"),p(O,"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(O,"href","#cerspensezeroscopev2576w-cerspensezeroscopev2xl"),p(C,"class","relative group"),p(Ie,"href","https://huggingface.co/cerspense/zeroscope_v2_576w"),p(Ie,"rel","nofollow"),p(Mt,"href","/docs/diffusers/main/en/api/pipelines/text_to_video#diffusers.TextToVideoSDPipeline"),p(Zt,"href","/docs/diffusers/main/en/api/pipelines/text_to_video#diffusers.VideoToVideoSDPipeline"),p(We,"href","https://huggingface.co/cerspense/zeroscope_v2_XL"),p(We,"rel","nofollow"),va(Ce.src,Ta="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/darthvader_cerpense.gif")||p(Ce,"src",Ta),p(Ce,"alt","Darth vader surfing in waves."),ba(Ce,"width","576px"),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(z,"class","relative group"),p(Dt,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(re,"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(le,"id","diffusers.VideoToVideoSDPipeline"),p(le,"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(le,"href","#diffusers.VideoToVideoSDPipeline"),p(N,"class","relative group"),p(jt,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(W,"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(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(he,"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(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(ge,"id","diffusers.pipelines.text_to_video_synthesis.TextToVideoSDPipelineOutput"),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","#diffusers.pipelines.text_to_video_synthesis.TextToVideoSDPipelineOutput"),p(R,"class","relative group"),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")},m(e,c){t(document.head,y),m(e,j,c),g(V,e,c),m(e,w,c),m(e,J,c),t(J,f),t(f,E),g(be,E,null),t(J,In),t(J,St),t(St,Wn),m(e,ko,c),m(e,ye,c),t(ye,we),t(we,Bn),t(ye,Xn),m(e,Po,c),m(e,_t,c),t(_t,Cn),m(e,So,c),m(e,vt,c),t(vt,Ut),t(Ut,zn),m(e,Uo,c),m(e,k,c),t(k,Nn),t(k,Te),t(Te,Rn),t(k,An),t(k,xe),t(xe,Ln),t(k,Fn),t(k,Ve),t(Ve,Yn),t(k,Hn),t(k,Me),t(Me,Qn),t(k,qn),t(k,Ze),t(Ze,On),t(k,Kn),m(e,Go,c),m(e,B,c),t(B,F),t(F,Gt),g(Je,Gt,null),t(B,es),t(B,It),t(It,ts),m(e,Io,c),m(e,X,c),t(X,Y),t(Y,Wt),g(Ee,Wt,null),t(X,os),t(X,Bt),t(Bt,Xt),t(Xt,ns),m(e,Wo,c),m(e,bt,c),t(bt,ss),m(e,Bo,c),g($e,e,c),m(e,Xo,c),m(e,yt,c),t(yt,is),m(e,Co,c),m(e,wt,c),t(wt,as),m(e,zo,c),g(De,e,c),m(e,No,c),m(e,H,c),t(H,rs),t(H,Ct),t(Ct,ls),t(H,ds),m(e,Ro,c),m(e,Tt,c),t(Tt,ps),m(e,Ao,c),g(je,e,c),m(e,Lo,c),m(e,xt,c),t(xt,cs),m(e,Fo,c),m(e,Vt,c),t(Vt,ke),t(ke,zt),t(zt,Q),t(Q,ms),t(Q,fs),t(Q,hs),t(Q,Pe),t(ke,us),t(ke,Nt),t(Nt,q),t(q,gs),t(q,_s),t(q,vs),t(q,Se),m(e,Yo,c),m(e,C,c),t(C,O),t(O,Rt),g(Ue,Rt,null),t(C,bs),t(C,Ge),t(Ge,At),t(At,ys),t(Ge,ws),t(Ge,Lt),t(Lt,Ts),m(e,Ho,c),m(e,$,c),t($,xs),t($,Ft),t(Ft,Vs),t($,Ms),t($,Yt),t(Yt,Zs),t($,Js),t($,Ie),t(Ie,Ht),t(Ht,Es),t($,$s),t($,Mt),t(Mt,Ds),t($,js),t($,Zt),t(Zt,ks),t($,Ps),t($,We),t(We,Qt),t(Qt,Ss),t($,Us),m(e,Qo,c),g(Be,e,c),m(e,qo,c),m(e,Jt,c),t(Jt,Gs),m(e,Oo,c),g(Xe,e,c),m(e,Ko,c),m(e,Et,c),t(Et,Is),m(e,en,c),m(e,$t,c),t($t,qt),t(qt,Ot),t(Ot,K),t(K,Ws),t(K,Bs),t(K,Xs),t(K,Ce),m(e,tn,c),m(e,z,c),t(z,ee),t(ee,Kt),g(ze,Kt,null),t(z,Cs),t(z,eo),t(eo,zs),m(e,on,c),m(e,T,c),g(Ne,T,null),t(T,Ns),t(T,to),t(to,Rs),t(T,As),t(T,Re),t(Re,Ls),t(Re,Dt),t(Dt,Fs),t(Re,Ys),t(T,Hs),t(T,I),g(Ae,I,null),t(I,Qs),t(I,oo),t(oo,qs),t(I,Os),g(te,I,null),t(T,Ks),t(T,oe),g(Le,oe,null),t(oe,ei),t(oe,Fe),t(Fe,ti),t(Fe,no),t(no,oi),t(Fe,ni),t(T,si),t(T,ne),g(Ye,ne,null),t(ne,ii),t(ne,He),t(He,ai),t(He,so),t(so,ri),t(He,li),t(T,di),t(T,se),g(Qe,se,null),t(se,pi),t(se,U),t(U,ci),t(U,io),t(io,mi),t(U,fi),t(U,ao),t(ao,hi),t(U,ui),t(U,ro),t(ro,gi),t(U,_i),t(T,vi),t(T,ie),g(qe,ie,null),t(ie,bi),t(ie,lo),t(lo,yi),t(T,wi),t(T,ae),g(Oe,ae,null),t(ae,Ti),t(ae,po),t(po,xi),t(T,Vi),t(T,re),g(Ke,re,null),t(re,Mi),t(re,co),t(co,Zi),m(e,nn,c),m(e,N,c),t(N,le),t(le,mo),g(et,mo,null),t(N,Ji),t(N,fo),t(fo,Ei),m(e,sn,c),m(e,x,c),g(tt,x,null),t(x,$i),t(x,ho),t(ho,Di),t(x,ji),t(x,ot),t(ot,ki),t(ot,jt),t(jt,Pi),t(ot,Si),t(x,Ui),t(x,W),g(nt,W,null),t(W,Gi),t(W,uo),t(uo,Ii),t(W,Wi),g(de,W,null),t(x,Bi),t(x,pe),g(st,pe,null),t(pe,Xi),t(pe,it),t(it,Ci),t(it,go),t(go,zi),t(it,Ni),t(x,Ri),t(x,ce),g(at,ce,null),t(ce,Ai),t(ce,rt),t(rt,Li),t(rt,_o),t(_o,Fi),t(rt,Yi),t(x,Hi),t(x,me),g(lt,me,null),t(me,Qi),t(me,G),t(G,qi),t(G,vo),t(vo,Oi),t(G,Ki),t(G,bo),t(bo,ea),t(G,ta),t(G,yo),t(yo,oa),t(G,na),t(x,sa),t(x,fe),g(dt,fe,null),t(fe,ia),t(fe,wo),t(wo,aa),t(x,ra),t(x,he),g(pt,he,null),t(he,la),t(he,To),t(To,da),t(x,pa),t(x,ue),g(ct,ue,null),t(ue,ca),t(ue,xo),t(xo,ma),m(e,an,c),m(e,R,c),t(R,ge),t(ge,Vo),g(mt,Vo,null),t(R,fa),t(R,Mo),t(Mo,ha),m(e,rn,c),m(e,A,c),g(ft,A,null),t(A,ua),t(A,Zo),t(Zo,ga),ln=!0},p(e,[c]){const ht={};c&2&&(ht.$$scope={dirty:c,ctx:e}),V.$set(ht);const Jo={};c&2&&(Jo.$$scope={dirty:c,ctx:e}),te.$set(Jo);const Eo={};c&2&&(Eo.$$scope={dirty:c,ctx:e}),de.$set(Eo)},i(e){ln||(_(V.$$.fragment,e),_(be.$$.fragment,e),_(Je.$$.fragment,e),_(Ee.$$.fragment,e),_($e.$$.fragment,e),_(De.$$.fragment,e),_(je.$$.fragment,e),_(Ue.$$.fragment,e),_(Be.$$.fragment,e),_(Xe.$$.fragment,e),_(ze.$$.fragment,e),_(Ne.$$.fragment,e),_(Ae.$$.fragment,e),_(te.$$.fragment,e),_(Le.$$.fragment,e),_(Ye.$$.fragment,e),_(Qe.$$.fragment,e),_(qe.$$.fragment,e),_(Oe.$$.fragment,e),_(Ke.$$.fragment,e),_(et.$$.fragment,e),_(tt.$$.fragment,e),_(nt.$$.fragment,e),_(de.$$.fragment,e),_(st.$$.fragment,e),_(at.$$.fragment,e),_(lt.$$.fragment,e),_(dt.$$.fragment,e),_(pt.$$.fragment,e),_(ct.$$.fragment,e),_(mt.$$.fragment,e),_(ft.$$.fragment,e),ln=!0)},o(e){v(V.$$.fragment,e),v(be.$$.fragment,e),v(Je.$$.fragment,e),v(Ee.$$.fragment,e),v($e.$$.fragment,e),v(De.$$.fragment,e),v(je.$$.fragment,e),v(Ue.$$.fragment,e),v(Be.$$.fragment,e),v(Xe.$$.fragment,e),v(ze.$$.fragment,e),v(Ne.$$.fragment,e),v(Ae.$$.fragment,e),v(te.$$.fragment,e),v(Le.$$.fragment,e),v(Ye.$$.fragment,e),v(Qe.$$.fragment,e),v(qe.$$.fragment,e),v(Oe.$$.fragment,e),v(Ke.$$.fragment,e),v(et.$$.fragment,e),v(tt.$$.fragment,e),v(nt.$$.fragment,e),v(de.$$.fragment,e),v(st.$$.fragment,e),v(at.$$.fragment,e),v(lt.$$.fragment,e),v(dt.$$.fragment,e),v(pt.$$.fragment,e),v(ct.$$.fragment,e),v(mt.$$.fragment,e),v(ft.$$.fragment,e),ln=!1},d(e){o(y),e&&o(j),b(V,e),e&&o(w),e&&o(J),b(be),e&&o(ko),e&&o(ye),e&&o(Po),e&&o(_t),e&&o(So),e&&o(vt),e&&o(Uo),e&&o(k),e&&o(Go),e&&o(B),b(Je),e&&o(Io),e&&o(X),b(Ee),e&&o(Wo),e&&o(bt),e&&o(Bo),b($e,e),e&&o(Xo),e&&o(yt),e&&o(Co),e&&o(wt),e&&o(zo),b(De,e),e&&o(No),e&&o(H),e&&o(Ro),e&&o(Tt),e&&o(Ao),b(je,e),e&&o(Lo),e&&o(xt),e&&o(Fo),e&&o(Vt),e&&o(Yo),e&&o(C),b(Ue),e&&o(Ho),e&&o($),e&&o(Qo),b(Be,e),e&&o(qo),e&&o(Jt),e&&o(Oo),b(Xe,e),e&&o(Ko),e&&o(Et),e&&o(en),e&&o($t),e&&o(tn),e&&o(z),b(ze),e&&o(on),e&&o(T),b(Ne),b(Ae),b(te),b(Le),b(Ye),b(Qe),b(qe),b(Oe),b(Ke),e&&o(nn),e&&o(N),b(et),e&&o(sn),e&&o(x),b(tt),b(nt),b(de),b(st),b(at),b(lt),b(dt),b(pt),b(ct),e&&o(an),e&&o(R),b(mt),e&&o(rn),e&&o(A),b(ft)}}}const ol={local:"texttovideo",sections:[{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`"}],title:"Usage example "},{local:"diffusers.TextToVideoSDPipeline",title:"TextToVideoSDPipeline"},{local:"diffusers.VideoToVideoSDPipeline",title:"VideoToVideoSDPipeline"},{local:"diffusers.pipelines.text_to_video_synthesis.TextToVideoSDPipelineOutput",title:"TextToVideoSDPipelineOutput"}],title:"Text-to-video"};function nl(L){return Qr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pl extends Lr{constructor(y){super();Fr(this,y,nl,tl,Yr,{})}}export{pl as default,ol as metadata};
