import{s as ge,o as he,n as ve}from"../chunks/scheduler.182ea377.js";import{S as be,i as _e,g as l,s as o,r as M,A as $e,h as f,f as i,c as a,j as te,u as I,x as h,k as ie,y as H,a as n,v as k,d as A,t as E,w as z}from"../chunks/index.abf12888.js";import{T as Pe}from"../chunks/Tip.230e2334.js";import{D as ce}from"../chunks/Docstring.93f6f462.js";import{H as ne}from"../chunks/Heading.16916d63.js";function we(U){let s,P='To learn how to use Stable Video Diffusion, take a look at the <a href="../../../using-diffusers/svd">Stable Video Diffusion</a> guide.',m,v,d,u,c='Check out the <a href="https://huggingface.co/stabilityai" rel="nofollow">Stability AI</a> Hub organization for the <a href="https://huggingface.co/stabilityai/stable-video-diffusion-img2vid" rel="nofollow">base</a> and <a href="https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt" rel="nofollow">extended frame</a> checkpoints!';return{c(){s=l("p"),s.innerHTML=P,m=o(),v=l("br"),d=o(),u=l("p"),u.innerHTML=c},l(r){s=f(r,"P",{"data-svelte-h":!0}),h(s)!=="svelte-142ytm0"&&(s.innerHTML=P),m=a(r),v=f(r,"BR",{}),d=a(r),u=f(r,"P",{"data-svelte-h":!0}),h(u)!=="svelte-1we98lt"&&(u.innerHTML=c)},m(r,g){n(r,s,g),n(r,m,g),n(r,v,g),n(r,d,g),n(r,u,g)},p:ve,d(r){r&&(i(s),i(m),i(v),i(d),i(u))}}}function De(U){let s,P,m,v,d,u,c,r='Stable Video Diffusion was proposed in <a href="https://hf.co/papers/2311.15127" rel="nofollow">Stable Video Diffusion: Scaling Latent Video Diffusion Models to Large Datasets</a> by Andreas Blattmann, Tim Dockhorn, Sumith Kulal, Daniel Mendelevitch, Maciej Kilian, Dominik Lorenz, Yam Levi, Zion English, Vikram Voleti, Adam Letts, Varun Jampani, Robin Rombach.',g,w,re="The abstract from the paper is:",W,D,le="<em>We present Stable Video Diffusion - a latent video diffusion model for high-resolution, state-of-the-art text-to-video and image-to-video generation. Recently, latent diffusion models trained for 2D image synthesis have been turned into generative video models by inserting temporal layers and finetuning them on small, high-quality video datasets. However, training methods in the literature vary widely, and the field has yet to agree on a unified strategy for curating video data. In this paper, we identify and evaluate three different stages for successful training of video LDMs: text-to-image pretraining, video pretraining, and high-quality video finetuning. Furthermore, we demonstrate the necessity of a well-curated pretraining dataset for generating high-quality videos and present a systematic curation process to train a strong base model, including captioning and filtering strategies. We then explore the impact of finetuning our base model on high-quality data and train a text-to-video model that is competitive with closed-source video generation. We also show that our base model provides a powerful motion representation for downstream tasks such as image-to-video generation and adaptability to camera motion-specific LoRA modules. Finally, we demonstrate that our model provides a strong multi-view 3D-prior and can serve as a base to finetune a multi-view diffusion model that jointly generates multiple views of objects in a feedforward fashion, outperforming image-based methods at a fraction of their compute budget. We release code and model weights at this https URL.</em>",K,$,q,y,N,x,fe="Video generation is memory-intensive and one way to reduce your memory usage is to set <code>enable_forward_chunking</code> on the pipeline’s UNet so you don’t run the entire feedforward layer at once. Breaking it up into chunks in a loop is more efficient.",F,L,de='Check out the <a href="text-img2vid">Text or image-to-video</a> guide for more details about how certain parameters can affect video generation and how to optimize inference by reducing memory usage.',J,V,Y,p,S,oe,j,ue="Pipeline to generate video from an input image using Stable Video Diffusion.",ae,O,pe=`This model inherits from <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`,Z,T,G,b,C,se,B,me="Output class for zero-shot text-to-video pipeline.",Q,R,X;return d=new ne({props:{title:"Stable Video Diffusion",local:"stable-video-diffusion",headingTag:"h1"}}),$=new Pe({props:{$$slots:{default:[we]},$$scope:{ctx:U}}}),y=new ne({props:{title:"Tips",local:"tips",headingTag:"h2"}}),V=new ne({props:{title:"StableVideoDiffusionPipeline",local:"diffusers.StableVideoDiffusionPipeline",headingTag:"h2"}}),S=new ce({props:{name:"class diffusers.StableVideoDiffusionPipeline",anchor:"diffusers.StableVideoDiffusionPipeline",parameters:[{name:"vae",val:": AutoencoderKLTemporalDecoder"},{name:"image_encoder",val:": CLIPVisionModelWithProjection"},{name:"unet",val:": UNetSpatioTemporalConditionModel"},{name:"scheduler",val:": EulerDiscreteScheduler"},{name:"feature_extractor",val:": CLIPImageProcessor"}],parametersDescription:[{anchor:"diffusers.StableVideoDiffusionPipeline.vae",description:`<strong>vae</strong> (<code>AutoencoderKLTemporalDecoder</code>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableVideoDiffusionPipeline.image_encoder",description:`<strong>image_encoder</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPVisionModelWithProjection" rel="nofollow">CLIPVisionModelWithProjection</a>) &#x2014;
Frozen CLIP image-encoder (<a href="https://huggingface.co/laion/CLIP-ViT-H-14-laion2B-s32B-b79K" rel="nofollow">laion/CLIP-ViT-H-14-laion2B-s32B-b79K</a>).`,name:"image_encoder"},{anchor:"diffusers.StableVideoDiffusionPipeline.unet",description:`<strong>unet</strong> (<code>UNetSpatioTemporalConditionModel</code>) &#x2014;
A <code>UNetSpatioTemporalConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableVideoDiffusionPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler">EulerDiscreteScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.StableVideoDiffusionPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_video_diffusion/pipeline_stable_video_diffusion.py#L79"}}),T=new ne({props:{title:"StableVideoDiffusionPipelineOutput",local:"diffusers.pipelines.stable_video_diffusion.StableVideoDiffusionPipelineOutput",headingTag:"h2"}}),C=new ce({props:{name:"class diffusers.pipelines.stable_video_diffusion.StableVideoDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_video_diffusion.StableVideoDiffusionPipelineOutput",parameters:[{name:"frames",val:": Union"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_video_diffusion.StableVideoDiffusionPipelineOutput.frames",description:`<strong>frames</strong> (<code>[List[PIL.Image.Image]</code>, <code>np.ndarray</code>]) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or NumPy array of shape <code>(batch_size, height, width, num_channels)</code>.`,name:"frames"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_video_diffusion/pipeline_stable_video_diffusion.py#L65"}}),{c(){s=l("meta"),P=o(),m=l("p"),v=o(),M(d.$$.fragment),u=o(),c=l("p"),c.innerHTML=r,g=o(),w=l("p"),w.textContent=re,W=o(),D=l("p"),D.innerHTML=le,K=o(),M($.$$.fragment),q=o(),M(y.$$.fragment),N=o(),x=l("p"),x.innerHTML=fe,F=o(),L=l("p"),L.innerHTML=de,J=o(),M(V.$$.fragment),Y=o(),p=l("div"),M(S.$$.fragment),oe=o(),j=l("p"),j.textContent=ue,ae=o(),O=l("p"),O.innerHTML=pe,Z=o(),M(T.$$.fragment),G=o(),b=l("div"),M(C.$$.fragment),se=o(),B=l("p"),B.textContent=me,Q=o(),R=l("p"),this.h()},l(e){const t=$e("svelte-u9bgzb",document.head);s=f(t,"META",{name:!0,content:!0}),t.forEach(i),P=a(e),m=f(e,"P",{}),te(m).forEach(i),v=a(e),I(d.$$.fragment,e),u=a(e),c=f(e,"P",{"data-svelte-h":!0}),h(c)!=="svelte-oc62j3"&&(c.innerHTML=r),g=a(e),w=f(e,"P",{"data-svelte-h":!0}),h(w)!=="svelte-1cwsb16"&&(w.textContent=re),W=a(e),D=f(e,"P",{"data-svelte-h":!0}),h(D)!=="svelte-13czz1p"&&(D.innerHTML=le),K=a(e),I($.$$.fragment,e),q=a(e),I(y.$$.fragment,e),N=a(e),x=f(e,"P",{"data-svelte-h":!0}),h(x)!=="svelte-op8wgu"&&(x.innerHTML=fe),F=a(e),L=f(e,"P",{"data-svelte-h":!0}),h(L)!=="svelte-1lb9rti"&&(L.innerHTML=de),J=a(e),I(V.$$.fragment,e),Y=a(e),p=f(e,"DIV",{class:!0});var _=te(p);I(S.$$.fragment,_),oe=a(_),j=f(_,"P",{"data-svelte-h":!0}),h(j)!=="svelte-ilygt8"&&(j.textContent=ue),ae=a(_),O=f(_,"P",{"data-svelte-h":!0}),h(O)!=="svelte-496sm0"&&(O.innerHTML=pe),_.forEach(i),Z=a(e),I(T.$$.fragment,e),G=a(e),b=f(e,"DIV",{class:!0});var ee=te(b);I(C.$$.fragment,ee),se=a(ee),B=f(ee,"P",{"data-svelte-h":!0}),h(B)!=="svelte-1dgz4ei"&&(B.textContent=me),ee.forEach(i),Q=a(e),R=f(e,"P",{}),te(R).forEach(i),this.h()},h(){ie(s,"name","hf:doc:metadata"),ie(s,"content",ye),ie(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ie(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(e,t){H(document.head,s),n(e,P,t),n(e,m,t),n(e,v,t),k(d,e,t),n(e,u,t),n(e,c,t),n(e,g,t),n(e,w,t),n(e,W,t),n(e,D,t),n(e,K,t),k($,e,t),n(e,q,t),k(y,e,t),n(e,N,t),n(e,x,t),n(e,F,t),n(e,L,t),n(e,J,t),k(V,e,t),n(e,Y,t),n(e,p,t),k(S,p,null),H(p,oe),H(p,j),H(p,ae),H(p,O),n(e,Z,t),k(T,e,t),n(e,G,t),n(e,b,t),k(C,b,null),H(b,se),H(b,B),n(e,Q,t),n(e,R,t),X=!0},p(e,[t]){const _={};t&2&&(_.$$scope={dirty:t,ctx:e}),$.$set(_)},i(e){X||(A(d.$$.fragment,e),A($.$$.fragment,e),A(y.$$.fragment,e),A(V.$$.fragment,e),A(S.$$.fragment,e),A(T.$$.fragment,e),A(C.$$.fragment,e),X=!0)},o(e){E(d.$$.fragment,e),E($.$$.fragment,e),E(y.$$.fragment,e),E(V.$$.fragment,e),E(S.$$.fragment,e),E(T.$$.fragment,e),E(C.$$.fragment,e),X=!1},d(e){e&&(i(P),i(m),i(v),i(u),i(c),i(g),i(w),i(W),i(D),i(K),i(q),i(N),i(x),i(F),i(L),i(J),i(Y),i(p),i(Z),i(G),i(b),i(Q),i(R)),i(s),z(d,e),z($,e),z(y,e),z(V,e),z(S),z(T,e),z(C)}}}const ye='{"title":"Stable Video Diffusion","local":"stable-video-diffusion","sections":[{"title":"Tips","local":"tips","sections":[],"depth":2},{"title":"StableVideoDiffusionPipeline","local":"diffusers.StableVideoDiffusionPipeline","sections":[],"depth":2},{"title":"StableVideoDiffusionPipelineOutput","local":"diffusers.pipelines.stable_video_diffusion.StableVideoDiffusionPipelineOutput","sections":[],"depth":2}],"depth":1}';function xe(U){return he(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Me extends be{constructor(s){super(),_e(this,s,xe,De,ge,{})}}export{Me as component};
