import{s as Ke,o as Oe,n as Qe}from"../chunks/scheduler.8c3d61f6.js";import{S as et,i as tt,g as r,s as a,r as h,A as nt,h as l,f as n,c as s,j as ne,u as g,x as p,k as oe,y as u,a as o,v as _,d as b,t as v,w}from"../chunks/index.da70eac4.js";import{T as ot}from"../chunks/Tip.1d9b8c37.js";import{D as Ce}from"../chunks/Docstring.ee4b6913.js";import{C as ae}from"../chunks/CodeBlock.00a903b3.js";import{E as at}from"../chunks/ExampleCodeBlock.f7bd2c1f.js";import{H as Ue,E as st}from"../chunks/EditOnGithub.1e64e623.js";function it(Y){let i,L='Make sure to check out the Schedulers <a href="../../using-diffusers/schedulers.md">guide</a> to learn how to explore the tradeoff between scheduler speed and quality, and see the <a href="../../using-diffusers/loading.md#reuse-a-pipeline">reuse components across pipelines</a> section to learn how to efficiently load the same components into multiple pipelines.';return{c(){i=r("p"),i.innerHTML=L},l(c){i=l(c,"P",{"data-svelte-h":!0}),p(i)!=="svelte-w7r39y"&&(i.innerHTML=L)},m(c,f){o(c,i,f)},p:Qe,d(c){c&&n(i)}}}function rt(Y){let i,L="Examples:",c,f,T;return f=new ae({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTGF0dGVQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBleHBvcnRfdG9fZ2lmJTBBJTBBJTIzJTIwWW91JTIwY2FuJTIwcmVwbGFjZSUyMHRoZSUyMGNoZWNrcG9pbnQlMjBpZCUyMHdpdGglMjAlMjJtYXhpbi1jbiUyRkxhdHRlLTElMjIlMjB0b28uJTBBcGlwZSUyMCUzRCUyMExhdHRlUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMm1heGluLWNuJTJGTGF0dGUtMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEElMjMlMjBFbmFibGUlMjBtZW1vcnklMjBvcHRpbWl6YXRpb25zLiUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwc21hbGwlMjBjYWN0dXMlMjB3aXRoJTIwYSUyMGhhcHB5JTIwZmFjZSUyMGluJTIwdGhlJTIwU2FoYXJhJTIwZGVzZXJ0LiUyMiUwQXZpZGVvcyUyMCUzRCUyMHBpcGUocHJvbXB0KS5mcmFtZXMlNUIwJTVEJTBBZXhwb3J0X3RvX2dpZih2aWRlb3MlMkMlMjAlMjJsYXR0ZS5naWYlMjIp",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> LattePipeline
<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><span class="hljs-comment"># You can replace the checkpoint id with &quot;maxin-cn/Latte-1&quot; too.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = LattePipeline.from_pretrained(<span class="hljs-string">&quot;maxin-cn/Latte-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Enable memory optimizations.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A small cactus with a happy face in the Sahara desert.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>videos = pipe(prompt).frames[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>export_to_gif(videos, <span class="hljs-string">&quot;latte.gif&quot;</span>)`,wrap:!1}}),{c(){i=r("p"),i.textContent=L,c=a(),h(f.$$.fragment)},l(d){i=l(d,"P",{"data-svelte-h":!0}),p(i)!=="svelte-kvfsh7"&&(i.textContent=L),c=s(d),g(f.$$.fragment,d)},m(d,$){o(d,i,$),o(d,c,$),_(f,d,$),T=!0},p:Qe,i(d){T||(b(f.$$.fragment,d),T=!0)},o(d){v(f.$$.fragment,d),T=!1},d(d){d&&(n(i),n(c)),w(f,d)}}}function lt(Y){let i,L,c,f,T,d,$,Be='<img src="https://github.com/Vchitect/Latte/blob/52bc0029899babbd6e9250384c83d8ed2670ff7a/visuals/latte.gif?raw=true" alt="latte text-to-video"/>',se,J,We='<a href="https://arxiv.org/abs/2401.03048" rel="nofollow">Latte: Latent Diffusion Transformer for Video Generation</a> from Monash University, Shanghai AI Lab, Nanjing University, and Nanyang Technological University.',ie,Z,He="The abstract from the paper is:",re,I,Fe="<em>We propose a novel Latent Diffusion Transformer, namely Latte, for video generation. Latte first extracts spatio-temporal tokens from input videos and then adopts a series of Transformer blocks to model video distribution in the latent space. In order to model a substantial number of tokens extracted from videos, four efficient variants are introduced from the perspective of decomposing the spatial and temporal dimensions of input videos. To improve the quality of generated videos, we determine the best practices of Latte through rigorous experimental analysis, including video clip patch embedding, model variants, timestep-class information injection, temporal positional embedding, and learning strategies. Our comprehensive evaluation demonstrates that Latte achieves state-of-the-art performance across four standard video generation datasets, i.e., FaceForensics, SkyTimelapse, UCF101, and Taichi-HD. In addition, we extend Latte to text-to-video generation (T2V) task, where Latte achieves comparable results compared to recent T2V models. We strongly believe that Latte provides valuable insights for future research on incorporating Transformers into diffusion models for video generation.</em>",le,G,Xe='<strong>Highlights</strong>: Latte is a latent diffusion transformer proposed as a backbone for modeling different modalities (trained for text-to-video generation here). It achieves state-of-the-art performance across four standard video benchmarks - <a href="https://arxiv.org/abs/1803.09179" rel="nofollow">FaceForensics</a>, <a href="https://arxiv.org/abs/1709.07592" rel="nofollow">SkyTimelapse</a>, <a href="https://arxiv.org/abs/1212.0402" rel="nofollow">UCF101</a> and <a href="https://arxiv.org/abs/2003.00196" rel="nofollow">Taichi-HD</a>. To prepare and download the datasets for evaluation, please refer to <a href="https://github.com/Vchitect/Latte/blob/main/docs/datasets_evaluation.md" rel="nofollow">this https URL</a>.',de,C,Ne='This pipeline was contributed by <a href="https://github.com/maxin-cn" rel="nofollow">maxin-cn</a>. The original codebase can be found <a href="https://github.com/Vchitect/Latte" rel="nofollow">here</a>. The original weights can be found under <a href="https://huggingface.co/maxin-cn" rel="nofollow">hf.co/maxin-cn</a>.',pe,j,ce,U,me,B,Ve='Use <a href="https://huggingface.co/docs/diffusers/main/en/tutorials/fast_diffusion#torchcompile" rel="nofollow"><code>torch.compile</code></a> to reduce the inference latency.',fe,W,ze="First, load the pipeline:",ue,H,he,F,Se="Then change the memory layout of the pipelines <code>transformer</code> and <code>vae</code> components to <code>torch.channels-last</code>:",ge,X,_e,N,Ee="Finally, compile the components and run inference:",be,V,ve,z,Re='The <a href="https://gist.github.com/a-r-r-o-w/4e1694ca46374793c0361d740a99ff19" rel="nofollow">benchmark</a> results on an 80GB A100 machine are:',we,S,xe,E,Te,m,R,je,Q,qe="Pipeline for text-to-video generation using Latte.",ke,K,De=`This model inherits from <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`,Pe,M,q,Je,O,Ae="Function invoked when calling the pipeline for generation.",Ze,k,Ie,P,D,Ge,ee,Ye="Encodes the prompt into text encoder hidden states.",$e,A,Le,te,Me;return T=new Ue({props:{title:"Latte",local:"latte",headingTag:"h1"}}),j=new ot({props:{$$slots:{default:[it]},$$scope:{ctx:Y}}}),U=new Ue({props:{title:"Inference",local:"inference",headingTag:"h3"}}),H=new ae({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTGF0dGVQaXBlbGluZSUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwTGF0dGVQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTA5JTIybWF4aW4tY24lMkZMYXR0ZS0xJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKS50byglMjJjdWRhJTIyKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LattePipeline

pipeline = LattePipeline.from_pretrained(
	<span class="hljs-string">&quot;maxin-cn/Latte-1&quot;</span>, torch_dtype=torch.float16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),X=new ae({props:{code:"cGlwZWxpbmUudHJhbnNmb3JtZXIudG8obWVtb3J5X2Zvcm1hdCUzRHRvcmNoLmNoYW5uZWxzX2xhc3QpJTBBcGlwZWxpbmUudmFlLnRvKG1lbW9yeV9mb3JtYXQlM0R0b3JjaC5jaGFubmVsc19sYXN0KQ==",highlighted:`pipeline.transformer.to(memory_format=torch.channels_last)
pipeline.vae.to(memory_format=torch.channels_last)`,wrap:!1}}),V=new ae({props:{code:"cGlwZWxpbmUudHJhbnNmb3JtZXIlMjAlM0QlMjB0b3JjaC5jb21waWxlKHBpcGVsaW5lLnRyYW5zZm9ybWVyKSUwQXBpcGVsaW5lLnZhZS5kZWNvZGUlMjAlM0QlMjB0b3JjaC5jb21waWxlKHBpcGVsaW5lLnZhZS5kZWNvZGUpJTBBJTBBdmlkZW8lMjAlM0QlMjBwaXBlbGluZShwcm9tcHQlM0QlMjJBJTIwZG9nJTIwd2VhcmluZyUyMHN1bmdsYXNzZXMlMjBmbG9hdGluZyUyMGluJTIwc3BhY2UlMkMlMjBzdXJyZWFsJTJDJTIwbmVidWxhZSUyMGluJTIwYmFja2dyb3VuZCUyMikuZnJhbWVzJTVCMCU1RA==",highlighted:`pipeline.transformer = torch.<span class="hljs-built_in">compile</span>(pipeline.transformer)
pipeline.vae.decode = torch.<span class="hljs-built_in">compile</span>(pipeline.vae.decode)

video = pipeline(prompt=<span class="hljs-string">&quot;A dog wearing sunglasses floating in space, surreal, nebulae in background&quot;</span>).frames[<span class="hljs-number">0</span>]`,wrap:!1}}),S=new ae({props:{code:"V2l0aG91dCUyMHRvcmNoLmNvbXBpbGUoKSUzQSUyMEF2ZXJhZ2UlMjBpbmZlcmVuY2UlMjB0aW1lJTNBJTIwMTYuMjQ2JTIwc2Vjb25kcy4lMEFXaXRoJTIwdG9yY2guY29tcGlsZSgpJTNBJTIwQXZlcmFnZSUyMGluZmVyZW5jZSUyMHRpbWUlM0ElMjAxNC41NzMlMjBzZWNvbmRzLg==",highlighted:`<span class="hljs-attribute">Without</span> torch.compile(): Average inference time: <span class="hljs-number">16</span>.<span class="hljs-number">246</span> seconds.
<span class="hljs-attribute">With</span> torch.compile(): Average inference time: <span class="hljs-number">14</span>.<span class="hljs-number">573</span> seconds.`,wrap:!1}}),E=new Ue({props:{title:"LattePipeline",local:"diffusers.LattePipeline",headingTag:"h2"}}),R=new Ce({props:{name:"class diffusers.LattePipeline",anchor:"diffusers.LattePipeline",parameters:[{name:"tokenizer",val:": T5Tokenizer"},{name:"text_encoder",val:": T5EncoderModel"},{name:"vae",val:": AutoencoderKL"},{name:"transformer",val:": LatteTransformer3DModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"}],parametersDescription:[{anchor:"diffusers.LattePipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode videos to and from latent representations.`,name:"vae"},{anchor:"diffusers.LattePipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>T5EncoderModel</code>) &#x2014;
Frozen text-encoder. Latte uses
<a href="https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5EncoderModel" rel="nofollow">T5</a>, specifically the
<a href="https://huggingface.co/PixArt-alpha/PixArt-alpha/tree/main/t5-v1_1-xxl" rel="nofollow">t5-v1_1-xxl</a> variant.`,name:"text_encoder"},{anchor:"diffusers.LattePipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>T5Tokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5Tokenizer" rel="nofollow">T5Tokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.LattePipeline.transformer",description:`<strong>transformer</strong> (<a href="/docs/diffusers/main/en/api/models/latte_transformer3d#diffusers.LatteTransformer3DModel">LatteTransformer3DModel</a>) &#x2014;
A text conditioned <code>LatteTransformer3DModel</code> to denoise the encoded video latents.`,name:"transformer"},{anchor:"diffusers.LattePipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>transformer</code> to denoise the encoded video latents.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/latte/pipeline_latte.py#L135"}}),q=new Ce({props:{name:"__call__",anchor:"diffusers.LattePipeline.__call__",parameters:[{name:"prompt",val:": Union = None"},{name:"negative_prompt",val:": str = ''"},{name:"num_inference_steps",val:": int = 50"},{name:"timesteps",val:": Optional = None"},{name:"guidance_scale",val:": float = 7.5"},{name:"num_images_per_prompt",val:": int = 1"},{name:"video_length",val:": int = 16"},{name:"height",val:": int = 512"},{name:"width",val:": int = 512"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": Union = None"},{name:"latents",val:": Optional = None"},{name:"prompt_embeds",val:": Optional = None"},{name:"negative_prompt_embeds",val:": Optional = None"},{name:"output_type",val:": str = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback_on_step_end",val:": Union = None"},{name:"callback_on_step_end_tensor_inputs",val:": List = ['latents']"},{name:"clean_caption",val:": bool = True"},{name:"mask_feature",val:": bool = True"},{name:"enable_temporal_attentions",val:": bool = True"},{name:"decode_chunk_size",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.LattePipeline.__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.LattePipeline.__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.LattePipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#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.LattePipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Custom timesteps to use for the denoising process. If not defined, equal spaced <code>num_inference_steps</code>
timesteps are used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.LattePipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate videos that are closely linked to the text <code>prompt</code>,
usually at the expense of lower video quality.`,name:"guidance_scale"},{anchor:"diffusers.LattePipeline.__call__.video_length",description:`<strong>video_length</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`,name:"video_length"},{anchor:"diffusers.LattePipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of videos to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.LattePipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size) &#x2014;
The height in pixels of the generated video.`,name:"height"},{anchor:"diffusers.LattePipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size) &#x2014;
The width in pixels of the generated video.`,name:"width"},{anchor:"diffusers.LattePipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.LattePipeline.__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.LattePipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for video
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.LattePipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.LattePipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. For Latte this negative prompt should be &quot;&quot;. If not provided,
negative_prompt_embeds will be generated from <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.LattePipeline.__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 generate 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.LattePipeline.__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.IFPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.LattePipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable[[int, int, Dict], None]</code>, <code>PipelineCallback</code>, <code>MultiPipelineCallbacks</code>, <em>optional</em>) &#x2014;
A callback function or a list of callback functions to be called at the end of each denoising step.`,name:"callback_on_step_end"},{anchor:"diffusers.LattePipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
A list of tensor inputs that should be passed to the callback function. If not defined, all tensor
inputs will be passed.`,name:"callback_on_step_end_tensor_inputs"},{anchor:"diffusers.LattePipeline.__call__.clean_caption",description:`<strong>clean_caption</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the caption before creating embeddings. Requires <code>beautifulsoup4</code> and <code>ftfy</code> to
be installed. If the dependencies are not installed, the embeddings will be created from the raw
prompt.`,name:"clean_caption"},{anchor:"diffusers.LattePipeline.__call__.mask_feature",description:"<strong>mask_feature</strong> (<code>bool</code> defaults to <code>True</code>) &#x2014; If set to <code>True</code>, the text embeddings will be masked.",name:"mask_feature"},{anchor:"diffusers.LattePipeline.__call__.enable_temporal_attentions",description:"<strong>enable_temporal_attentions</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014; Whether to enable temporal attentions",name:"enable_temporal_attentions"},{anchor:"diffusers.LattePipeline.__call__.decode_chunk_size",description:`<strong>decode_chunk_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of frames to decode at a time. Higher chunk size leads to better temporal consistency at the
expense of more memory usage. By default, the decoder decodes all frames at once for maximal quality.
For lower memory usage, reduce <code>decode_chunk_size</code>.`,name:"decode_chunk_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/latte/pipeline_latte.py#L599",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is <code>True</code>, <code>LattePipelineOutput</code> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>LattePipelineOutput</code> or <code>tuple</code></p>
`}}),k=new at({props:{anchor:"diffusers.LattePipeline.__call__.example",$$slots:{default:[rt]},$$scope:{ctx:Y}}}),D=new Ce({props:{name:"encode_prompt",anchor:"diffusers.LattePipeline.encode_prompt",parameters:[{name:"prompt",val:": Union"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"negative_prompt",val:": str = ''"},{name:"num_images_per_prompt",val:": int = 1"},{name:"device",val:": Optional = None"},{name:"prompt_embeds",val:": Optional = None"},{name:"negative_prompt_embeds",val:": Optional = None"},{name:"clean_caption",val:": bool = False"},{name:"mask_feature",val:": bool = True"},{name:"dtype",val:" = None"}],parametersDescription:[{anchor:"diffusers.LattePipeline.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.LattePipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt 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>). For
Latte, this should be &quot;&quot;.`,name:"negative_prompt"},{anchor:"diffusers.LattePipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.LattePipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
number of video that should be generated per prompt
device &#x2014; (<code>torch.device</code>, <em>optional</em>):
torch device to place the resulting embeddings on`,name:"num_images_per_prompt"},{anchor:"diffusers.LattePipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.LattePipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. For Latte, it&#x2019;s should be the embeddings of the &quot;&quot; string.`,name:"negative_prompt_embeds"},{anchor:"diffusers.LattePipeline.encode_prompt.clean_caption",description:`<strong>clean_caption</strong> (bool, defaults to <code>False</code>) &#x2014;
If <code>True</code>, the function will preprocess and clean the provided caption before encoding.
mask_feature &#x2014; (bool, defaults to <code>True</code>):
If <code>True</code>, the function will mask the text embeddings.`,name:"clean_caption"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/latte/pipeline_latte.py#L196"}}),A=new st({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/latte.md"}}),{c(){i=r("meta"),L=a(),c=r("p"),f=a(),h(T.$$.fragment),d=a(),$=r("p"),$.innerHTML=Be,se=a(),J=r("p"),J.innerHTML=We,ie=a(),Z=r("p"),Z.textContent=He,re=a(),I=r("p"),I.innerHTML=Fe,le=a(),G=r("p"),G.innerHTML=Xe,de=a(),C=r("p"),C.innerHTML=Ne,pe=a(),h(j.$$.fragment),ce=a(),h(U.$$.fragment),me=a(),B=r("p"),B.innerHTML=Ve,fe=a(),W=r("p"),W.textContent=ze,ue=a(),h(H.$$.fragment),he=a(),F=r("p"),F.innerHTML=Se,ge=a(),h(X.$$.fragment),_e=a(),N=r("p"),N.textContent=Ee,be=a(),h(V.$$.fragment),ve=a(),z=r("p"),z.innerHTML=Re,we=a(),h(S.$$.fragment),xe=a(),h(E.$$.fragment),Te=a(),m=r("div"),h(R.$$.fragment),je=a(),Q=r("p"),Q.textContent=qe,ke=a(),K=r("p"),K.innerHTML=De,Pe=a(),M=r("div"),h(q.$$.fragment),Je=a(),O=r("p"),O.textContent=Ae,Ze=a(),h(k.$$.fragment),Ie=a(),P=r("div"),h(D.$$.fragment),Ge=a(),ee=r("p"),ee.textContent=Ye,$e=a(),h(A.$$.fragment),Le=a(),te=r("p"),this.h()},l(e){const t=nt("svelte-u9bgzb",document.head);i=l(t,"META",{name:!0,content:!0}),t.forEach(n),L=s(e),c=l(e,"P",{}),ne(c).forEach(n),f=s(e),g(T.$$.fragment,e),d=s(e),$=l(e,"P",{"data-svelte-h":!0}),p($)!=="svelte-1bd7mp4"&&($.innerHTML=Be),se=s(e),J=l(e,"P",{"data-svelte-h":!0}),p(J)!=="svelte-12pxxb4"&&(J.innerHTML=We),ie=s(e),Z=l(e,"P",{"data-svelte-h":!0}),p(Z)!=="svelte-1cwsb16"&&(Z.textContent=He),re=s(e),I=l(e,"P",{"data-svelte-h":!0}),p(I)!=="svelte-12ap5po"&&(I.innerHTML=Fe),le=s(e),G=l(e,"P",{"data-svelte-h":!0}),p(G)!=="svelte-1pzaijb"&&(G.innerHTML=Xe),de=s(e),C=l(e,"P",{"data-svelte-h":!0}),p(C)!=="svelte-66m9gt"&&(C.innerHTML=Ne),pe=s(e),g(j.$$.fragment,e),ce=s(e),g(U.$$.fragment,e),me=s(e),B=l(e,"P",{"data-svelte-h":!0}),p(B)!=="svelte-iekg51"&&(B.innerHTML=Ve),fe=s(e),W=l(e,"P",{"data-svelte-h":!0}),p(W)!=="svelte-jub7f1"&&(W.textContent=ze),ue=s(e),g(H.$$.fragment,e),he=s(e),F=l(e,"P",{"data-svelte-h":!0}),p(F)!=="svelte-4294wb"&&(F.innerHTML=Se),ge=s(e),g(X.$$.fragment,e),_e=s(e),N=l(e,"P",{"data-svelte-h":!0}),p(N)!=="svelte-9i4prs"&&(N.textContent=Ee),be=s(e),g(V.$$.fragment,e),ve=s(e),z=l(e,"P",{"data-svelte-h":!0}),p(z)!=="svelte-xadg5n"&&(z.innerHTML=Re),we=s(e),g(S.$$.fragment,e),xe=s(e),g(E.$$.fragment,e),Te=s(e),m=l(e,"DIV",{class:!0});var x=ne(m);g(R.$$.fragment,x),je=s(x),Q=l(x,"P",{"data-svelte-h":!0}),p(Q)!=="svelte-5dgzru"&&(Q.textContent=qe),ke=s(x),K=l(x,"P",{"data-svelte-h":!0}),p(K)!=="svelte-wu1jmh"&&(K.innerHTML=De),Pe=s(x),M=l(x,"DIV",{class:!0});var y=ne(M);g(q.$$.fragment,y),Je=s(y),O=l(y,"P",{"data-svelte-h":!0}),p(O)!=="svelte-v78lg8"&&(O.textContent=Ae),Ze=s(y),g(k.$$.fragment,y),y.forEach(n),Ie=s(x),P=l(x,"DIV",{class:!0});var ye=ne(P);g(D.$$.fragment,ye),Ge=s(ye),ee=l(ye,"P",{"data-svelte-h":!0}),p(ee)!=="svelte-16q0ax1"&&(ee.textContent=Ye),ye.forEach(n),x.forEach(n),$e=s(e),g(A.$$.fragment,e),Le=s(e),te=l(e,"P",{}),ne(te).forEach(n),this.h()},h(){oe(i,"name","hf:doc:metadata"),oe(i,"content",dt),oe(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),oe(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),oe(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){u(document.head,i),o(e,L,t),o(e,c,t),o(e,f,t),_(T,e,t),o(e,d,t),o(e,$,t),o(e,se,t),o(e,J,t),o(e,ie,t),o(e,Z,t),o(e,re,t),o(e,I,t),o(e,le,t),o(e,G,t),o(e,de,t),o(e,C,t),o(e,pe,t),_(j,e,t),o(e,ce,t),_(U,e,t),o(e,me,t),o(e,B,t),o(e,fe,t),o(e,W,t),o(e,ue,t),_(H,e,t),o(e,he,t),o(e,F,t),o(e,ge,t),_(X,e,t),o(e,_e,t),o(e,N,t),o(e,be,t),_(V,e,t),o(e,ve,t),o(e,z,t),o(e,we,t),_(S,e,t),o(e,xe,t),_(E,e,t),o(e,Te,t),o(e,m,t),_(R,m,null),u(m,je),u(m,Q),u(m,ke),u(m,K),u(m,Pe),u(m,M),_(q,M,null),u(M,Je),u(M,O),u(M,Ze),_(k,M,null),u(m,Ie),u(m,P),_(D,P,null),u(P,Ge),u(P,ee),o(e,$e,t),_(A,e,t),o(e,Le,t),o(e,te,t),Me=!0},p(e,[t]){const x={};t&2&&(x.$$scope={dirty:t,ctx:e}),j.$set(x);const y={};t&2&&(y.$$scope={dirty:t,ctx:e}),k.$set(y)},i(e){Me||(b(T.$$.fragment,e),b(j.$$.fragment,e),b(U.$$.fragment,e),b(H.$$.fragment,e),b(X.$$.fragment,e),b(V.$$.fragment,e),b(S.$$.fragment,e),b(E.$$.fragment,e),b(R.$$.fragment,e),b(q.$$.fragment,e),b(k.$$.fragment,e),b(D.$$.fragment,e),b(A.$$.fragment,e),Me=!0)},o(e){v(T.$$.fragment,e),v(j.$$.fragment,e),v(U.$$.fragment,e),v(H.$$.fragment,e),v(X.$$.fragment,e),v(V.$$.fragment,e),v(S.$$.fragment,e),v(E.$$.fragment,e),v(R.$$.fragment,e),v(q.$$.fragment,e),v(k.$$.fragment,e),v(D.$$.fragment,e),v(A.$$.fragment,e),Me=!1},d(e){e&&(n(L),n(c),n(f),n(d),n($),n(se),n(J),n(ie),n(Z),n(re),n(I),n(le),n(G),n(de),n(C),n(pe),n(ce),n(me),n(B),n(fe),n(W),n(ue),n(he),n(F),n(ge),n(_e),n(N),n(be),n(ve),n(z),n(we),n(xe),n(Te),n(m),n($e),n(Le),n(te)),n(i),w(T,e),w(j,e),w(U,e),w(H,e),w(X,e),w(V,e),w(S,e),w(E,e),w(R),w(q),w(k),w(D),w(A,e)}}}const dt='{"title":"Latte","local":"latte","sections":[{"title":"Inference","local":"inference","sections":[],"depth":3},{"title":"LattePipeline","local":"diffusers.LattePipeline","sections":[],"depth":2}],"depth":1}';function pt(Y){return Oe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class bt extends et{constructor(i){super(),tt(this,i,pt,lt,Ke,{})}}export{bt as component};
