import{S as rp,i as ip,s as pp,e as a,k as p,w as f,t as s,M as dp,c as l,d as o,m as d,a as n,x as m,h as r,b as i,N as cp,G as e,g as h,y as u,L as hp,q as v,o as _,B as g,v as fp}from"../../../chunks/vendor-hf-doc-builder.js";import{D as hl}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as W}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as N}from"../../../chunks/IconCopyLink-hf-doc-builder.js";function mp(ir){let G,ea,B,L,Rt,ve,fl,Xt,ml,ta,C,q,St,_e,ul,Dt,vl,oa,M,ge,_l,gl,ye,yl,bl,be,wl,Tl,aa,ut,Jl,la,E,zt,Ml,Zl,Qt,xl,El,Yt,Ul,na,vt,kl,sa,_t,gt,pr,ra,yt,Il,ia,bt,Ft,jl,pa,wt,Vl,da,U,At,we,Wl,Nl,Ht,Te,Gl,Bl,Lt,Je,Cl,ca,P,O,qt,Me,Pl,Ot,$l,ha,K,Kt,$,eo,Rl,Xl,to,Sl,Dl,Tt,zl,Ql,oo,R,ao,Ze,Yl,Fl,lo,no,Al,Hl,Jt,xe,Ll,fa,X,ee,so,Ee,ql,ro,Ol,ma,S,te,io,Ue,Kl,po,en,ua,Mt,tn,va,ke,_a,Zt,on,ga,k,oe,an,Ie,ln,nn,co,Z,ho,sn,rn,fo,pn,dn,mo,cn,hn,uo,fn,mn,x,vo,un,vn,_o,_n,gn,je,yn,bn,go,T,yo,wn,Tn,bo,Jn,Mn,wo,Zn,xn,To,En,Un,Jo,kn,In,xt,jn,Mo,Ve,Zo,Vn,Wn,xo,Nn,ya,D,ae,Eo,We,Gn,Uo,Bn,ba,Et,Ne,ko,Cn,Pn,Ge,wa,z,Q,Io,$n,Rn,Be,Xn,Ce,Sn,Ut,Dn,zn,Qn,Pe,$e,Yn,jo,Fn,An,Hn,Re,Ta,Y,le,Vo,Xe,Ln,Wo,qn,Ja,ne,On,Se,Kn,es,Ma,F,se,No,De,ts,Go,os,Za,re,as,kt,ls,ns,xa,I,ze,Bo,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MEFpbWFnZWlvLm1pbXNhdmUoJTIydmlkZW8ubXA0JTIyJTJDJTIwcmVzdWx0JTJDJTIwZnBzJTNENCk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> imageio
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> TextToVideoZeroPipeline

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = TextToVideoZeroPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;A panda is playing guitar on times square&quot;</span>
result = pipe(prompt=prompt).images
result = [(r * <span class="hljs-number">255</span>).astype(<span class="hljs-string">&quot;uint8&quot;</span>) <span class="hljs-keyword">for</span> r <span class="hljs-keyword">in</span> result]
imageio.mimsave(<span class="hljs-string">&quot;video.mp4&quot;</span>, result, fps=<span class="hljs-number">4</span>)`}}),We=new N({}),Ge=new W({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGhmX2h1Yl9kb3dubG9hZCUwQSUwQWZpbGVuYW1lJTIwJTNEJTIwJTIyX19hc3NldHNfXyUyRnBvc2VzX3NrZWxldG9uX2dpZnMlMkZkYW5jZTFfY29yci5tcDQlMjIlMEFyZXBvX2lkJTIwJTNEJTIwJTIyUEFJUiUyRlRleHQyVmlkZW8tWmVybyUyMiUwQXZpZGVvX3BhdGglMjAlM0QlMjBoZl9odWJfZG93bmxvYWQocmVwb190eXBlJTNEJTIyc3BhY2UlMjIlMkMlMjByZXBvX2lkJTNEcmVwb19pZCUyQyUyMGZpbGVuYW1lJTNEZmlsZW5hbWUp",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download

filename = <span class="hljs-string">&quot;__assets__/poses_skeleton_gifs/dance1_corr.mp4&quot;</span>
repo_id = <span class="hljs-string">&quot;PAIR/Text2Video-Zero&quot;</span>
video_path = hf_hub_download(repo_type=<span class="hljs-string">&quot;space&quot;</span>, repo_id=repo_id, filename=filename)`}}),Be=new W({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwaW1hZ2VpbyUwQSUwQXJlYWRlciUyMCUzRCUyMGltYWdlaW8uZ2V0X3JlYWRlcih2aWRlb19wYXRoJTJDJTIwJTIyZmZtcGVnJTIyKSUwQWZyYW1lX2NvdW50JTIwJTNEJTIwOCUwQXBvc2VfaW1hZ2VzJTIwJTNEJTIwJTVCSW1hZ2UuZnJvbWFycmF5KHJlYWRlci5nZXRfZGF0YShpKSklMjBmb3IlMjBpJTIwaW4lMjByYW5nZShmcmFtZV9jb3VudCklNUQ=",highlighted:`<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> imageio

reader = imageio.get_reader(video_path, <span class="hljs-string">&quot;ffmpeg&quot;</span>)
frame_count = <span class="hljs-number">8</span>
pose_images = [Image.fromarray(reader.get_data(i)) <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(frame_count)]`}}),Re=new W({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uQ29udHJvbE5ldFBpcGVsaW5lJTJDJTIwQ29udHJvbE5ldE1vZGVsJTBBZnJvbSUyMGRpZmZ1c2Vycy5waXBlbGluZXMudGV4dF90b192aWRlb19zeW50aGVzaXMucGlwZWxpbmVfdGV4dF90b192aWRlb196ZXJvJTIwaW1wb3J0JTIwQ3Jvc3NGcmFtZUF0dG5Qcm9jZXNzb3IlMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBY29udHJvbG5ldCUyMCUzRCUyMENvbnRyb2xOZXRNb2RlbC5mcm9tX3ByZXRyYWluZWQ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2ltYWdlcyUyQyUyMGxhdGVudHMlM0RsYXRlbnRzKS5pbWFnZXMlMEFpbWFnZWlvLm1pbXNhdmUoJTIydmlkZW8ubXA0JTIyJTJDJTIwcmVzdWx0JTJDJTIwZnBzJTNENCk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel
<span class="hljs-keyword">from</span> diffusers.pipelines.text_to_video_synthesis.pipeline_text_to_video_zero <span class="hljs-keyword">import</span> CrossFrameAttnProcessor

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
controlnet = ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-openpose&quot;</span>, torch_dtype=torch.float16)
pipe = StableDiffusionControlNetPipeline.from_pretrained(
    model_id, controlnet=controlnet, torch_dtype=torch.float16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># Set the attention processor</span>
pipe.unet.set_attn_processor(CrossFrameAttnProcessor(batch_size=<span class="hljs-number">2</span>))
pipe.controlnet.set_attn_processor(CrossFrameAttnProcessor(batch_size=<span class="hljs-number">2</span>))

<span class="hljs-comment"># fix latents for all frames</span>
latents = torch.randn((<span class="hljs-number">1</span>, <span class="hljs-number">4</span>, <span class="hljs-number">64</span>, <span class="hljs-number">64</span>), device=<span class="hljs-string">&quot;cuda&quot;</span>, dtype=torch.float16).repeat(<span class="hljs-built_in">len</span>(pose_images), <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>)

prompt = <span class="hljs-string">&quot;Darth Vader dancing in a desert&quot;</span>
result = pipe(prompt=[prompt] * <span class="hljs-built_in">len</span>(pose_images), image=pose_images, latents=latents).images
imageio.mimsave(<span class="hljs-string">&quot;video.mp4&quot;</span>, result, fps=<span class="hljs-number">4</span>)`}}),Xe=new N({}),De=new N({}),Qe=new W({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGhmX2h1Yl9kb3dubG9hZCUwQSUwQWZpbGVuYW1lJTIwJTNEJTIwJTIyX19hc3NldHNfXyUyRnBpeDJwaXglMjB2aWRlbyUyRmNhbWVsLm1wNCUyMiUwQXJlcG9faWQlMjAlM0QlMjAlMjJQQUlSJTJGVGV4dDJWaWRlby1aZXJvJTIyJTBBdmlkZW9fcGF0aCUyMCUzRCUyMGhmX2h1Yl9kb3dubG9hZChyZXBvX3R5cGUlM0QlMjJzcGFjZSUyMiUyQyUyMHJlcG9faWQlM0RyZXBvX2lkJTJDJTIwZmlsZW5hbWUlM0RmaWxlbmFtZSk=",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download

filename = <span class="hljs-string">&quot;__assets__/pix2pix video/camel.mp4&quot;</span>
repo_id = <span class="hljs-string">&quot;PAIR/Text2Video-Zero&quot;</span>
video_path = hf_hub_download(repo_type=<span class="hljs-string">&quot;space&quot;</span>, repo_id=repo_id, filename=filename)`}}),Fe=new W({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwaW1hZ2VpbyUwQSUwQXJlYWRlciUyMCUzRCUyMGltYWdlaW8uZ2V0X3JlYWRlcih2aWRlb19wYXRoJTJDJTIwJTIyZmZtcGVnJTIyKSUwQWZyYW1lX2NvdW50JTIwJTNEJTIwOCUwQXZpZGVvJTIwJTNEJTIwJTVCSW1hZ2UuZnJvbWFycmF5KHJlYWRlci5nZXRfZGF0YShpKSklMjBmb3IlMjBpJTIwaW4lMjByYW5nZShmcmFtZV9jb3VudCklNUQ=",highlighted:`<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> imageio

reader = imageio.get_reader(video_path, <span class="hljs-string">&quot;ffmpeg&quot;</span>)
frame_count = <span class="hljs-number">8</span>
video = [Image.fromarray(reader.get_data(i)) <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(frame_count)]`}}),Le=new W({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uSW5zdHJ1Y3RQaXgyUGl4UGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnBpcGVsaW5lcy50ZXh0X3RvX3ZpZGVvX3N5bnRoZXNpcy5waXBlbGluZV90ZXh0X3RvX3ZpZGVvX3plcm8lMjBpbXBvcnQlMjBDcm9zc0ZyYW1lQXR0blByb2Nlc3NvciUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIydGltYnJvb2tzJTJGaW5zdHJ1Y3QtcGl4MnBpeCUyMiUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25JbnN0cnVjdFBpeDJQaXhQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQobW9kZWxfaWQlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpLnRvKCUyMmN1ZGElMjIpJTBBcGlwZS51bmV0LnNldF9hdHRuX3Byb2Nlc3NvcihDcm9zc0ZyYW1lQXR0blByb2Nlc3NvcihiYXRjaF9zaXplJTNEMykpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIybWFrZSUyMGl0JTIwVmFuJTIwR29naCUyMFN0YXJyeSUyME5pZ2h0JTIwc3R5bGUlMjIlMEFyZXN1bHQlMjAlM0QlMjBwaXBlKHByb21wdCUzRCU1QnByb21wdCU1RCUyMColMjBsZW4odmlkZW8pJTJDJTIwaW1hZ2UlM0R2aWRlbykuaW1hZ2VzJTBBaW1hZ2Vpby5taW1zYXZlKCUyMmVkaXRlZF92aWRlby5tcDQlMjIlMkMlMjByZXN1bHQlMkMlMjBmcHMlM0Q0KQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionInstructPix2PixPipeline
<span class="hljs-keyword">from</span> diffusers.pipelines.text_to_video_synthesis.pipeline_text_to_video_zero <span class="hljs-keyword">import</span> CrossFrameAttnProcessor

model_id = <span class="hljs-string">&quot;timbrooks/instruct-pix2pix&quot;</span>
pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipe.unet.set_attn_processor(CrossFrameAttnProcessor(batch_size=<span class="hljs-number">3</span>))

prompt = <span class="hljs-string">&quot;make it Van Gogh Starry Night style&quot;</span>
result = pipe(prompt=[prompt] * <span class="hljs-built_in">len</span>(video), image=video).images
imageio.mimsave(<span class="hljs-string">&quot;edited_video.mp4&quot;</span>, result, fps=<span class="hljs-number">4</span>)`}}),qe=new N({}),tt=new W({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGhmX2h1Yl9kb3dubG9hZCUwQSUwQWZpbGVuYW1lJTIwJTNEJTIwJTIyX19hc3NldHNfXyUyRmNhbm55X3ZpZGVvc19tcDQlMkZnaXJsX3R1cm5pbmcubXA0JTIyJTBBcmVwb19pZCUyMCUzRCUyMCUyMlBBSVIlMkZUZXh0MlZpZGVvLVplcm8lMjIlMEF2aWRlb19wYXRoJTIwJTNEJTIwaGZfaHViX2Rvd25sb2FkKHJlcG9fdHlwZSUzRCUyMnNwYWNlJTIyJTJDJTIwcmVwb19pZCUzRHJlcG9faWQlMkMlMjBmaWxlbmFtZSUzRGZpbGVuYW1lKQ==",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download

filename = <span class="hljs-string">&quot;__assets__/canny_videos_mp4/girl_turning.mp4&quot;</span>
repo_id = <span class="hljs-string">&quot;PAIR/Text2Video-Zero&quot;</span>
video_path = hf_hub_download(repo_type=<span class="hljs-string">&quot;space&quot;</span>, repo_id=repo_id, filename=filename)`}}),at=new W({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwaW1hZ2VpbyUwQSUwQXJlYWRlciUyMCUzRCUyMGltYWdlaW8uZ2V0X3JlYWRlcih2aWRlb19wYXRoJTJDJTIwJTIyZmZtcGVnJTIyKSUwQWZyYW1lX2NvdW50JTIwJTNEJTIwOCUwQXZpZGVvJTIwJTNEJTIwJTVCSW1hZ2UuZnJvbWFycmF5KHJlYWRlci5nZXRfZGF0YShpKSklMjBmb3IlMjBpJTIwaW4lMjByYW5nZShmcmFtZV9jb3VudCklNUQ=",highlighted:`<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> imageio

reader = imageio.get_reader(video_path, <span class="hljs-string">&quot;ffmpeg&quot;</span>)
frame_count = <span class="hljs-number">8</span>
video = [Image.fromarray(reader.get_data(i)) <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(frame_count)]`}}),st=new W({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uQ29udHJvbE5ldFBpcGVsaW5lJTJDJTIwQ29udHJvbE5ldE1vZGVsJTBBZnJvbSUyMGRpZmZ1c2Vycy5waXBlbGluZXMudGV4dF90b192aWRlb19zeW50aGVzaXMucGlwZWxpbmVfdGV4dF90b192aWRlb196ZXJvJTIwaW1wb3J0JTIwQ3Jvc3NGcmFtZUF0dG5Qcm9jZXNzb3IlMEElMEElMjMlMjBzZXQlMjBtb2RlbCUyMGlkJTIwdG8lMjBjdXN0b20lMjBtb2RlbCUwQW1vZGVsX2lkJTIwJTNEJTIwJTIyUEFJUiUyRnRleHQydmlkZW8temVyby1jb250cm9sbmV0LWNhbm55LWF2YXRhciUyMiUwQWNvbnRyb2xuZXQlMjAlM0QlMjBDb250cm9sTmV0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmxsbHlhc3ZpZWwlMkZzZC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pbWFnZXMlMkMlMjBsYXRlbnRzJTNEbGF0ZW50cykuaW1hZ2VzJTBBaW1hZ2Vpby5taW1zYXZlKCUyMnZpZGVvLm1wNCUyMiUyQyUyMHJlc3VsdCUyQyUyMGZwcyUzRDQp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel
<span class="hljs-keyword">from</span> diffusers.pipelines.text_to_video_synthesis.pipeline_text_to_video_zero <span class="hljs-keyword">import</span> CrossFrameAttnProcessor

<span class="hljs-comment"># set model id to custom model</span>
model_id = <span class="hljs-string">&quot;PAIR/text2video-zero-controlnet-canny-avatar&quot;</span>
controlnet = ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-canny&quot;</span>, torch_dtype=torch.float16)
pipe = StableDiffusionControlNetPipeline.from_pretrained(
    model_id, controlnet=controlnet, torch_dtype=torch.float16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># Set the attention processor</span>
pipe.unet.set_attn_processor(CrossFrameAttnProcessor(batch_size=<span class="hljs-number">2</span>))
pipe.controlnet.set_attn_processor(CrossFrameAttnProcessor(batch_size=<span class="hljs-number">2</span>))

<span class="hljs-comment"># fix latents for all frames</span>
latents = torch.randn((<span class="hljs-number">1</span>, <span class="hljs-number">4</span>, <span class="hljs-number">64</span>, <span class="hljs-number">64</span>), device=<span class="hljs-string">&quot;cuda&quot;</span>, dtype=torch.float16).repeat(<span class="hljs-built_in">len</span>(pose_images), <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>)

prompt = <span class="hljs-string">&quot;oil painting of a beautiful girl avatar style&quot;</span>
result = pipe(prompt=[prompt] * <span class="hljs-built_in">len</span>(pose_images), image=pose_images, latents=latents).images
imageio.mimsave(<span class="hljs-string">&quot;video.mp4&quot;</span>, result, fps=<span class="hljs-number">4</span>)`}}),it=new N({}),pt=new hl({props:{name:"class diffusers.TextToVideoZeroPipeline",anchor:"diffusers.TextToVideoZeroPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.TextToVideoZeroPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.17.1/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.TextToVideoZeroPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.TextToVideoZeroPipeline.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.TextToVideoZeroPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.17.1/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.TextToVideoZeroPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.17.1/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.17.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.17.1/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.17.1/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.TextToVideoZeroPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.TextToVideoZeroPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py#L188"}}),ct=new hl({props:{name:"__call__",anchor:"diffusers.TextToVideoZeroPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"video_length",val:": typing.Optional[int] = 8"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_videos_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"motion_field_strength_x",val:": float = 12"},{name:"motion_field_strength_y",val:": float = 12"},{name:"output_type",val:": typing.Optional[str] = 'tensor'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": typing.Optional[int] = 1"},{name:"t0",val:": int = 44"},{name:"t1",val:": int = 47"}],parametersDescription:[{anchor:"diffusers.TextToVideoZeroPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.TextToVideoZeroPipeline.__call__.video_length",description:"<strong>video_length</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014; The number of generated video frames",name:"video_length"},{anchor:"diffusers.TextToVideoZeroPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.TextToVideoZeroPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.TextToVideoZeroPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.TextToVideoZeroPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.TextToVideoZeroPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.TextToVideoZeroPipeline.__call__.num_videos_per_prompt",description:`<strong>num_videos_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of videos to generate per prompt.`,name:"num_videos_per_prompt"},{anchor:"diffusers.TextToVideoZeroPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.17.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.TextToVideoZeroPipeline.__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.TextToVideoZeroPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.TextToVideoZeroPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;numpy&quot;</code>) &#x2014;
The output format of the generated image. Choose between <code>&quot;latent&quot;</code> and <code>&quot;numpy&quot;</code>.`,name:"output_type"},{anchor:"diffusers.TextToVideoZeroPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.17.1/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.TextToVideoZeroPipeline.__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.TextToVideoZeroPipeline.__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.TextToVideoZeroPipeline.__call__.motion_field_strength_x",description:`<strong>motion_field_strength_x</strong> (<code>float</code>, <em>optional</em>, defaults to 12) &#x2014;
Strength of motion in generated video along x-axis. See the <a href="https://arxiv.org/abs/2303.13439" rel="nofollow">paper</a>,
Sect. 3.3.1.`,name:"motion_field_strength_x"},{anchor:"diffusers.TextToVideoZeroPipeline.__call__.motion_field_strength_y",description:`<strong>motion_field_strength_y</strong> (<code>float</code>, <em>optional</em>, defaults to 12) &#x2014;
Strength of motion in generated video along y-axis. See the <a href="https://arxiv.org/abs/2303.13439" rel="nofollow">paper</a>,
Sect. 3.3.1.`,name:"motion_field_strength_y"},{anchor:"diffusers.TextToVideoZeroPipeline.__call__.t0",description:`<strong>t0</strong> (<code>int</code>, <em>optional</em>, defaults to 44) &#x2014;
Timestep t0. Should be in the range [0, num_inference_steps - 1]. See the
<a href="https://arxiv.org/abs/2303.13439" rel="nofollow">paper</a>, Sect. 3.3.1.`,name:"t0"},{anchor:"diffusers.TextToVideoZeroPipeline.__call__.t1",description:`<strong>t1</strong> (<code>int</code>, <em>optional</em>, defaults to 47) &#x2014;
Timestep t0. Should be in the range [t0 + 1, num_inference_steps - 1]. See the
<a href="https://arxiv.org/abs/2303.13439" rel="nofollow">paper</a>, Sect. 3.3.1.`,name:"t1"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py#L319",returnDescription:`
<p>The output contains a ndarray of the generated images, when output_type != \u2018latent\u2019, otherwise a latent
codes of generated image, and a list of <code>bool</code>s denoting whether the corresponding generated image
likely represents \u201Cnot-safe-for-work\u201D (nsfw) content, according to the <code>safety_checker</code>.</p>
`,returnType:`
<p><code>~pipelines.text_to_video_synthesis.TextToVideoPipelineOutput</code></p>
`}}),ht=new hl({props:{name:"backward_loop",anchor:"diffusers.TextToVideoZeroPipeline.backward_loop",parameters:[{name:"latents",val:""},{name:"timesteps",val:""},{name:"prompt_embeds",val:""},{name:"guidance_scale",val:""},{name:"callback",val:""},{name:"callback_steps",val:""},{name:"num_warmup_steps",val:""},{name:"extra_step_kwargs",val:""},{name:"cross_attention_kwargs",val:" = None"}],parametersDescription:[{anchor:"diffusers.TextToVideoZeroPipeline.backward_loop.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.TextToVideoZeroPipeline.backward_loop.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.
extra_step_kwargs &#x2014; extra_step_kwargs.
cross_attention_kwargs &#x2014; cross_attention_kwargs.
num_warmup_steps &#x2014; number of warmup steps.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py#L250",returnDescription:`
<p>latents of backward process output at time timesteps[-1]</p>
`,returnType:`
<p>latents</p>
`}}),ft=new hl({props:{name:"forward_loop",anchor:"diffusers.TextToVideoZeroPipeline.forward_loop",parameters:[{name:"x_t0",val:""},{name:"t0",val:""},{name:"t1",val:""},{name:"generator",val:""}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py#L232",returnDescription:`
<p>forward process applied to x_t0 from time t0 to t1.</p>
`,returnType:`
<p>x_t1</p>
`}}),{c(){G=a("meta"),ea=p(),B=a("h1"),L=a("a"),Rt=a("span"),f(ve.$$.fragment),fl=p(),Xt=a("span"),ml=s("Zero-Shot Text-to-Video Generation"),ta=p(),C=a("h2"),q=a("a"),St=a("span"),f(_e.$$.fragment),ul=p(),Dt=a("span"),vl=s("Overview"),oa=p(),M=a("p"),ge=a("a"),_l=s("Text2Video-Zero: Text-to-Image Diffusion Models are Zero-Shot Video Generators"),gl=s(` by
Levon Khachatryan,
Andranik Movsisyan,
Vahram Tadevosyan,
Roberto Henschel,
`),ye=a("a"),yl=s("Zhangyang Wang"),bl=s(", Shant Navasardyan, "),be=a("a"),wl=s("Humphrey Shi"),Tl=s("."),aa=p(),ut=a("p"),Jl=s("Our method Text2Video-Zero enables zero-shot video generation using either"),la=p(),E=a("ol"),zt=a("li"),Ml=s("A textual prompt, or"),Zl=p(),Qt=a("li"),xl=s("A prompt combined with guidance from poses or edges, or"),El=p(),Yt=a("li"),Ul=s("Video Instruct-Pix2Pix, i.e., instruction-guided video editing."),na=p(),vt=a("p"),kl=s("Results are temporally consistent and follow closely the guidance and textual prompts."),sa=p(),_t=a("p"),gt=a("img"),ra=p(),yt=a("p"),Il=s("The abstract of the paper is the following:"),ia=p(),bt=a("p"),Ft=a("em"),jl=s(`Recent text-to-video generation approaches rely on computationally heavy training and require large-scale video datasets. In this paper, we introduce a new task of zero-shot text-to-video generation and propose a low-cost approach (without any training or optimization) by leveraging the power of existing text-to-image synthesis methods (e.g., Stable Diffusion), making them suitable for the video domain.
Our key modifications include (i) enriching the latent codes of the generated frames with motion dynamics to keep the global scene and the background time consistent; and (ii) reprogramming frame-level self-attention using a new cross-frame attention of each frame on the first frame, to preserve the context, appearance, and identity of the foreground object.
Experiments show that this leads to low overhead, yet high-quality and remarkably consistent video generation. Moreover, our approach is not limited to text-to-video synthesis but is also applicable to other tasks such as conditional and content-specialized video generation, and Video Instruct-Pix2Pix, i.e., instruction-guided video editing.
As experiments show, our method performs comparably or sometimes better than recent approaches, despite not being trained on additional video data.`),pa=p(),wt=a("p"),Vl=s("Resources:"),da=p(),U=a("ul"),At=a("li"),we=a("a"),Wl=s("Project Page"),Nl=p(),Ht=a("li"),Te=a("a"),Gl=s("Paper"),Bl=p(),Lt=a("li"),Je=a("a"),Cl=s("Original Code"),ca=p(),P=a("h2"),O=a("a"),qt=a("span"),f(Me.$$.fragment),Pl=p(),Ot=a("span"),$l=s("Available Pipelines:"),ha=p(),K=a("table"),Kt=a("thead"),$=a("tr"),eo=a("th"),Rl=s("Pipeline"),Xl=p(),to=a("th"),Sl=s("Tasks"),Dl=p(),Tt=a("th"),zl=s("Demo"),Ql=p(),oo=a("tbody"),R=a("tr"),ao=a("td"),Ze=a("a"),Yl=s("TextToVideoZeroPipeline"),Fl=p(),lo=a("td"),no=a("em"),Al=s("Zero-shot Text-to-Video Generation"),Hl=p(),Jt=a("td"),xe=a("a"),Ll=s("\u{1F917} Space"),fa=p(),X=a("h2"),ee=a("a"),so=a("span"),f(Ee.$$.fragment),ql=p(),ro=a("span"),Ol=s("Usage example"),ma=p(),S=a("h3"),te=a("a"),io=a("span"),f(Ue.$$.fragment),Kl=p(),po=a("span"),en=s("Text-To-Video"),ua=p(),Mt=a("p"),tn=s("To generate a video from prompt, run the following python command"),va=p(),f(ke.$$.fragment),_a=p(),Zt=a("p"),on=s("You can change these parameters in the pipeline call:"),ga=p(),k=a("ul"),oe=a("li"),an=s("Motion field strength (see the "),Ie=a("a"),ln=s("paper"),nn=s(", Sect. 3.3.1):"),co=a("ul"),Z=a("li"),ho=a("code"),sn=s("motion_field_strength_x"),rn=s(" and "),fo=a("code"),pn=s("motion_field_strength_y"),dn=s(". Default: "),mo=a("code"),cn=s("motion_field_strength_x=12"),hn=s(", "),uo=a("code"),fn=s("motion_field_strength_y=12"),mn=p(),x=a("li"),vo=a("code"),un=s("T"),vn=s(" and "),_o=a("code"),_n=s("T'"),gn=s(" (see the "),je=a("a"),yn=s("paper"),bn=s(", Sect. 3.3.1)"),go=a("ul"),T=a("li"),yo=a("code"),wn=s("t0"),Tn=s(" and "),bo=a("code"),Jn=s("t1"),Mn=s(" in the range "),wo=a("code"),Zn=s("{0, ..., num_inference_steps}"),xn=s(". Default: "),To=a("code"),En=s("t0=45"),Un=s(", "),Jo=a("code"),kn=s("t1=48"),In=p(),xt=a("li"),jn=s("Video length:"),Mo=a("ul"),Ve=a("li"),Zo=a("code"),Vn=s("video_length"),Wn=s(", the number of frames video_length to be generated. Default: "),xo=a("code"),Nn=s("video_length=8"),ya=p(),D=a("h3"),ae=a("a"),Eo=a("span"),f(We.$$.fragment),Gn=p(),Uo=a("span"),Bn=s("Text-To-Video with Pose Control"),ba=s(`

To generate a video from prompt with additional pose control
`),Et=a("ol"),Ne=a("li"),ko=a("p"),Cn=s("Download a demo video"),Pn=p(),f(Ge.$$.fragment),wa=p(),z=a("ol"),Q=a("li"),Io=a("p"),$n=s("Read video containing extracted pose images"),Rn=p(),f(Be.$$.fragment),Xn=p(),Ce=a("p"),Sn=s("To extract pose from actual video, read "),Ut=a("a"),Dn=s("ControlNet documentation"),zn=s("."),Qn=p(),Pe=a("li"),$e=a("p"),Yn=s("Run "),jo=a("code"),Fn=s("StableDiffusionControlNetPipeline"),An=s(" with our custom attention processor"),Hn=p(),f(Re.$$.fragment),Ta=p(),Y=a("h3"),le=a("a"),Vo=a("span"),f(Xe.$$.fragment),Ln=p(),Wo=a("span"),qn=s("Text-To-Video with Edge Control"),Ja=p(),ne=a("p"),On=s(`To generate a video from prompt with additional pose control,
follow the steps described above for pose-guided generation using `),Se=a("a"),Kn=s("Canny edge ControlNet model"),es=s("."),Ma=p(),F=a("h3"),se=a("a"),No=a("span"),f(De.$$.fragment),ts=p(),Go=a("span"),os=s("Video Instruct-Pix2Pix"),Za=p(),re=a("p"),as=s("To perform text-guided video editing (with "),kt=a("a"),ls=s("InstructPix2Pix"),ns=s("):"),xa=p(),I=a("ol"),ze=a("li"),Bo=a("p"),ss=s("Download a demo video"),rs=p(),f(Qe.$$.fragment),is=p(),Ye=a("li"),Co=a("p"),ps=s("Read video from path"),ds=p(),f(Fe.$$.fragment),cs=p(),Ae=a("li"),He=a("p"),hs=s("Run "),Po=a("code"),fs=s("StableDiffusionInstructPix2PixPipeline"),ms=s(" with our custom attention processor"),us=p(),f(Le.$$.fragment),Ea=p(),A=a("h3"),ie=a("a"),$o=a("span"),f(qe.$$.fragment),vs=p(),Ro=a("span"),_s=s("DreamBooth specialization"),Ua=p(),y=a("p"),gs=s("Methods "),Xo=a("strong"),ys=s("Text-To-Video"),bs=s(", "),So=a("strong"),ws=s("Text-To-Video with Pose Control"),Ts=s(" and "),Do=a("strong"),Js=s("Text-To-Video with Edge Control"),Ms=s(`
can run with custom `),It=a("a"),Zs=s("DreamBooth"),xs=s(` models, as shown below for
`),Oe=a("a"),Es=s("Canny edge ControlNet model"),Us=s(` and
`),Ke=a("a"),ks=s("Avatar style DreamBooth"),Is=s(" model"),ka=p(),j=a("ol"),et=a("li"),zo=a("p"),js=s("Download a demo video"),Vs=p(),f(tt.$$.fragment),Ws=p(),ot=a("li"),Qo=a("p"),Ns=s("Read video from path"),Gs=p(),f(at.$$.fragment),Bs=p(),lt=a("li"),nt=a("p"),Cs=s("Run "),Yo=a("code"),Ps=s("StableDiffusionControlNetPipeline"),$s=s(" with custom trained DreamBooth model"),Rs=p(),f(st.$$.fragment),Ia=p(),pe=a("p"),Xs=s("You can filter out some available DreamBooth-trained models with "),rt=a("a"),Ss=s("this link"),Ds=s("."),ja=p(),H=a("h2"),de=a("a"),Fo=a("span"),f(it.$$.fragment),zs=p(),Ao=a("span"),Qs=s("TextToVideoZeroPipeline"),Va=p(),b=a("div"),f(pt.$$.fragment),Ys=p(),Ho=a("p"),Fs=s("Pipeline for zero-shot text-to-video generation using Stable Diffusion."),As=p(),dt=a("p"),Hs=s("This model inherits from "),jt=a("a"),Ls=s("StableDiffusionPipeline"),qs=s(`. Check the superclass documentation for the generic methods
the library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Os=p(),ce=a("div"),f(ct.$$.fragment),Ks=p(),Lo=a("p"),er=s("Function invoked when calling the pipeline for generation."),tr=p(),he=a("div"),f(ht.$$.fragment),or=p(),qo=a("p"),ar=s("Perform backward process given list of time steps"),lr=p(),fe=a("div"),f(ft.$$.fragment),nr=p(),Oo=a("p"),sr=s("Perform ddpm forward process from time t0 to t1. This is the same as adding noise with corresponding variance."),this.h()},l(t){const c=dp('[data-svelte="svelte-1phssyn"]',document.head);G=l(c,"META",{name:!0,content:!0}),c.forEach(o),ea=d(t),B=l(t,"H1",{class:!0});var Na=n(B);L=l(Na,"A",{id:!0,class:!0,href:!0});var dr=n(L);Rt=l(dr,"SPAN",{});var cr=n(Rt);m(ve.$$.fragment,cr),cr.forEach(o),dr.forEach(o),fl=d(Na),Xt=l(Na,"SPAN",{});var hr=n(Xt);ml=r(hr,"Zero-Shot Text-to-Video Generation"),hr.forEach(o),Na.forEach(o),ta=d(t),C=l(t,"H2",{class:!0});var Ga=n(C);q=l(Ga,"A",{id:!0,class:!0,href:!0});var fr=n(q);St=l(fr,"SPAN",{});var mr=n(St);m(_e.$$.fragment,mr),mr.forEach(o),fr.forEach(o),ul=d(Ga),Dt=l(Ga,"SPAN",{});var ur=n(Dt);vl=r(ur,"Overview"),ur.forEach(o),Ga.forEach(o),oa=d(t),M=l(t,"P",{});var mt=n(M);ge=l(mt,"A",{href:!0,rel:!0});var vr=n(ge);_l=r(vr,"Text2Video-Zero: Text-to-Image Diffusion Models are Zero-Shot Video Generators"),vr.forEach(o),gl=r(mt,` by
Levon Khachatryan,
Andranik Movsisyan,
Vahram Tadevosyan,
Roberto Henschel,
`),ye=l(mt,"A",{href:!0,rel:!0});var _r=n(ye);yl=r(_r,"Zhangyang Wang"),_r.forEach(o),bl=r(mt,", Shant Navasardyan, "),be=l(mt,"A",{href:!0,rel:!0});var gr=n(be);wl=r(gr,"Humphrey Shi"),gr.forEach(o),Tl=r(mt,"."),mt.forEach(o),aa=d(t),ut=l(t,"P",{});var yr=n(ut);Jl=r(yr,"Our method Text2Video-Zero enables zero-shot video generation using either"),yr.forEach(o),la=d(t),E=l(t,"OL",{});var Vt=n(E);zt=l(Vt,"LI",{});var br=n(zt);Ml=r(br,"A textual prompt, or"),br.forEach(o),Zl=d(Vt),Qt=l(Vt,"LI",{});var wr=n(Qt);xl=r(wr,"A prompt combined with guidance from poses or edges, or"),wr.forEach(o),El=d(Vt),Yt=l(Vt,"LI",{});var Tr=n(Yt);Ul=r(Tr,"Video Instruct-Pix2Pix, i.e., instruction-guided video editing."),Tr.forEach(o),Vt.forEach(o),na=d(t),vt=l(t,"P",{});var Jr=n(vt);kl=r(Jr,"Results are temporally consistent and follow closely the guidance and textual prompts."),Jr.forEach(o),sa=d(t),_t=l(t,"P",{});var Mr=n(_t);gt=l(Mr,"IMG",{src:!0,alt:!0}),Mr.forEach(o),ra=d(t),yt=l(t,"P",{});var Zr=n(yt);Il=r(Zr,"The abstract of the paper is the following:"),Zr.forEach(o),ia=d(t),bt=l(t,"P",{});var xr=n(bt);Ft=l(xr,"EM",{});var Er=n(Ft);jl=r(Er,`Recent text-to-video generation approaches rely on computationally heavy training and require large-scale video datasets. In this paper, we introduce a new task of zero-shot text-to-video generation and propose a low-cost approach (without any training or optimization) by leveraging the power of existing text-to-image synthesis methods (e.g., Stable Diffusion), making them suitable for the video domain.
Our key modifications include (i) enriching the latent codes of the generated frames with motion dynamics to keep the global scene and the background time consistent; and (ii) reprogramming frame-level self-attention using a new cross-frame attention of each frame on the first frame, to preserve the context, appearance, and identity of the foreground object.
Experiments show that this leads to low overhead, yet high-quality and remarkably consistent video generation. Moreover, our approach is not limited to text-to-video synthesis but is also applicable to other tasks such as conditional and content-specialized video generation, and Video Instruct-Pix2Pix, i.e., instruction-guided video editing.
As experiments show, our method performs comparably or sometimes better than recent approaches, despite not being trained on additional video data.`),Er.forEach(o),xr.forEach(o),pa=d(t),wt=l(t,"P",{});var Ur=n(wt);Vl=r(Ur,"Resources:"),Ur.forEach(o),da=d(t),U=l(t,"UL",{});var Wt=n(U);At=l(Wt,"LI",{});var kr=n(At);we=l(kr,"A",{href:!0,rel:!0});var Ir=n(we);Wl=r(Ir,"Project Page"),Ir.forEach(o),kr.forEach(o),Nl=d(Wt),Ht=l(Wt,"LI",{});var jr=n(Ht);Te=l(jr,"A",{href:!0,rel:!0});var Vr=n(Te);Gl=r(Vr,"Paper"),Vr.forEach(o),jr.forEach(o),Bl=d(Wt),Lt=l(Wt,"LI",{});var Wr=n(Lt);Je=l(Wr,"A",{href:!0,rel:!0});var Nr=n(Je);Cl=r(Nr,"Original Code"),Nr.forEach(o),Wr.forEach(o),Wt.forEach(o),ca=d(t),P=l(t,"H2",{class:!0});var Ba=n(P);O=l(Ba,"A",{id:!0,class:!0,href:!0});var Gr=n(O);qt=l(Gr,"SPAN",{});var Br=n(qt);m(Me.$$.fragment,Br),Br.forEach(o),Gr.forEach(o),Pl=d(Ba),Ot=l(Ba,"SPAN",{});var Cr=n(Ot);$l=r(Cr,"Available Pipelines:"),Cr.forEach(o),Ba.forEach(o),ha=d(t),K=l(t,"TABLE",{});var Ca=n(K);Kt=l(Ca,"THEAD",{});var Pr=n(Kt);$=l(Pr,"TR",{});var Nt=n($);eo=l(Nt,"TH",{});var $r=n(eo);Rl=r($r,"Pipeline"),$r.forEach(o),Xl=d(Nt),to=l(Nt,"TH",{});var Rr=n(to);Sl=r(Rr,"Tasks"),Rr.forEach(o),Dl=d(Nt),Tt=l(Nt,"TH",{align:!0});var Xr=n(Tt);zl=r(Xr,"Demo"),Xr.forEach(o),Nt.forEach(o),Pr.forEach(o),Ql=d(Ca),oo=l(Ca,"TBODY",{});var Sr=n(oo);R=l(Sr,"TR",{});var Gt=n(R);ao=l(Gt,"TD",{});var Dr=n(ao);Ze=l(Dr,"A",{href:!0,rel:!0});var zr=n(Ze);Yl=r(zr,"TextToVideoZeroPipeline"),zr.forEach(o),Dr.forEach(o),Fl=d(Gt),lo=l(Gt,"TD",{});var Qr=n(lo);no=l(Qr,"EM",{});var Yr=n(no);Al=r(Yr,"Zero-shot Text-to-Video Generation"),Yr.forEach(o),Qr.forEach(o),Hl=d(Gt),Jt=l(Gt,"TD",{align:!0});var Fr=n(Jt);xe=l(Fr,"A",{href:!0,rel:!0});var Ar=n(xe);Ll=r(Ar,"\u{1F917} Space"),Ar.forEach(o),Fr.forEach(o),Gt.forEach(o),Sr.forEach(o),Ca.forEach(o),fa=d(t),X=l(t,"H2",{class:!0});var Pa=n(X);ee=l(Pa,"A",{id:!0,class:!0,href:!0});var Hr=n(ee);so=l(Hr,"SPAN",{});var Lr=n(so);m(Ee.$$.fragment,Lr),Lr.forEach(o),Hr.forEach(o),ql=d(Pa),ro=l(Pa,"SPAN",{});var qr=n(ro);Ol=r(qr,"Usage example"),qr.forEach(o),Pa.forEach(o),ma=d(t),S=l(t,"H3",{class:!0});var $a=n(S);te=l($a,"A",{id:!0,class:!0,href:!0});var Or=n(te);io=l(Or,"SPAN",{});var Kr=n(io);m(Ue.$$.fragment,Kr),Kr.forEach(o),Or.forEach(o),Kl=d($a),po=l($a,"SPAN",{});var ei=n(po);en=r(ei,"Text-To-Video"),ei.forEach(o),$a.forEach(o),ua=d(t),Mt=l(t,"P",{});var ti=n(Mt);tn=r(ti,"To generate a video from prompt, run the following python command"),ti.forEach(o),va=d(t),m(ke.$$.fragment,t),_a=d(t),Zt=l(t,"P",{});var oi=n(Zt);on=r(oi,"You can change these parameters in the pipeline call:"),oi.forEach(o),ga=d(t),k=l(t,"UL",{});var Bt=n(k);oe=l(Bt,"LI",{});var Ko=n(oe);an=r(Ko,"Motion field strength (see the "),Ie=l(Ko,"A",{href:!0,rel:!0});var ai=n(Ie);ln=r(ai,"paper"),ai.forEach(o),nn=r(Ko,", Sect. 3.3.1):"),co=l(Ko,"UL",{});var li=n(co);Z=l(li,"LI",{});var me=n(Z);ho=l(me,"CODE",{});var ni=n(ho);sn=r(ni,"motion_field_strength_x"),ni.forEach(o),rn=r(me," and "),fo=l(me,"CODE",{});var si=n(fo);pn=r(si,"motion_field_strength_y"),si.forEach(o),dn=r(me,". Default: "),mo=l(me,"CODE",{});var ri=n(mo);cn=r(ri,"motion_field_strength_x=12"),ri.forEach(o),hn=r(me,", "),uo=l(me,"CODE",{});var ii=n(uo);fn=r(ii,"motion_field_strength_y=12"),ii.forEach(o),me.forEach(o),li.forEach(o),Ko.forEach(o),mn=d(Bt),x=l(Bt,"LI",{});var ue=n(x);vo=l(ue,"CODE",{});var pi=n(vo);un=r(pi,"T"),pi.forEach(o),vn=r(ue," and "),_o=l(ue,"CODE",{});var di=n(_o);_n=r(di,"T'"),di.forEach(o),gn=r(ue," (see the "),je=l(ue,"A",{href:!0,rel:!0});var ci=n(je);yn=r(ci,"paper"),ci.forEach(o),bn=r(ue,", Sect. 3.3.1)"),go=l(ue,"UL",{});var hi=n(go);T=l(hi,"LI",{});var V=n(T);yo=l(V,"CODE",{});var fi=n(yo);wn=r(fi,"t0"),fi.forEach(o),Tn=r(V," and "),bo=l(V,"CODE",{});var mi=n(bo);Jn=r(mi,"t1"),mi.forEach(o),Mn=r(V," in the range "),wo=l(V,"CODE",{});var ui=n(wo);Zn=r(ui,"{0, ..., num_inference_steps}"),ui.forEach(o),xn=r(V,". Default: "),To=l(V,"CODE",{});var vi=n(To);En=r(vi,"t0=45"),vi.forEach(o),Un=r(V,", "),Jo=l(V,"CODE",{});var _i=n(Jo);kn=r(_i,"t1=48"),_i.forEach(o),V.forEach(o),hi.forEach(o),ue.forEach(o),In=d(Bt),xt=l(Bt,"LI",{});var rr=n(xt);jn=r(rr,"Video length:"),Mo=l(rr,"UL",{});var gi=n(Mo);Ve=l(gi,"LI",{});var Ra=n(Ve);Zo=l(Ra,"CODE",{});var yi=n(Zo);Vn=r(yi,"video_length"),yi.forEach(o),Wn=r(Ra,", the number of frames video_length to be generated. Default: "),xo=l(Ra,"CODE",{});var bi=n(xo);Nn=r(bi,"video_length=8"),bi.forEach(o),Ra.forEach(o),gi.forEach(o),rr.forEach(o),Bt.forEach(o),ya=d(t),D=l(t,"H3",{class:!0});var Xa=n(D);ae=l(Xa,"A",{id:!0,class:!0,href:!0});var wi=n(ae);Eo=l(wi,"SPAN",{});var Ti=n(Eo);m(We.$$.fragment,Ti),Ti.forEach(o),wi.forEach(o),Gn=d(Xa),Uo=l(Xa,"SPAN",{});var Ji=n(Uo);Bn=r(Ji,"Text-To-Video with Pose Control"),Ji.forEach(o),Xa.forEach(o),ba=r(t,`

To generate a video from prompt with additional pose control
`),Et=l(t,"OL",{});var Mi=n(Et);Ne=l(Mi,"LI",{});var Sa=n(Ne);ko=l(Sa,"P",{});var Zi=n(ko);Cn=r(Zi,"Download a demo video"),Zi.forEach(o),Pn=d(Sa),m(Ge.$$.fragment,Sa),Sa.forEach(o),Mi.forEach(o),wa=d(t),z=l(t,"OL",{start:!0});var Da=n(z);Q=l(Da,"LI",{});var Ct=n(Q);Io=l(Ct,"P",{});var xi=n(Io);$n=r(xi,"Read video containing extracted pose images"),xi.forEach(o),Rn=d(Ct),m(Be.$$.fragment,Ct),Xn=d(Ct),Ce=l(Ct,"P",{});var za=n(Ce);Sn=r(za,"To extract pose from actual video, read "),Ut=l(za,"A",{href:!0});var Ei=n(Ut);Dn=r(Ei,"ControlNet documentation"),Ei.forEach(o),zn=r(za,"."),za.forEach(o),Ct.forEach(o),Qn=d(Da),Pe=l(Da,"LI",{});var Qa=n(Pe);$e=l(Qa,"P",{});var Ya=n($e);Yn=r(Ya,"Run "),jo=l(Ya,"CODE",{});var Ui=n(jo);Fn=r(Ui,"StableDiffusionControlNetPipeline"),Ui.forEach(o),An=r(Ya," with our custom attention processor"),Ya.forEach(o),Hn=d(Qa),m(Re.$$.fragment,Qa),Qa.forEach(o),Da.forEach(o),Ta=d(t),Y=l(t,"H3",{class:!0});var Fa=n(Y);le=l(Fa,"A",{id:!0,class:!0,href:!0});var ki=n(le);Vo=l(ki,"SPAN",{});var Ii=n(Vo);m(Xe.$$.fragment,Ii),Ii.forEach(o),ki.forEach(o),Ln=d(Fa),Wo=l(Fa,"SPAN",{});var ji=n(Wo);qn=r(ji,"Text-To-Video with Edge Control"),ji.forEach(o),Fa.forEach(o),Ja=d(t),ne=l(t,"P",{});var Aa=n(ne);On=r(Aa,`To generate a video from prompt with additional pose control,
follow the steps described above for pose-guided generation using `),Se=l(Aa,"A",{href:!0,rel:!0});var Vi=n(Se);Kn=r(Vi,"Canny edge ControlNet model"),Vi.forEach(o),es=r(Aa,"."),Aa.forEach(o),Ma=d(t),F=l(t,"H3",{class:!0});var Ha=n(F);se=l(Ha,"A",{id:!0,class:!0,href:!0});var Wi=n(se);No=l(Wi,"SPAN",{});var Ni=n(No);m(De.$$.fragment,Ni),Ni.forEach(o),Wi.forEach(o),ts=d(Ha),Go=l(Ha,"SPAN",{});var Gi=n(Go);os=r(Gi,"Video Instruct-Pix2Pix"),Gi.forEach(o),Ha.forEach(o),Za=d(t),re=l(t,"P",{});var La=n(re);as=r(La,"To perform text-guided video editing (with "),kt=l(La,"A",{href:!0});var Bi=n(kt);ls=r(Bi,"InstructPix2Pix"),Bi.forEach(o),ns=r(La,"):"),La.forEach(o),xa=d(t),I=l(t,"OL",{});var Pt=n(I);ze=l(Pt,"LI",{});var qa=n(ze);Bo=l(qa,"P",{});var Ci=n(Bo);ss=r(Ci,"Download a demo video"),Ci.forEach(o),rs=d(qa),m(Qe.$$.fragment,qa),qa.forEach(o),is=d(Pt),Ye=l(Pt,"LI",{});var Oa=n(Ye);Co=l(Oa,"P",{});var Pi=n(Co);ps=r(Pi,"Read video from path"),Pi.forEach(o),ds=d(Oa),m(Fe.$$.fragment,Oa),Oa.forEach(o),cs=d(Pt),Ae=l(Pt,"LI",{});var Ka=n(Ae);He=l(Ka,"P",{});var el=n(He);hs=r(el,"Run "),Po=l(el,"CODE",{});var $i=n(Po);fs=r($i,"StableDiffusionInstructPix2PixPipeline"),$i.forEach(o),ms=r(el," with our custom attention processor"),el.forEach(o),us=d(Ka),m(Le.$$.fragment,Ka),Ka.forEach(o),Pt.forEach(o),Ea=d(t),A=l(t,"H3",{class:!0});var tl=n(A);ie=l(tl,"A",{id:!0,class:!0,href:!0});var Ri=n(ie);$o=l(Ri,"SPAN",{});var Xi=n($o);m(qe.$$.fragment,Xi),Xi.forEach(o),Ri.forEach(o),vs=d(tl),Ro=l(tl,"SPAN",{});var Si=n(Ro);_s=r(Si,"DreamBooth specialization"),Si.forEach(o),tl.forEach(o),Ua=d(t),y=l(t,"P",{});var w=n(y);gs=r(w,"Methods "),Xo=l(w,"STRONG",{});var Di=n(Xo);ys=r(Di,"Text-To-Video"),Di.forEach(o),bs=r(w,", "),So=l(w,"STRONG",{});var zi=n(So);ws=r(zi,"Text-To-Video with Pose Control"),zi.forEach(o),Ts=r(w," and "),Do=l(w,"STRONG",{});var Qi=n(Do);Js=r(Qi,"Text-To-Video with Edge Control"),Qi.forEach(o),Ms=r(w,`
can run with custom `),It=l(w,"A",{href:!0});var Yi=n(It);Zs=r(Yi,"DreamBooth"),Yi.forEach(o),xs=r(w,` models, as shown below for
`),Oe=l(w,"A",{href:!0,rel:!0});var Fi=n(Oe);Es=r(Fi,"Canny edge ControlNet model"),Fi.forEach(o),Us=r(w,` and
`),Ke=l(w,"A",{href:!0,rel:!0});var Ai=n(Ke);ks=r(Ai,"Avatar style DreamBooth"),Ai.forEach(o),Is=r(w," model"),w.forEach(o),ka=d(t),j=l(t,"OL",{});var $t=n(j);et=l($t,"LI",{});var ol=n(et);zo=l(ol,"P",{});var Hi=n(zo);js=r(Hi,"Download a demo video"),Hi.forEach(o),Vs=d(ol),m(tt.$$.fragment,ol),ol.forEach(o),Ws=d($t),ot=l($t,"LI",{});var al=n(ot);Qo=l(al,"P",{});var Li=n(Qo);Ns=r(Li,"Read video from path"),Li.forEach(o),Gs=d(al),m(at.$$.fragment,al),al.forEach(o),Bs=d($t),lt=l($t,"LI",{});var ll=n(lt);nt=l(ll,"P",{});var nl=n(nt);Cs=r(nl,"Run "),Yo=l(nl,"CODE",{});var qi=n(Yo);Ps=r(qi,"StableDiffusionControlNetPipeline"),qi.forEach(o),$s=r(nl," with custom trained DreamBooth model"),nl.forEach(o),Rs=d(ll),m(st.$$.fragment,ll),ll.forEach(o),$t.forEach(o),Ia=d(t),pe=l(t,"P",{});var sl=n(pe);Xs=r(sl,"You can filter out some available DreamBooth-trained models with "),rt=l(sl,"A",{href:!0,rel:!0});var Oi=n(rt);Ss=r(Oi,"this link"),Oi.forEach(o),Ds=r(sl,"."),sl.forEach(o),ja=d(t),H=l(t,"H2",{class:!0});var rl=n(H);de=l(rl,"A",{id:!0,class:!0,href:!0});var Ki=n(de);Fo=l(Ki,"SPAN",{});var ep=n(Fo);m(it.$$.fragment,ep),ep.forEach(o),Ki.forEach(o),zs=d(rl),Ao=l(rl,"SPAN",{});var tp=n(Ao);Qs=r(tp,"TextToVideoZeroPipeline"),tp.forEach(o),rl.forEach(o),Va=d(t),b=l(t,"DIV",{class:!0});var J=n(b);m(pt.$$.fragment,J),Ys=d(J),Ho=l(J,"P",{});var op=n(Ho);Fs=r(op,"Pipeline for zero-shot text-to-video generation using Stable Diffusion."),op.forEach(o),As=d(J),dt=l(J,"P",{});var il=n(dt);Hs=r(il,"This model inherits from "),jt=l(il,"A",{href:!0});var ap=n(jt);Ls=r(ap,"StableDiffusionPipeline"),ap.forEach(o),qs=r(il,`. 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.)`),il.forEach(o),Os=d(J),ce=l(J,"DIV",{class:!0});var pl=n(ce);m(ct.$$.fragment,pl),Ks=d(pl),Lo=l(pl,"P",{});var lp=n(Lo);er=r(lp,"Function invoked when calling the pipeline for generation."),lp.forEach(o),pl.forEach(o),tr=d(J),he=l(J,"DIV",{class:!0});var dl=n(he);m(ht.$$.fragment,dl),or=d(dl),qo=l(dl,"P",{});var np=n(qo);ar=r(np,"Perform backward process given list of time steps"),np.forEach(o),dl.forEach(o),lr=d(J),fe=l(J,"DIV",{class:!0});var cl=n(fe);m(ft.$$.fragment,cl),nr=d(cl),Oo=l(cl,"P",{});var sp=n(Oo);sr=r(sp,"Perform ddpm forward process from time t0 to t1. This is the same as adding noise with corresponding variance."),sp.forEach(o),cl.forEach(o),J.forEach(o),this.h()},h(){i(G,"name","hf:doc:metadata"),i(G,"content",JSON.stringify(up)),i(L,"id","zeroshot-texttovideo-generation"),i(L,"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"),i(L,"href","#zeroshot-texttovideo-generation"),i(B,"class","relative group"),i(q,"id","overview"),i(q,"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"),i(q,"href","#overview"),i(C,"class","relative group"),i(ge,"href","https://arxiv.org/abs/2303.13439"),i(ge,"rel","nofollow"),i(ye,"href","https://www.ece.utexas.edu/people/faculty/atlas-wang"),i(ye,"rel","nofollow"),i(be,"href","https://www.humphreyshi.com"),i(be,"rel","nofollow"),cp(gt.src,pr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/t2v_zero_teaser.png")||i(gt,"src",pr),i(gt,"alt","teaser-img"),i(we,"href","https://text2video-zero.github.io/"),i(we,"rel","nofollow"),i(Te,"href","https://arxiv.org/abs/2303.13439"),i(Te,"rel","nofollow"),i(Je,"href","https://github.com/Picsart-AI-Research/Text2Video-Zero"),i(Je,"rel","nofollow"),i(O,"id","available-pipelines"),i(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"),i(O,"href","#available-pipelines"),i(P,"class","relative group"),i(Tt,"align","center"),i(Ze,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py"),i(Ze,"rel","nofollow"),i(xe,"href","https://huggingface.co/spaces/PAIR/Text2Video-Zero"),i(xe,"rel","nofollow"),i(Jt,"align","center"),i(ee,"id","usage-example"),i(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"),i(ee,"href","#usage-example"),i(X,"class","relative group"),i(te,"id","texttovideo"),i(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"),i(te,"href","#texttovideo"),i(S,"class","relative group"),i(Ie,"href","https://arxiv.org/abs/2303.13439"),i(Ie,"rel","nofollow"),i(je,"href","https://arxiv.org/abs/2303.13439"),i(je,"rel","nofollow"),i(ae,"id","texttovideo-with-pose-control"),i(ae,"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"),i(ae,"href","#texttovideo-with-pose-control"),i(D,"class","relative group"),i(Ut,"href","./stable_diffusion/controlnet"),i(z,"start","2"),i(le,"id","texttovideo-with-edge-control"),i(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"),i(le,"href","#texttovideo-with-edge-control"),i(Y,"class","relative group"),i(Se,"href","https://huggingface.co/lllyasviel/sd-controlnet-canny"),i(Se,"rel","nofollow"),i(se,"id","video-instructpix2pix"),i(se,"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"),i(se,"href","#video-instructpix2pix"),i(F,"class","relative group"),i(kt,"href","./stable_diffusion/pix2pix"),i(ie,"id","dreambooth-specialization"),i(ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(ie,"href","#dreambooth-specialization"),i(A,"class","relative group"),i(It,"href","../training/dreambooth"),i(Oe,"href","https://huggingface.co/lllyasviel/sd-controlnet-canny"),i(Oe,"rel","nofollow"),i(Ke,"href","https://huggingface.co/PAIR/text2video-zero-controlnet-canny-avatar"),i(Ke,"rel","nofollow"),i(rt,"href","https://huggingface.co/models?search=dreambooth"),i(rt,"rel","nofollow"),i(de,"id","diffusers.TextToVideoZeroPipeline"),i(de,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(de,"href","#diffusers.TextToVideoZeroPipeline"),i(H,"class","relative group"),i(jt,"href","/docs/diffusers/v0.17.1/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),i(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(b,"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,G),h(t,ea,c),h(t,B,c),e(B,L),e(L,Rt),u(ve,Rt,null),e(B,fl),e(B,Xt),e(Xt,ml),h(t,ta,c),h(t,C,c),e(C,q),e(q,St),u(_e,St,null),e(C,ul),e(C,Dt),e(Dt,vl),h(t,oa,c),h(t,M,c),e(M,ge),e(ge,_l),e(M,gl),e(M,ye),e(ye,yl),e(M,bl),e(M,be),e(be,wl),e(M,Tl),h(t,aa,c),h(t,ut,c),e(ut,Jl),h(t,la,c),h(t,E,c),e(E,zt),e(zt,Ml),e(E,Zl),e(E,Qt),e(Qt,xl),e(E,El),e(E,Yt),e(Yt,Ul),h(t,na,c),h(t,vt,c),e(vt,kl),h(t,sa,c),h(t,_t,c),e(_t,gt),h(t,ra,c),h(t,yt,c),e(yt,Il),h(t,ia,c),h(t,bt,c),e(bt,Ft),e(Ft,jl),h(t,pa,c),h(t,wt,c),e(wt,Vl),h(t,da,c),h(t,U,c),e(U,At),e(At,we),e(we,Wl),e(U,Nl),e(U,Ht),e(Ht,Te),e(Te,Gl),e(U,Bl),e(U,Lt),e(Lt,Je),e(Je,Cl),h(t,ca,c),h(t,P,c),e(P,O),e(O,qt),u(Me,qt,null),e(P,Pl),e(P,Ot),e(Ot,$l),h(t,ha,c),h(t,K,c),e(K,Kt),e(Kt,$),e($,eo),e(eo,Rl),e($,Xl),e($,to),e(to,Sl),e($,Dl),e($,Tt),e(Tt,zl),e(K,Ql),e(K,oo),e(oo,R),e(R,ao),e(ao,Ze),e(Ze,Yl),e(R,Fl),e(R,lo),e(lo,no),e(no,Al),e(R,Hl),e(R,Jt),e(Jt,xe),e(xe,Ll),h(t,fa,c),h(t,X,c),e(X,ee),e(ee,so),u(Ee,so,null),e(X,ql),e(X,ro),e(ro,Ol),h(t,ma,c),h(t,S,c),e(S,te),e(te,io),u(Ue,io,null),e(S,Kl),e(S,po),e(po,en),h(t,ua,c),h(t,Mt,c),e(Mt,tn),h(t,va,c),u(ke,t,c),h(t,_a,c),h(t,Zt,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(I,ze),e(ze,Bo),e(Bo,ss),e(ze,rs),u(Qe,ze,null),e(I,is),e(I,Ye),e(Ye,Co),e(Co,ps),e(Ye,ds),u(Fe,Ye,null),e(I,cs),e(I,Ae),e(Ae,He),e(He,hs),e(He,Po),e(Po,fs),e(He,ms),e(Ae,us),u(Le,Ae,null),h(t,Ea,c),h(t,A,c),e(A,ie),e(ie,$o),u(qe,$o,null),e(A,vs),e(A,Ro),e(Ro,_s),h(t,Ua,c),h(t,y,c),e(y,gs),e(y,Xo),e(Xo,ys),e(y,bs),e(y,So),e(So,ws),e(y,Ts),e(y,Do),e(Do,Js),e(y,Ms),e(y,It),e(It,Zs),e(y,xs),e(y,Oe),e(Oe,Es),e(y,Us),e(y,Ke),e(Ke,ks),e(y,Is),h(t,ka,c),h(t,j,c),e(j,et),e(et,zo),e(zo,js),e(et,Vs),u(tt,et,null),e(j,Ws),e(j,ot),e(ot,Qo),e(Qo,Ns),e(ot,Gs),u(at,ot,null),e(j,Bs),e(j,lt),e(lt,nt),e(nt,Cs),e(nt,Yo),e(Yo,Ps),e(nt,$s),e(lt,Rs),u(st,lt,null),h(t,Ia,c),h(t,pe,c),e(pe,Xs),e(pe,rt),e(rt,Ss),e(pe,Ds),h(t,ja,c),h(t,H,c),e(H,de),e(de,Fo),u(it,Fo,null),e(H,zs),e(H,Ao),e(Ao,Qs),h(t,Va,c),h(t,b,c),u(pt,b,null),e(b,Ys),e(b,Ho),e(Ho,Fs),e(b,As),e(b,dt),e(dt,Hs),e(dt,jt),e(jt,Ls),e(dt,qs),e(b,Os),e(b,ce),u(ct,ce,null),e(ce,Ks),e(ce,Lo),e(Lo,er),e(b,tr),e(b,he),u(ht,he,null),e(he,or),e(he,qo),e(qo,ar),e(b,lr),e(b,fe),u(ft,fe,null),e(fe,nr),e(fe,Oo),e(Oo,sr),Wa=!0},p:hp,i(t){Wa||(v(ve.$$.fragment,t),v(_e.$$.fragment,t),v(Me.$$.fragment,t),v(Ee.$$.fragment,t),v(Ue.$$.fragment,t),v(ke.$$.fragment,t),v(We.$$.fragment,t),v(Ge.$$.fragment,t),v(Be.$$.fragment,t),v(Re.$$.fragment,t),v(Xe.$$.fragment,t),v(De.$$.fragment,t),v(Qe.$$.fragment,t),v(Fe.$$.fragment,t),v(Le.$$.fragment,t),v(qe.$$.fragment,t),v(tt.$$.fragment,t),v(at.$$.fragment,t),v(st.$$.fragment,t),v(it.$$.fragment,t),v(pt.$$.fragment,t),v(ct.$$.fragment,t),v(ht.$$.fragment,t),v(ft.$$.fragment,t),Wa=!0)},o(t){_(ve.$$.fragment,t),_(_e.$$.fragment,t),_(Me.$$.fragment,t),_(Ee.$$.fragment,t),_(Ue.$$.fragment,t),_(ke.$$.fragment,t),_(We.$$.fragment,t),_(Ge.$$.fragment,t),_(Be.$$.fragment,t),_(Re.$$.fragment,t),_(Xe.$$.fragment,t),_(De.$$.fragment,t),_(Qe.$$.fragment,t),_(Fe.$$.fragment,t),_(Le.$$.fragment,t),_(qe.$$.fragment,t),_(tt.$$.fragment,t),_(at.$$.fragment,t),_(st.$$.fragment,t),_(it.$$.fragment,t),_(pt.$$.fragment,t),_(ct.$$.fragment,t),_(ht.$$.fragment,t),_(ft.$$.fragment,t),Wa=!1},d(t){o(G),t&&o(ea),t&&o(B),g(ve),t&&o(ta),t&&o(C),g(_e),t&&o(oa),t&&o(M),t&&o(aa),t&&o(ut),t&&o(la),t&&o(E),t&&o(na),t&&o(vt),t&&o(sa),t&&o(_t),t&&o(ra),t&&o(yt),t&&o(ia),t&&o(bt),t&&o(pa),t&&o(wt),t&&o(da),t&&o(U),t&&o(ca),t&&o(P),g(Me),t&&o(ha),t&&o(K),t&&o(fa),t&&o(X),g(Ee),t&&o(ma),t&&o(S),g(Ue),t&&o(ua),t&&o(Mt),t&&o(va),g(ke,t),t&&o(_a),t&&o(Zt),t&&o(ga),t&&o(k),t&&o(ya),t&&o(D),g(We),t&&o(ba),t&&o(Et),g(Ge),t&&o(wa),t&&o(z),g(Be),g(Re),t&&o(Ta),t&&o(Y),g(Xe),t&&o(Ja),t&&o(ne),t&&o(Ma),t&&o(F),g(De),t&&o(Za),t&&o(re),t&&o(xa),t&&o(I),g(Qe),g(Fe),g(Le),t&&o(Ea),t&&o(A),g(qe),t&&o(Ua),t&&o(y),t&&o(ka),t&&o(j),g(tt),g(at),g(st),t&&o(Ia),t&&o(pe),t&&o(ja),t&&o(H),g(it),t&&o(Va),t&&o(b),g(pt),g(ct),g(ht),g(ft)}}}const up={local:"zeroshot-texttovideo-generation",sections:[{local:"overview",title:"Overview"},{local:"available-pipelines",title:"Available Pipelines:"},{local:"usage-example",sections:[{local:"texttovideo",title:"Text-To-Video"},{local:"texttovideo-with-pose-control",title:"Text-To-Video with Pose Control"},{local:"texttovideo-with-edge-control",title:"Text-To-Video with Edge Control"},{local:"video-instructpix2pix",title:"Video Instruct-Pix2Pix"},{local:"dreambooth-specialization",title:"DreamBooth specialization "}],title:"Usage example"},{local:"diffusers.TextToVideoZeroPipeline",title:"TextToVideoZeroPipeline"}],title:"Zero-Shot Text-to-Video Generation "};function vp(ir){return fp(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wp extends rp{constructor(G){super();ip(this,G,vp,mp,pp,{})}}export{wp as default,up as metadata};
