Buckets:

rtrm's picture
download
raw
298 kB
import{s as Ir,o as Cr,n as xa}from"../chunks/scheduler.53228c21.js";import{S as Gr,i as Wr,e as a,s as i,c as p,h as Vr,a as l,d as n,b as s,f as T,g as c,j as d,k as y,l as r,m as o,n as m,t as f,o as u,p as g}from"../chunks/index.100fac89.js";import{C as xr}from"../chunks/CopyLLMTxtMenu.e47a4e22.js";import{D as U}from"../chunks/Docstring.5ca3b7d0.js";import{C as Z}from"../chunks/CodeBlock.d30a6509.js";import{E as Va}from"../chunks/ExampleCodeBlock.d89ff92c.js";import{H as b,E as kr}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.441993b1.js";function Br(z){let _,R="Examples:",v,M,w;return M=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTW90aW9uQWRhcHRlciUyQyUyMEFuaW1hdGVEaWZmUGlwZWxpbmUlMkMlMjBERElNU2NoZWR1bGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b19naWYlMEElMEFhZGFwdGVyJTIwJTNEJTIwTW90aW9uQWRhcHRlci5mcm9tX3ByZXRyYWluZWQoJTIyZ3VveXd3JTJGYW5pbWF0ZWRpZmYtbW90aW9uLWFkYXB0ZXItdjEtNS0yJTIyKSUwQXBpcGUlMjAlM0QlMjBBbmltYXRlRGlmZlBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJmcmFua2pvc2h1YSUyRnRvb255b3VfYmV0YTYlMjIlMkMlMjBtb3Rpb25fYWRhcHRlciUzRGFkYXB0ZXIpJTBBcGlwZS5zY2hlZHVsZXIlMjAlM0QlMjBERElNU2NoZWR1bGVyKGJldGFfc2NoZWR1bGUlM0QlMjJsaW5lYXIlMjIlMkMlMjBzdGVwc19vZmZzZXQlM0QxJTJDJTIwY2xpcF9zYW1wbGUlM0RGYWxzZSklMEFvdXRwdXQlMjAlM0QlMjBwaXBlKHByb21wdCUzRCUyMkElMjBjb3JnaSUyMHdhbGtpbmclMjBpbiUyMHRoZSUyMHBhcmslMjIpJTBBZnJhbWVzJTIwJTNEJTIwb3V0cHV0LmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fZ2lmKGZyYW1lcyUyQyUyMCUyMmFuaW1hdGlvbi5naWYlMjIp",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> MotionAdapter, AnimateDiffPipeline, DDIMScheduler
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif
<span class="hljs-meta">&gt;&gt;&gt; </span>adapter = MotionAdapter.from_pretrained(<span class="hljs-string">&quot;guoyww/animatediff-motion-adapter-v1-5-2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = AnimateDiffPipeline.from_pretrained(<span class="hljs-string">&quot;frankjoshua/toonyou_beta6&quot;</span>, motion_adapter=adapter)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.scheduler = DDIMScheduler(beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>, steps_offset=<span class="hljs-number">1</span>, clip_sample=<span class="hljs-literal">False</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>output = pipe(prompt=<span class="hljs-string">&quot;A corgi walking in the park&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>frames = output.frames[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>export_to_gif(frames, <span class="hljs-string">&quot;animation.gif&quot;</span>)`,wrap:!1}}),{c(){_=a("p"),_.textContent=R,v=i(),p(M.$$.fragment)},l(h){_=l(h,"P",{"data-svelte-h":!0}),d(_)!=="svelte-kvfsh7"&&(_.textContent=R),v=s(h),c(M.$$.fragment,h)},m(h,j){o(h,_,j),o(h,v,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Z2lmKHZpZGVvJTJDJTIwJTIyb3V0cHV0LmdpZiUyMik=",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> AnimateDiffSparseControlNetPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.models <span class="hljs-keyword">import</span> AutoencoderKL, MotionAdapter, SparseControlNetModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.schedulers <span class="hljs-keyword">import</span> 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_gif, load_image
<span class="hljs-meta">&gt;&gt;&gt; </span>model_id = <span class="hljs-string">&quot;SG161222/Realistic_Vision_V5.1_noVAE&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>motion_adapter_id = <span class="hljs-string">&quot;guoyww/animatediff-motion-adapter-v1-5-3&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>controlnet_id = <span class="hljs-string">&quot;guoyww/animatediff-sparsectrl-scribble&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>lora_adapter_id = <span class="hljs-string">&quot;guoyww/animatediff-motion-lora-v1-5-3&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>vae_id = <span class="hljs-string">&quot;stabilityai/sd-vae-ft-mse&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>device = <span class="hljs-string">&quot;cuda&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>motion_adapter = MotionAdapter.from_pretrained(motion_adapter_id, torch_dtype=torch.float16).to(device)
<span class="hljs-meta">&gt;&gt;&gt; </span>controlnet = SparseControlNetModel.from_pretrained(controlnet_id, torch_dtype=torch.float16).to(device)
<span class="hljs-meta">&gt;&gt;&gt; </span>vae = AutoencoderKL.from_pretrained(vae_id, torch_dtype=torch.float16).to(device)
<span class="hljs-meta">&gt;&gt;&gt; </span>scheduler = DPMSolverMultistepScheduler.from_pretrained(
<span class="hljs-meta">... </span> model_id,
<span class="hljs-meta">... </span> subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>,
<span class="hljs-meta">... </span> beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>,
<span class="hljs-meta">... </span> algorithm_type=<span class="hljs-string">&quot;dpmsolver++&quot;</span>,
<span class="hljs-meta">... </span> use_karras_sigmas=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = AnimateDiffSparseControlNetPipeline.from_pretrained(
<span class="hljs-meta">... </span> model_id,
<span class="hljs-meta">... </span> motion_adapter=motion_adapter,
<span class="hljs-meta">... </span> controlnet=controlnet,
<span class="hljs-meta">... </span> vae=vae,
<span class="hljs-meta">... </span> scheduler=scheduler,
<span class="hljs-meta">... </span> torch_dtype=torch.float16,
<span class="hljs-meta">... </span>).to(device)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.load_lora_weights(lora_adapter_id, adapter_name=<span class="hljs-string">&quot;motion_lora&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.fuse_lora(lora_scale=<span class="hljs-number">1.0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;an aerial view of a cyberpunk city, night time, neon lights, masterpiece, high quality&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>negative_prompt = <span class="hljs-string">&quot;low quality, worst quality, letterboxed&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_files = [
<span class="hljs-meta">... </span> <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-scribble-1.png&quot;</span>,
<span class="hljs-meta">... </span> <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-scribble-2.png&quot;</span>,
<span class="hljs-meta">... </span> <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-scribble-3.png&quot;</span>,
<span class="hljs-meta">... </span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>condition_frame_indices = [<span class="hljs-number">0</span>, <span class="hljs-number">8</span>, <span class="hljs-number">15</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>conditioning_frames = [load_image(img_file) <span class="hljs-keyword">for</span> img_file <span class="hljs-keyword">in</span> image_files]
<span class="hljs-meta">&gt;&gt;&gt; </span>video = pipe(
<span class="hljs-meta">... </span> prompt=prompt,
<span class="hljs-meta">... </span> negative_prompt=negative_prompt,
<span class="hljs-meta">... </span> num_inference_steps=<span class="hljs-number">25</span>,
<span class="hljs-meta">... </span> conditioning_frames=conditioning_frames,
<span class="hljs-meta">... </span> controlnet_conditioning_scale=<span class="hljs-number">1.0</span>,
<span class="hljs-meta">... </span> controlnet_frame_indices=condition_frame_indices,
<span class="hljs-meta">... </span> generator=torch.Generator().manual_seed(<span class="hljs-number">1337</span>),
<span class="hljs-meta">... </span>).frames[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>export_to_gif(video, <span class="hljs-string">&quot;output.gif&quot;</span>)`,wrap:!1}}),{c(){_=a("p"),_.textContent=R,v=i(),p(M.$$.fragment)},l(h){_=l(h,"P",{"data-svelte-h":!0}),d(_)!=="svelte-kvfsh7"&&(_.textContent=R),v=s(h),c(M.$$.fragment,h)},m(h,j){o(h,_,j),o(h,v,j),m(M,h,j),w=!0},p:xa,i(h){w||(f(M.$$.fragment,h),w=!0)},o(h){u(M.$$.fragment,h),w=!1},d(h){h&&(n(_),n(v)),g(M,h)}}}function Ar(z){let _,R="Examples:",v,M,w;return M=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzLm1vZGVscyUyMGltcG9ydCUyME1vdGlv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UyMHNjaGVkdWxlciUzRHNjaGVkdWxlciUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUwQSUyMCUyMCUyMCUyMHZhcmlhbnQlM0QlMjJmcDE2JTIyJTJDJTBBKS50byglMjJjdWRhJTIyKSUwQSUwQSUyMyUyMGVuYWJsZSUyMG1lbW9yeSUyMHNhdmluZ3MlMEFwaXBlLmVuYWJsZV92YWVfc2xpY2luZygpJTBBcGlwZS5lbmFibGVfdmFlX3RpbGluZygpJTBBJTBBb3V0cHV0JTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0QlMjJhJTIwcGFuZGElMjBzdXJmaW5nJTIwaW4lMjB0aGUlMjBvY2VhbiUyQyUyMHJlYWxpc3RpYyUyQyUyMGhpZ2glMjBxdWFsaXR5JTIyJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfcHJvbXB0JTNEJTIybG93JTIwcXVhbGl0eSUyQyUyMHdvcnN0JTIwcXVhbGl0eSUyMiUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QyMCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEOCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNEMTAyNCUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDEwMjQlMkMlMEElMjAlMjAlMjAlMjBudW1fZnJhbWVzJTNEMTYlMkMlMEEpJTBBJTBBZnJhbWVzJTIwJTNEJTIwb3V0cHV0LmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fZ2lmKGZyYW1lcyUyQyUyMCUyMmFuaW1hdGlvbi5naWYlMjIp",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.models <span class="hljs-keyword">import</span> MotionAdapter
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AnimateDiffSDXLPipeline, DDIMScheduler
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif
<span class="hljs-meta">&gt;&gt;&gt; </span>adapter = MotionAdapter.from_pretrained(
<span class="hljs-meta">... </span> <span class="hljs-string">&quot;a-r-r-o-w/animatediff-motion-adapter-sdxl-beta&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model_id = <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>scheduler = DDIMScheduler.from_pretrained(
<span class="hljs-meta">... </span> model_id,
<span class="hljs-meta">... </span> subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>,
<span class="hljs-meta">... </span> clip_sample=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span> timestep_spacing=<span class="hljs-string">&quot;linspace&quot;</span>,
<span class="hljs-meta">... </span> beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>,
<span class="hljs-meta">... </span> steps_offset=<span class="hljs-number">1</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = AnimateDiffSDXLPipeline.from_pretrained(
<span class="hljs-meta">... </span> model_id,
<span class="hljs-meta">... </span> motion_adapter=adapter,
<span class="hljs-meta">... </span> scheduler=scheduler,
<span class="hljs-meta">... </span> torch_dtype=torch.float16,
<span class="hljs-meta">... </span> variant=<span class="hljs-string">&quot;fp16&quot;</span>,
<span class="hljs-meta">... </span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># enable memory savings</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_vae_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_vae_tiling()
<span class="hljs-meta">&gt;&gt;&gt; </span>output = pipe(
<span class="hljs-meta">... </span> prompt=<span class="hljs-string">&quot;a panda surfing in the ocean, realistic, high quality&quot;</span>,
<span class="hljs-meta">... </span> negative_prompt=<span class="hljs-string">&quot;low quality, worst quality&quot;</span>,
<span class="hljs-meta">... </span> num_inference_steps=<span class="hljs-number">20</span>,
<span class="hljs-meta">... </span> guidance_scale=<span class="hljs-number">8</span>,
<span class="hljs-meta">... </span> width=<span class="hljs-number">1024</span>,
<span class="hljs-meta">... </span> height=<span class="hljs-number">1024</span>,
<span class="hljs-meta">... </span> num_frames=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>frames = output.frames[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>export_to_gif(frames, <span class="hljs-string">&quot;animation.gif&quot;</span>)`,wrap:!1}}),{c(){_=a("p"),_.textContent=R,v=i(),p(M.$$.fragment)},l(h){_=l(h,"P",{"data-svelte-h":!0}),d(_)!=="svelte-kvfsh7"&&(_.textContent=R),v=s(h),c(M.$$.fragment,h)},m(h,j){o(h,_,j),o(h,v,j),m(M,h,j),w=!0},p:xa,i(h){w||(f(M.$$.fragment,h),w=!0)},o(h){u(M.$$.fragment,h),w=!1},d(h){h&&(n(_),n(v)),g(M,h)}}}function Dr(z){let _,R,v,M,w,h,j,Mo,H,ka='<img alt="LoRA" src="https://img.shields.io/badge/LoRA-d8b4fe?style=flat"/>',bo,fe,wo,ue,Ba='<a href="https://huggingface.co/papers/2307.04725" rel="nofollow">AnimateDiff: Animate Your Personalized Text-to-Image Diffusion Models without Specific Tuning</a> by Yuwei Guo, Ceyuan Yang, Anyi Rao, Yaohui Wang, Yu Qiao, Dahua Lin, Bo Dai.',To,ge,Na="The abstract of the paper is the following:",Jo,he,Aa='<em>With the advance of text-to-image models (e.g., Stable Diffusion) and corresponding personalization techniques such as DreamBooth and LoRA, everyone can manifest their imagination into high-quality images at an affordable cost. Subsequently, there is a great demand for image animation techniques to further combine generated static images with motion dynamics. In this report, we propose a practical framework to animate most of the existing personalized text-to-image models once and for all, saving efforts in model-specific tuning. At the core of the proposed framework is to insert a newly initialized motion modeling module into the frozen text-to-image model and train it on video clips to distill reasonable motion priors. Once trained, by simply injecting this motion modeling module, all personalized versions derived from the same base T2I readily become text-driven models that produce diverse and personalized animated images. We conduct our evaluation on several public representative personalized text-to-image models across anime pictures and realistic photographs, and demonstrate that our proposed framework helps these models generate temporally smooth animation clips while preserving the domain and diversity of their outputs. Code and pre-trained weights will be publicly available at <a href="https://animatediff.github.io/" rel="nofollow">this https URL</a>.</em>',vo,_e,Uo,ye,Da='<thead><tr><th>Pipeline</th> <th>Tasks</th> <th align="center">Demo</th></tr></thead> <tbody><tr><td><a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/animatediff/pipeline_animatediff.py" rel="nofollow">AnimateDiffPipeline</a></td> <td><em>Text-to-Video Generation with AnimateDiff</em></td> <td align="center"></td></tr> <tr><td><a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/animatediff/pipeline_animatediff_controlnet.py" rel="nofollow">AnimateDiffControlNetPipeline</a></td> <td><em>Controlled Video-to-Video Generation with AnimateDiff using ControlNet</em></td> <td align="center"></td></tr> <tr><td><a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/animatediff/pipeline_animatediff_sparsectrl.py" rel="nofollow">AnimateDiffSparseControlNetPipeline</a></td> <td><em>Controlled Video-to-Video Generation with AnimateDiff using SparseCtrl</em></td> <td align="center"></td></tr> <tr><td><a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/animatediff/pipeline_animatediff_sdxl.py" rel="nofollow">AnimateDiffSDXLPipeline</a></td> <td><em>Video-to-Video Generation with AnimateDiff</em></td> <td align="center"></td></tr> <tr><td><a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video.py" rel="nofollow">AnimateDiffVideoToVideoPipeline</a></td> <td><em>Video-to-Video Generation with AnimateDiff</em></td> <td align="center"></td></tr> <tr><td><a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video_controlnet.py" rel="nofollow">AnimateDiffVideoToVideoControlNetPipeline</a></td> <td><em>Video-to-Video Generation with AnimateDiff using ControlNet</em></td> <td align="center"></td></tr></tbody>',Zo,Me,jo,be,Ra='Motion Adapter checkpoints can be found under <a href="https://huggingface.co/guoyww/" rel="nofollow">guoyww</a>. These checkpoints are meant to work with any model based on Stable Diffusion 1.4/1.5.',Io,we,Co,Te,Go,Je,Xa="AnimateDiff works with a MotionAdapter checkpoint and a Stable Diffusion model checkpoint. The MotionAdapter is a collection of Motion Modules that are responsible for adding coherent motion across image frames. These modules are applied after the Resnet and Attention blocks in Stable Diffusion UNet.",Wo,ve,Sa="The following example demonstrates how to use a <em>MotionAdapter</em> checkpoint with Diffusers for inference based on StableDiffusion-1.4/1.5.",Vo,Ue,xo,Ze,La="Here are some sample outputs:",ko,je,Ya=`<tbody><tr><td><center>masterpiece, bestquality, sunset.
<br/> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-realistic-doc.gif" alt="masterpiece, bestquality, sunset" style="width: 300px;"/></center></td></tr></tbody>`,Bo,$,Ea="<p>AnimateDiff tends to work better with finetuned Stable Diffusion models. If you plan on using a scheduler that can clip samples, make sure to disable it by setting <code>clip_sample=False</code> in the scheduler as this can also have an adverse effect on generated samples. Additionally, the AnimateDiff checkpoints can be sensitive to the beta schedule of the scheduler. We recommend setting this to <code>linear</code>.</p>",No,Ie,Ao,Ce,Qa='AnimateDiff can also be used with ControlNets ControlNet was introduced in <a href="https://huggingface.co/papers/2302.05543" rel="nofollow">Adding Conditional Control to Text-to-Image Diffusion Models</a> by Lvmin Zhang, Anyi Rao, and Maneesh Agrawala. With a ControlNet model, you can provide an additional control image to condition and control Stable Diffusion generation. For example, if you provide depth maps, the ControlNet model generates a video that’ll preserve the spatial information from the depth maps. It is a more flexible and accurate way to control the video generation process.',Do,Ge,Ro,We,Pa="Here are some sample outputs:",Xo,q,Fa=`<tbody><tr><th align="center">Source Video</th> <th align="center">Output Video</th></tr> <tr><td align="center">raccoon playing a guitar
<br/> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-1.gif" alt="racoon playing a guitar"/></td> <td align="center">a panda, playing a guitar, sitting in a pink boat, in the ocean, mountains in background, realistic, high quality
<br/> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-controlnet-output.gif" alt="a panda, playing a guitar, sitting in a pink boat, in the ocean, mountains in background, realistic, high quality"/></td></tr></tbody>`,So,Ve,Lo,xe,za='<a href="https://huggingface.co/papers/2311.16933" rel="nofollow">SparseCtrl: Adding Sparse Controls to Text-to-Video Diffusion Models</a> for achieving controlled generation in text-to-video diffusion models by Yuwei Guo, Ceyuan Yang, Anyi Rao, Maneesh Agrawala, Dahua Lin, and Bo Dai.',Yo,ke,Ha="The abstract from the paper is:",Eo,Be,$a='<em>The development of text-to-video (T2V), i.e., generating videos with a given text prompt, has been significantly advanced in recent years. However, relying solely on text prompts often results in ambiguous frame composition due to spatial uncertainty. The research community thus leverages the dense structure signals, e.g., per-frame depth/edge sequences, to enhance controllability, whose collection accordingly increases the burden of inference. In this work, we present SparseCtrl to enable flexible structure control with temporally sparse signals, requiring only one or a few inputs, as shown in Figure 1. It incorporates an additional condition encoder to process these sparse signals while leaving the pre-trained T2V model untouched. The proposed approach is compatible with various modalities, including sketches, depth maps, and RGB images, providing more practical control for video generation and promoting applications such as storyboarding, depth rendering, keyframe animation, and interpolation. Extensive experiments demonstrate the generalization of SparseCtrl on both original and personalized T2V generators. Codes and models will be publicly available at <a href="https://guoyww.github.io/projects/SparseCtrl" rel="nofollow">this https URL</a>.</em>',Qo,Ne,qa="SparseCtrl introduces the following checkpoints for controlled text-to-video generation:",Po,Ae,Oa='<li><a href="https://huggingface.co/guoyww/animatediff-sparsectrl-scribble" rel="nofollow">SparseCtrl Scribble</a></li> <li><a href="https://huggingface.co/guoyww/animatediff-sparsectrl-rgb" rel="nofollow">SparseCtrl RGB</a></li>',Fo,De,zo,Re,Ho,Xe,Ka="Here are some sample outputs:",$o,Se,el="<b>an aerial view of a cyberpunk city, night time, neon lights, masterpiece, high quality</b> ",O,tl='<tbody><tr></tr> <tr><td><center><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-scribble-1.png" alt="scribble-1"/></center></td> <td><center><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-scribble-2.png" alt="scribble-2"/></center></td> <td><center><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-scribble-3.png" alt="scribble-3"/></center></td></tr> <tr><td colspan="3"><center><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-sparsectrl-scribble-results.gif" alt="an aerial view of a cyberpunk city, night time, neon lights, masterpiece, high quality"/></center></td></tr></tbody>',qo,Le,Oo,Ye,Ko,Ee,nl="Here are some sample outputs:",ei,Qe,ol="<b>closeup face photo of man in black clothes, night city street, bokeh, fireworks in background</b> ",K,il='<tbody><tr></tr> <tr><td><center><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-firework.png" alt="closeup face photo of man in black clothes, night city street, bokeh, fireworks in background"/></center></td> <td><center><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-sparsectrl-rgb-result.gif" alt="closeup face photo of man in black clothes, night city street, bokeh, fireworks in background"/></center></td></tr></tbody>',ti,Pe,ni,Fe,sl="AnimateDiff can also be used with SDXL models. This is currently an experimental feature as only a beta release of the motion adapter checkpoint is available.",oi,ze,ii,He,si,$e,al="AnimateDiff can also be used to generate visually similar videos or enable style/character/background or other edits starting from an initial video, allowing you to seamlessly explore creative possibilities.",ai,qe,li,Oe,ll="Here are some sample outputs:",ri,Ke,rl=`<tbody><tr><th align="center">Source Video</th> <th align="center">Output Video</th></tr> <tr><td align="center">raccoon playing a guitar
<br/> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-1.gif" alt="racoon playing a guitar" style="width: 300px;"/></td> <td align="center">panda playing a guitar
<br/> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-output-1.gif" alt="panda playing a guitar" style="width: 300px;"/></td></tr> <tr><td align="center">closeup of margot robbie, fireworks in the background, high quality
<br/> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-2.gif" alt="closeup of margot robbie, fireworks in the background, high quality" style="width: 300px;"/></td> <td align="center">closeup of tony stark, robert downey jr, fireworks
<br/> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-output-2.gif" alt="closeup of tony stark, robert downey jr, fireworks" style="width: 300px;"/></td></tr></tbody>`,di,et,pi,tt,dl='AnimateDiff can be used together with ControlNets to enhance video-to-video generation by allowing for precise control over the output. ControlNet was introduced in <a href="https://huggingface.co/papers/2302.05543" rel="nofollow">Adding Conditional Control to Text-to-Image Diffusion Models</a> by Lvmin Zhang, Anyi Rao, and Maneesh Agrawala, and allows you to condition Stable Diffusion with an additional control image to ensure that the spatial information is preserved throughout the video.',ci,nt,pl="This pipeline allows you to condition your generation both on the original video and on a sequence of control images.",mi,ot,fi,it,cl="Here are some sample outputs:",ui,ee,ml=`<tbody><tr><th align="center">Source Video</th> <th align="center">Output Video</th></tr> <tr><td align="center">anime girl, dancing
<br/> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/dance.gif" alt="anime girl, dancing"/></td> <td align="center">astronaut in space, dancing
<br/> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff_vid2vid_controlnet.gif" alt="astronaut in space, dancing"/></td></tr></tbody>`,gi,st,fl="<strong>The lights and composition were transferred from the Source Video.</strong>",hi,at,_i,lt,ul="Motion LoRAs are a collection of LoRAs that work with the <code>guoyww/animatediff-motion-adapter-v1-5-2</code> checkpoint. These LoRAs are responsible for adding specific types of motion to the animations.",yi,rt,Mi,dt,gl=`<tbody><tr><td><center>masterpiece, bestquality, sunset.
<br/> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-zoom-out-lora.gif" alt="masterpiece, bestquality, sunset" style="width: 300px;"/></center></td></tr></tbody>`,bi,pt,wi,ct,hl='You can also leverage the <a href="https://github.com/huggingface/peft" rel="nofollow">PEFT</a> backend to combine Motion LoRA’s and create more complex animations.',Ti,mt,_l="First install PEFT with",Ji,ft,vi,ut,yl="Then you can use the following code to combine Motion LoRAs.",Ui,gt,Zi,ht,Ml=`<tbody><tr><td><center>masterpiece, bestquality, sunset.
<br/> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-zoom-out-pan-left-lora.gif" alt="masterpiece, bestquality, sunset" style="width: 300px;"/></center></td></tr></tbody>`,ji,_t,Ii,yt,bl='<a href="https://huggingface.co/papers/2312.07537" rel="nofollow">FreeInit: Bridging Initialization Gap in Video Diffusion Models</a> by Tianxing Wu, Chenyang Si, Yuming Jiang, Ziqi Huang, Ziwei Liu.',Ci,Mt,wl="FreeInit is an effective method that improves temporal consistency and overall quality of videos generated using video-diffusion-models without any addition training. It can be applied to AnimateDiff, ModelScope, VideoCrafter and various other video generation models seamlessly at inference time, and works by iteratively refining the latent-initialization noise. More details can be found it the paper.",Gi,bt,Tl="The following example demonstrates the usage of FreeInit.",Wi,wt,Vi,te,Jl="<p>FreeInit is not really free - the improved quality comes at the cost of extra computation. It requires sampling a few extra times depending on the <code>num_iters</code> parameter that is set when enabling it. Setting the <code>use_fast_sampling</code> parameter to <code>True</code> can improve the overall performance (at the cost of lower quality compared to when <code>use_fast_sampling=False</code> but still better results than vanilla video generation models).</p>",xi,ne,vl='<p>Make sure to check out the Schedulers <a href="../../using-diffusers/schedulers">guide</a> to learn how to explore the tradeoff between scheduler speed and quality, and see the <a href="../../using-diffusers/loading#reuse-a-pipeline">reuse components across pipelines</a> section to learn how to efficiently load the same components into multiple pipelines.</p>',ki,Tt,Ul=`<tbody><tr><th align="center">Without FreeInit enabled</th> <th align="center">With FreeInit enabled</th></tr> <tr><td align="center">panda playing a guitar
<br/> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-no-freeinit.gif" alt="panda playing a guitar" style="width: 300px;"/></td> <td align="center">panda playing a guitar
<br/> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-freeinit.gif" alt="panda playing a guitar" style="width: 300px;"/></td></tr></tbody>`,Bi,Jt,Ni,vt,Zl='<a href="https://animatelcm.github.io/" rel="nofollow">AnimateLCM</a> is a motion module checkpoint and an <a href="https://huggingface.co/docs/diffusers/using-diffusers/inference_with_lcm_lora" rel="nofollow">LCM LoRA</a> that have been created using a consistency learning strategy that decouples the distillation of the image generation priors and the motion generation priors.',Ai,Ut,Di,Zt,jl=`<tbody><tr><td><center>A space rocket, 4K.
<br/> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatelcm-output.gif" alt="A space rocket, 4K" style="width: 300px;"/></center></td></tr></tbody>`,Ri,jt,Il='AnimateLCM is also compatible with existing <a href="https://huggingface.co/collections/dn6/animatediff-motion-loras-654cb8ad732b9e3cf4d3c17e" rel="nofollow">Motion LoRAs</a>.',Xi,It,Si,Ct,Cl=`<tbody><tr><td><center>A space rocket, 4K.
<br/> <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatelcm-motion-lora.gif" alt="A space rocket, 4K" style="width: 300px;"/></center></td></tr></tbody>`,Li,Gt,Yi,Wt,Gl='<a href="https://huggingface.co/papers/2310.15169" rel="nofollow">FreeNoise: Tuning-Free Longer Video Diffusion via Noise Rescheduling</a> by Haonan Qiu, Menghan Xia, Yong Zhang, Yingqing He, Xintao Wang, Ying Shan, Ziwei Liu.',Ei,Vt,Wl="FreeNoise is a sampling mechanism that can generate longer videos with short-video generation models by employing noise-rescheduling, temporal attention over sliding windows, and weighted averaging of latent frames. It also can be used with multiple prompts to allow for interpolated video generations. More details are available in the paper.",Qi,xt,Vl="The currently supported AnimateDiff pipelines that can be used with FreeNoise are:",Pi,kt,xl='<li><a href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.AnimateDiffPipeline">AnimateDiffPipeline</a></li> <li><a href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.AnimateDiffControlNetPipeline">AnimateDiffControlNetPipeline</a></li> <li><a href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.AnimateDiffVideoToVideoPipeline">AnimateDiffVideoToVideoPipeline</a></li> <li><a href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.AnimateDiffVideoToVideoControlNetPipeline">AnimateDiffVideoToVideoControlNetPipeline</a></li>',Fi,Bt,kl="In order to use FreeNoise, a single line needs to be added to the inference code after loading your pipelines.",zi,Nt,Hi,At,Bl="After this, either a single prompt could be used, or multiple prompts can be passed as a dictionary of integer-string pairs. The integer keys of the dictionary correspond to the frame index at which the influence of that prompt would be maximum. Each frame index should map to a single string prompt. The prompts for intermediate frame indices, that are not passed in the dictionary, are created by interpolating between the frame prompts that are passed. By default, simple linear interpolation is used. However, you can customize this behaviour with a callback to the <code>prompt_interpolation_callback</code> parameter when enabling FreeNoise.",$i,Dt,Nl="Full example:",qi,Rt,Oi,Xt,Ki,St,Al="Since FreeNoise processes multiple frames together, there are parts in the modeling where the memory required exceeds that available on normal consumer GPUs. The main memory bottlenecks that we identified are spatial and temporal attention blocks, upsampling and downsampling blocks, resnet blocks and feed-forward layers. Since most of these blocks operate effectively only on the channel/embedding dimension, one can perform chunked inference across the batch dimensions. The batch dimension in AnimateDiff are either spatial (<code>[B x F, H x W, C]</code>) or temporal (<code>B x H x W, F, C</code>) in nature (note that it may seem counter-intuitive, but the batch dimension here are correct, because spatial blocks process across the <code>B x F</code> dimension while the temporal blocks process across the <code>B x H x W</code> dimension). We introduce a <code>SplitInferenceModule</code> that makes it easier to chunk across any dimension and perform inference. This saves a lot of memory but comes at the cost of requiring more time for inference.",es,Lt,ts,Yt,Dl="The call to <code>pipe.enable_free_noise_split_inference</code> method accepts two parameters: <code>spatial_split_size</code> (defaults to <code>256</code>) and <code>temporal_split_size</code> (defaults to <code>16</code>). These can be configured based on how much VRAM you have available. A lower split size results in lower memory usage but slower inference, whereas a larger split size results in faster inference at the cost of more memory.",ns,Et,os,Qt,Rl="<code>diffusers&gt;=0.30.0</code> supports loading the AnimateDiff checkpoints into the <code>MotionAdapter</code> in their original format via <code>from_single_file</code>",is,Pt,ss,Ft,as,I,zt,Is,Jn,Xl="Pipeline for text-to-video generation.",Cs,vn,Sl=`This model inherits from <a href="/docs/diffusers/pr_12652/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.).`,Gs,Un,Ll="The pipeline also inherits the following loading methods:",Ws,Zn,Yl='<li><a href="/docs/diffusers/pr_12652/en/api/loaders/textual_inversion#diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion">load_textual_inversion()</a> for loading textual inversion embeddings</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> for loading LoRA weights</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.save_lora_weights">save_lora_weights()</a> for saving LoRA weights</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/ip_adapter#diffusers.loaders.IPAdapterMixin.load_ip_adapter">load_ip_adapter()</a> for loading IP Adapters</li>',Vs,S,Ht,xs,jn,El="The call function to the pipeline for generation.",ks,oe,Bs,ie,$t,Ns,In,Ql="Encodes the prompt into text encoder hidden states.",ls,qt,rs,C,Ot,As,Cn,Pl="Pipeline for text-to-video generation with ControlNet guidance.",Ds,Gn,Fl=`This model inherits from <a href="/docs/diffusers/pr_12652/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.).`,Rs,Wn,zl="The pipeline also inherits the following loading methods:",Xs,Vn,Hl='<li><a href="/docs/diffusers/pr_12652/en/api/loaders/textual_inversion#diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion">load_textual_inversion()</a> for loading textual inversion embeddings</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> for loading LoRA weights</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.save_lora_weights">save_lora_weights()</a> for saving LoRA weights</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/ip_adapter#diffusers.loaders.IPAdapterMixin.load_ip_adapter">load_ip_adapter()</a> for loading IP Adapters</li>',Ss,L,Kt,Ls,xn,$l="The call function to the pipeline for generation.",Ys,kn,ql="Examples:",Es,se,en,Qs,Bn,Ol="Encodes the prompt into text encoder hidden states.",ds,tn,ps,G,nn,Ps,Nn,Kl=`Pipeline for controlled text-to-video generation using the method described in <a href="https://huggingface.co/papers/2311.16933" rel="nofollow">SparseCtrl: Adding Sparse Controls
to Text-to-Video Diffusion Models</a>.`,Fs,An,er=`This model inherits from <a href="/docs/diffusers/pr_12652/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.).`,zs,Dn,tr="The pipeline also inherits the following loading methods:",Hs,Rn,nr='<li><a href="/docs/diffusers/pr_12652/en/api/loaders/textual_inversion#diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion">load_textual_inversion()</a> for loading textual inversion embeddings</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> for loading LoRA weights</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.save_lora_weights">save_lora_weights()</a> for saving LoRA weights</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/ip_adapter#diffusers.loaders.IPAdapterMixin.load_ip_adapter">load_ip_adapter()</a> for loading IP Adapters</li>',$s,Y,on,qs,Xn,or="The call function to the pipeline for generation.",Os,ae,Ks,le,sn,ea,Sn,ir="Encodes the prompt into text encoder hidden states.",cs,an,ms,J,ln,ta,Ln,sr="Pipeline for text-to-video generation using Stable Diffusion XL.",na,Yn,ar=`This model inherits from <a href="/docs/diffusers/pr_12652/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. 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.)`,oa,En,lr="The pipeline also inherits the following loading methods:",ia,Qn,rr='<li><a href="/docs/diffusers/pr_12652/en/api/loaders/textual_inversion#diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion">load_textual_inversion()</a> for loading textual inversion embeddings</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file">from_single_file()</a> for loading <code>.ckpt</code> files</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/lora#diffusers.loaders.StableDiffusionXLLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> for loading LoRA weights</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/lora#diffusers.loaders.StableDiffusionXLLoraLoaderMixin.save_lora_weights">save_lora_weights()</a> for saving LoRA weights</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/ip_adapter#diffusers.loaders.IPAdapterMixin.load_ip_adapter">load_ip_adapter()</a> for loading IP Adapters</li>',sa,E,rn,aa,Pn,dr="Function invoked when calling the pipeline for generation.",la,re,ra,de,dn,da,Fn,pr="Encodes the prompt into text encoder hidden states.",pa,pe,pn,ca,zn,cr='See <a href="https://github.com/google-research/vdm/blob/dc27b98a554f65cdc654b800da5aa1846545d41b/model_vdm.py#L298" rel="nofollow">https://github.com/google-research/vdm/blob/dc27b98a554f65cdc654b800da5aa1846545d41b/model_vdm.py#L298</a>',fs,cn,us,W,mn,ma,Hn,mr="Pipeline for video-to-video generation.",fa,$n,fr=`This model inherits from <a href="/docs/diffusers/pr_12652/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.).`,ua,qn,ur="The pipeline also inherits the following loading methods:",ga,On,gr='<li><a href="/docs/diffusers/pr_12652/en/api/loaders/textual_inversion#diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion">load_textual_inversion()</a> for loading textual inversion embeddings</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> for loading LoRA weights</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.save_lora_weights">save_lora_weights()</a> for saving LoRA weights</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/ip_adapter#diffusers.loaders.IPAdapterMixin.load_ip_adapter">load_ip_adapter()</a> for loading IP Adapters</li>',ha,Q,fn,_a,Kn,hr="The call function to the pipeline for generation.",ya,eo,_r="Examples:",Ma,ce,un,ba,to,yr="Encodes the prompt into text encoder hidden states.",gs,gn,hs,V,hn,wa,no,Mr="Pipeline for video-to-video generation with ControlNet guidance.",Ta,oo,br=`This model inherits from <a href="/docs/diffusers/pr_12652/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.).`,Ja,io,wr="The pipeline also inherits the following loading methods:",va,so,Tr='<li><a href="/docs/diffusers/pr_12652/en/api/loaders/textual_inversion#diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion">load_textual_inversion()</a> for loading textual inversion embeddings</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> for loading LoRA weights</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.save_lora_weights">save_lora_weights()</a> for saving LoRA weights</li> <li><a href="/docs/diffusers/pr_12652/en/api/loaders/ip_adapter#diffusers.loaders.IPAdapterMixin.load_ip_adapter">load_ip_adapter()</a> for loading IP Adapters</li>',Ua,P,_n,Za,ao,Jr="The call function to the pipeline for generation.",ja,lo,vr="Examples:",Ia,me,yn,Ca,ro,Ur="Encodes the prompt into text encoder hidden states.",_s,Mn,ys,X,bn,Ga,po,Zr="Output class for AnimateDiff pipelines.",Wa,co,jr=`PIL image sequences of length <code>num_frames.</code> It can also be a NumPy array or Torch tensor of shape
<code>(batch_size, num_frames, channels, height, width)</code>`,Ms,wn,bs,yo,ws;return w=new xr({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),j=new b({props:{title:"Text-to-Video Generation with AnimateDiff",local:"text-to-video-generation-with-animatediff",headingTag:"h1"}}),fe=new b({props:{title:"Overview",local:"overview",headingTag:"h2"}}),_e=new b({props:{title:"Available Pipelines",local:"available-pipelines",headingTag:"h2"}}),Me=new b({props:{title:"Available checkpoints",local:"available-checkpoints",headingTag:"h2"}}),we=new b({props:{title:"Usage example",local:"usage-example",headingTag:"h2"}}),Te=new b({props:{title:"AnimateDiffPipeline",local:"animatediffpipeline",headingTag:"h3"}}),Ue=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glME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JzZSUyMHF1YWxpdHklMjIlMkMlMEElMjAlMjAlMjAlMjBudW1fZnJhbWVzJTNEMTYlMkMlMEElMjAlMjAlMjAlMjBndWlkYW5jZV9zY2FsZSUzRDcuNSUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QyNSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRHRvcmNoLkdlbmVyYXRvciglMjJjcHUlMjIpLm1hbnVhbF9zZWVkKDQyKSUyQyUwQSklMEFmcmFtZXMlMjAlM0QlMjBvdXRwdXQuZnJhbWVzJTVCMCU1RCUwQWV4cG9ydF90b19naWYoZnJhbWVzJTJDJTIwJTIyYW5pbWF0aW9uLmdpZiUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AnimateDiffPipeline, DDIMScheduler, MotionAdapter
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif
<span class="hljs-comment"># Load the motion adapter</span>
adapter = MotionAdapter.from_pretrained(<span class="hljs-string">&quot;guoyww/animatediff-motion-adapter-v1-5-2&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-comment"># load SD 1.5 based finetuned model</span>
model_id = <span class="hljs-string">&quot;SG161222/Realistic_Vision_V5.1_noVAE&quot;</span>
pipe = AnimateDiffPipeline.from_pretrained(model_id, motion_adapter=adapter, torch_dtype=torch.float16)
scheduler = DDIMScheduler.from_pretrained(
model_id,
subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>,
clip_sample=<span class="hljs-literal">False</span>,
timestep_spacing=<span class="hljs-string">&quot;linspace&quot;</span>,
beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>,
steps_offset=<span class="hljs-number">1</span>,
)
pipe.scheduler = scheduler
<span class="hljs-comment"># enable memory savings</span>
pipe.enable_vae_slicing()
pipe.enable_model_cpu_offload()
output = pipe(
prompt=(
<span class="hljs-string">&quot;masterpiece, bestquality, highlydetailed, ultradetailed, sunset, &quot;</span>
<span class="hljs-string">&quot;orange sky, warm lighting, fishing boats, ocean waves seagulls, &quot;</span>
<span class="hljs-string">&quot;rippling water, wharf, silhouette, serene atmosphere, dusk, evening glow, &quot;</span>
<span class="hljs-string">&quot;golden hour, coastal landscape, seaside scenery&quot;</span>
),
negative_prompt=<span class="hljs-string">&quot;bad quality, worse quality&quot;</span>,
num_frames=<span class="hljs-number">16</span>,
guidance_scale=<span class="hljs-number">7.5</span>,
num_inference_steps=<span class="hljs-number">25</span>,
generator=torch.Generator(<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">42</span>),
)
frames = output.frames[<span class="hljs-number">0</span>]
export_to_gif(frames, <span class="hljs-string">&quot;animation.gif&quot;</span>)`,wrap:!1}}),Ie=new b({props:{title:"AnimateDiffControlNetPipeline",local:"animatediffcontrolnetpipeline",headingTag:"h3"}}),Ge=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQW5pbWF0ZURpZmZDb250cm9sTmV0UGlwZWxpbmUlMkMlMjBBdXRvZW5jb2RlcktMJTJDJTIwQ29udHJvbE5ldE1vZGVsJTJDJTIwTW90aW9uQWRhcHRlciUyQyUyMExDTVNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBleHBvcnRfdG9fZ2lmJTJDJTIwbG9hZF92aWRlbyUwQSUwQSUyMyUyMEFkZGl0aW9uYWxseSUyQyUyMHlvdSUyMHdpbGwlMjBuZWVkJTIwYSUyMHByZXByb2Nlc3MlMjB2aWRlb3MlMjBiZWZvcmUlMjB0aGV5JTIwY2FuJTIwYmUlMjB1c2VkJTIwd2l0aCUyMHRoZSUyMENvbnRyb2xOZXQlMEElMjMlMjBIRiUyMG1haW50YWlucyUyMGp1c3QlMjB0aGUlMjByaWdodCUyMHBhY2thZ2UlMjBmb3IlMjBpdCUzQ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Gl0eSUyQyUyMHdvcnN0JTIwcXVhbGl0eSUyMiUwQSUwQXZpZGVvJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0Rwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9wcm9tcHQlM0RuZWdhdGl2ZV9wcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBudW1fZnJhbWVzJTNEbGVuKHZpZGVvKSUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QxMCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEMi4wJTJDJTBBJTIwJTIwJTIwJTIwY29uZGl0aW9uaW5nX2ZyYW1lcyUzRGNvbmRpdGlvbmluZ19mcmFtZXMlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0R0b3JjaC5HZW5lcmF0b3IoKS5tYW51YWxfc2VlZCg0MiklMkMlMEEpLmZyYW1lcyU1QjAlNUQlMEElMEFleHBvcnRfdG9fZ2lmKHZpZGVvJTJDJTIwJTIyYW5pbWF0ZWRpZmZfY29udHJvbG5ldC5naWYlMjIlMkMlMjBmcHMlM0Q4KQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AnimateDiffControlNetPipeline, AutoencoderKL, ControlNetModel, MotionAdapter, LCMScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif, load_video
<span class="hljs-comment"># Additionally, you will need a preprocess videos before they can be used with the ControlNet</span>
<span class="hljs-comment"># HF maintains just the right package for it: \`pip install controlnet_aux\`</span>
<span class="hljs-keyword">from</span> controlnet_aux.processor <span class="hljs-keyword">import</span> ZoeDetector
<span class="hljs-comment"># Download controlnets from https://huggingface.co/lllyasviel/ControlNet-v1-1 to use .from_single_file</span>
<span class="hljs-comment"># Download Diffusers-format controlnets, such as https://huggingface.co/lllyasviel/sd-controlnet-depth, to use .from_pretrained()</span>
controlnet = ControlNetModel.from_single_file(<span class="hljs-string">&quot;control_v11f1p_sd15_depth.pth&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-comment"># We use AnimateLCM for this example but one can use the original motion adapters as well (for example, https://huggingface.co/guoyww/animatediff-motion-adapter-v1-5-3)</span>
motion_adapter = MotionAdapter.from_pretrained(<span class="hljs-string">&quot;wangfuyun/AnimateLCM&quot;</span>)
vae = AutoencoderKL.from_pretrained(<span class="hljs-string">&quot;stabilityai/sd-vae-ft-mse&quot;</span>, torch_dtype=torch.float16)
pipe: AnimateDiffControlNetPipeline = AnimateDiffControlNetPipeline.from_pretrained(
<span class="hljs-string">&quot;SG161222/Realistic_Vision_V5.1_noVAE&quot;</span>,
motion_adapter=motion_adapter,
controlnet=controlnet,
vae=vae,
).to(device=<span class="hljs-string">&quot;cuda&quot;</span>, dtype=torch.float16)
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config, beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>)
pipe.load_lora_weights(<span class="hljs-string">&quot;wangfuyun/AnimateLCM&quot;</span>, weight_name=<span class="hljs-string">&quot;AnimateLCM_sd15_t2v_lora.safetensors&quot;</span>, adapter_name=<span class="hljs-string">&quot;lcm-lora&quot;</span>)
pipe.set_adapters([<span class="hljs-string">&quot;lcm-lora&quot;</span>], [<span class="hljs-number">0.8</span>])
depth_detector = ZoeDetector.from_pretrained(<span class="hljs-string">&quot;lllyasviel/Annotators&quot;</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)
video = load_video(<span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-1.gif&quot;</span>)
conditioning_frames = []
<span class="hljs-keyword">with</span> pipe.progress_bar(total=<span class="hljs-built_in">len</span>(video)) <span class="hljs-keyword">as</span> progress_bar:
<span class="hljs-keyword">for</span> frame <span class="hljs-keyword">in</span> video:
conditioning_frames.append(depth_detector(frame))
progress_bar.update()
prompt = <span class="hljs-string">&quot;a panda, playing a guitar, sitting in a pink boat, in the ocean, mountains in background, realistic, high quality&quot;</span>
negative_prompt = <span class="hljs-string">&quot;bad quality, worst quality&quot;</span>
video = pipe(
prompt=prompt,
negative_prompt=negative_prompt,
num_frames=<span class="hljs-built_in">len</span>(video),
num_inference_steps=<span class="hljs-number">10</span>,
guidance_scale=<span class="hljs-number">2.0</span>,
conditioning_frames=conditioning_frames,
generator=torch.Generator().manual_seed(<span class="hljs-number">42</span>),
).frames[<span class="hljs-number">0</span>]
export_to_gif(video, <span class="hljs-string">&quot;animatediff_controlnet.gif&quot;</span>, fps=<span class="hljs-number">8</span>)`,wrap:!1}}),Ve=new b({props:{title:"AnimateDiffSparseControlNetPipeline",local:"animatediffsparsecontrolnetpipeline",headingTag:"h3"}}),De=new b({props:{title:"Using SparseCtrl Scribble",local:"using-sparsectrl-scribble",headingTag:"h4"}}),Re=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQW5pbWF0ZURpZmZTcGFyc2VDb250cm9sTmV0UGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLm1vZGVscyUyMGltcG9ydCUyMEF1dG9lbmNvZGVyS0wlMkMlMjBNb3Rpb25BZGFwdGVyJTJDJTIwU3BhcnNlQ29udHJvbE5ldE1vZGVsJTBBZnJvbSUyMGRpZmZ1c2Vycy5zY2hlZHVsZXJzJTIwaW1wb3J0JTIwRFBNU29sdmVyTXVsdGlzdGVwU2NoZWR1bGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b19naWYlMkMlMjBsb2FkX2ltYWdlJTBBJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJTRzE2MTIyMiUyRlJlYWxpc3RpY19WaXNpb25fVjUuMV9ub1ZBRSUyMiUwQW1vdGlvbl9hZGFwdGVyX2lkJTIwJ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I1JTJDJTBBJTIwJTIwJTIwJTIwY29uZGl0aW9uaW5nX2ZyYW1lcyUzRGNvbmRpdGlvbmluZ19mcmFtZXMlMkMlMEElMjAlMjAlMjAlMjBjb250cm9sbmV0X2NvbmRpdGlvbmluZ19zY2FsZSUzRDEuMCUyQyUwQSUyMCUyMCUyMCUyMGNvbnRyb2xuZXRfZnJhbWVfaW5kaWNlcyUzRGNvbmRpdGlvbl9mcmFtZV9pbmRpY2VzJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEdG9yY2guR2VuZXJhdG9yKCkubWFudWFsX3NlZWQoMTMzNyklMkMlMEEpLmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fZ2lmKHZpZGVvJTJDJTIwJTIyb3V0cHV0LmdpZiUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AnimateDiffSparseControlNetPipeline
<span class="hljs-keyword">from</span> diffusers.models <span class="hljs-keyword">import</span> AutoencoderKL, MotionAdapter, SparseControlNetModel
<span class="hljs-keyword">from</span> diffusers.schedulers <span class="hljs-keyword">import</span> DPMSolverMultistepScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif, load_image
model_id = <span class="hljs-string">&quot;SG161222/Realistic_Vision_V5.1_noVAE&quot;</span>
motion_adapter_id = <span class="hljs-string">&quot;guoyww/animatediff-motion-adapter-v1-5-3&quot;</span>
controlnet_id = <span class="hljs-string">&quot;guoyww/animatediff-sparsectrl-scribble&quot;</span>
lora_adapter_id = <span class="hljs-string">&quot;guoyww/animatediff-motion-lora-v1-5-3&quot;</span>
vae_id = <span class="hljs-string">&quot;stabilityai/sd-vae-ft-mse&quot;</span>
device = <span class="hljs-string">&quot;cuda&quot;</span>
motion_adapter = MotionAdapter.from_pretrained(motion_adapter_id, torch_dtype=torch.float16).to(device)
controlnet = SparseControlNetModel.from_pretrained(controlnet_id, torch_dtype=torch.float16).to(device)
vae = AutoencoderKL.from_pretrained(vae_id, torch_dtype=torch.float16).to(device)
scheduler = DPMSolverMultistepScheduler.from_pretrained(
model_id,
subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>,
beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>,
algorithm_type=<span class="hljs-string">&quot;dpmsolver++&quot;</span>,
use_karras_sigmas=<span class="hljs-literal">True</span>,
)
pipe = AnimateDiffSparseControlNetPipeline.from_pretrained(
model_id,
motion_adapter=motion_adapter,
controlnet=controlnet,
vae=vae,
scheduler=scheduler,
torch_dtype=torch.float16,
).to(device)
pipe.load_lora_weights(lora_adapter_id, adapter_name=<span class="hljs-string">&quot;motion_lora&quot;</span>)
pipe.fuse_lora(lora_scale=<span class="hljs-number">1.0</span>)
prompt = <span class="hljs-string">&quot;an aerial view of a cyberpunk city, night time, neon lights, masterpiece, high quality&quot;</span>
negative_prompt = <span class="hljs-string">&quot;low quality, worst quality, letterboxed&quot;</span>
image_files = [
<span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-scribble-1.png&quot;</span>,
<span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-scribble-2.png&quot;</span>,
<span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-scribble-3.png&quot;</span>
]
condition_frame_indices = [<span class="hljs-number">0</span>, <span class="hljs-number">8</span>, <span class="hljs-number">15</span>]
conditioning_frames = [load_image(img_file) <span class="hljs-keyword">for</span> img_file <span class="hljs-keyword">in</span> image_files]
video = pipe(
prompt=prompt,
negative_prompt=negative_prompt,
num_inference_steps=<span class="hljs-number">25</span>,
conditioning_frames=conditioning_frames,
controlnet_conditioning_scale=<span class="hljs-number">1.0</span>,
controlnet_frame_indices=condition_frame_indices,
generator=torch.Generator().manual_seed(<span class="hljs-number">1337</span>),
).frames[<span class="hljs-number">0</span>]
export_to_gif(video, <span class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m9sbmV0X2NvbmRpdGlvbmluZ19zY2FsZSUzRDEuMCUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRHRvcmNoLkdlbmVyYXRvcigpLm1hbnVhbF9zZWVkKDQyKSUyQyUwQSkuZnJhbWVzJTVCMCU1RCUwQWV4cG9ydF90b19naWYodmlkZW8lMkMlMjAlMjJvdXRwdXQuZ2lmJTIyKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AnimateDiffSparseControlNetPipeline
<span class="hljs-keyword">from</span> diffusers.models <span class="hljs-keyword">import</span> AutoencoderKL, MotionAdapter, SparseControlNetModel
<span class="hljs-keyword">from</span> diffusers.schedulers <span class="hljs-keyword">import</span> DPMSolverMultistepScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif, load_image
model_id = <span class="hljs-string">&quot;SG161222/Realistic_Vision_V5.1_noVAE&quot;</span>
motion_adapter_id = <span class="hljs-string">&quot;guoyww/animatediff-motion-adapter-v1-5-3&quot;</span>
controlnet_id = <span class="hljs-string">&quot;guoyww/animatediff-sparsectrl-rgb&quot;</span>
lora_adapter_id = <span class="hljs-string">&quot;guoyww/animatediff-motion-lora-v1-5-3&quot;</span>
vae_id = <span class="hljs-string">&quot;stabilityai/sd-vae-ft-mse&quot;</span>
device = <span class="hljs-string">&quot;cuda&quot;</span>
motion_adapter = MotionAdapter.from_pretrained(motion_adapter_id, torch_dtype=torch.float16).to(device)
controlnet = SparseControlNetModel.from_pretrained(controlnet_id, torch_dtype=torch.float16).to(device)
vae = AutoencoderKL.from_pretrained(vae_id, torch_dtype=torch.float16).to(device)
scheduler = DPMSolverMultistepScheduler.from_pretrained(
model_id,
subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>,
beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>,
algorithm_type=<span class="hljs-string">&quot;dpmsolver++&quot;</span>,
use_karras_sigmas=<span class="hljs-literal">True</span>,
)
pipe = AnimateDiffSparseControlNetPipeline.from_pretrained(
model_id,
motion_adapter=motion_adapter,
controlnet=controlnet,
vae=vae,
scheduler=scheduler,
torch_dtype=torch.float16,
).to(device)
pipe.load_lora_weights(lora_adapter_id, adapter_name=<span class="hljs-string">&quot;motion_lora&quot;</span>)
image = load_image(<span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-firework.png&quot;</span>)
video = pipe(
prompt=<span class="hljs-string">&quot;closeup face photo of man in black clothes, night city street, bokeh, fireworks in background&quot;</span>,
negative_prompt=<span class="hljs-string">&quot;low quality, worst quality&quot;</span>,
num_inference_steps=<span class="hljs-number">25</span>,
conditioning_frames=image,
controlnet_frame_indices=[<span class="hljs-number">0</span>],
controlnet_conditioning_scale=<span class="hljs-number">1.0</span>,
generator=torch.Generator().manual_seed(<span class="hljs-number">42</span>),
).frames[<span class="hljs-number">0</span>]
export_to_gif(video, <span class="hljs-string">&quot;output.gif&quot;</span>)`,wrap:!1}}),Pe=new b({props:{title:"AnimateDiffSDXLPipeline",local:"animatediffsdxlpipeline",headingTag:"h3"}}),ze=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzLm1vZGVscyUyMGltcG9ydCUyME1vdGlvbkFkYXB0ZXIlMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQW5pbWF0ZURpZmZTRFhMUGlwZWxpbmUlMkMlMjBERElNU2NoZWR1bGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b19naWYlMEElMEFhZGFwdGVyJTIwJTNEJTIwTW90aW9uQWRhcHRlci5mcm9tX3ByZXRyYWluZWQoJTIyZ3VveXd3JTJGYW5pbWF0ZWRpZmYtbW90aW9uLWFkYXB0ZXItc2R4bC1iZXRhJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2K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W5nJTIwaW4lMjB0aGUlMjBvY2VhbiUyQyUyMHJlYWxpc3RpYyUyQyUyMGhpZ2glMjBxdWFsaXR5JTIyJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfcHJvbXB0JTNEJTIybG93JTIwcXVhbGl0eSUyQyUyMHdvcnN0JTIwcXVhbGl0eSUyMiUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QyMCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEOCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNEMTAyNCUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDEwMjQlMkMlMEElMjAlMjAlMjAlMjBudW1fZnJhbWVzJTNEMTYlMkMlMEEpJTBBJTBBZnJhbWVzJTIwJTNEJTIwb3V0cHV0LmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fZ2lmKGZyYW1lcyUyQyUyMCUyMmFuaW1hdGlvbi5naWYlMjIp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers.models <span class="hljs-keyword">import</span> MotionAdapter
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AnimateDiffSDXLPipeline, DDIMScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif
adapter = MotionAdapter.from_pretrained(<span class="hljs-string">&quot;guoyww/animatediff-motion-adapter-sdxl-beta&quot;</span>, torch_dtype=torch.float16)
model_id = <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>
scheduler = DDIMScheduler.from_pretrained(
model_id,
subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>,
clip_sample=<span class="hljs-literal">False</span>,
timestep_spacing=<span class="hljs-string">&quot;linspace&quot;</span>,
beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>,
steps_offset=<span class="hljs-number">1</span>,
)
pipe = AnimateDiffSDXLPipeline.from_pretrained(
model_id,
motion_adapter=adapter,
scheduler=scheduler,
torch_dtype=torch.float16,
variant=<span class="hljs-string">&quot;fp16&quot;</span>,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-comment"># enable memory savings</span>
pipe.enable_vae_slicing()
pipe.enable_vae_tiling()
output = pipe(
prompt=<span class="hljs-string">&quot;a panda surfing in the ocean, realistic, high quality&quot;</span>,
negative_prompt=<span class="hljs-string">&quot;low quality, worst quality&quot;</span>,
num_inference_steps=<span class="hljs-number">20</span>,
guidance_scale=<span class="hljs-number">8</span>,
width=<span class="hljs-number">1024</span>,
height=<span class="hljs-number">1024</span>,
num_frames=<span class="hljs-number">16</span>,
)
frames = output.frames[<span class="hljs-number">0</span>]
export_to_gif(frames, <span class="hljs-string">&quot;animation.gif&quot;</span>)`,wrap:!1}}),He=new b({props:{title:"AnimateDiffVideoToVideoPipeline",local:"animatediffvideotovideopipeline",headingTag:"h3"}}),qe=new Z({props:{code:"aW1wb3J0JTIwaW1hZ2VpbyUwQWltcG9ydCUyMHJlcXVlc3RzJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQW5pbWF0ZURpZmZWaWRlb1RvVmlkZW9QaXBlbGluZSUyQyUyMERESU1TY2hlZHVsZXIlMkMlMjBNb3Rpb25BZGFwdGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b19naWYlMEFmcm9tJTIwaW8lMjBpbXBvcnQlMjBCeXRlc0lPJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBJTBBJTIzJTIwTG9hZCUyMHRoZSUyMG1vdGlvbiUyMGFkYXB0ZXIlMEFhZGFwdGVyJTIwJTNEJTIwTW90aW9uQWRhcHRlci5mcm9tX3ByZXRyYWluZWQoJTIyZ3VveXd3JTJGYW5pbWF0ZWRpZmYtbW90aW9uLWFkYXB0ZXItdjE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span> imageio
<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AnimateDiffVideoToVideoPipeline, DDIMScheduler, MotionAdapter
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif
<span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-comment"># Load the motion adapter</span>
adapter = MotionAdapter.from_pretrained(<span class="hljs-string">&quot;guoyww/animatediff-motion-adapter-v1-5-2&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-comment"># load SD 1.5 based finetuned model</span>
model_id = <span class="hljs-string">&quot;SG161222/Realistic_Vision_V5.1_noVAE&quot;</span>
pipe = AnimateDiffVideoToVideoPipeline.from_pretrained(model_id, motion_adapter=adapter, torch_dtype=torch.float16)
scheduler = DDIMScheduler.from_pretrained(
model_id,
subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>,
clip_sample=<span class="hljs-literal">False</span>,
timestep_spacing=<span class="hljs-string">&quot;linspace&quot;</span>,
beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>,
steps_offset=<span class="hljs-number">1</span>,
)
pipe.scheduler = scheduler
<span class="hljs-comment"># enable memory savings</span>
pipe.enable_vae_slicing()
pipe.enable_model_cpu_offload()
<span class="hljs-comment"># helper function to load videos</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">load_video</span>(<span class="hljs-params">file_path: <span class="hljs-built_in">str</span></span>):
images = []
<span class="hljs-keyword">if</span> file_path.startswith((<span class="hljs-string">&#x27;http://&#x27;</span>, <span class="hljs-string">&#x27;https://&#x27;</span>)):
<span class="hljs-comment"># If the file_path is a URL</span>
response = requests.get(file_path)
response.raise_for_status()
content = BytesIO(response.content)
vid = imageio.get_reader(content)
<span class="hljs-keyword">else</span>:
<span class="hljs-comment"># Assuming it&#x27;s a local file path</span>
vid = imageio.get_reader(file_path)
<span class="hljs-keyword">for</span> frame <span class="hljs-keyword">in</span> vid:
pil_image = Image.fromarray(frame)
images.append(pil_image)
<span class="hljs-keyword">return</span> images
video = load_video(<span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/animatediff-vid2vid-input-1.gif&quot;</span>)
output = pipe(
video = video,
prompt=<span class="hljs-string">&quot;panda playing a guitar, on a boat, in the ocean, high quality&quot;</span>,
negative_prompt=<span class="hljs-string">&quot;bad quality, worse quality&quot;</span>,
guidance_scale=<span class="hljs-number">7.5</span>,
num_inference_steps=<span class="hljs-number">25</span>,
strength=<span class="hljs-number">0.5</span>,
generator=torch.Generator(<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">42</span>),
)
frames = output.frames[<span class="hljs-number">0</span>]
export_to_gif(frames, <span class="hljs-string">&quot;animation.gif&quot;</span>)`,wrap:!1}}),et=new b({props:{title:"AnimateDiffVideoToVideoControlNetPipeline",local:"animatediffvideotovideocontrolnetpipeline",headingTag:"h3"}}),ot=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFmcm9tJTIwdHFkbS5hdXRvJTIwaW1wb3J0JTIwdHFkbSUwQSUwQWZyb20lMjBjb250cm9sbmV0X2F1eC5wcm9jZXNzb3IlMjBpbXBvcnQlMjBPcGVucG9zZURldGVjdG9yJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEFuaW1hdGVEaWZmVmlkZW9Ub1ZpZGVvQ29udHJvbE5ldFBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b19naWYlMkMlMjBsb2FkX3ZpZGVvJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9lbmNvZGVyS0wlMkMlMjBDb250cm9sTmV0TW9kZWwlMkMlMjBNb3Rpb25B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AlMjAlMjAlMjBzdHJlbmd0aCUzRHN0cmVuZ3RoJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEdG9yY2guR2VuZXJhdG9yKCkubWFudWFsX3NlZWQoNDIpJTJDJTBBJTIwJTIwJTIwJTIwKS5mcmFtZXMlNUIwJTVEJTBBJTBBdmlkZW8lMjAlM0QlMjAlNUJmcmFtZS5yZXNpemUoY29uZGl0aW9uaW5nX2ZyYW1lcyU1QjAlNUQuc2l6ZSklMjBmb3IlMjBmcmFtZSUyMGluJTIwdmlkZW8lNUQlMEFleHBvcnRfdG9fZ2lmKHZpZGVvJTJDJTIwZiUyMmFuaW1hdGVkaWZmX3ZpZDJ2aWRfY29udHJvbG5ldC5naWYlMjIlMkMlMjBmcHMlM0Q4KQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">from</span> tqdm.auto <span class="hljs-keyword">import</span> tqdm
<span class="hljs-keyword">from</span> controlnet_aux.processor <span class="hljs-keyword">import</span> OpenposeDetector
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AnimateDiffVideoToVideoControlNetPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif, load_video
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoencoderKL, ControlNetModel, MotionAdapter, LCMScheduler
<span class="hljs-comment"># Load the ControlNet</span>
controlnet = ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-openpose&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-comment"># Load the motion adapter</span>
motion_adapter = MotionAdapter.from_pretrained(<span class="hljs-string">&quot;wangfuyun/AnimateLCM&quot;</span>)
<span class="hljs-comment"># Load SD 1.5 based finetuned model</span>
vae = AutoencoderKL.from_pretrained(<span class="hljs-string">&quot;stabilityai/sd-vae-ft-mse&quot;</span>, torch_dtype=torch.float16)
pipe = AnimateDiffVideoToVideoControlNetPipeline.from_pretrained(
<span class="hljs-string">&quot;SG161222/Realistic_Vision_V5.1_noVAE&quot;</span>,
motion_adapter=motion_adapter,
controlnet=controlnet,
vae=vae,
).to(device=<span class="hljs-string">&quot;cuda&quot;</span>, dtype=torch.float16)
<span class="hljs-comment"># Enable LCM to speed up inference</span>
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config, beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>)
pipe.load_lora_weights(<span class="hljs-string">&quot;wangfuyun/AnimateLCM&quot;</span>, weight_name=<span class="hljs-string">&quot;AnimateLCM_sd15_t2v_lora.safetensors&quot;</span>, adapter_name=<span class="hljs-string">&quot;lcm-lora&quot;</span>)
pipe.set_adapters([<span class="hljs-string">&quot;lcm-lora&quot;</span>], [<span class="hljs-number">0.8</span>])
video = load_video(<span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/dance.gif&quot;</span>)
video = [frame.convert(<span class="hljs-string">&quot;RGB&quot;</span>) <span class="hljs-keyword">for</span> frame <span class="hljs-keyword">in</span> video]
prompt = <span class="hljs-string">&quot;astronaut in space, dancing&quot;</span>
negative_prompt = <span class="hljs-string">&quot;bad quality, worst quality, jpeg artifacts, ugly&quot;</span>
<span class="hljs-comment"># Create controlnet preprocessor</span>
open_pose = OpenposeDetector.from_pretrained(<span class="hljs-string">&quot;lllyasviel/Annotators&quot;</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-comment"># Preprocess controlnet images</span>
conditioning_frames = []
<span class="hljs-keyword">for</span> frame <span class="hljs-keyword">in</span> tqdm(video):
conditioning_frames.append(open_pose(frame))
strength = <span class="hljs-number">0.8</span>
<span class="hljs-keyword">with</span> torch.inference_mode():
video = pipe(
video=video,
prompt=prompt,
negative_prompt=negative_prompt,
num_inference_steps=<span class="hljs-number">10</span>,
guidance_scale=<span class="hljs-number">2.0</span>,
controlnet_conditioning_scale=<span class="hljs-number">0.75</span>,
conditioning_frames=conditioning_frames,
strength=strength,
generator=torch.Generator().manual_seed(<span class="hljs-number">42</span>),
).frames[<span class="hljs-number">0</span>]
video = [frame.resize(conditioning_frames[<span class="hljs-number">0</span>].size) <span class="hljs-keyword">for</span> frame <span class="hljs-keyword">in</span> video]
export_to_gif(video, <span class="hljs-string">f&quot;animatediff_vid2vid_controlnet.gif&quot;</span>, fps=<span class="hljs-number">8</span>)`,wrap:!1}}),at=new b({props:{title:"Using Motion LoRAs",local:"using-motion-loras",headingTag:"h2"}}),rt=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQW5pbWF0ZURpZmZQaXBlbGluZSUyQyUyMERESU1TY2hlZHVsZXIlMkMlMjBNb3Rpb25BZGFwdGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b19naWYlMEElMEElMjMlMjBMb2FkJTIwdGhlJTIwbW90aW9uJTIwYWRhcHRlciUwQWFkYXB0ZXIlMjAlM0QlMjBNb3Rpb25BZGFwdGVyLmZyb21fcHJldHJhaW5lZCglMjJndW95d3clMkZhbmltYXRlZGlmZi1tb3Rpb24tYWRhcHRlci12MS01LTIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBJTIzJTIwbG9hZCUyMFNEJTIwMS41JTIwYmFzZWQlMjBmaW5ldHVuZWQlMjBtb2RlbCUwQW1vZGVsX2lkJTIwJTNEJTIwJTIyU0cxNjEyMjIlMkZSZWFsaXN0aWNfVmlzaW9uX1Y1LjFfbm9WQUUlMjIlMEFwaXBlJTIwJTNEJTIwQW5pbWF0ZURpZmZQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQobW9kZWxfaWQlMkMlMjBtb3Rpb25fYWRhcHRlciUzRGFkYXB0ZXIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvc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dhcm0lMjBsaWdodGluZyUyQyUyMGZpc2hpbmclMjBib2F0cyUyQyUyMG9jZWFuJTIwd2F2ZXMlMjBzZWFndWxscyUyQyUyMCUyMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJpcHBsaW5nJTIwd2F0ZXIlMkMlMjB3aGFyZiUyQyUyMHNpbGhvdWV0dGUlMkMlMjBzZXJlbmUlMjBhdG1vc3BoZXJlJTJDJTIwZHVzayUyQyUyMGV2ZW5pbmclMjBnbG93JTJDJTIwJTIyJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyZ29sZGVuJTIwaG91ciUyQyUyMGNvYXN0YWwlMjBsYW5kc2NhcGUlMkMlMjBzZWFzaWRlJTIwc2NlbmVyeSUyMiUwQSUyMCUyMCUyMCUyMCklMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9wcm9tcHQlM0QlMjJiYWQlMjBxdWFsaXR5JTJDJTIwd29yc2UlMjBxdWFsaXR5JTIyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2ZyYW1lcyUzRDE2JTJDJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0Q3LjUlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMjUlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0R0b3JjaC5HZW5lcmF0b3IoJTIyY3B1JTIyKS5tYW51YWxfc2VlZCg0MiklMkMlMEEpJTBBZnJhbWVzJTIwJTNEJTIwb3V0cHV0LmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fZ2lmKGZyYW1lcyUyQyUyMCUyMmFuaW1hdGlvbi5naWYlMjIp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AnimateDiffPipeline, DDIMScheduler, MotionAdapter
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif
<span class="hljs-comment"># Load the motion adapter</span>
adapter = MotionAdapter.from_pretrained(<span class="hljs-string">&quot;guoyww/animatediff-motion-adapter-v1-5-2&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-comment"># load SD 1.5 based finetuned model</span>
model_id = <span class="hljs-string">&quot;SG161222/Realistic_Vision_V5.1_noVAE&quot;</span>
pipe = AnimateDiffPipeline.from_pretrained(model_id, motion_adapter=adapter, torch_dtype=torch.float16)
pipe.load_lora_weights(
<span class="hljs-string">&quot;guoyww/animatediff-motion-lora-zoom-out&quot;</span>, adapter_name=<span class="hljs-string">&quot;zoom-out&quot;</span>
)
scheduler = DDIMScheduler.from_pretrained(
model_id,
subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>,
clip_sample=<span class="hljs-literal">False</span>,
beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>,
timestep_spacing=<span class="hljs-string">&quot;linspace&quot;</span>,
steps_offset=<span class="hljs-number">1</span>,
)
pipe.scheduler = scheduler
<span class="hljs-comment"># enable memory savings</span>
pipe.enable_vae_slicing()
pipe.enable_model_cpu_offload()
output = pipe(
prompt=(
<span class="hljs-string">&quot;masterpiece, bestquality, highlydetailed, ultradetailed, sunset, &quot;</span>
<span class="hljs-string">&quot;orange sky, warm lighting, fishing boats, ocean waves seagulls, &quot;</span>
<span class="hljs-string">&quot;rippling water, wharf, silhouette, serene atmosphere, dusk, evening glow, &quot;</span>
<span class="hljs-string">&quot;golden hour, coastal landscape, seaside scenery&quot;</span>
),
negative_prompt=<span class="hljs-string">&quot;bad quality, worse quality&quot;</span>,
num_frames=<span class="hljs-number">16</span>,
guidance_scale=<span class="hljs-number">7.5</span>,
num_inference_steps=<span class="hljs-number">25</span>,
generator=torch.Generator(<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">42</span>),
)
frames = output.frames[<span class="hljs-number">0</span>]
export_to_gif(frames, <span class="hljs-string">&quot;animation.gif&quot;</span>)`,wrap:!1}}),pt=new b({props:{title:"Using Motion LoRAs with PEFT",local:"using-motion-loras-with-peft",headingTag:"h2"}}),ft=new Z({props:{code:"cGlwJTIwaW5zdGFsbCUyMHBlZnQ=",highlighted:"pip install peft",wrap:!1}}),gt=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQW5pbWF0ZURpZmZQaXBlbGluZSUyQyUyMERESU1TY2hlZHVsZXIlMkMlMjBNb3Rpb25BZGFwdGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b19naWYlMEElMEElMjMlMjBMb2FkJTIwdGhlJTIwbW90aW9uJTIwYWRhcHRlciUwQWFkYXB0ZXIlMjAlM0QlMjBNb3Rpb25BZGFwdGVyLmZyb21fcHJldHJhaW5lZCglMjJndW95d3clMkZhbmltYXRlZGlmZi1tb3Rpb24tYWRhcHRlci12MS01LTIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBJTIzJTIwbG9hZCUyMFNEJTIwMS41JTIwYmFzZWQlMjBmaW5ldHVuZWQlMjBtb2RlbCUwQW1vZGVsX2lkJTIwJTNEJTIwJTIyU0cxNjEyMjIlMkZSZWFsaXN0aWNfVmlzaW9uX1Y1LjFfbm9WQUUlMjIlMEFwaXBlJTIwJTNEJTIwQW5pbWF0ZURpZmZQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQobW9kZWxfaWQlMkMlMjBtb3Rpb25fYWRhcHRlciUzRGFkYXB0ZXIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBJTBBcGlwZS5sb2FkX2xvcmFfd2VpZ2h0cyglMEElMjAlMjAlMjAlMjAlMjJkaWZmdXNlcnMlMkZhbmltYXRlZGlmZi1tb3Rpb24tbG9yYS16b29tLW91dCUyMiUyQyUyMGFkYXB0ZXJfbmFtZSUzRCUyMnpvb20tb3V0JTIyJTJDJ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YlMjIp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AnimateDiffPipeline, DDIMScheduler, MotionAdapter
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif
<span class="hljs-comment"># Load the motion adapter</span>
adapter = MotionAdapter.from_pretrained(<span class="hljs-string">&quot;guoyww/animatediff-motion-adapter-v1-5-2&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-comment"># load SD 1.5 based finetuned model</span>
model_id = <span class="hljs-string">&quot;SG161222/Realistic_Vision_V5.1_noVAE&quot;</span>
pipe = AnimateDiffPipeline.from_pretrained(model_id, motion_adapter=adapter, torch_dtype=torch.float16)
pipe.load_lora_weights(
<span class="hljs-string">&quot;diffusers/animatediff-motion-lora-zoom-out&quot;</span>, adapter_name=<span class="hljs-string">&quot;zoom-out&quot;</span>,
)
pipe.load_lora_weights(
<span class="hljs-string">&quot;diffusers/animatediff-motion-lora-pan-left&quot;</span>, adapter_name=<span class="hljs-string">&quot;pan-left&quot;</span>,
)
pipe.set_adapters([<span class="hljs-string">&quot;zoom-out&quot;</span>, <span class="hljs-string">&quot;pan-left&quot;</span>], adapter_weights=[<span class="hljs-number">1.0</span>, <span class="hljs-number">1.0</span>])
scheduler = DDIMScheduler.from_pretrained(
model_id,
subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>,
clip_sample=<span class="hljs-literal">False</span>,
timestep_spacing=<span class="hljs-string">&quot;linspace&quot;</span>,
beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>,
steps_offset=<span class="hljs-number">1</span>,
)
pipe.scheduler = scheduler
<span class="hljs-comment"># enable memory savings</span>
pipe.enable_vae_slicing()
pipe.enable_model_cpu_offload()
output = pipe(
prompt=(
<span class="hljs-string">&quot;masterpiece, bestquality, highlydetailed, ultradetailed, sunset, &quot;</span>
<span class="hljs-string">&quot;orange sky, warm lighting, fishing boats, ocean waves seagulls, &quot;</span>
<span class="hljs-string">&quot;rippling water, wharf, silhouette, serene atmosphere, dusk, evening glow, &quot;</span>
<span class="hljs-string">&quot;golden hour, coastal landscape, seaside scenery&quot;</span>
),
negative_prompt=<span class="hljs-string">&quot;bad quality, worse quality&quot;</span>,
num_frames=<span class="hljs-number">16</span>,
guidance_scale=<span class="hljs-number">7.5</span>,
num_inference_steps=<span class="hljs-number">25</span>,
generator=torch.Generator(<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">42</span>),
)
frames = output.frames[<span class="hljs-number">0</span>]
export_to_gif(frames, <span class="hljs-string">&quot;animation.gif&quot;</span>)`,wrap:!1}}),_t=new b({props:{title:"Using FreeInit",local:"using-freeinit",headingTag:"h2"}}),wt=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTW90aW9uQWRhcHRlciUyQyUyMEFuaW1hdGVEaWZmUGlwZWxpbmUlMkMlMjBERElNU2NoZWR1bGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b19naWYlMEElMEFhZGFwdGVyJTIwJTNEJTIwTW90aW9uQWRhcHRlci5mcm9tX3ByZXRyYWluZWQoJTIyZ3VveXd3JTJGYW5pbWF0ZWRpZmYtbW90aW9uLWFkYXB0ZXItdjEtNS0yJTIyKSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIyU0cxNjEyMjIlMkZSZWFsaXN0aWNfVmlzaW9uX1Y1LjFfbm9WQUUlMjIlMEFwaXBlJTIwJTNEJTIwQW5pbWF0ZURpZmZQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQobW9kZWxfaWQlMkMlMjBtb3Rpb25fYWRhcHRlciUzRGFkYXB0ZXIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpLnRvKCUyMmN1ZGElMjIpJTBBcGlwZS5zY2hlZHVsZXIlMjAlM0QlMjBERElNU2NoZWR1bGV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YmFkJTIwcXVhbGl0eSUyQyUyMHdvcnNlJTIwcXVhbGl0eSUyMiUyQyUwQSUyMCUyMCUyMCUyMG51bV9mcmFtZXMlM0QxNiUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNENy41JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEdG9yY2guR2VuZXJhdG9yKCUyMmNwdSUyMikubWFudWFsX3NlZWQoNjY2KSUyQyUwQSklMEElMEElMjMlMjBkaXNhYmxlJTIwRnJlZUluaXQlMEFwaXBlLmRpc2FibGVfZnJlZV9pbml0KCklMEElMEFmcmFtZXMlMjAlM0QlMjBvdXRwdXQuZnJhbWVzJTVCMCU1RCUwQWV4cG9ydF90b19naWYoZnJhbWVzJTJDJTIwJTIyYW5pbWF0aW9uLmdpZiUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> MotionAdapter, AnimateDiffPipeline, DDIMScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif
adapter = MotionAdapter.from_pretrained(<span class="hljs-string">&quot;guoyww/animatediff-motion-adapter-v1-5-2&quot;</span>)
model_id = <span class="hljs-string">&quot;SG161222/Realistic_Vision_V5.1_noVAE&quot;</span>
pipe = AnimateDiffPipeline.from_pretrained(model_id, motion_adapter=adapter, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipe.scheduler = DDIMScheduler.from_pretrained(
model_id,
subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>,
beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>,
clip_sample=<span class="hljs-literal">False</span>,
timestep_spacing=<span class="hljs-string">&quot;linspace&quot;</span>,
steps_offset=<span class="hljs-number">1</span>
)
<span class="hljs-comment"># enable memory savings</span>
pipe.enable_vae_slicing()
pipe.enable_vae_tiling()
<span class="hljs-comment"># enable FreeInit</span>
<span class="hljs-comment"># Refer to the enable_free_init documentation for a full list of configurable parameters</span>
pipe.enable_free_init(method=<span class="hljs-string">&quot;butterworth&quot;</span>, use_fast_sampling=<span class="hljs-literal">True</span>)
<span class="hljs-comment"># run inference</span>
output = pipe(
prompt=<span class="hljs-string">&quot;a panda playing a guitar, on a boat, in the ocean, high quality&quot;</span>,
negative_prompt=<span class="hljs-string">&quot;bad quality, worse quality&quot;</span>,
num_frames=<span class="hljs-number">16</span>,
guidance_scale=<span class="hljs-number">7.5</span>,
num_inference_steps=<span class="hljs-number">20</span>,
generator=torch.Generator(<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">666</span>),
)
<span class="hljs-comment"># disable FreeInit</span>
pipe.disable_free_init()
frames = output.frames[<span class="hljs-number">0</span>]
export_to_gif(frames, <span class="hljs-string">&quot;animation.gif&quot;</span>)`,wrap:!1}}),Jt=new b({props:{title:"Using AnimateLCM",local:"using-animatelcm",headingTag:"h2"}}),Ut=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQW5pbWF0ZURpZmZQaXBlbGluZSUyQyUyMExDTVNjaGVkdWxlciUyQyUyME1vdGlvbkFkYXB0ZXIlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX2dpZiUwQSUwQWFkYXB0ZXIlMjAlM0QlMjBNb3Rpb25BZGFwdGVyLmZyb21fcHJldHJhaW5lZCglMjJ3YW5nZnV5dW4lMkZBbmltYXRlTENNJTIyKSUwQXBpcGUlMjAlM0QlMjBBbmltYXRlRGlmZlBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJlbWlsaWFuSlIlMkZlcGlDUmVhbGlzbSUyMiUyQyUyMG1vdGlvbl9hZGFwdGVyJTNEYWRhcHRlciklMEFwaXBlLnNjaGVkdW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zJTIwJTNEJTIwb3V0cHV0LmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fZ2lmKGZyYW1lcyUyQyUyMCUyMmFuaW1hdGVsY20uZ2lmJTIyKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AnimateDiffPipeline, LCMScheduler, MotionAdapter
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif
adapter = MotionAdapter.from_pretrained(<span class="hljs-string">&quot;wangfuyun/AnimateLCM&quot;</span>)
pipe = AnimateDiffPipeline.from_pretrained(<span class="hljs-string">&quot;emilianJR/epiCRealism&quot;</span>, motion_adapter=adapter)
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config, beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>)
pipe.load_lora_weights(<span class="hljs-string">&quot;wangfuyun/AnimateLCM&quot;</span>, weight_name=<span class="hljs-string">&quot;sd15_lora_beta.safetensors&quot;</span>, adapter_name=<span class="hljs-string">&quot;lcm-lora&quot;</span>)
pipe.enable_vae_slicing()
pipe.enable_model_cpu_offload()
output = pipe(
prompt=<span class="hljs-string">&quot;A space rocket with trails of smoke behind it launching into space from the desert, 4k, high resolution&quot;</span>,
negative_prompt=<span class="hljs-string">&quot;bad quality, worse quality, low resolution&quot;</span>,
num_frames=<span class="hljs-number">16</span>,
guidance_scale=<span class="hljs-number">1.5</span>,
num_inference_steps=<span class="hljs-number">6</span>,
generator=torch.Generator(<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">0</span>),
)
frames = output.frames[<span class="hljs-number">0</span>]
export_to_gif(frames, <span class="hljs-string">&quot;animatelcm.gif&quot;</span>)`,wrap:!1}}),It=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQW5pbWF0ZURpZmZQaXBlbGluZSUyQyUyMExDTVNjaGVkdWxlciUy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BpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEJTIyQSUyMHNwYWNlJTIwcm9ja2V0JTIwd2l0aCUyMHRyYWlscyUyMG9mJTIwc21va2UlMjBiZWhpbmQlMjBpdCUyMGxhdW5jaGluZyUyMGludG8lMjBzcGFjZSUyMGZyb20lMjB0aGUlMjBkZXNlcnQlMkMlMjA0ayUyQyUyMGhpZ2glMjByZXNvbHV0aW9uJTIyJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfcHJvbXB0JTNEJTIyYmFkJTIwcXVhbGl0eSUyQyUyMHdvcnNlJTIwcXVhbGl0eSUyQyUyMGxvdyUyMHJlc29sdXRpb24lMjIlMkMlMEElMjAlMjAlMjAlMjBudW1fZnJhbWVzJTNEMTYlMkMlMEElMjAlMjAlMjAlMjBndWlkYW5jZV9zY2FsZSUzRDEuNSUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q2JTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEdG9yY2guR2VuZXJhdG9yKCUyMmNwdSUyMikubWFudWFsX3NlZWQoMCklMkMlMEEpJTBBZnJhbWVzJTIwJTNEJTIwb3V0cHV0LmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fZ2lmKGZyYW1lcyUyQyUyMCUyMmFuaW1hdGVsY20tbW90aW9uLWxvcmEuZ2lmJTIyKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AnimateDiffPipeline, LCMScheduler, MotionAdapter
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif
adapter = MotionAdapter.from_pretrained(<span class="hljs-string">&quot;wangfuyun/AnimateLCM&quot;</span>)
pipe = AnimateDiffPipeline.from_pretrained(<span class="hljs-string">&quot;emilianJR/epiCRealism&quot;</span>, motion_adapter=adapter)
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config, beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>)
pipe.load_lora_weights(<span class="hljs-string">&quot;wangfuyun/AnimateLCM&quot;</span>, weight_name=<span class="hljs-string">&quot;sd15_lora_beta.safetensors&quot;</span>, adapter_name=<span class="hljs-string">&quot;lcm-lora&quot;</span>)
pipe.load_lora_weights(<span class="hljs-string">&quot;guoyww/animatediff-motion-lora-tilt-up&quot;</span>, adapter_name=<span class="hljs-string">&quot;tilt-up&quot;</span>)
pipe.set_adapters([<span class="hljs-string">&quot;lcm-lora&quot;</span>, <span class="hljs-string">&quot;tilt-up&quot;</span>], [<span class="hljs-number">1.0</span>, <span class="hljs-number">0.8</span>])
pipe.enable_vae_slicing()
pipe.enable_model_cpu_offload()
output = pipe(
prompt=<span class="hljs-string">&quot;A space rocket with trails of smoke behind it launching into space from the desert, 4k, high resolution&quot;</span>,
negative_prompt=<span class="hljs-string">&quot;bad quality, worse quality, low resolution&quot;</span>,
num_frames=<span class="hljs-number">16</span>,
guidance_scale=<span class="hljs-number">1.5</span>,
num_inference_steps=<span class="hljs-number">6</span>,
generator=torch.Generator(<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">0</span>),
)
frames = output.frames[<span class="hljs-number">0</span>]
export_to_gif(frames, <span class="hljs-string">&quot;animatelcm-motion-lora.gif&quot;</span>)`,wrap:!1}}),Gt=new b({props:{title:"Using FreeNoise",local:"using-freenoise",headingTag:"h2"}}),Nt=new Z({props:{code:"JTJCJTIwcGlwZS5lbmFibGVfZnJlZV9ub2lzZSgp",highlighted:'<span class="hljs-addition">+ pipe.enable_free_noise()</span>',wrap:!1}}),Rt=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQXV0b2VuY29kZXJLTCUyQyUyMEFuaW1hdGVEaWZmUGlwZWxpbmUlMkMlMjBMQ01TY2hlZHVsZXIlMkMlMjBNb3Rpb25BZGFwdGVyJTBBZnJ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IwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEdG9yY2guR2VuZXJhdG9yKCUyMmNwdSUyMikubWFudWFsX3NlZWQoMCklMkMlMEEpJTBBJTBBJTIzJTIwU2F2ZSUyMHZpZGVvJTBBZnJhbWVzJTIwJTNEJTIwb3V0cHV0LmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fdmlkZW8oZnJhbWVzJTJDJTIwJTIyb3V0cHV0Lm1wNCUyMiUyQyUyMGZwcyUzRDE2KQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoencoderKL, AnimateDiffPipeline, LCMScheduler, MotionAdapter
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video, load_image
<span class="hljs-comment"># Load pipeline</span>
dtype = torch.float16
motion_adapter = MotionAdapter.from_pretrained(<span class="hljs-string">&quot;wangfuyun/AnimateLCM&quot;</span>, torch_dtype=dtype)
vae = AutoencoderKL.from_pretrained(<span class="hljs-string">&quot;stabilityai/sd-vae-ft-mse&quot;</span>, torch_dtype=dtype)
pipe = AnimateDiffPipeline.from_pretrained(<span class="hljs-string">&quot;emilianJR/epiCRealism&quot;</span>, motion_adapter=motion_adapter, vae=vae, torch_dtype=dtype)
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config, beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>)
pipe.load_lora_weights(
<span class="hljs-string">&quot;wangfuyun/AnimateLCM&quot;</span>, weight_name=<span class="hljs-string">&quot;AnimateLCM_sd15_t2v_lora.safetensors&quot;</span>, adapter_name=<span class="hljs-string">&quot;lcm_lora&quot;</span>
)
pipe.set_adapters([<span class="hljs-string">&quot;lcm_lora&quot;</span>], [<span class="hljs-number">0.8</span>])
<span class="hljs-comment"># Enable FreeNoise for long prompt generation</span>
pipe.enable_free_noise(context_length=<span class="hljs-number">16</span>, context_stride=<span class="hljs-number">4</span>)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-comment"># Can be a single prompt, or a dictionary with frame timesteps</span>
prompt = {
<span class="hljs-number">0</span>: <span class="hljs-string">&quot;A caterpillar on a leaf, high quality, photorealistic&quot;</span>,
<span class="hljs-number">40</span>: <span class="hljs-string">&quot;A caterpillar transforming into a cocoon, on a leaf, near flowers, photorealistic&quot;</span>,
<span class="hljs-number">80</span>: <span class="hljs-string">&quot;A cocoon on a leaf, flowers in the background, photorealistic&quot;</span>,
<span class="hljs-number">120</span>: <span class="hljs-string">&quot;A cocoon maturing and a butterfly being born, flowers and leaves visible in the background, photorealistic&quot;</span>,
<span class="hljs-number">160</span>: <span class="hljs-string">&quot;A beautiful butterfly, vibrant colors, sitting on a leaf, flowers in the background, photorealistic&quot;</span>,
<span class="hljs-number">200</span>: <span class="hljs-string">&quot;A beautiful butterfly, flying away in a forest, photorealistic&quot;</span>,
<span class="hljs-number">240</span>: <span class="hljs-string">&quot;A cyberpunk butterfly, neon lights, glowing&quot;</span>,
}
negative_prompt = <span class="hljs-string">&quot;bad quality, worst quality, jpeg artifacts&quot;</span>
<span class="hljs-comment"># Run inference</span>
output = pipe(
prompt=prompt,
negative_prompt=negative_prompt,
num_frames=<span class="hljs-number">256</span>,
guidance_scale=<span class="hljs-number">2.5</span>,
num_inference_steps=<span class="hljs-number">10</span>,
generator=torch.Generator(<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">0</span>),
)
<span class="hljs-comment"># Save video</span>
frames = output.frames[<span class="hljs-number">0</span>]
export_to_video(frames, <span class="hljs-string">&quot;output.mp4&quot;</span>, fps=<span class="hljs-number">16</span>)`,wrap:!1}}),Xt=new b({props:{title:"FreeNoise memory savings",local:"freenoise-memory-savings",headingTag:"h3"}}),Lt=new Z({props:{code:"JTIzJTIwTG9hZCUyMHBpcGVsaW5lJTIwYW5kJTIwYWRhcHRlcnMlMEElMjMlMjAuLi4lMEElMkIlMjBwaXBlLmVuYWJsZV9mcmVlX25vaXNlX3NwbGl0X2luZmVyZW5jZSgpJTBBJTJCJTIwcGlwZS51bmV0LmVuYWJsZV9mb3J3YXJkX2NodW5raW5nKDE2KQ==",highlighted:`# Load pipeline and adapters
# ...
<span class="hljs-addition">+ pipe.enable_free_noise_split_inference()</span>
<span class="hljs-addition">+ pipe.unet.enable_forward_chunking(16)</span>`,wrap:!1}}),Et=new b({props:{title:"Using from_single_file with the MotionAdapter",local:"using-fromsinglefile-with-the-motionadapter",headingTag:"h2"}}),Pt=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyME1vdGlvbkFkYXB0ZXIlMEElMEFja3B0X3BhdGglMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGTGlnaHRyaWNrcyUyRkxvbmdBbmltYXRlRGlmZiUyRmJsb2IlMkZtYWluJTJGbHRfbG9uZ19tbV8zMl9mcmFtZXMuY2twdCUyMiUwQSUwQWFkYXB0ZXIlMjAlM0QlMjBNb3Rpb25BZGFwdGVyLmZyb21fc2luZ2xlX2ZpbGUoY2twdF9wYXRoJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGUlMjAlM0QlMjBBbmltYXRlRGlmZlBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJlbWlsaWFuSlIlMkZlcGlDUmVhbGlzbSUyMiUyQyUyMG1vdGlvbl9hZGFwdGVyJTNEYWRhcHRlcik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> MotionAdapter
ckpt_path = <span class="hljs-string">&quot;https://huggingface.co/Lightricks/LongAnimateDiff/blob/main/lt_long_mm_32_frames.ckpt&quot;</span>
adapter = MotionAdapter.from_single_file(ckpt_path, torch_dtype=torch.float16)
pipe = AnimateDiffPipeline.from_pretrained(<span class="hljs-string">&quot;emilianJR/epiCRealism&quot;</span>, motion_adapter=adapter)`,wrap:!1}}),Ft=new b({props:{title:"AnimateDiffPipeline",local:"diffusers.AnimateDiffPipeline",headingTag:"h2"}}),zt=new U({props:{name:"class diffusers.AnimateDiffPipeline",anchor:"diffusers.AnimateDiffPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": typing.Union[diffusers.models.unets.unet_2d_condition.UNet2DConditionModel, diffusers.models.unets.unet_motion_model.UNetMotionModel]"},{name:"motion_adapter",val:": MotionAdapter"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_pndm.PNDMScheduler, diffusers.schedulers.scheduling_lms_discrete.LMSDiscreteScheduler, diffusers.schedulers.scheduling_euler_discrete.EulerDiscreteScheduler, diffusers.schedulers.scheduling_euler_ancestral_discrete.EulerAncestralDiscreteScheduler, diffusers.schedulers.scheduling_dpmsolver_multistep.DPMSolverMultistepScheduler]"},{name:"feature_extractor",val:": CLIPImageProcessor = None"},{name:"image_encoder",val:": CLIPVisionModelWithProjection = None"}],parametersDescription:[{anchor:"diffusers.AnimateDiffPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_12652/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.AnimateDiffPipeline.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.AnimateDiffPipeline.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.AnimateDiffPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/pr_12652/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <a href="/docs/diffusers/pr_12652/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a> used to create a UNetMotionModel to denoise the encoded video latents.`,name:"unet"},{anchor:"diffusers.AnimateDiffPipeline.motion_adapter",description:`<strong>motion_adapter</strong> (<code>MotionAdapter</code>) &#x2014;
A <code>MotionAdapter</code> to be used in combination with <code>unet</code> to denoise the encoded video latents.`,name:"motion_adapter"},{anchor:"diffusers.AnimateDiffPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_12652/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/pr_12652/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/pr_12652/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/pr_12652/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff.py#L78"}}),Ht=new U({props:{name:"__call__",anchor:"diffusers.AnimateDiffPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_frames",val:": typing.Optional[int] = 16"},{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.Tensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"ip_adapter_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor], NoneType] = None"},{name:"ip_adapter_image_embeds",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"cross_attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"clip_skip",val:": typing.Optional[int] = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int, typing.Dict], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": typing.List[str] = ['latents']"},{name:"decode_chunk_size",val:": int = 16"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.AnimateDiffPipeline.__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.AnimateDiffPipeline.__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.AnimateDiffPipeline.__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.AnimateDiffPipeline.__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.AnimateDiffPipeline.__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.AnimateDiffPipeline.__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.AnimateDiffPipeline.__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.AnimateDiffPipeline.__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://huggingface.co/papers/2010.02502" rel="nofollow">DDIM</a> paper. Only
applies to the <a href="/docs/diffusers/pr_12652/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.AnimateDiffPipeline.__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.AnimateDiffPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</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.AnimateDiffPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffPipeline.__call__.ip_adapter_image",description:`<strong>ip_adapter_image</strong> &#x2014; (<code>PipelineImageInput</code>, <em>optional</em>):
Optional image input to work with IP Adapters.`,name:"ip_adapter_image"},{anchor:"diffusers.AnimateDiffPipeline.__call__.ip_adapter_image_embeds",description:`<strong>ip_adapter_image_embeds</strong> (<code>List[torch.Tensor]</code>, <em>optional</em>) &#x2014;
Pre-generated image embeddings for IP-Adapter. It should be a list of length same as number of
IP-adapters. Each element should be a tensor of shape <code>(batch_size, num_images, emb_dim)</code>. It should
contain the negative image embedding if <code>do_classifier_free_guidance</code> is set to <code>True</code>. If not
provided, embeddings are computed from the <code>ip_adapter_image</code> input argument.`,name:"ip_adapter_image_embeds"},{anchor:"diffusers.AnimateDiffPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generated video. Choose between <code>torch.Tensor</code>, <code>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.AnimateDiffPipeline.__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/pr_12652/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.AnimateDiffPipeline.__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"},{anchor:"diffusers.AnimateDiffPipeline.__call__.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"},{anchor:"diffusers.AnimateDiffPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls at the end of each denoising steps during the inference. The function is called
with the following arguments: <code>callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)</code>. <code>callback_kwargs</code> will include a list of all tensors as specified by
<code>callback_on_step_end_tensor_inputs</code>.`,name:"callback_on_step_end"},{anchor:"diffusers.AnimateDiffPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) &#x2014;
The list of tensor inputs for the <code>callback_on_step_end</code> function. The tensors specified in the list
will be passed as <code>callback_kwargs</code> argument. You will only be able to include variables listed in the
<code>._callback_tensor_inputs</code> attribute of your pipeline class.`,name:"callback_on_step_end_tensor_inputs"},{anchor:"diffusers.AnimateDiffPipeline.__call__.decode_chunk_size",description:`<strong>decode_chunk_size</strong> (<code>int</code>, defaults to <code>16</code>) &#x2014;
The number of frames to decode at a time when calling <code>decode_latents</code> method.`,name:"decode_chunk_size"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff.py#L573",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>If <code>return_dict</code> is <code>True</code>, <a
href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.pipelines.animatediff.AnimateDiffPipelineOutput"
>AnimateDiffPipelineOutput</a> is
returned, otherwise a <code>tuple</code> is returned where the first element is a list with the generated frames.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><a
href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.pipelines.animatediff.AnimateDiffPipelineOutput"
>AnimateDiffPipelineOutput</a> or <code>tuple</code></p>
`}}),oe=new Va({props:{anchor:"diffusers.AnimateDiffPipeline.__call__.example",$$slots:{default:[Br]},$$scope:{ctx:z}}}),$t=new U({props:{name:"encode_prompt",anchor:"diffusers.AnimateDiffPipeline.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.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"},{name:"clip_skip",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"diffusers.AnimateDiffPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"},{anchor:"diffusers.AnimateDiffPipeline.encode_prompt.device",description:`<strong>device</strong> &#x2014; (<code>torch.device</code>):
torch device`,name:"device"},{anchor:"diffusers.AnimateDiffPipeline.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.AnimateDiffPipeline.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.AnimateDiffPipeline.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.AnimateDiffPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffPipeline.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"},{anchor:"diffusers.AnimateDiffPipeline.encode_prompt.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff.py#L156"}}),qt=new b({props:{title:"AnimateDiffControlNetPipeline",local:"diffusers.AnimateDiffControlNetPipeline",headingTag:"h2"}}),Ot=new U({props:{name:"class diffusers.AnimateDiffControlNetPipeline",anchor:"diffusers.AnimateDiffControlNetPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": typing.Union[diffusers.models.unets.unet_2d_condition.UNet2DConditionModel, diffusers.models.unets.unet_motion_model.UNetMotionModel]"},{name:"motion_adapter",val:": MotionAdapter"},{name:"controlnet",val:": typing.Union[diffusers.models.controlnets.controlnet.ControlNetModel, typing.List[diffusers.models.controlnets.controlnet.ControlNetModel], typing.Tuple[diffusers.models.controlnets.controlnet.ControlNetModel], diffusers.models.controlnets.multicontrolnet.MultiControlNetModel]"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"feature_extractor",val:": typing.Optional[transformers.models.clip.image_processing_clip.CLIPImageProcessor] = None"},{name:"image_encoder",val:": typing.Optional[transformers.models.clip.modeling_clip.CLIPVisionModelWithProjection] = None"}],parametersDescription:[{anchor:"diffusers.AnimateDiffControlNetPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_12652/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.AnimateDiffControlNetPipeline.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.AnimateDiffControlNetPipeline.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.AnimateDiffControlNetPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/pr_12652/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <a href="/docs/diffusers/pr_12652/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a> used to create a UNetMotionModel to denoise the encoded video latents.`,name:"unet"},{anchor:"diffusers.AnimateDiffControlNetPipeline.motion_adapter",description:`<strong>motion_adapter</strong> (<code>MotionAdapter</code>) &#x2014;
A <code>MotionAdapter</code> to be used in combination with <code>unet</code> to denoise the encoded video latents.`,name:"motion_adapter"},{anchor:"diffusers.AnimateDiffControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_12652/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/pr_12652/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/pr_12652/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/pr_12652/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_controlnet.py#L120"}}),Kt=new U({props:{name:"__call__",anchor:"diffusers.AnimateDiffControlNetPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"num_frames",val:": typing.Optional[int] = 16"},{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.Tensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"ip_adapter_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor], NoneType] = None"},{name:"ip_adapter_image_embeds",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor], NoneType] = None"},{name:"conditioning_frames",val:": typing.Optional[typing.List[typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor]]]] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"cross_attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 1.0"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"},{name:"clip_skip",val:": typing.Optional[int] = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int, typing.Dict], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": typing.List[str] = ['latents']"},{name:"decode_chunk_size",val:": int = 16"}],parametersDescription:[{anchor:"diffusers.AnimateDiffControlNetPipeline.__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.AnimateDiffControlNetPipeline.__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.AnimateDiffControlNetPipeline.__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.AnimateDiffControlNetPipeline.__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.AnimateDiffControlNetPipeline.__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.AnimateDiffControlNetPipeline.__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.AnimateDiffControlNetPipeline.__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.AnimateDiffControlNetPipeline.__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://huggingface.co/papers/2010.02502" rel="nofollow">DDIM</a> paper. Only
applies to the <a href="/docs/diffusers/pr_12652/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.AnimateDiffControlNetPipeline.__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.AnimateDiffControlNetPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</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.AnimateDiffControlNetPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffControlNetPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffControlNetPipeline.__call__.ip_adapter_image",description:`<strong>ip_adapter_image</strong> (<code>PipelineImageInput</code>, <em>optional</em>) &#x2014;
Optional image input to work with IP Adapters.`,name:"ip_adapter_image"},{anchor:"diffusers.AnimateDiffControlNetPipeline.__call__.ip_adapter_image_embeds",description:`<strong>ip_adapter_image_embeds</strong> (<code>List[torch.Tensor]</code>, <em>optional</em>) &#x2014;
Pre-generated image embeddings for IP-Adapter. It should be a list of length same as number of
IP-adapters. Each element should be a tensor of shape <code>(batch_size, num_images, emb_dim)</code>. It should
contain the negative image embedding if <code>do_classifier_free_guidance</code> is set to <code>True</code>. If not
provided, embeddings are computed from the <code>ip_adapter_image</code> input argument.`,name:"ip_adapter_image_embeds"},{anchor:"diffusers.AnimateDiffControlNetPipeline.__call__.conditioning_frames",description:`<strong>conditioning_frames</strong> (<code>List[PipelineImageInput]</code>, <em>optional</em>) &#x2014;
The ControlNet input condition to provide guidance to the <code>unet</code> for generation. If multiple
ControlNets are specified, images must be passed as a list such that each element of the list can be
correctly batched for input to a single ControlNet.`,name:"conditioning_frames"},{anchor:"diffusers.AnimateDiffControlNetPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generated video. Choose between <code>torch.Tensor</code>, <code>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.AnimateDiffControlNetPipeline.__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/pr_12652/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.AnimateDiffControlNetPipeline.__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"},{anchor:"diffusers.AnimateDiffControlNetPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the ControlNet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original <code>unet</code>. If multiple ControlNets are specified in <code>init</code>, you can set
the corresponding scale as a list.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.AnimateDiffControlNetPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
The ControlNet encoder tries to recognize the content of the input image even if you remove all
prompts. A <code>guidance_scale</code> value between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.AnimateDiffControlNetPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the ControlNet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.AnimateDiffControlNetPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the ControlNet stops applying.`,name:"control_guidance_end"},{anchor:"diffusers.AnimateDiffControlNetPipeline.__call__.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"},{anchor:"diffusers.AnimateDiffControlNetPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls at the end of each denoising steps during the inference. The function is called
with the following arguments: <code>callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)</code>. <code>callback_kwargs</code> will include a list of all tensors as specified by
<code>callback_on_step_end_tensor_inputs</code>.`,name:"callback_on_step_end"},{anchor:"diffusers.AnimateDiffControlNetPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) &#x2014;
The list of tensor inputs for the <code>callback_on_step_end</code> function. The tensors specified in the list
will be passed as <code>callback_kwargs</code> argument. You will only be able to include variables listed in the
<code>._callback_tensor_inputs</code> attribute of your pipeline class.`,name:"callback_on_step_end_tensor_inputs"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_controlnet.py#L721",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>If <code>return_dict</code> is <code>True</code>, <a
href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.pipelines.animatediff.AnimateDiffPipelineOutput"
>AnimateDiffPipelineOutput</a> is
returned, otherwise a <code>tuple</code> is returned where the first element is a list with the generated frames.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><a
href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.pipelines.animatediff.AnimateDiffPipelineOutput"
>AnimateDiffPipelineOutput</a> or <code>tuple</code></p>
`}}),en=new U({props:{name:"encode_prompt",anchor:"diffusers.AnimateDiffControlNetPipeline.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.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"},{name:"clip_skip",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"diffusers.AnimateDiffControlNetPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"},{anchor:"diffusers.AnimateDiffControlNetPipeline.encode_prompt.device",description:`<strong>device</strong> &#x2014; (<code>torch.device</code>):
torch device`,name:"device"},{anchor:"diffusers.AnimateDiffControlNetPipeline.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.AnimateDiffControlNetPipeline.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.AnimateDiffControlNetPipeline.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.AnimateDiffControlNetPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffControlNetPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffControlNetPipeline.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"},{anchor:"diffusers.AnimateDiffControlNetPipeline.encode_prompt.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_controlnet.py#L199"}}),tn=new b({props:{title:"AnimateDiffSparseControlNetPipeline",local:"diffusers.AnimateDiffSparseControlNetPipeline",headingTag:"h2"}}),nn=new U({props:{name:"class diffusers.AnimateDiffSparseControlNetPipeline",anchor:"diffusers.AnimateDiffSparseControlNetPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": typing.Union[diffusers.models.unets.unet_2d_condition.UNet2DConditionModel, diffusers.models.unets.unet_motion_model.UNetMotionModel]"},{name:"motion_adapter",val:": MotionAdapter"},{name:"controlnet",val:": SparseControlNetModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"feature_extractor",val:": CLIPImageProcessor = None"},{name:"image_encoder",val:": CLIPVisionModelWithProjection = None"}],parametersDescription:[{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_12652/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.AnimateDiffSparseControlNetPipeline.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.AnimateDiffSparseControlNetPipeline.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.AnimateDiffSparseControlNetPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/pr_12652/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <a href="/docs/diffusers/pr_12652/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a> used to create a UNetMotionModel to denoise the encoded video latents.`,name:"unet"},{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.motion_adapter",description:`<strong>motion_adapter</strong> (<code>MotionAdapter</code>) &#x2014;
A <code>MotionAdapter</code> to be used in combination with <code>unet</code> to denoise the encoded video latents.`,name:"motion_adapter"},{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_12652/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/pr_12652/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/pr_12652/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/pr_12652/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_sparsectrl.py#L132"}}),on=new U({props:{name:"__call__",anchor:"diffusers.AnimateDiffSparseControlNetPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_frames",val:": int = 16"},{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:": 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.Tensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"ip_adapter_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor], NoneType] = None"},{name:"ip_adapter_image_embeds",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"conditioning_frames",val:": typing.Optional[typing.List[typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor]]]] = None"},{name:"output_type",val:": str = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"cross_attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 1.0"},{name:"controlnet_frame_indices",val:": typing.List[int] = [0]"},{name:"guess_mode",val:": bool = False"},{name:"clip_skip",val:": typing.Optional[int] = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int, typing.Dict], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": typing.List[str] = ['latents']"}],parametersDescription:[{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.__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.AnimateDiffSparseControlNetPipeline.__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.AnimateDiffSparseControlNetPipeline.__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.AnimateDiffSparseControlNetPipeline.__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.AnimateDiffSparseControlNetPipeline.__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.AnimateDiffSparseControlNetPipeline.__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.AnimateDiffSparseControlNetPipeline.__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.AnimateDiffSparseControlNetPipeline.__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://huggingface.co/papers/2010.02502" rel="nofollow">DDIM</a> paper. Only
applies to the <a href="/docs/diffusers/pr_12652/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.__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.AnimateDiffSparseControlNetPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</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.AnimateDiffSparseControlNetPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffSparseControlNetPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffSparseControlNetPipeline.__call__.ip_adapter_image",description:`<strong>ip_adapter_image</strong> &#x2014; (<code>PipelineImageInput</code>, <em>optional</em>):
Optional image input to work with IP Adapters.`,name:"ip_adapter_image"},{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.__call__.ip_adapter_image_embeds",description:`<strong>ip_adapter_image_embeds</strong> (<code>List[torch.Tensor]</code>, <em>optional</em>) &#x2014;
Pre-generated image embeddings for IP-Adapter. It should be a list of length same as number of
IP-adapters. Each element should be a tensor of shape <code>(batch_size, num_images, emb_dim)</code>. It should
contain the negative image embedding if <code>do_classifier_free_guidance</code> is set to <code>True</code>. If not
provided, embeddings are computed from the <code>ip_adapter_image</code> input argument.`,name:"ip_adapter_image_embeds"},{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.__call__.conditioning_frames",description:`<strong>conditioning_frames</strong> (<code>List[PipelineImageInput]</code>, <em>optional</em>) &#x2014;
The SparseControlNet input to provide guidance to the <code>unet</code> for generation.`,name:"conditioning_frames"},{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generated video. Choose between <code>torch.Tensor</code>, <code>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.__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/pr_12652/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.AnimateDiffSparseControlNetPipeline.__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"},{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the ControlNet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original <code>unet</code>. If multiple ControlNets are specified in <code>init</code>, you can set
the corresponding scale as a list.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.__call__.controlnet_frame_indices",description:`<strong>controlnet_frame_indices</strong> (<code>List[int]</code>) &#x2014;
The indices where the conditioning frames must be applied for generation. Multiple frames can be
provided to guide the model to generate similar structure outputs, where the <code>unet</code> can
&#x201C;fill-in-the-gaps&#x201D; for interpolation videos, or a single frame could be provided for general expected
structure. Must have the same length as <code>conditioning_frames</code>.`,name:"controlnet_frame_indices"},{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.__call__.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"},{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls at the end of each denoising steps during the inference. The function is called
with the following arguments: <code>callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)</code>. <code>callback_kwargs</code> will include a list of all tensors as specified by
<code>callback_on_step_end_tensor_inputs</code>.`,name:"callback_on_step_end"},{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) &#x2014;
The list of tensor inputs for the <code>callback_on_step_end</code> function. The tensors specified in the list
will be passed as <code>callback_kwargs</code> argument. You will only be able to include variables listed in the
<code>._callback_tensor_inputs</code> attribute of your pipeline class.`,name:"callback_on_step_end_tensor_inputs"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_sparsectrl.py#L712",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>If <code>return_dict</code> is <code>True</code>, <a
href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.pipelines.animatediff.AnimateDiffPipelineOutput"
>AnimateDiffPipelineOutput</a> is
returned, otherwise a <code>tuple</code> is returned where the first element is a list with the generated frames.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><a
href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.pipelines.animatediff.AnimateDiffPipelineOutput"
>AnimateDiffPipelineOutput</a> or <code>tuple</code></p>
`}}),ae=new Va({props:{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.__call__.example",$$slots:{default:[Nr]},$$scope:{ctx:z}}}),sn=new U({props:{name:"encode_prompt",anchor:"diffusers.AnimateDiffSparseControlNetPipeline.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.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"},{name:"clip_skip",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"},{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.encode_prompt.device",description:`<strong>device</strong> &#x2014; (<code>torch.device</code>):
torch device`,name:"device"},{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.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.AnimateDiffSparseControlNetPipeline.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.AnimateDiffSparseControlNetPipeline.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.AnimateDiffSparseControlNetPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffSparseControlNetPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffSparseControlNetPipeline.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"},{anchor:"diffusers.AnimateDiffSparseControlNetPipeline.encode_prompt.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_sparsectrl.py#L208"}}),an=new b({props:{title:"AnimateDiffSDXLPipeline",local:"diffusers.AnimateDiffSDXLPipeline",headingTag:"h2"}}),ln=new U({props:{name:"class diffusers.AnimateDiffSDXLPipeline",anchor:"diffusers.AnimateDiffSDXLPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"text_encoder_2",val:": CLIPTextModelWithProjection"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"tokenizer_2",val:": CLIPTokenizer"},{name:"unet",val:": typing.Union[diffusers.models.unets.unet_2d_condition.UNet2DConditionModel, diffusers.models.unets.unet_motion_model.UNetMotionModel]"},{name:"motion_adapter",val:": MotionAdapter"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_pndm.PNDMScheduler, diffusers.schedulers.scheduling_lms_discrete.LMSDiscreteScheduler, diffusers.schedulers.scheduling_euler_discrete.EulerDiscreteScheduler, diffusers.schedulers.scheduling_euler_ancestral_discrete.EulerAncestralDiscreteScheduler, diffusers.schedulers.scheduling_dpmsolver_multistep.DPMSolverMultistepScheduler]"},{name:"image_encoder",val:": CLIPVisionModelWithProjection = None"},{name:"feature_extractor",val:": CLIPImageProcessor = None"},{name:"force_zeros_for_empty_prompt",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AnimateDiffSDXLPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_12652/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.AnimateDiffSDXLPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion XL 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.AnimateDiffSDXLPipeline.text_encoder_2",description:`<strong>text_encoder_2</strong> (<code> CLIPTextModelWithProjection</code>) &#x2014;
Second frozen text-encoder. Stable Diffusion XL uses the text and pool portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModelWithProjection" rel="nofollow">CLIP</a>,
specifically the
<a href="https://huggingface.co/laion/CLIP-ViT-bigG-14-laion2B-39B-b160k" rel="nofollow">laion/CLIP-ViT-bigG-14-laion2B-39B-b160k</a>
variant.`,name:"text_encoder_2"},{anchor:"diffusers.AnimateDiffSDXLPipeline.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.AnimateDiffSDXLPipeline.tokenizer_2",description:`<strong>tokenizer_2</strong> (<code>CLIPTokenizer</code>) &#x2014;
Second 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_2"},{anchor:"diffusers.AnimateDiffSDXLPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/pr_12652/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.AnimateDiffSDXLPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_12652/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/pr_12652/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/pr_12652/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/pr_12652/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.AnimateDiffSDXLPipeline.force_zeros_for_empty_prompt",description:`<strong>force_zeros_for_empty_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>&quot;True&quot;</code>) &#x2014;
Whether the negative prompt embeddings shall be forced to always be set to 0. Also see the config of
<code>stabilityai/stable-diffusion-xl-base-1-0</code>.`,name:"force_zeros_for_empty_prompt"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_sdxl.py#L210"}}),rn=new U({props:{name:"__call__",anchor:"diffusers.AnimateDiffSDXLPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"prompt_2",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_frames",val:": int = 16"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"timesteps",val:": typing.List[int] = None"},{name:"sigmas",val:": typing.List[float] = None"},{name:"denoising_end",val:": typing.Optional[float] = None"},{name:"guidance_scale",val:": float = 5.0"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"negative_prompt_2",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.Tensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"pooled_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_pooled_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"ip_adapter_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor], NoneType] = None"},{name:"ip_adapter_image_embeds",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"cross_attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"guidance_rescale",val:": float = 0.0"},{name:"original_size",val:": typing.Optional[typing.Tuple[int, int]] = None"},{name:"crops_coords_top_left",val:": typing.Tuple[int, int] = (0, 0)"},{name:"target_size",val:": typing.Optional[typing.Tuple[int, int]] = None"},{name:"negative_original_size",val:": typing.Optional[typing.Tuple[int, int]] = None"},{name:"negative_crops_coords_top_left",val:": typing.Tuple[int, int] = (0, 0)"},{name:"negative_target_size",val:": typing.Optional[typing.Tuple[int, int]] = None"},{name:"clip_skip",val:": typing.Optional[int] = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int, typing.Dict], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": typing.List[str] = ['latents']"}],parametersDescription:[{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the video generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to be sent to the <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is
used in both text-encoders`,name:"prompt_2"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.num_frames",description:`<strong>num_frames</strong> &#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.AnimateDiffSDXLPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated video. This is set to 1024 by default for the best results.
Anything below 512 pixels won&#x2019;t work well for
<a href="https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0" rel="nofollow">stabilityai/stable-diffusion-xl-base-1.0</a>
and checkpoints that are not specifically fine-tuned on low resolutions.`,name:"height"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated video. This is set to 1024 by default for the best results.
Anything below 512 pixels won&#x2019;t work well for
<a href="https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0" rel="nofollow">stabilityai/stable-diffusion-xl-base-1.0</a>
and checkpoints that are not specifically fine-tuned on low resolutions.`,name:"width"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__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 video at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Custom timesteps to use for the denoising process with schedulers which support a <code>timesteps</code> argument
in their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is
passed will be used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>List[float]</code>, <em>optional</em>) &#x2014;
Custom sigmas to use for the denoising process with schedulers which support a <code>sigmas</code> argument in
their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is passed
will be used.`,name:"sigmas"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.denoising_end",description:`<strong>denoising_end</strong> (<code>float</code>, <em>optional</em>) &#x2014;
When specified, determines the fraction (between 0.0 and 1.0) of the total denoising process to be
completed before it is intentionally prematurely terminated. As a result, the returned sample will
still retain a substantial amount of noise as determined by the discrete timesteps selected by the
scheduler. The denoising_end parameter should ideally be utilized when this pipeline forms a part of a
&#x201C;Mixture of Denoisers&#x201D; multi-pipeline setup, as elaborated in <a href="https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/stable_diffusion_xl#refining-the-image-output" rel="nofollow"><strong>Refining the Image
Output</strong></a>`,name:"denoising_end"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 5.0) &#x2014;
Guidance scale as defined in <a href="https://huggingface.co/papers/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://huggingface.co/papers/2205.11487" 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 video quality.`,name:"guidance_scale"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the video generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.negative_prompt_2",description:`<strong>negative_prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the video generation to be sent to <code>tokenizer_2</code> and
<code>text_encoder_2</code>. If not defined, <code>negative_prompt</code> is used in both text-encoders`,name:"negative_prompt_2"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__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.AnimateDiffSDXLPipeline.__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://huggingface.co/papers/2010.02502" rel="nofollow">https://huggingface.co/papers/2010.02502</a>. Only
applies to <a href="/docs/diffusers/pr_12652/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__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.AnimateDiffSDXLPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for video
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will be generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffSDXLPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffSDXLPipeline.__call__.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting.
If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.negative_pooled_prompt_embeds",description:`<strong>negative_pooled_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, pooled negative_prompt_embeds will be generated from <code>negative_prompt</code>
input argument.`,name:"negative_pooled_prompt_embeds"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.ip_adapter_image",description:`<strong>ip_adapter_image</strong> &#x2014; (<code>PipelineImageInput</code>, <em>optional</em>):
Optional image input to work with IP Adapters.`,name:"ip_adapter_image"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.ip_adapter_image_embeds",description:`<strong>ip_adapter_image_embeds</strong> (<code>List[torch.Tensor]</code>, <em>optional</em>) &#x2014;
Pre-generated image embeddings for IP-Adapter. If not provided, embeddings are computed from the
<code>ip_adapter_image</code> input argument.`,name:"ip_adapter_image_embeds"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generated video. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>~pipelines.stable_diffusion_xl.AnimateDiffPipelineOutput</code> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.guidance_rescale",description:`<strong>guidance_rescale</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Guidance rescale factor proposed by <a href="https://huggingface.co/papers/2305.08891" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are
Flawed</a> <code>guidance_scale</code> is defined as <code>&#x3C6;</code> in equation 16. of
<a href="https://huggingface.co/papers/2305.08891" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are
Flawed</a>. Guidance rescale factor should fix overexposure when
using zero terminal SNR.`,name:"guidance_rescale"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.original_size",description:`<strong>original_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
If <code>original_size</code> is not the same as <code>target_size</code> the image will appear to be down- or upsampled.
<code>original_size</code> defaults to <code>(height, width)</code> if not specified. Part of SDXL&#x2019;s micro-conditioning as
explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"original_size"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.crops_coords_top_left",description:`<strong>crops_coords_top_left</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (0, 0)) &#x2014;
<code>crops_coords_top_left</code> can be used to generate an image that appears to be &#x201C;cropped&#x201D; from the position
<code>crops_coords_top_left</code> downwards. Favorable, well-centered images are usually achieved by setting
<code>crops_coords_top_left</code> to (0, 0). Part of SDXL&#x2019;s micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"crops_coords_top_left"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.target_size",description:`<strong>target_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
For most cases, <code>target_size</code> should be set to the desired height and width of the generated image. If
not specified it will default to <code>(height, width)</code>. Part of SDXL&#x2019;s micro-conditioning as explained in
section 2.2 of <a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"target_size"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.negative_original_size",description:`<strong>negative_original_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
To negatively condition the generation process based on a specific image resolution. Part of SDXL&#x2019;s
micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. For more
information, refer to this issue thread: <a href="https://github.com/huggingface/diffusers/issues/4208" rel="nofollow">https://github.com/huggingface/diffusers/issues/4208</a>.`,name:"negative_original_size"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.negative_crops_coords_top_left",description:`<strong>negative_crops_coords_top_left</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (0, 0)) &#x2014;
To negatively condition the generation process based on a specific crop coordinates. Part of SDXL&#x2019;s
micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. For more
information, refer to this issue thread: <a href="https://github.com/huggingface/diffusers/issues/4208" rel="nofollow">https://github.com/huggingface/diffusers/issues/4208</a>.`,name:"negative_crops_coords_top_left"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.negative_target_size",description:`<strong>negative_target_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
To negatively condition the generation process based on a target image resolution. It should be as same
as the <code>target_size</code> for most cases. Part of SDXL&#x2019;s micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. For more
information, refer to this issue thread: <a href="https://github.com/huggingface/diffusers/issues/4208" rel="nofollow">https://github.com/huggingface/diffusers/issues/4208</a>.`,name:"negative_target_size"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls at the end of each denoising steps during the inference. The function is called
with the following arguments: <code>callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)</code>. <code>callback_kwargs</code> will include a list of all tensors as specified by
<code>callback_on_step_end_tensor_inputs</code>.`,name:"callback_on_step_end"},{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) &#x2014;
The list of tensor inputs for the <code>callback_on_step_end</code> function. The tensors specified in the list
will be passed as <code>callback_kwargs</code> argument. You will only be able to include variables listed in the
<code>._callback_tensor_inputs</code> attribute of your pipeline class.`,name:"callback_on_step_end_tensor_inputs"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_sdxl.py#L869",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>If <code>return_dict</code> is <code>True</code>, <a
href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.pipelines.animatediff.AnimateDiffPipelineOutput"
>AnimateDiffPipelineOutput</a> is
returned, otherwise a <code>tuple</code> is returned where the first element is a list with the generated frames.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><a
href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.pipelines.animatediff.AnimateDiffPipelineOutput"
>AnimateDiffPipelineOutput</a> or <code>tuple</code></p>
`}}),re=new Va({props:{anchor:"diffusers.AnimateDiffSDXLPipeline.__call__.example",$$slots:{default:[Ar]},$$scope:{ctx:z}}}),dn=new U({props:{name:"encode_prompt",anchor:"diffusers.AnimateDiffSDXLPipeline.encode_prompt",parameters:[{name:"prompt",val:": str"},{name:"prompt_2",val:": typing.Optional[str] = None"},{name:"device",val:": typing.Optional[torch.device] = None"},{name:"num_videos_per_prompt",val:": int = 1"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"negative_prompt",val:": typing.Optional[str] = None"},{name:"negative_prompt_2",val:": typing.Optional[str] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"pooled_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_pooled_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"},{name:"clip_skip",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"diffusers.AnimateDiffSDXLPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"},{anchor:"diffusers.AnimateDiffSDXLPipeline.encode_prompt.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to be sent to the <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is
used in both text-encoders`,name:"prompt_2"},{anchor:"diffusers.AnimateDiffSDXLPipeline.encode_prompt.device",description:`<strong>device</strong> &#x2014; (<code>torch.device</code>):
torch device`,name:"device"},{anchor:"diffusers.AnimateDiffSDXLPipeline.encode_prompt.num_videos_per_prompt",description:`<strong>num_videos_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_videos_per_prompt"},{anchor:"diffusers.AnimateDiffSDXLPipeline.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.AnimateDiffSDXLPipeline.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.AnimateDiffSDXLPipeline.encode_prompt.negative_prompt_2",description:`<strong>negative_prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_2</code> and
<code>text_encoder_2</code>. If not defined, <code>negative_prompt</code> is used in both text-encoders`,name:"negative_prompt_2"},{anchor:"diffusers.AnimateDiffSDXLPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffSDXLPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffSDXLPipeline.encode_prompt.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting.
If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.AnimateDiffSDXLPipeline.encode_prompt.negative_pooled_prompt_embeds",description:`<strong>negative_pooled_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, pooled negative_prompt_embeds will be generated from <code>negative_prompt</code>
input argument.`,name:"negative_pooled_prompt_embeds"},{anchor:"diffusers.AnimateDiffSDXLPipeline.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"},{anchor:"diffusers.AnimateDiffSDXLPipeline.encode_prompt.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_sdxl.py#L329"}}),pn=new U({props:{name:"get_guidance_scale_embedding",anchor:"diffusers.AnimateDiffSDXLPipeline.get_guidance_scale_embedding",parameters:[{name:"w",val:": Tensor"},{name:"embedding_dim",val:": int = 512"},{name:"dtype",val:": dtype = torch.float32"}],parametersDescription:[{anchor:"diffusers.AnimateDiffSDXLPipeline.get_guidance_scale_embedding.w",description:`<strong>w</strong> (<code>torch.Tensor</code>) &#x2014;
Generate embedding vectors with a specified guidance scale to subsequently enrich timestep embeddings.`,name:"w"},{anchor:"diffusers.AnimateDiffSDXLPipeline.get_guidance_scale_embedding.embedding_dim",description:`<strong>embedding_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimension of the embeddings to generate.`,name:"embedding_dim"},{anchor:"diffusers.AnimateDiffSDXLPipeline.get_guidance_scale_embedding.dtype",description:`<strong>dtype</strong> (<code>torch.dtype</code>, <em>optional</em>, defaults to <code>torch.float32</code>) &#x2014;
Data type of the generated embeddings.`,name:"dtype"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_sdxl.py#L804",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>Embedding vectors with shape <code>(len(w), embedding_dim)</code>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>torch.Tensor</code></p>
`}}),cn=new b({props:{title:"AnimateDiffVideoToVideoPipeline",local:"diffusers.AnimateDiffVideoToVideoPipeline",headingTag:"h2"}}),mn=new U({props:{name:"class diffusers.AnimateDiffVideoToVideoPipeline",anchor:"diffusers.AnimateDiffVideoToVideoPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": typing.Union[diffusers.models.unets.unet_2d_condition.UNet2DConditionModel, diffusers.models.unets.unet_motion_model.UNetMotionModel]"},{name:"motion_adapter",val:": MotionAdapter"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_pndm.PNDMScheduler, diffusers.schedulers.scheduling_lms_discrete.LMSDiscreteScheduler, diffusers.schedulers.scheduling_euler_discrete.EulerDiscreteScheduler, diffusers.schedulers.scheduling_euler_ancestral_discrete.EulerAncestralDiscreteScheduler, diffusers.schedulers.scheduling_dpmsolver_multistep.DPMSolverMultistepScheduler]"},{name:"feature_extractor",val:": CLIPImageProcessor = None"},{name:"image_encoder",val:": CLIPVisionModelWithProjection = None"}],parametersDescription:[{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_12652/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.AnimateDiffVideoToVideoPipeline.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.AnimateDiffVideoToVideoPipeline.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.AnimateDiffVideoToVideoPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/pr_12652/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <a href="/docs/diffusers/pr_12652/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a> used to create a UNetMotionModel to denoise the encoded video latents.`,name:"unet"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.motion_adapter",description:`<strong>motion_adapter</strong> (<code>MotionAdapter</code>) &#x2014;
A <code>MotionAdapter</code> to be used in combination with <code>unet</code> to denoise the encoded video latents.`,name:"motion_adapter"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_12652/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/pr_12652/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/pr_12652/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/pr_12652/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video.py#L181"}}),fn=new U({props:{name:"__call__",anchor:"diffusers.AnimateDiffVideoToVideoPipeline.__call__",parameters:[{name:"video",val:": typing.List[typing.List[typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor]]]] = None"},{name:"prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"enforce_inference_steps",val:": bool = False"},{name:"timesteps",val:": typing.Optional[typing.List[int]] = None"},{name:"sigmas",val:": typing.Optional[typing.List[float]] = None"},{name:"guidance_scale",val:": float = 7.5"},{name:"strength",val:": float = 0.8"},{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.Tensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"ip_adapter_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor], NoneType] = None"},{name:"ip_adapter_image_embeds",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"cross_attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"clip_skip",val:": typing.Optional[int] = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int, typing.Dict], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": typing.List[str] = ['latents']"},{name:"decode_chunk_size",val:": int = 16"}],parametersDescription:[{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.__call__.video",description:`<strong>video</strong> (<code>List[PipelineImageInput]</code>) &#x2014;
The input video to condition the generation on. Must be a list of images/frames of the video.`,name:"video"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.__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.AnimateDiffVideoToVideoPipeline.__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.AnimateDiffVideoToVideoPipeline.__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.AnimateDiffVideoToVideoPipeline.__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.AnimateDiffVideoToVideoPipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Custom timesteps to use for the denoising process with schedulers which support a <code>timesteps</code> argument
in their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is
passed will be used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>List[float]</code>, <em>optional</em>) &#x2014;
Custom sigmas to use for the denoising process with schedulers which support a <code>sigmas</code> argument in
their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is passed
will be used.`,name:"sigmas"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Higher strength leads to more differences between original video and generated video.`,name:"strength"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.__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.AnimateDiffVideoToVideoPipeline.__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.AnimateDiffVideoToVideoPipeline.__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://huggingface.co/papers/2010.02502" rel="nofollow">DDIM</a> paper. Only
applies to the <a href="/docs/diffusers/pr_12652/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.__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.AnimateDiffVideoToVideoPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</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.AnimateDiffVideoToVideoPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffVideoToVideoPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffVideoToVideoPipeline.__call__.ip_adapter_image",description:`<strong>ip_adapter_image</strong> &#x2014; (<code>PipelineImageInput</code>, <em>optional</em>):
Optional image input to work with IP Adapters.`,name:"ip_adapter_image"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.__call__.ip_adapter_image_embeds",description:`<strong>ip_adapter_image_embeds</strong> (<code>List[torch.Tensor]</code>, <em>optional</em>) &#x2014;
Pre-generated image embeddings for IP-Adapter. It should be a list of length same as number of
IP-adapters. Each element should be a tensor of shape <code>(batch_size, num_images, emb_dim)</code>. It should
contain the negative image embedding if <code>do_classifier_free_guidance</code> is set to <code>True</code>. If not
provided, embeddings are computed from the <code>ip_adapter_image</code> input argument.`,name:"ip_adapter_image_embeds"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generated video. Choose between <code>torch.Tensor</code>, <code>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>AnimateDiffPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.__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"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.__call__.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls at the end of each denoising steps during the inference. The function is called
with the following arguments: <code>callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)</code>. <code>callback_kwargs</code> will include a list of all tensors as specified by
<code>callback_on_step_end_tensor_inputs</code>.`,name:"callback_on_step_end"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) &#x2014;
The list of tensor inputs for the <code>callback_on_step_end</code> function. The tensors specified in the list
will be passed as <code>callback_kwargs</code> argument. You will only be able to include variables listed in the
<code>._callback_tensor_inputs</code> attribute of your pipeline class.`,name:"callback_on_step_end_tensor_inputs"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.__call__.decode_chunk_size",description:`<strong>decode_chunk_size</strong> (<code>int</code>, defaults to <code>16</code>) &#x2014;
The number of frames to decode at a time when calling <code>decode_latents</code> method.`,name:"decode_chunk_size"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video.py#L746",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>If <code>return_dict</code> is <code>True</code>, <a
href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.pipelines.animatediff.AnimateDiffPipelineOutput"
>pipelines.animatediff.pipeline_output.AnimateDiffPipelineOutput</a> is
returned, otherwise a <code>tuple</code> is returned where the first element is a list with the generated frames.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><a
href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.pipelines.animatediff.AnimateDiffPipelineOutput"
>pipelines.animatediff.pipeline_output.AnimateDiffPipelineOutput</a> or <code>tuple</code></p>
`}}),un=new U({props:{name:"encode_prompt",anchor:"diffusers.AnimateDiffVideoToVideoPipeline.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.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"},{name:"clip_skip",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.encode_prompt.device",description:`<strong>device</strong> &#x2014; (<code>torch.device</code>):
torch device`,name:"device"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.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.AnimateDiffVideoToVideoPipeline.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.AnimateDiffVideoToVideoPipeline.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.AnimateDiffVideoToVideoPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffVideoToVideoPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffVideoToVideoPipeline.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"},{anchor:"diffusers.AnimateDiffVideoToVideoPipeline.encode_prompt.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video.py#L258"}}),gn=new b({props:{title:"AnimateDiffVideoToVideoControlNetPipeline",local:"diffusers.AnimateDiffVideoToVideoControlNetPipeline",headingTag:"h2"}}),hn=new U({props:{name:"class diffusers.AnimateDiffVideoToVideoControlNetPipeline",anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": typing.Union[diffusers.models.unets.unet_2d_condition.UNet2DConditionModel, diffusers.models.unets.unet_motion_model.UNetMotionModel]"},{name:"motion_adapter",val:": MotionAdapter"},{name:"controlnet",val:": typing.Union[diffusers.models.controlnets.controlnet.ControlNetModel, typing.List[diffusers.models.controlnets.controlnet.ControlNetModel], typing.Tuple[diffusers.models.controlnets.controlnet.ControlNetModel], diffusers.models.controlnets.multicontrolnet.MultiControlNetModel]"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_pndm.PNDMScheduler, diffusers.schedulers.scheduling_lms_discrete.LMSDiscreteScheduler, diffusers.schedulers.scheduling_euler_discrete.EulerDiscreteScheduler, diffusers.schedulers.scheduling_euler_ancestral_discrete.EulerAncestralDiscreteScheduler, diffusers.schedulers.scheduling_dpmsolver_multistep.DPMSolverMultistepScheduler]"},{name:"feature_extractor",val:": CLIPImageProcessor = None"},{name:"image_encoder",val:": CLIPVisionModelWithProjection = None"}],parametersDescription:[{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_12652/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.AnimateDiffVideoToVideoControlNetPipeline.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.AnimateDiffVideoToVideoControlNetPipeline.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.AnimateDiffVideoToVideoControlNetPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/pr_12652/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <a href="/docs/diffusers/pr_12652/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a> used to create a UNetMotionModel to denoise the encoded video latents.`,name:"unet"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.motion_adapter",description:`<strong>motion_adapter</strong> (<code>MotionAdapter</code>) &#x2014;
A <code>MotionAdapter</code> to be used in combination with <code>unet</code> to denoise the encoded video latents.`,name:"motion_adapter"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/pr_12652/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code> or <code>Tuple[ControlNetModel]</code> or <code>MultiControlNetModel</code>) &#x2014;
Provides additional conditioning to the <code>unet</code> during the denoising process. If you set multiple
ControlNets as a list, the outputs from each ControlNet are added together to create one combined
additional conditioning.`,name:"controlnet"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_12652/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/pr_12652/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/pr_12652/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/pr_12652/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video_controlnet.py#L199"}}),_n=new U({props:{name:"__call__",anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__",parameters:[{name:"video",val:": typing.List[typing.List[typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor]]]] = None"},{name:"prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"enforce_inference_steps",val:": bool = False"},{name:"timesteps",val:": typing.Optional[typing.List[int]] = None"},{name:"sigmas",val:": typing.Optional[typing.List[float]] = None"},{name:"guidance_scale",val:": float = 7.5"},{name:"strength",val:": float = 0.8"},{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.Tensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"ip_adapter_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor], NoneType] = None"},{name:"ip_adapter_image_embeds",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"conditioning_frames",val:": typing.Optional[typing.List[typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor]]]] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"cross_attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 1.0"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"},{name:"clip_skip",val:": typing.Optional[int] = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int, typing.Dict], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": typing.List[str] = ['latents']"},{name:"decode_chunk_size",val:": int = 16"}],parametersDescription:[{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__.video",description:`<strong>video</strong> (<code>List[PipelineImageInput]</code>) &#x2014;
The input video to condition the generation on. Must be a list of images/frames of the video.`,name:"video"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__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.AnimateDiffVideoToVideoControlNetPipeline.__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.AnimateDiffVideoToVideoControlNetPipeline.__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.AnimateDiffVideoToVideoControlNetPipeline.__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.AnimateDiffVideoToVideoControlNetPipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Custom timesteps to use for the denoising process with schedulers which support a <code>timesteps</code> argument
in their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is
passed will be used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>List[float]</code>, <em>optional</em>) &#x2014;
Custom sigmas to use for the denoising process with schedulers which support a <code>sigmas</code> argument in
their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is passed
will be used.`,name:"sigmas"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Higher strength leads to more differences between original video and generated video.`,name:"strength"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__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.AnimateDiffVideoToVideoControlNetPipeline.__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.AnimateDiffVideoToVideoControlNetPipeline.__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://huggingface.co/papers/2010.02502" rel="nofollow">DDIM</a> paper. Only
applies to the <a href="/docs/diffusers/pr_12652/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__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.AnimateDiffVideoToVideoControlNetPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</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.AnimateDiffVideoToVideoControlNetPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffVideoToVideoControlNetPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffVideoToVideoControlNetPipeline.__call__.ip_adapter_image",description:`<strong>ip_adapter_image</strong> &#x2014; (<code>PipelineImageInput</code>, <em>optional</em>):
Optional image input to work with IP Adapters.`,name:"ip_adapter_image"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__.ip_adapter_image_embeds",description:`<strong>ip_adapter_image_embeds</strong> (<code>List[torch.Tensor]</code>, <em>optional</em>) &#x2014;
Pre-generated image embeddings for IP-Adapter. It should be a list of length same as number of
IP-adapters. Each element should be a tensor of shape <code>(batch_size, num_images, emb_dim)</code>. It should
contain the negative image embedding if <code>do_classifier_free_guidance</code> is set to <code>True</code>. If not
provided, embeddings are computed from the <code>ip_adapter_image</code> input argument.`,name:"ip_adapter_image_embeds"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__.conditioning_frames",description:`<strong>conditioning_frames</strong> (<code>List[PipelineImageInput]</code>, <em>optional</em>) &#x2014;
The ControlNet input condition to provide guidance to the <code>unet</code> for generation. If multiple
ControlNets are specified, images must be passed as a list such that each element of the list can be
correctly batched for input to a single ControlNet.`,name:"conditioning_frames"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generated video. Choose between <code>torch.Tensor</code>, <code>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>AnimateDiffPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__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"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the ControlNet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original <code>unet</code>. If multiple ControlNets are specified in <code>init</code>, you can set
the corresponding scale as a list.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
The ControlNet encoder tries to recognize the content of the input image even if you remove all
prompts. A <code>guidance_scale</code> value between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the ControlNet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the ControlNet stops applying.`,name:"control_guidance_end"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls at the end of each denoising steps during the inference. The function is called
with the following arguments: <code>callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)</code>. <code>callback_kwargs</code> will include a list of all tensors as specified by
<code>callback_on_step_end_tensor_inputs</code>.`,name:"callback_on_step_end"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) &#x2014;
The list of tensor inputs for the <code>callback_on_step_end</code> function. The tensors specified in the list
will be passed as <code>callback_kwargs</code> argument. You will only be able to include variables listed in the
<code>._callback_tensor_inputs</code> attribute of your pipeline class.`,name:"callback_on_step_end_tensor_inputs"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.__call__.decode_chunk_size",description:`<strong>decode_chunk_size</strong> (<code>int</code>, defaults to <code>16</code>) &#x2014;
The number of frames to decode at a time when calling <code>decode_latents</code> method.`,name:"decode_chunk_size"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video_controlnet.py#L911",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>If <code>return_dict</code> is <code>True</code>, <a
href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.pipelines.animatediff.AnimateDiffPipelineOutput"
>pipelines.animatediff.pipeline_output.AnimateDiffPipelineOutput</a> is
returned, otherwise a <code>tuple</code> is returned where the first element is a list with the generated frames.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><a
href="/docs/diffusers/pr_12652/en/api/pipelines/animatediff#diffusers.pipelines.animatediff.AnimateDiffPipelineOutput"
>pipelines.animatediff.pipeline_output.AnimateDiffPipelineOutput</a> or <code>tuple</code></p>
`}}),yn=new U({props:{name:"encode_prompt",anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.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.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"},{name:"clip_skip",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.encode_prompt.device",description:`<strong>device</strong> &#x2014; (<code>torch.device</code>):
torch device`,name:"device"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.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.AnimateDiffVideoToVideoControlNetPipeline.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.AnimateDiffVideoToVideoControlNetPipeline.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.AnimateDiffVideoToVideoControlNetPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffVideoToVideoControlNetPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</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.AnimateDiffVideoToVideoControlNetPipeline.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"},{anchor:"diffusers.AnimateDiffVideoToVideoControlNetPipeline.encode_prompt.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_animatediff_video2video_controlnet.py#L289"}}),Mn=new b({props:{title:"AnimateDiffPipelineOutput",local:"diffusers.pipelines.animatediff.AnimateDiffPipelineOutput",headingTag:"h2"}}),bn=new U({props:{name:"class diffusers.pipelines.animatediff.AnimateDiffPipelineOutput",anchor:"diffusers.pipelines.animatediff.AnimateDiffPipelineOutput",parameters:[{name:"frames",val:": typing.Union[torch.Tensor, numpy.ndarray, typing.List[typing.List[PIL.Image.Image]]]"}],parametersDescription:[{anchor:"diffusers.pipelines.animatediff.AnimateDiffPipelineOutput.frames",description:`<strong>frames</strong> (<code>torch.Tensor</code>, <code>np.ndarray</code>, or List[List[PIL.Image.Image]]) &#x2014;
List of video outputs - It can be a nested list of length <code>batch_size,</code> with each sub-list containing
denoised`,name:"frames"}],source:"https://github.com/huggingface/diffusers/blob/vr_12652/src/diffusers/pipelines/animatediff/pipeline_output.py#L12"}}),wn=new kr({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/animatediff.md"}}),{c(){_=a("meta"),R=i(),v=a("p"),M=i(),p(w.$$.fragment),h=i(),p(j.$$.fragment),Mo=i(),H=a("div"),H.innerHTML=ka,bo=i(),p(fe.$$.fragment),wo=i(),ue=a("p"),ue.innerHTML=Ba,To=i(),ge=a("p"),ge.textContent=Na,Jo=i(),he=a("p"),he.innerHTML=Aa,vo=i(),p(_e.$$.fragment),Uo=i(),ye=a("table"),ye.innerHTML=Da,Zo=i(),p(Me.$$.fragment),jo=i(),be=a("p"),be.innerHTML=Ra,Io=i(),p(we.$$.fragment),Co=i(),p(Te.$$.fragment),Go=i(),Je=a("p"),Je.textContent=Xa,Wo=i(),ve=a("p"),ve.innerHTML=Sa,Vo=i(),p(Ue.$$.fragment),xo=i(),Ze=a("p"),Ze.textContent=La,ko=i(),je=a("table"),je.innerHTML=Ya,Bo=i(),$=a("blockquote"),$.innerHTML=Ea,No=i(),p(Ie.$$.fragment),Ao=i(),Ce=a("p"),Ce.innerHTML=Qa,Do=i(),p(Ge.$$.fragment),Ro=i(),We=a("p"),We.textContent=Pa,Xo=i(),q=a("table"),q.innerHTML=Fa,So=i(),p(Ve.$$.fragment),Lo=i(),xe=a("p"),xe.innerHTML=za,Yo=i(),ke=a("p"),ke.textContent=Ha,Eo=i(),Be=a("p"),Be.innerHTML=$a,Qo=i(),Ne=a("p"),Ne.textContent=qa,Po=i(),Ae=a("ul"),Ae.innerHTML=Oa,Fo=i(),p(De.$$.fragment),zo=i(),p(Re.$$.fragment),Ho=i(),Xe=a("p"),Xe.textContent=Ka,$o=i(),Se=a("center"),Se.innerHTML=el,O=a("table"),O.innerHTML=tl,qo=i(),p(Le.$$.fragment),Oo=i(),p(Ye.$$.fragment),Ko=i(),Ee=a("p"),Ee.textContent=nl,ei=i(),Qe=a("center"),Qe.innerHTML=ol,K=a("table"),K.innerHTML=il,ti=i(),p(Pe.$$.fragment),ni=i(),Fe=a("p"),Fe.textContent=sl,oi=i(),p(ze.$$.fragment),ii=i(),p(He.$$.fragment),si=i(),$e=a("p"),$e.textContent=al,ai=i(),p(qe.$$.fragment),li=i(),Oe=a("p"),Oe.textContent=ll,ri=i(),Ke=a("table"),Ke.innerHTML=rl,di=i(),p(et.$$.fragment),pi=i(),tt=a("p"),tt.innerHTML=dl,ci=i(),nt=a("p"),nt.textContent=pl,mi=i(),p(ot.$$.fragment),fi=i(),it=a("p"),it.textContent=cl,ui=i(),ee=a("table"),ee.innerHTML=ml,gi=i(),st=a("p"),st.innerHTML=fl,hi=i(),p(at.$$.fragment),_i=i(),lt=a("p"),lt.innerHTML=ul,yi=i(),p(rt.$$.fragment),Mi=i(),dt=a("table"),dt.innerHTML=gl,bi=i(),p(pt.$$.fragment),wi=i(),ct=a("p"),ct.innerHTML=hl,Ti=i(),mt=a("p"),mt.textContent=_l,Ji=i(),p(ft.$$.fragment),vi=i(),ut=a("p"),ut.textContent=yl,Ui=i(),p(gt.$$.fragment),Zi=i(),ht=a("table"),ht.innerHTML=Ml,ji=i(),p(_t.$$.fragment),Ii=i(),yt=a("p"),yt.innerHTML=bl,Ci=i(),Mt=a("p"),Mt.textContent=wl,Gi=i(),bt=a("p"),bt.textContent=Tl,Wi=i(),p(wt.$$.fragment),Vi=i(),te=a("blockquote"),te.innerHTML=Jl,xi=i(),ne=a("blockquote"),ne.innerHTML=vl,ki=i(),Tt=a("table"),Tt.innerHTML=Ul,Bi=i(),p(Jt.$$.fragment),Ni=i(),vt=a("p"),vt.innerHTML=Zl,Ai=i(),p(Ut.$$.fragment),Di=i(),Zt=a("table"),Zt.innerHTML=jl,Ri=i(),jt=a("p"),jt.innerHTML=Il,Xi=i(),p(It.$$.fragment),Si=i(),Ct=a("table"),Ct.innerHTML=Cl,Li=i(),p(Gt.$$.fragment),Yi=i(),Wt=a("p"),Wt.innerHTML=Gl,Ei=i(),Vt=a("p"),Vt.textContent=Wl,Qi=i(),xt=a("p"),xt.textContent=Vl,Pi=i(),kt=a("ul"),kt.innerHTML=xl,Fi=i(),Bt=a("p"),Bt.textContent=kl,zi=i(),p(Nt.$$.fragment),Hi=i(),At=a("p"),At.innerHTML=Bl,$i=i(),Dt=a("p"),Dt.textContent=Nl,qi=i(),p(Rt.$$.fragment),Oi=i(),p(Xt.$$.fragment),Ki=i(),St=a("p"),St.innerHTML=Al,es=i(),p(Lt.$$.fragment),ts=i(),Yt=a("p"),Yt.innerHTML=Dl,ns=i(),p(Et.$$.fragment),os=i(),Qt=a("p"),Qt.innerHTML=Rl,is=i(),p(Pt.$$.fragment),ss=i(),p(Ft.$$.fragment),as=i(),I=a("div"),p(zt.$$.fragment),Is=i(),Jn=a("p"),Jn.textContent=Xl,Cs=i(),vn=a("p"),vn.innerHTML=Sl,Gs=i(),Un=a("p"),Un.textContent=Ll,Ws=i(),Zn=a("ul"),Zn.innerHTML=Yl,Vs=i(),S=a("div"),p(Ht.$$.fragment),xs=i(),jn=a("p"),jn.textContent=El,ks=i(),p(oe.$$.fragment),Bs=i(),ie=a("div"),p($t.$$.fragment),Ns=i(),In=a("p"),In.textContent=Ql,ls=i(),p(qt.$$.fragment),rs=i(),C=a("div"),p(Ot.$$.fragment),As=i(),Cn=a("p"),Cn.textContent=Pl,Ds=i(),Gn=a("p"),Gn.innerHTML=Fl,Rs=i(),Wn=a("p"),Wn.textContent=zl,Xs=i(),Vn=a("ul"),Vn.innerHTML=Hl,Ss=i(),L=a("div"),p(Kt.$$.fragment),Ls=i(),xn=a("p"),xn.textContent=$l,Ys=i(),kn=a("p"),kn.textContent=ql,Es=i(),se=a("div"),p(en.$$.fragment),Qs=i(),Bn=a("p"),Bn.textContent=Ol,ds=i(),p(tn.$$.fragment),ps=i(),G=a("div"),p(nn.$$.fragment),Ps=i(),Nn=a("p"),Nn.innerHTML=Kl,Fs=i(),An=a("p"),An.innerHTML=er,zs=i(),Dn=a("p"),Dn.textContent=tr,Hs=i(),Rn=a("ul"),Rn.innerHTML=nr,$s=i(),Y=a("div"),p(on.$$.fragment),qs=i(),Xn=a("p"),Xn.textContent=or,Os=i(),p(ae.$$.fragment),Ks=i(),le=a("div"),p(sn.$$.fragment),ea=i(),Sn=a("p"),Sn.textContent=ir,cs=i(),p(an.$$.fragment),ms=i(),J=a("div"),p(ln.$$.fragment),ta=i(),Ln=a("p"),Ln.textContent=sr,na=i(),Yn=a("p"),Yn.innerHTML=ar,oa=i(),En=a("p"),En.textContent=lr,ia=i(),Qn=a("ul"),Qn.innerHTML=rr,sa=i(),E=a("div"),p(rn.$$.fragment),aa=i(),Pn=a("p"),Pn.textContent=dr,la=i(),p(re.$$.fragment),ra=i(),de=a("div"),p(dn.$$.fragment),da=i(),Fn=a("p"),Fn.textContent=pr,pa=i(),pe=a("div"),p(pn.$$.fragment),ca=i(),zn=a("p"),zn.innerHTML=cr,fs=i(),p(cn.$$.fragment),us=i(),W=a("div"),p(mn.$$.fragment),ma=i(),Hn=a("p"),Hn.textContent=mr,fa=i(),$n=a("p"),$n.innerHTML=fr,ua=i(),qn=a("p"),qn.textContent=ur,ga=i(),On=a("ul"),On.innerHTML=gr,ha=i(),Q=a("div"),p(fn.$$.fragment),_a=i(),Kn=a("p"),Kn.textContent=hr,ya=i(),eo=a("p"),eo.textContent=_r,Ma=i(),ce=a("div"),p(un.$$.fragment),ba=i(),to=a("p"),to.textContent=yr,gs=i(),p(gn.$$.fragment),hs=i(),V=a("div"),p(hn.$$.fragment),wa=i(),no=a("p"),no.textContent=Mr,Ta=i(),oo=a("p"),oo.innerHTML=br,Ja=i(),io=a("p"),io.textContent=wr,va=i(),so=a("ul"),so.innerHTML=Tr,Ua=i(),P=a("div"),p(_n.$$.fragment),Za=i(),ao=a("p"),ao.textContent=Jr,ja=i(),lo=a("p"),lo.textContent=vr,Ia=i(),me=a("div"),p(yn.$$.fragment),Ca=i(),ro=a("p"),ro.textContent=Ur,_s=i(),p(Mn.$$.fragment),ys=i(),X=a("div"),p(bn.$$.fragment),Ga=i(),po=a("p"),po.textContent=Zr,Wa=i(),co=a("p"),co.innerHTML=jr,Ms=i(),p(wn.$$.fragment),bs=i(),yo=a("p"),this.h()},l(e){const t=Vr("svelte-u9bgzb",document.head);_=l(t,"META",{name:!0,content:!0}),t.forEach(n),R=s(e),v=l(e,"P",{}),T(v).forEach(n),M=s(e),c(w.$$.fragment,e),h=s(e),c(j.$$.fragment,e),Mo=s(e),H=l(e,"DIV",{class:!0,"data-svelte-h":!0}),d(H)!=="svelte-si9ct8"&&(H.innerHTML=ka),bo=s(e),c(fe.$$.fragment,e),wo=s(e),ue=l(e,"P",{"data-svelte-h":!0}),d(ue)!=="svelte-1qkyhxp"&&(ue.innerHTML=Ba),To=s(e),ge=l(e,"P",{"data-svelte-h":!0}),d(ge)!=="svelte-wu27l3"&&(ge.textContent=Na),Jo=s(e),he=l(e,"P",{"data-svelte-h":!0}),d(he)!=="svelte-17654bv"&&(he.innerHTML=Aa),vo=s(e),c(_e.$$.fragment,e),Uo=s(e),ye=l(e,"TABLE",{"data-svelte-h":!0}),d(ye)!=="svelte-r57ep6"&&(ye.innerHTML=Da),Zo=s(e),c(Me.$$.fragment,e),jo=s(e),be=l(e,"P",{"data-svelte-h":!0}),d(be)!=="svelte-1eu5pwh"&&(be.innerHTML=Ra),Io=s(e),c(we.$$.fragment,e),Co=s(e),c(Te.$$.fragment,e),Go=s(e),Je=l(e,"P",{"data-svelte-h":!0}),d(Je)!=="svelte-q9bvzo"&&(Je.textContent=Xa),Wo=s(e),ve=l(e,"P",{"data-svelte-h":!0}),d(ve)!=="svelte-o3l8n4"&&(ve.innerHTML=Sa),Vo=s(e),c(Ue.$$.fragment,e),xo=s(e),Ze=l(e,"P",{"data-svelte-h":!0}),d(Ze)!=="svelte-1pxzje"&&(Ze.textContent=La),ko=s(e),je=l(e,"TABLE",{"data-svelte-h":!0}),d(je)!=="svelte-5250wa"&&(je.innerHTML=Ya),Bo=s(e),$=l(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),d($)!=="svelte-1hn8tug"&&($.innerHTML=Ea),No=s(e),c(Ie.$$.fragment,e),Ao=s(e),Ce=l(e,"P",{"data-svelte-h":!0}),d(Ce)!=="svelte-d4p8de"&&(Ce.innerHTML=Qa),Do=s(e),c(Ge.$$.fragment,e),Ro=s(e),We=l(e,"P",{"data-svelte-h":!0}),d(We)!=="svelte-1pxzje"&&(We.textContent=Pa),Xo=s(e),q=l(e,"TABLE",{align:!0,"data-svelte-h":!0}),d(q)!=="svelte-17jw58u"&&(q.innerHTML=Fa),So=s(e),c(Ve.$$.fragment,e),Lo=s(e),xe=l(e,"P",{"data-svelte-h":!0}),d(xe)!=="svelte-w61v54"&&(xe.innerHTML=za),Yo=s(e),ke=l(e,"P",{"data-svelte-h":!0}),d(ke)!=="svelte-1cwsb16"&&(ke.textContent=Ha),Eo=s(e),Be=l(e,"P",{"data-svelte-h":!0}),d(Be)!=="svelte-uew8uc"&&(Be.innerHTML=$a),Qo=s(e),Ne=l(e,"P",{"data-svelte-h":!0}),d(Ne)!=="svelte-1vgzuo0"&&(Ne.textContent=qa),Po=s(e),Ae=l(e,"UL",{"data-svelte-h":!0}),d(Ae)!=="svelte-1135q6s"&&(Ae.innerHTML=Oa),Fo=s(e),c(De.$$.fragment,e),zo=s(e),c(Re.$$.fragment,e),Ho=s(e),Xe=l(e,"P",{"data-svelte-h":!0}),d(Xe)!=="svelte-1pxzje"&&(Xe.textContent=Ka),$o=s(e),Se=l(e,"CENTER",{"data-svelte-h":!0}),d(Se)!=="svelte-1a6zue0"&&(Se.innerHTML=el),O=l(e,"TABLE",{align:!0,"data-svelte-h":!0}),d(O)!=="svelte-1yjcm20"&&(O.innerHTML=tl),qo=s(e),c(Le.$$.fragment,e),Oo=s(e),c(Ye.$$.fragment,e),Ko=s(e),Ee=l(e,"P",{"data-svelte-h":!0}),d(Ee)!=="svelte-1pxzje"&&(Ee.textContent=nl),ei=s(e),Qe=l(e,"CENTER",{"data-svelte-h":!0}),d(Qe)!=="svelte-5k7u1e"&&(Qe.innerHTML=ol),K=l(e,"TABLE",{align:!0,"data-svelte-h":!0}),d(K)!=="svelte-14oq4l5"&&(K.innerHTML=il),ti=s(e),c(Pe.$$.fragment,e),ni=s(e),Fe=l(e,"P",{"data-svelte-h":!0}),d(Fe)!=="svelte-hcpa8p"&&(Fe.textContent=sl),oi=s(e),c(ze.$$.fragment,e),ii=s(e),c(He.$$.fragment,e),si=s(e),$e=l(e,"P",{"data-svelte-h":!0}),d($e)!=="svelte-v5wx3"&&($e.textContent=al),ai=s(e),c(qe.$$.fragment,e),li=s(e),Oe=l(e,"P",{"data-svelte-h":!0}),d(Oe)!=="svelte-1pxzje"&&(Oe.textContent=ll),ri=s(e),Ke=l(e,"TABLE",{"data-svelte-h":!0}),d(Ke)!=="svelte-1hj8351"&&(Ke.innerHTML=rl),di=s(e),c(et.$$.fragment,e),pi=s(e),tt=l(e,"P",{"data-svelte-h":!0}),d(tt)!=="svelte-t77lll"&&(tt.innerHTML=dl),ci=s(e),nt=l(e,"P",{"data-svelte-h":!0}),d(nt)!=="svelte-1tvfm6v"&&(nt.textContent=pl),mi=s(e),c(ot.$$.fragment,e),fi=s(e),it=l(e,"P",{"data-svelte-h":!0}),d(it)!=="svelte-1pxzje"&&(it.textContent=cl),ui=s(e),ee=l(e,"TABLE",{align:!0,"data-svelte-h":!0}),d(ee)!=="svelte-tjy703"&&(ee.innerHTML=ml),gi=s(e),st=l(e,"P",{"data-svelte-h":!0}),d(st)!=="svelte-xbdauq"&&(st.innerHTML=fl),hi=s(e),c(at.$$.fragment,e),_i=s(e),lt=l(e,"P",{"data-svelte-h":!0}),d(lt)!=="svelte-u1dwwg"&&(lt.innerHTML=ul),yi=s(e),c(rt.$$.fragment,e),Mi=s(e),dt=l(e,"TABLE",{"data-svelte-h":!0}),d(dt)!=="svelte-16prig"&&(dt.innerHTML=gl),bi=s(e),c(pt.$$.fragment,e),wi=s(e),ct=l(e,"P",{"data-svelte-h":!0}),d(ct)!=="svelte-1gecok3"&&(ct.innerHTML=hl),Ti=s(e),mt=l(e,"P",{"data-svelte-h":!0}),d(mt)!=="svelte-26fcye"&&(mt.textContent=_l),Ji=s(e),c(ft.$$.fragment,e),vi=s(e),ut=l(e,"P",{"data-svelte-h":!0}),d(ut)!=="svelte-1e37vkb"&&(ut.textContent=yl),Ui=s(e),c(gt.$$.fragment,e),Zi=s(e),ht=l(e,"TABLE",{"data-svelte-h":!0}),d(ht)!=="svelte-3p6096"&&(ht.innerHTML=Ml),ji=s(e),c(_t.$$.fragment,e),Ii=s(e),yt=l(e,"P",{"data-svelte-h":!0}),d(yt)!=="svelte-cdtrwq"&&(yt.innerHTML=bl),Ci=s(e),Mt=l(e,"P",{"data-svelte-h":!0}),d(Mt)!=="svelte-i9hpov"&&(Mt.textContent=wl),Gi=s(e),bt=l(e,"P",{"data-svelte-h":!0}),d(bt)!=="svelte-1qq4ux4"&&(bt.textContent=Tl),Wi=s(e),c(wt.$$.fragment,e),Vi=s(e),te=l(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),d(te)!=="svelte-v1f8er"&&(te.innerHTML=Jl),xi=s(e),ne=l(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),d(ne)!=="svelte-r1jcqf"&&(ne.innerHTML=vl),ki=s(e),Tt=l(e,"TABLE",{"data-svelte-h":!0}),d(Tt)!=="svelte-178x3s7"&&(Tt.innerHTML=Ul),Bi=s(e),c(Jt.$$.fragment,e),Ni=s(e),vt=l(e,"P",{"data-svelte-h":!0}),d(vt)!=="svelte-10musd5"&&(vt.innerHTML=Zl),Ai=s(e),c(Ut.$$.fragment,e),Di=s(e),Zt=l(e,"TABLE",{"data-svelte-h":!0}),d(Zt)!=="svelte-1rjpilt"&&(Zt.innerHTML=jl),Ri=s(e),jt=l(e,"P",{"data-svelte-h":!0}),d(jt)!=="svelte-1q8gfh6"&&(jt.innerHTML=Il),Xi=s(e),c(It.$$.fragment,e),Si=s(e),Ct=l(e,"TABLE",{"data-svelte-h":!0}),d(Ct)!=="svelte-17fpusd"&&(Ct.innerHTML=Cl),Li=s(e),c(Gt.$$.fragment,e),Yi=s(e),Wt=l(e,"P",{"data-svelte-h":!0}),d(Wt)!=="svelte-1areg05"&&(Wt.innerHTML=Gl),Ei=s(e),Vt=l(e,"P",{"data-svelte-h":!0}),d(Vt)!=="svelte-270hsg"&&(Vt.textContent=Wl),Qi=s(e),xt=l(e,"P",{"data-svelte-h":!0}),d(xt)!=="svelte-m78lqj"&&(xt.textContent=Vl),Pi=s(e),kt=l(e,"UL",{"data-svelte-h":!0}),d(kt)!=="svelte-15yqp38"&&(kt.innerHTML=xl),Fi=s(e),Bt=l(e,"P",{"data-svelte-h":!0}),d(Bt)!=="svelte-2t84et"&&(Bt.textContent=kl),zi=s(e),c(Nt.$$.fragment,e),Hi=s(e),At=l(e,"P",{"data-svelte-h":!0}),d(At)!=="svelte-1fv6a77"&&(At.innerHTML=Bl),$i=s(e),Dt=l(e,"P",{"data-svelte-h":!0}),d(Dt)!=="svelte-15w43u7"&&(Dt.textContent=Nl),qi=s(e),c(Rt.$$.fragment,e),Oi=s(e),c(Xt.$$.fragment,e),Ki=s(e),St=l(e,"P",{"data-svelte-h":!0}),d(St)!=="svelte-1frb8xa"&&(St.innerHTML=Al),es=s(e),c(Lt.$$.fragment,e),ts=s(e),Yt=l(e,"P",{"data-svelte-h":!0}),d(Yt)!=="svelte-1xew7n9"&&(Yt.innerHTML=Dl),ns=s(e),c(Et.$$.fragment,e),os=s(e),Qt=l(e,"P",{"data-svelte-h":!0}),d(Qt)!=="svelte-l2zwkj"&&(Qt.innerHTML=Rl),is=s(e),c(Pt.$$.fragment,e),ss=s(e),c(Ft.$$.fragment,e),as=s(e),I=l(e,"DIV",{class:!0});var x=T(I);c(zt.$$.fragment,x),Is=s(x),Jn=l(x,"P",{"data-svelte-h":!0}),d(Jn)!=="svelte-19ipoo4"&&(Jn.textContent=Xl),Cs=s(x),vn=l(x,"P",{"data-svelte-h":!0}),d(vn)!=="svelte-5l9ik"&&(vn.innerHTML=Sl),Gs=s(x),Un=l(x,"P",{"data-svelte-h":!0}),d(Un)!=="svelte-14s6m4u"&&(Un.textContent=Ll),Ws=s(x),Zn=l(x,"UL",{"data-svelte-h":!0}),d(Zn)!=="svelte-16n8z58"&&(Zn.innerHTML=Yl),Vs=s(x),S=l(x,"DIV",{class:!0});var F=T(S);c(Ht.$$.fragment,F),xs=s(F),jn=l(F,"P",{"data-svelte-h":!0}),d(jn)!=="svelte-50j04k"&&(jn.textContent=El),ks=s(F),c(oe.$$.fragment,F),F.forEach(n),Bs=s(x),ie=l(x,"DIV",{class:!0});var Tn=T(ie);c($t.$$.fragment,Tn),Ns=s(Tn),In=l(Tn,"P",{"data-svelte-h":!0}),d(In)!=="svelte-16q0ax1"&&(In.textContent=Ql),Tn.forEach(n),x.forEach(n),ls=s(e),c(qt.$$.fragment,e),rs=s(e),C=l(e,"DIV",{class:!0});var B=T(C);c(Ot.$$.fragment,B),As=s(B),Cn=l(B,"P",{"data-svelte-h":!0}),d(Cn)!=="svelte-p8e5gq"&&(Cn.textContent=Pl),Ds=s(B),Gn=l(B,"P",{"data-svelte-h":!0}),d(Gn)!=="svelte-5l9ik"&&(Gn.innerHTML=Fl),Rs=s(B),Wn=l(B,"P",{"data-svelte-h":!0}),d(Wn)!=="svelte-14s6m4u"&&(Wn.textContent=zl),Xs=s(B),Vn=l(B,"UL",{"data-svelte-h":!0}),d(Vn)!=="svelte-16n8z58"&&(Vn.innerHTML=Hl),Ss=s(B),L=l(B,"DIV",{class:!0});var mo=T(L);c(Kt.$$.fragment,mo),Ls=s(mo),xn=l(mo,"P",{"data-svelte-h":!0}),d(xn)!=="svelte-50j04k"&&(xn.textContent=$l),Ys=s(mo),kn=l(mo,"P",{"data-svelte-h":!0}),d(kn)!=="svelte-kvfsh7"&&(kn.textContent=ql),mo.forEach(n),Es=s(B),se=l(B,"DIV",{class:!0});var Ts=T(se);c(en.$$.fragment,Ts),Qs=s(Ts),Bn=l(Ts,"P",{"data-svelte-h":!0}),d(Bn)!=="svelte-16q0ax1"&&(Bn.textContent=Ol),Ts.forEach(n),B.forEach(n),ds=s(e),c(tn.$$.fragment,e),ps=s(e),G=l(e,"DIV",{class:!0});var N=T(G);c(nn.$$.fragment,N),Ps=s(N),Nn=l(N,"P",{"data-svelte-h":!0}),d(Nn)!=="svelte-gdhnuf"&&(Nn.innerHTML=Kl),Fs=s(N),An=l(N,"P",{"data-svelte-h":!0}),d(An)!=="svelte-5l9ik"&&(An.innerHTML=er),zs=s(N),Dn=l(N,"P",{"data-svelte-h":!0}),d(Dn)!=="svelte-14s6m4u"&&(Dn.textContent=tr),Hs=s(N),Rn=l(N,"UL",{"data-svelte-h":!0}),d(Rn)!=="svelte-16n8z58"&&(Rn.innerHTML=nr),$s=s(N),Y=l(N,"DIV",{class:!0});var fo=T(Y);c(on.$$.fragment,fo),qs=s(fo),Xn=l(fo,"P",{"data-svelte-h":!0}),d(Xn)!=="svelte-50j04k"&&(Xn.textContent=or),Os=s(fo),c(ae.$$.fragment,fo),fo.forEach(n),Ks=s(N),le=l(N,"DIV",{class:!0});var Js=T(le);c(sn.$$.fragment,Js),ea=s(Js),Sn=l(Js,"P",{"data-svelte-h":!0}),d(Sn)!=="svelte-16q0ax1"&&(Sn.textContent=ir),Js.forEach(n),N.forEach(n),cs=s(e),c(an.$$.fragment,e),ms=s(e),J=l(e,"DIV",{class:!0});var k=T(J);c(ln.$$.fragment,k),ta=s(k),Ln=l(k,"P",{"data-svelte-h":!0}),d(Ln)!=="svelte-1tviodw"&&(Ln.textContent=sr),na=s(k),Yn=l(k,"P",{"data-svelte-h":!0}),d(Yn)!=="svelte-1x0d6el"&&(Yn.innerHTML=ar),oa=s(k),En=l(k,"P",{"data-svelte-h":!0}),d(En)!=="svelte-14s6m4u"&&(En.textContent=lr),ia=s(k),Qn=l(k,"UL",{"data-svelte-h":!0}),d(Qn)!=="svelte-p0si5h"&&(Qn.innerHTML=rr),sa=s(k),E=l(k,"DIV",{class:!0});var uo=T(E);c(rn.$$.fragment,uo),aa=s(uo),Pn=l(uo,"P",{"data-svelte-h":!0}),d(Pn)!=="svelte-v78lg8"&&(Pn.textContent=dr),la=s(uo),c(re.$$.fragment,uo),uo.forEach(n),ra=s(k),de=l(k,"DIV",{class:!0});var vs=T(de);c(dn.$$.fragment,vs),da=s(vs),Fn=l(vs,"P",{"data-svelte-h":!0}),d(Fn)!=="svelte-16q0ax1"&&(Fn.textContent=pr),vs.forEach(n),pa=s(k),pe=l(k,"DIV",{class:!0});var Us=T(pe);c(pn.$$.fragment,Us),ca=s(Us),zn=l(Us,"P",{"data-svelte-h":!0}),d(zn)!=="svelte-vo59ec"&&(zn.innerHTML=cr),Us.forEach(n),k.forEach(n),fs=s(e),c(cn.$$.fragment,e),us=s(e),W=l(e,"DIV",{class:!0});var A=T(W);c(mn.$$.fragment,A),ma=s(A),Hn=l(A,"P",{"data-svelte-h":!0}),d(Hn)!=="svelte-19djzsa"&&(Hn.textContent=mr),fa=s(A),$n=l(A,"P",{"data-svelte-h":!0}),d($n)!=="svelte-5l9ik"&&($n.innerHTML=fr),ua=s(A),qn=l(A,"P",{"data-svelte-h":!0}),d(qn)!=="svelte-14s6m4u"&&(qn.textContent=ur),ga=s(A),On=l(A,"UL",{"data-svelte-h":!0}),d(On)!=="svelte-16n8z58"&&(On.innerHTML=gr),ha=s(A),Q=l(A,"DIV",{class:!0});var go=T(Q);c(fn.$$.fragment,go),_a=s(go),Kn=l(go,"P",{"data-svelte-h":!0}),d(Kn)!=="svelte-50j04k"&&(Kn.textContent=hr),ya=s(go),eo=l(go,"P",{"data-svelte-h":!0}),d(eo)!=="svelte-kvfsh7"&&(eo.textContent=_r),go.forEach(n),Ma=s(A),ce=l(A,"DIV",{class:!0});var Zs=T(ce);c(un.$$.fragment,Zs),ba=s(Zs),to=l(Zs,"P",{"data-svelte-h":!0}),d(to)!=="svelte-16q0ax1"&&(to.textContent=yr),Zs.forEach(n),A.forEach(n),gs=s(e),c(gn.$$.fragment,e),hs=s(e),V=l(e,"DIV",{class:!0});var D=T(V);c(hn.$$.fragment,D),wa=s(D),no=l(D,"P",{"data-svelte-h":!0}),d(no)!=="svelte-1w5cp98"&&(no.textContent=Mr),Ta=s(D),oo=l(D,"P",{"data-svelte-h":!0}),d(oo)!=="svelte-5l9ik"&&(oo.innerHTML=br),Ja=s(D),io=l(D,"P",{"data-svelte-h":!0}),d(io)!=="svelte-14s6m4u"&&(io.textContent=wr),va=s(D),so=l(D,"UL",{"data-svelte-h":!0}),d(so)!=="svelte-16n8z58"&&(so.innerHTML=Tr),Ua=s(D),P=l(D,"DIV",{class:!0});var ho=T(P);c(_n.$$.fragment,ho),Za=s(ho),ao=l(ho,"P",{"data-svelte-h":!0}),d(ao)!=="svelte-50j04k"&&(ao.textContent=Jr),ja=s(ho),lo=l(ho,"P",{"data-svelte-h":!0}),d(lo)!=="svelte-kvfsh7"&&(lo.textContent=vr),ho.forEach(n),Ia=s(D),me=l(D,"DIV",{class:!0});var js=T(me);c(yn.$$.fragment,js),Ca=s(js),ro=l(js,"P",{"data-svelte-h":!0}),d(ro)!=="svelte-16q0ax1"&&(ro.textContent=Ur),js.forEach(n),D.forEach(n),_s=s(e),c(Mn.$$.fragment,e),ys=s(e),X=l(e,"DIV",{class:!0});var _o=T(X);c(bn.$$.fragment,_o),Ga=s(_o),po=l(_o,"P",{"data-svelte-h":!0}),d(po)!=="svelte-8gpkil"&&(po.textContent=Zr),Wa=s(_o),co=l(_o,"P",{"data-svelte-h":!0}),d(co)!=="svelte-gk6g69"&&(co.innerHTML=jr),_o.forEach(n),Ms=s(e),c(wn.$$.fragment,e),bs=s(e),yo=l(e,"P",{}),T(yo).forEach(n),this.h()},h(){y(_,"name","hf:doc:metadata"),y(_,"content",Rr),y(H,"class","flex flex-wrap space-x-1"),y($,"class","tip"),y(q,"align","center"),y(O,"align","center"),y(K,"align","center"),y(ee,"align","center"),y(te,"class","warning"),y(ne,"class","tip"),y(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(X,"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){r(document.head,_),o(e,R,t),o(e,v,t),o(e,M,t),m(w,e,t),o(e,h,t),m(j,e,t),o(e,Mo,t),o(e,H,t),o(e,bo,t),m(fe,e,t),o(e,wo,t),o(e,ue,t),o(e,To,t),o(e,ge,t),o(e,Jo,t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),m(en,se,null),r(se,Qs),r(se,Bn),o(e,ds,t),m(tn,e,t),o(e,ps,t),o(e,G,t),m(nn,G,null),r(G,Ps),r(G,Nn),r(G,Fs),r(G,An),r(G,zs),r(G,Dn),r(G,Hs),r(G,Rn),r(G,$s),r(G,Y),m(on,Y,null),r(Y,qs),r(Y,Xn),r(Y,Os),m(ae,Y,null),r(G,Ks),r(G,le),m(sn,le,null),r(le,ea),r(le,Sn),o(e,cs,t),m(an,e,t),o(e,ms,t),o(e,J,t),m(ln,J,null),r(J,ta),r(J,Ln),r(J,na),r(J,Yn),r(J,oa),r(J,En),r(J,ia),r(J,Qn),r(J,sa),r(J,E),m(rn,E,null),r(E,aa),r(E,Pn),r(E,la),m(re,E,null),r(J,ra),r(J,de),m(dn,de,null),r(de,da),r(de,Fn),r(J,pa),r(J,pe),m(pn,pe,null),r(pe,ca),r(pe,zn),o(e,fs,t),m(cn,e,t),o(e,us,t),o(e,W,t),m(mn,W,null),r(W,ma),r(W,Hn),r(W,fa),r(W,$n),r(W,ua),r(W,qn),r(W,ga),r(W,On),r(W,ha),r(W,Q),m(fn,Q,null),r(Q,_a),r(Q,Kn),r(Q,ya),r(Q,eo),r(W,Ma),r(W,ce),m(un,ce,null),r(ce,ba),r(ce,to),o(e,gs,t),m(gn,e,t),o(e,hs,t),o(e,V,t),m(hn,V,null),r(V,wa),r(V,no),r(V,Ta),r(V,oo),r(V,Ja),r(V,io),r(V,va),r(V,so),r(V,Ua),r(V,P),m(_n,P,null),r(P,Za),r(P,ao),r(P,ja),r(P,lo),r(V,Ia),r(V,me),m(yn,me,null),r(me,Ca),r(me,ro),o(e,_s,t),m(Mn,e,t),o(e,ys,t),o(e,X,t),m(bn,X,null),r(X,Ga),r(X,po),r(X,Wa),r(X,co),o(e,Ms,t),m(wn,e,t),o(e,bs,t),o(e,yo,t),ws=!0},p(e,[t]){const x={};t&2&&(x.$$scope={dirty:t,ctx:e}),oe.$set(x);const F={};t&2&&(F.$$scope={dirty:t,ctx:e}),ae.$set(F);const Tn={};t&2&&(Tn.$$scope={dirty:t,ctx:e}),re.$set(Tn)},i(e){ws||(f(w.$$.fragment,e),f(j.$$.fragment,e),f(fe.$$.fragment,e),f(_e.$$.fragment,e),f(Me.$$.fragment,e),f(we.$$.fragment,e),f(Te.$$.fragment,e),f(Ue.$$.fragment,e),f(Ie.$$.fragment,e),f(Ge.$$.fragment,e),f(Ve.$$.fragment,e),f(De.$$.fragment,e),f(Re.$$.fragment,e),f(Le.$$.fragment,e),f(Ye.$$.fragment,e),f(Pe.$$.fragment,e),f(ze.$$.fragment,e),f(He.$$.fragment,e),f(qe.$$.fragment,e),f(et.$$.fragment,e),f(ot.$$.fragment,e),f(at.$$.fragment,e),f(rt.$$.fragment,e),f(pt.$$.fragment,e),f(ft.$$.fragment,e),f(gt.$$.fragment,e),f(_t.$$.fragment,e),f(wt.$$.fragment,e),f(Jt.$$.fragment,e),f(Ut.$$.fragment,e),f(It.$$.fragment,e),f(Gt.$$.fragment,e),f(Nt.$$.fragment,e),f(Rt.$$.fragment,e),f(Xt.$$.fragment,e),f(Lt.$$.fragment,e),f(Et.$$.fragment,e),f(Pt.$$.fragment,e),f(Ft.$$.fragment,e),f(zt.$$.fragment,e),f(Ht.$$.fragment,e),f(oe.$$.fragment,e),f($t.$$.fragment,e),f(qt.$$.fragment,e),f(Ot.$$.fragment,e),f(Kt.$$.fragment,e),f(en.$$.fragment,e),f(tn.$$.fragment,e),f(nn.$$.fragment,e),f(on.$$.fragment,e),f(ae.$$.fragment,e),f(sn.$$.fragment,e),f(an.$$.fragment,e),f(ln.$$.fragment,e),f(rn.$$.fragment,e),f(re.$$.fragment,e),f(dn.$$.fragment,e),f(pn.$$.fragment,e),f(cn.$$.fragment,e),f(mn.$$.fragment,e),f(fn.$$.fragment,e),f(un.$$.fragment,e),f(gn.$$.fragment,e),f(hn.$$.fragment,e),f(_n.$$.fragment,e),f(yn.$$.fragment,e),f(Mn.$$.fragment,e),f(bn.$$.fragment,e),f(wn.$$.fragment,e),ws=!0)},o(e){u(w.$$.fragment,e),u(j.$$.fragment,e),u(fe.$$.fragment,e),u(_e.$$.fragment,e),u(Me.$$.fragment,e),u(we.$$.fragment,e),u(Te.$$.fragment,e),u(Ue.$$.fragment,e),u(Ie.$$.fragment,e),u(Ge.$$.fragment,e),u(Ve.$$.fragment,e),u(De.$$.fragment,e),u(Re.$$.fragment,e),u(Le.$$.fragment,e),u(Ye.$$.fragment,e),u(Pe.$$.fragment,e),u(ze.$$.fragment,e),u(He.$$.fragment,e),u(qe.$$.fragment,e),u(et.$$.fragment,e),u(ot.$$.fragment,e),u(at.$$.fragment,e),u(rt.$$.fragment,e),u(pt.$$.fragment,e),u(ft.$$.fragment,e),u(gt.$$.fragment,e),u(_t.$$.fragment,e),u(wt.$$.fragment,e),u(Jt.$$.fragment,e),u(Ut.$$.fragment,e),u(It.$$.fragment,e),u(Gt.$$.fragment,e),u(Nt.$$.fragment,e),u(Rt.$$.fragment,e),u(Xt.$$.fragment,e),u(Lt.$$.fragment,e),u(Et.$$.fragment,e),u(Pt.$$.fragment,e),u(Ft.$$.fragment,e),u(zt.$$.fragment,e),u(Ht.$$.fragment,e),u(oe.$$.fragment,e),u($t.$$.fragment,e),u(qt.$$.fragment,e),u(Ot.$$.fragment,e),u(Kt.$$.fragment,e),u(en.$$.fragment,e),u(tn.$$.fragment,e),u(nn.$$.fragment,e),u(on.$$.fragment,e),u(ae.$$.fragment,e),u(sn.$$.fragment,e),u(an.$$.fragment,e),u(ln.$$.fragment,e),u(rn.$$.fragment,e),u(re.$$.fragment,e),u(dn.$$.fragment,e),u(pn.$$.fragment,e),u(cn.$$.fragment,e),u(mn.$$.fragment,e),u(fn.$$.fragment,e),u(un.$$.fragment,e),u(gn.$$.fragment,e),u(hn.$$.fragment,e),u(_n.$$.fragment,e),u(yn.$$.fragment,e),u(Mn.$$.fragment,e),u(bn.$$.fragment,e),u(wn.$$.fragment,e),ws=!1},d(e){e&&(n(R),n(v),n(M),n(h),n(Mo),n(H),n(bo),n(wo),n(ue),n(To),n(ge),n(Jo),n(he),n(vo),n(Uo),n(ye),n(Zo),n(jo),n(be),n(Io),n(Co),n(Go),n(Je),n(Wo),n(ve),n(Vo),n(xo),n(Ze),n(ko),n(je),n(Bo),n($),n(No),n(Ao),n(Ce),n(Do),n(Ro),n(We),n(Xo),n(q),n(So),n(Lo),n(xe),n(Yo),n(ke),n(Eo),n(Be),n(Qo),n(Ne),n(Po),n(Ae),n(Fo),n(zo),n(Ho),n(Xe),n($o),n(Se),n(O),n(qo),n(Oo),n(Ko),n(Ee),n(ei),n(Qe),n(K),n(ti),n(ni),n(Fe),n(oi),n(ii),n(si),n($e),n(ai),n(li),n(Oe),n(ri),n(Ke),n(di),n(pi),n(tt),n(ci),n(nt),n(mi),n(fi),n(it),n(ui),n(ee),n(gi),n(st),n(hi),n(_i),n(lt),n(yi),n(Mi),n(dt),n(bi),n(wi),n(ct),n(Ti),n(mt),n(Ji),n(vi),n(ut),n(Ui),n(Zi),n(ht),n(ji),n(Ii),n(yt),n(Ci),n(Mt),n(Gi),n(bt),n(Wi),n(Vi),n(te),n(xi),n(ne),n(ki),n(Tt),n(Bi),n(Ni),n(vt),n(Ai),n(Di),n(Zt),n(Ri),n(jt),n(Xi),n(Si),n(Ct),n(Li),n(Yi),n(Wt),n(Ei),n(Vt),n(Qi),n(xt),n(Pi),n(kt),n(Fi),n(Bt),n(zi),n(Hi),n(At),n($i),n(Dt),n(qi),n(Oi),n(Ki),n(St),n(es),n(ts),n(Yt),n(ns),n(os),n(Qt),n(is),n(ss),n(as),n(I),n(ls),n(rs),n(C),n(ds),n(ps),n(G),n(cs),n(ms),n(J),n(fs),n(us),n(W),n(gs),n(hs),n(V),n(_s),n(ys),n(X),n(Ms),n(bs),n(yo)),n(_),g(w,e),g(j,e),g(fe,e),g(_e,e),g(Me,e),g(we,e),g(Te,e),g(Ue,e),g(Ie,e),g(Ge,e),g(Ve,e),g(De,e),g(Re,e),g(Le,e),g(Ye,e),g(Pe,e),g(ze,e),g(He,e),g(qe,e),g(et,e),g(ot,e),g(at,e),g(rt,e),g(pt,e),g(ft,e),g(gt,e),g(_t,e),g(wt,e),g(Jt,e),g(Ut,e),g(It,e),g(Gt,e),g(Nt,e),g(Rt,e),g(Xt,e),g(Lt,e),g(Et,e),g(Pt,e),g(Ft,e),g(zt),g(Ht),g(oe),g($t),g(qt,e),g(Ot),g(Kt),g(en),g(tn,e),g(nn),g(on),g(ae),g(sn),g(an,e),g(ln),g(rn),g(re),g(dn),g(pn),g(cn,e),g(mn),g(fn),g(un),g(gn,e),g(hn),g(_n),g(yn),g(Mn,e),g(bn),g(wn,e)}}}const Rr='{"title":"Text-to-Video Generation with AnimateDiff","local":"text-to-video-generation-with-animatediff","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Available Pipelines","local":"available-pipelines","sections":[],"depth":2},{"title":"Available checkpoints","local":"available-checkpoints","sections":[],"depth":2},{"title":"Usage example","local":"usage-example","sections":[{"title":"AnimateDiffPipeline","local":"animatediffpipeline","sections":[],"depth":3},{"title":"AnimateDiffControlNetPipeline","local":"animatediffcontrolnetpipeline","sections":[],"depth":3},{"title":"AnimateDiffSparseControlNetPipeline","local":"animatediffsparsecontrolnetpipeline","sections":[{"title":"Using SparseCtrl Scribble","local":"using-sparsectrl-scribble","sections":[],"depth":4},{"title":"Using SparseCtrl RGB","local":"using-sparsectrl-rgb","sections":[],"depth":4}],"depth":3},{"title":"AnimateDiffSDXLPipeline","local":"animatediffsdxlpipeline","sections":[],"depth":3},{"title":"AnimateDiffVideoToVideoPipeline","local":"animatediffvideotovideopipeline","sections":[],"depth":3},{"title":"AnimateDiffVideoToVideoControlNetPipeline","local":"animatediffvideotovideocontrolnetpipeline","sections":[],"depth":3}],"depth":2},{"title":"Using Motion LoRAs","local":"using-motion-loras","sections":[],"depth":2},{"title":"Using Motion LoRAs with PEFT","local":"using-motion-loras-with-peft","sections":[],"depth":2},{"title":"Using FreeInit","local":"using-freeinit","sections":[],"depth":2},{"title":"Using AnimateLCM","local":"using-animatelcm","sections":[],"depth":2},{"title":"Using FreeNoise","local":"using-freenoise","sections":[{"title":"FreeNoise memory savings","local":"freenoise-memory-savings","sections":[],"depth":3}],"depth":2},{"title":"Using from_single_file with the MotionAdapter","local":"using-fromsinglefile-with-the-motionadapter","sections":[],"depth":2},{"title":"AnimateDiffPipeline","local":"diffusers.AnimateDiffPipeline","sections":[],"depth":2},{"title":"AnimateDiffControlNetPipeline","local":"diffusers.AnimateDiffControlNetPipeline","sections":[],"depth":2},{"title":"AnimateDiffSparseControlNetPipeline","local":"diffusers.AnimateDiffSparseControlNetPipeline","sections":[],"depth":2},{"title":"AnimateDiffSDXLPipeline","local":"diffusers.AnimateDiffSDXLPipeline","sections":[],"depth":2},{"title":"AnimateDiffVideoToVideoPipeline","local":"diffusers.AnimateDiffVideoToVideoPipeline","sections":[],"depth":2},{"title":"AnimateDiffVideoToVideoControlNetPipeline","local":"diffusers.AnimateDiffVideoToVideoControlNetPipeline","sections":[],"depth":2},{"title":"AnimateDiffPipelineOutput","local":"diffusers.pipelines.animatediff.AnimateDiffPipelineOutput","sections":[],"depth":2}],"depth":1}';function Xr(z){return Cr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class zr extends Gr{constructor(_){super(),Wr(this,_,Xr,Dr,Ir,{})}}export{zr as component};

Xet Storage Details

Size:
298 kB
·
Xet hash:
6482695e7eb3e24dc46c00984f697b5721d2f537c7bd041852bdd51ddbd47575

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.