import{s as os,o as as,n as ls}from"../chunks/scheduler.8c3d61f6.js";import{S as is,i as rs,g as a,s as l,r as c,A as ps,h as i,f as s,c as o,j as I,u as m,x as g,k as T,y as p,a as n,v as d,d as M,t as h,w as u,m as Xt,n as Et}from"../chunks/index.da70eac4.js";import{T as At}from"../chunks/Tip.6f698f24.js";import{D as Y}from"../chunks/Docstring.367be9ed.js";import{C as Te}from"../chunks/CodeBlock.a9c4becf.js";import{E as cs}from"../chunks/ExampleCodeBlock.dd9ee828.js";import{H as k,E as ms}from"../chunks/getInferenceSnippets.cb466318.js";function ds(v){let r,f,j="When enabling <code>force_zeros_for_empty_prompt</code>, it is recommended to run the text encoding step outside the autocast context in full precision.";return{c(){r=Xt(`The original Mochi implementation zeros out empty prompts. However, enabling this option and placing the entire pipeline under autocast can lead to numerical overflows with the T5 text encoder.
`),f=a("p"),f.innerHTML=j},l(b){r=Et(b,`The original Mochi implementation zeros out empty prompts. However, enabling this option and placing the entire pipeline under autocast can lead to numerical overflows with the T5 text encoder.
`),f=i(b,"P",{"data-svelte-h":!0}),g(f)!=="svelte-16wuz5"&&(f.innerHTML=j)},m(b,J){n(b,r,J),n(b,f,J)},p:ls,d(b){b&&(s(r),s(f))}}}function Ms(v){let r;return{c(){r=Xt("Decoding the latents in full precision is very memory intensive. You will need at least 70GB VRAM to generate the 163 frames in this example. To reduce memory, either reduce the number of frames or run the decoding step in `torch.bfloat16`.")},l(f){r=Et(f,"Decoding the latents in full precision is very memory intensive. You will need at least 70GB VRAM to generate the 163 frames in this example. To reduce memory, either reduce the number of frames or run the decoding step in `torch.bfloat16`.")},m(f,j){n(f,r,j)},d(f){f&&s(r)}}}function hs(v){let r;return{c(){r=Xt("Diffusers currently doesn't support using the FP8 scaled versions of the Mochi single file checkpoints.")},l(f){r=Et(f,"Diffusers currently doesn't support using the FP8 scaled versions of the Mochi single file checkpoints.")},m(f,j){n(f,r,j)},d(f){f&&s(r)}}}function us(v){let r,f="Examples:",j,b,J;return b=new Te({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTW9jaGlQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBleHBvcnRfdG9fdmlkZW8lMEElMEFwaXBlJTIwJTNEJTIwTW9jaGlQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyZ2VubW8lMkZtb2NoaS0xLXByZXZpZXclMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEFwaXBlLmVuYWJsZV92YWVfdGlsaW5nKCklMEFwcm9tcHQlMjAlM0QlMjAlMjJDbG9zZS11cCUyMG9mJTIwYSUyMGNoYW1lbGVvbidzJTIwZXllJTJDJTIwd2l0aCUyMGl0cyUyMHNjYWx5JTIwc2tpbiUyMGNoYW5naW5nJTIwY29sb3IuJTIwVWx0cmElMjBoaWdoJTIwcmVzb2x1dGlvbiUyMDRrLiUyMiUwQWZyYW1lcyUyMCUzRCUyMHBpcGUocHJvbXB0JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDI4JTJDJTIwZ3VpZGFuY2Vfc2NhbGUlM0QzLjUpLmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fdmlkZW8oZnJhbWVzJTJDJTIwJTIybW9jaGkubXA0JTIyKQ==",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> MochiPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = MochiPipeline.from_pretrained(<span class="hljs-string">&quot;genmo/mochi-1-preview&quot;</span>, torch_dtype=torch.bfloat16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_model_cpu_offload()
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_vae_tiling()
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;Close-up of a chameleon&#x27;s eye, with its scaly skin changing color. Ultra high resolution 4k.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>frames = pipe(prompt, num_inference_steps=<span class="hljs-number">28</span>, guidance_scale=<span class="hljs-number">3.5</span>).frames[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>export_to_video(frames, <span class="hljs-string">&quot;mochi.mp4&quot;</span>)`,wrap:!1}}),{c(){r=a("p"),r.textContent=f,j=l(),c(b.$$.fragment)},l(_){r=i(_,"P",{"data-svelte-h":!0}),g(r)!=="svelte-kvfsh7"&&(r.textContent=f),j=o(_),m(b.$$.fragment,_)},m(_,U){n(_,r,U),n(_,j,U),d(b,_,U),J=!0},p:ls,i(_){J||(M(b.$$.fragment,_),J=!0)},o(_){h(b.$$.fragment,_),J=!1},d(_){_&&(s(r),s(j)),u(b,_)}}}function fs(v){let r,f,j,b,J,_,U,Vt='<img alt="LoRA" src="https://img.shields.io/badge/LoRA-d8b4fe?style=flat"/>',Xe,G,$t="<p>Only a research preview of the model weights is available at the moment.</p>",Ee,z,Rt='<a href="https://huggingface.co/genmo/mochi-1-preview" rel="nofollow">Mochi 1</a> is a video generation model by Genmo with a strong focus on prompt adherence and motion quality. The model features a 10B parameter Asmmetric Diffusion Transformer (AsymmDiT) architecture, and uses non-square QKV and output projection layers to reduce inference memory requirements. A single T5-XXL model is used to encode prompts.',Ve,F,xt="<em>Mochi 1 preview is an open state-of-the-art video generation model with high-fidelity motion and strong prompt adherence in preliminary evaluation. This model dramatically closes the gap between closed and open video generation systems. The model is released under a permissive Apache 2.0 license.</em>",$e,B,Nt='<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>',Re,H,xe,q,Qt="Quantization helps reduce the memory requirements of very large models by storing model weights in a lower precision data type. However, quantization may have varying impact on video quality depending on the video model.",Ne,S,Yt='Refer to the <a href="../../quantization/overview">Quantization</a> overview to learn more about supported quantization backends and selecting a quantization backend that supports your use case. The example below demonstrates how to load a quantized <a href="/docs/diffusers/main/en/api/pipelines/mochi#diffusers.MochiPipeline">MochiPipeline</a> for inference with bitsandbytes.',Qe,P,Ye,L,ze,D,zt="The following example will download the full precision <code>mochi-1-preview</code> weights and produce the highest quality results but will require at least 42GB VRAM to run.",Fe,O,He,K,qe,ee,Ft="The following example will use the <code>bfloat16</code> variant of the model and requires 22GB VRAM to run. There is a slight drop in the quality of the generated video as a result.",Se,te,Pe,se,Le,ne,Ht='The <a href="https://github.com/genmoai/mochi/tree/main" rel="nofollow">Genmo Mochi implementation</a> uses different precision values for each stage in the inference process. The text encoder and VAE use <code>torch.float32</code>, while the DiT uses <code>torch.bfloat16</code> with the <a href="https://pytorch.org/docs/stable/generated/torch.nn.attention.sdpa_kernel.html#torch.nn.attention.sdpa_kernel" rel="nofollow">attention kernel</a> set to <code>EFFICIENT_ATTENTION</code>. Diffusers pipelines currently do not support setting different <code>dtypes</code> for different stages of the pipeline. In order to run inference in the same way as the original implementation, please refer to the following example.',De,A,Oe,X,Ke,le,et,oe,tt,ae,qt="It is possible to split the large Mochi transformer across multiple GPUs using the <code>device_map</code> and <code>max_memory</code> options in <code>from_pretrained</code>. In the following example we split the model across two GPUs, each with 24GB of VRAM.",st,ie,nt,re,lt,pe,St="You can use <code>from_single_file</code> to load the Mochi transformer in its original format.",ot,E,at,ce,it,me,rt,y,de,gt,Ue,Pt="The mochi pipeline for text-to-video generation.",wt,ve,Lt='Reference: <a href="https://github.com/genmoai/models" rel="nofollow">https://github.com/genmoai/models</a>',bt,Z,Me,_t,Ze,Dt="Function invoked when calling the pipeline for generation.",jt,V,Jt,$,he,Tt,Ie,Ot=`Disable sliced VAE decoding. If <code>enable_vae_slicing</code> was previously enabled, this method will go back to
computing decoding in one step.`,Ut,R,ue,vt,Ce,Kt=`Disable tiled VAE decoding. If <code>enable_vae_tiling</code> was previously enabled, this method will go back to
computing decoding in one step.`,Zt,x,fe,It,We,es=`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`,Ct,N,ye,Wt,ke,ts=`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`,kt,Q,ge,Gt,Ge,ss="Encodes the prompt into text encoder hidden states.",pt,we,ct,C,be,Bt,Be,ns="Output class for Mochi pipelines.",mt,_e,dt,Ae,Mt;return J=new k({props:{title:"Mochi 1 Preview",local:"mochi-1-preview",headingTag:"h1"}}),H=new k({props:{title:"Quantization",local:"quantization",headingTag:"h2"}}),P=new Te({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQml0c0FuZEJ5dGVzQ29uZmlnJTIwYXMlMjBEaWZmdXNlcnNCaXRzQW5kQnl0ZXNDb25maWclMkMlMjBNb2NoaVRyYW5zZm9ybWVyM0RNb2RlbCUyQyUyME1vY2hpUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX3ZpZGVvJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJpdHNBbmRCeXRlc0NvbmZpZyUyMGFzJTIwQml0c0FuZEJ5dGVzQ29uZmlnJTJDJTIwVDVFbmNvZGVyTW9kZWwlMEElMEFxdWFudF9jb25maWclMjAlM0QlMjBCaXRzQW5kQnl0ZXNDb25maWcobG9hZF9pbl84Yml0JTNEVHJ1ZSklMEF0ZXh0X2VuY29kZXJfOGJpdCUyMCUzRCUyMFQ1RW5jb2Rlck1vZGVsLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJnZW5tbyUyRm1vY2hpLTEtcHJldmlldyUyMiUyQyUwQSUyMCUyMCUyMCUyMHN1YmZvbGRlciUzRCUyMnRleHRfZW5jb2RlciUyMiUyQyUwQSUyMCUyMCUyMCUyMHF1YW50aXphdGlvbl9jb25maWclM0RxdWFudF9jb25maWclMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMEEpJTBBJTBBcXVhbnRfY29uZmlnJTIwJTNEJTIwRGlmZnVzZXJzQml0c0FuZEJ5dGVzQ29uZmlnKGxvYWRfaW5fOGJpdCUzRFRydWUpJTBBdHJhbnNmb3JtZXJfOGJpdCUyMCUzRCUyME1vY2hpVHJhbnNmb3JtZXIzRE1vZGVsLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJnZW5tbyUyRm1vY2hpLTEtcHJldmlldyUyMiUyQyUwQSUyMCUyMCUyMCUyMHN1YmZvbGRlciUzRCUyMnRyYW5zZm9ybWVyJTIyJTJDJTBBJTIwJTIwJTIwJTIwcXVhbnRpemF0aW9uX2NvbmZpZyUzRHF1YW50X2NvbmZpZyUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUwQSklMEElMEFwaXBlbGluZSUyMCUzRCUyME1vY2hpUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmdlbm1vJTJGbW9jaGktMS1wcmV2aWV3JTIyJTJDJTBBJTIwJTIwJTIwJTIwdGV4dF9lbmNvZGVyJTNEdGV4dF9lbmNvZGVyXzhiaXQlMkMlMEElMjAlMjAlMjAlMjB0cmFuc2Zvcm1lciUzRHRyYW5zZm9ybWVyXzhiaXQlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMEElMjAlMjAlMjAlMjBkZXZpY2VfbWFwJTNEJTIyYmFsYW5jZWQlMjIlMkMlMEEpJTBBJTBBdmlkZW8lMjAlM0QlMjBwaXBlbGluZSglMEElMjAlMjAlMjJDbG9zZS11cCUyMG9mJTIwYSUyMGNhdHMlMjBleWUlMkMlMjB3aXRoJTIwdGhlJTIwZ2FsYXh5JTIwcmVmbGVjdGVkJTIwaW4lMjB0aGUlMjBjYXRzJTIwZXllLiUyMFVsdHJhJTIwaGlnaCUyMHJlc29sdXRpb24lMjA0ay4lMjIlMkMlMEElMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMjglMkMlMEElMjAlMjBndWlkYW5jZV9zY2FsZSUzRDMuNSUwQSkuZnJhbWVzJTVCMCU1RCUwQWV4cG9ydF90b192aWRlbyh2aWRlbyUyQyUyMCUyMmNhdC5tcDQlMjIp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> BitsAndBytesConfig <span class="hljs-keyword">as</span> DiffusersBitsAndBytesConfig, MochiTransformer3DModel, MochiPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BitsAndBytesConfig <span class="hljs-keyword">as</span> BitsAndBytesConfig, T5EncoderModel

quant_config = BitsAndBytesConfig(load_in_8bit=<span class="hljs-literal">True</span>)
text_encoder_8bit = T5EncoderModel.from_pretrained(
    <span class="hljs-string">&quot;genmo/mochi-1-preview&quot;</span>,
    subfolder=<span class="hljs-string">&quot;text_encoder&quot;</span>,
    quantization_config=quant_config,
    torch_dtype=torch.float16,
)

quant_config = DiffusersBitsAndBytesConfig(load_in_8bit=<span class="hljs-literal">True</span>)
transformer_8bit = MochiTransformer3DModel.from_pretrained(
    <span class="hljs-string">&quot;genmo/mochi-1-preview&quot;</span>,
    subfolder=<span class="hljs-string">&quot;transformer&quot;</span>,
    quantization_config=quant_config,
    torch_dtype=torch.float16,
)

pipeline = MochiPipeline.from_pretrained(
    <span class="hljs-string">&quot;genmo/mochi-1-preview&quot;</span>,
    text_encoder=text_encoder_8bit,
    transformer=transformer_8bit,
    torch_dtype=torch.float16,
    device_map=<span class="hljs-string">&quot;balanced&quot;</span>,
)

video = pipeline(
  <span class="hljs-string">&quot;Close-up of a cats eye, with the galaxy reflected in the cats eye. Ultra high resolution 4k.&quot;</span>,
  num_inference_steps=<span class="hljs-number">28</span>,
  guidance_scale=<span class="hljs-number">3.5</span>
).frames[<span class="hljs-number">0</span>]
export_to_video(video, <span class="hljs-string">&quot;cat.mp4&quot;</span>)`,wrap:!1}}),L=new k({props:{title:"Generating videos with Mochi-1 Preview",local:"generating-videos-with-mochi-1-preview",headingTag:"h2"}}),O=new Te({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTW9jaGlQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBleHBvcnRfdG9fdmlkZW8lMEElMEFwaXBlJTIwJTNEJTIwTW9jaGlQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyZ2VubW8lMkZtb2NoaS0xLXByZXZpZXclMjIpJTBBJTBBJTIzJTIwRW5hYmxlJTIwbWVtb3J5JTIwc2F2aW5ncyUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEFwaXBlLmVuYWJsZV92YWVfdGlsaW5nKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJDbG9zZS11cCUyMG9mJTIwYSUyMGNoYW1lbGVvbidzJTIwZXllJTJDJTIwd2l0aCUyMGl0cyUyMHNjYWx5JTIwc2tpbiUyMGNoYW5naW5nJTIwY29sb3IuJTIwVWx0cmElMjBoaWdoJTIwcmVzb2x1dGlvbiUyMDRrLiUyMiUwQSUwQXdpdGglMjB0b3JjaC5hdXRvY2FzdCglMjJjdWRhJTIyJTJDJTIwdG9yY2guYmZsb2F0MTYlMkMlMjBjYWNoZV9lbmFibGVkJTNERmFsc2UpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwZnJhbWVzJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1fZnJhbWVzJTNEODUpLmZyYW1lcyU1QjAlNUQlMEElMEFleHBvcnRfdG9fdmlkZW8oZnJhbWVzJTJDJTIwJTIybW9jaGkubXA0JTIyJTJDJTIwZnBzJTNEMzAp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> MochiPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

pipe = MochiPipeline.from_pretrained(<span class="hljs-string">&quot;genmo/mochi-1-preview&quot;</span>)

<span class="hljs-comment"># Enable memory savings</span>
pipe.enable_model_cpu_offload()
pipe.enable_vae_tiling()

prompt = <span class="hljs-string">&quot;Close-up of a chameleon&#x27;s eye, with its scaly skin changing color. Ultra high resolution 4k.&quot;</span>

<span class="hljs-keyword">with</span> torch.autocast(<span class="hljs-string">&quot;cuda&quot;</span>, torch.bfloat16, cache_enabled=<span class="hljs-literal">False</span>):
      frames = pipe(prompt, num_frames=<span class="hljs-number">85</span>).frames[<span class="hljs-number">0</span>]

export_to_video(frames, <span class="hljs-string">&quot;mochi.mp4&quot;</span>, fps=<span class="hljs-number">30</span>)`,wrap:!1}}),K=new k({props:{title:"Using a lower precision variant to save memory",local:"using-a-lower-precision-variant-to-save-memory",headingTag:"h2"}}),te=new Te({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTW9jaGlQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBleHBvcnRfdG9fdmlkZW8lMEElMEFwaXBlJTIwJTNEJTIwTW9jaGlQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyZ2VubW8lMkZtb2NoaS0xLXByZXZpZXclMjIlMkMlMjB2YXJpYW50JTNEJTIyYmYxNiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYpJTBBJTBBJTIzJTIwRW5hYmxlJTIwbWVtb3J5JTIwc2F2aW5ncyUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEFwaXBlLmVuYWJsZV92YWVfdGlsaW5nKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJDbG9zZS11cCUyMG9mJTIwYSUyMGNoYW1lbGVvbidzJTIwZXllJTJDJTIwd2l0aCUyMGl0cyUyMHNjYWx5JTIwc2tpbiUyMGNoYW5naW5nJTIwY29sb3IuJTIwVWx0cmElMjBoaWdoJTIwcmVzb2x1dGlvbiUyMDRrLiUyMiUwQWZyYW1lcyUyMCUzRCUyMHBpcGUocHJvbXB0JTJDJTIwbnVtX2ZyYW1lcyUzRDg1KS5mcmFtZXMlNUIwJTVEJTBBJTBBZXhwb3J0X3RvX3ZpZGVvKGZyYW1lcyUyQyUyMCUyMm1vY2hpLm1wNCUyMiUyQyUyMGZwcyUzRDMwKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> MochiPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

pipe = MochiPipeline.from_pretrained(<span class="hljs-string">&quot;genmo/mochi-1-preview&quot;</span>, variant=<span class="hljs-string">&quot;bf16&quot;</span>, torch_dtype=torch.bfloat16)

<span class="hljs-comment"># Enable memory savings</span>
pipe.enable_model_cpu_offload()
pipe.enable_vae_tiling()

prompt = <span class="hljs-string">&quot;Close-up of a chameleon&#x27;s eye, with its scaly skin changing color. Ultra high resolution 4k.&quot;</span>
frames = pipe(prompt, num_frames=<span class="hljs-number">85</span>).frames[<span class="hljs-number">0</span>]

export_to_video(frames, <span class="hljs-string">&quot;mochi.mp4&quot;</span>, fps=<span class="hljs-number">30</span>)`,wrap:!1}}),se=new k({props:{title:"Reproducing the results from the Genmo Mochi repo",local:"reproducing-the-results-from-the-genmo-mochi-repo",headingTag:"h2"}}),A=new At({props:{$$slots:{default:[ds]},$$scope:{ctx:v}}}),X=new At({props:{$$slots:{default:[Ms]},$$scope:{ctx:v}}}),le=new Te({props:{code:" ",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> torch.nn.attention <span class="hljs-keyword">import</span> SDPBackend, sdpa_kernel

<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> MochiPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video
<span class="hljs-keyword">from</span> diffusers.video_processor <span class="hljs-keyword">import</span> VideoProcessor

pipe = MochiPipeline.from_pretrained(<span class="hljs-string">&quot;genmo/mochi-1-preview&quot;</span>, force_zeros_for_empty_prompt=<span class="hljs-literal">True</span>)
pipe.enable_vae_tiling()
pipe.enable_model_cpu_offload()

prompt =  <span class="hljs-string">&quot;An aerial shot of a parade of elephants walking across the African savannah. The camera showcases the herd and the surrounding landscape.&quot;</span>

<span class="hljs-keyword">with</span> torch.no_grad():
    prompt_embeds, prompt_attention_mask, negative_prompt_embeds, negative_prompt_attention_mask = (
        pipe.encode_prompt(prompt=prompt)
    )

<span class="hljs-keyword">with</span> torch.autocast(<span class="hljs-string">&quot;cuda&quot;</span>, torch.bfloat16):
    <span class="hljs-keyword">with</span> sdpa_kernel(SDPBackend.EFFICIENT_ATTENTION):
        frames = pipe(
            prompt_embeds=prompt_embeds,
            prompt_attention_mask=prompt_attention_mask,
            negative_prompt_embeds=negative_prompt_embeds,
            negative_prompt_attention_mask=negative_prompt_attention_mask,
            guidance_scale=<span class="hljs-number">4.5</span>,
            num_inference_steps=<span class="hljs-number">64</span>,
            height=<span class="hljs-number">480</span>,
            width=<span class="hljs-number">848</span>,
            num_frames=<span class="hljs-number">163</span>,
            generator=torch.Generator(<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">0</span>),
            output_type=<span class="hljs-string">&quot;latent&quot;</span>,
            return_dict=<span class="hljs-literal">False</span>,
        )[<span class="hljs-number">0</span>]

video_processor = VideoProcessor(vae_scale_factor=<span class="hljs-number">8</span>)
has_latents_mean = <span class="hljs-built_in">hasattr</span>(pipe.vae.config, <span class="hljs-string">&quot;latents_mean&quot;</span>) <span class="hljs-keyword">and</span> pipe.vae.config.latents_mean <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-literal">None</span>
has_latents_std = <span class="hljs-built_in">hasattr</span>(pipe.vae.config, <span class="hljs-string">&quot;latents_std&quot;</span>) <span class="hljs-keyword">and</span> pipe.vae.config.latents_std <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-literal">None</span>
<span class="hljs-keyword">if</span> has_latents_mean <span class="hljs-keyword">and</span> has_latents_std:
    latents_mean = (
        torch.tensor(pipe.vae.config.latents_mean).view(<span class="hljs-number">1</span>, <span class="hljs-number">12</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>).to(frames.device, frames.dtype)
    )
    latents_std = (
        torch.tensor(pipe.vae.config.latents_std).view(<span class="hljs-number">1</span>, <span class="hljs-number">12</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>).to(frames.device, frames.dtype)
    )
    frames = frames * latents_std / pipe.vae.config.scaling_factor + latents_mean
<span class="hljs-keyword">else</span>:
    frames = frames / pipe.vae.config.scaling_factor

<span class="hljs-keyword">with</span> torch.no_grad():
    video = pipe.vae.decode(frames.to(pipe.vae.dtype), return_dict=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]

video = video_processor.postprocess_video(video)[<span class="hljs-number">0</span>]
export_to_video(video, <span class="hljs-string">&quot;mochi.mp4&quot;</span>, fps=<span class="hljs-number">30</span>)`,wrap:!1}}),oe=new k({props:{title:"Running inference with multiple GPUs",local:"running-inference-with-multiple-gpus",headingTag:"h2"}}),ie=new Te({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTW9jaGlQaXBlbGluZSUyQyUyME1vY2hpVHJhbnNmb3JtZXIzRE1vZGVsJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b192aWRlbyUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIyZ2VubW8lMkZtb2NoaS0xLXByZXZpZXclMjIlMEF0cmFuc2Zvcm1lciUyMCUzRCUyME1vY2hpVHJhbnNmb3JtZXIzRE1vZGVsLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUyQyUwQSUyMCUyMCUyMCUyMHN1YmZvbGRlciUzRCUyMnRyYW5zZm9ybWVyJTIyJTJDJTBBJTIwJTIwJTIwJTIwZGV2aWNlX21hcCUzRCUyMmF1dG8lMjIlMkMlMEElMjAlMjAlMjAlMjBtYXhfbWVtb3J5JTNEJTdCMCUzQSUyMCUyMjI0R0IlMjIlMkMlMjAxJTNBJTIwJTIyMjRHQiUyMiU3RCUwQSklMEElMEFwaXBlJTIwJTNEJTIwTW9jaGlQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQobW9kZWxfaWQlMkMlMjAlMjB0cmFuc2Zvcm1lciUzRHRyYW5zZm9ybWVyKSUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEFwaXBlLmVuYWJsZV92YWVfdGlsaW5nKCklMEElMEF3aXRoJTIwdG9yY2guYXV0b2Nhc3QoZGV2aWNlX3R5cGUlM0QlMjJjdWRhJTIyJTJDJTIwZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiUyQyUyMGNhY2hlX2VuYWJsZWQlM0RGYWxzZSklM0ElMEElMjAlMjAlMjAlMjBmcmFtZXMlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHByb21wdCUzRCUyMkNsb3NlLXVwJTIwb2YlMjBhJTIwY2hhbWVsZW9uJ3MlMjBleWUlMkMlMjB3aXRoJTIwaXRzJTIwc2NhbHklMjBza2luJTIwY2hhbmdpbmclMjBjb2xvci4lMjBVbHRyYSUyMGhpZ2glMjByZXNvbHV0aW9uJTIwNGsuJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbmVnYXRpdmVfcHJvbXB0JTNEJTIyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaGVpZ2h0JTNENDgwJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwd2lkdGglM0Q4NDglMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBudW1fZnJhbWVzJTNEODUlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTAlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBndWlkYW5jZV9zY2FsZSUzRDQuNSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG51bV92aWRlb3NfcGVyX3Byb21wdCUzRDElMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0R0b3JjaC5HZW5lcmF0b3IoZGV2aWNlJTNEJTIyY3VkYSUyMikubWFudWFsX3NlZWQoMCklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBtYXhfc2VxdWVuY2VfbGVuZ3RoJTNEMjU2JTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwb3V0cHV0X3R5cGUlM0QlMjJwaWwlMjIlMkMlMEElMjAlMjAlMjAlMjApLmZyYW1lcyU1QjAlNUQlMEElMEFleHBvcnRfdG9fdmlkZW8oZnJhbWVzJTJDJTIwJTIyb3V0cHV0Lm1wNCUyMiUyQyUyMGZwcyUzRDMwKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> MochiPipeline, MochiTransformer3DModel
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

model_id = <span class="hljs-string">&quot;genmo/mochi-1-preview&quot;</span>
transformer = MochiTransformer3DModel.from_pretrained(
    model_id,
    subfolder=<span class="hljs-string">&quot;transformer&quot;</span>,
    device_map=<span class="hljs-string">&quot;auto&quot;</span>,
    max_memory={<span class="hljs-number">0</span>: <span class="hljs-string">&quot;24GB&quot;</span>, <span class="hljs-number">1</span>: <span class="hljs-string">&quot;24GB&quot;</span>}
)

pipe = MochiPipeline.from_pretrained(model_id,  transformer=transformer)
pipe.enable_model_cpu_offload()
pipe.enable_vae_tiling()

<span class="hljs-keyword">with</span> torch.autocast(device_type=<span class="hljs-string">&quot;cuda&quot;</span>, dtype=torch.bfloat16, cache_enabled=<span class="hljs-literal">False</span>):
    frames = pipe(
        prompt=<span class="hljs-string">&quot;Close-up of a chameleon&#x27;s eye, with its scaly skin changing color. Ultra high resolution 4k.&quot;</span>,
        negative_prompt=<span class="hljs-string">&quot;&quot;</span>,
        height=<span class="hljs-number">480</span>,
        width=<span class="hljs-number">848</span>,
        num_frames=<span class="hljs-number">85</span>,
        num_inference_steps=<span class="hljs-number">50</span>,
        guidance_scale=<span class="hljs-number">4.5</span>,
        num_videos_per_prompt=<span class="hljs-number">1</span>,
        generator=torch.Generator(device=<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">0</span>),
        max_sequence_length=<span class="hljs-number">256</span>,
        output_type=<span class="hljs-string">&quot;pil&quot;</span>,
    ).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">30</span>)`,wrap:!1}}),re=new k({props:{title:"Using single file loading with the Mochi Transformer",local:"using-single-file-loading-with-the-mochi-transformer",headingTag:"h2"}}),E=new At({props:{$$slots:{default:[hs]},$$scope:{ctx:v}}}),ce=new Te({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTW9jaGlQaXBlbGluZSUyQyUyME1vY2hpVHJhbnNmb3JtZXIzRE1vZGVsJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b192aWRlbyUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIyZ2VubW8lMkZtb2NoaS0xLXByZXZpZXclMjIlMEElMEFja3B0X3BhdGglMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGQ29tZnktT3JnJTJGbW9jaGlfcHJldmlld19yZXBhY2thZ2VkJTJGYmxvYiUyRm1haW4lMkZzcGxpdF9maWxlcyUyRmRpZmZ1c2lvbl9tb2RlbHMlMkZtb2NoaV9wcmV2aWV3X2JmMTYuc2FmZXRlbnNvcnMlMjIlMEElMEF0cmFuc2Zvcm1lciUyMCUzRCUyME1vY2hpVHJhbnNmb3JtZXIzRE1vZGVsLmZyb21fcHJldHJhaW5lZChja3B0X3BhdGglMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQSUwQXBpcGUlMjAlM0QlMjBNb2NoaVBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMCUyMHRyYW5zZm9ybWVyJTNEdHJhbnNmb3JtZXIpJTBBcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQXBpcGUuZW5hYmxlX3ZhZV90aWxpbmcoKSUwQSUwQXdpdGglMjB0b3JjaC5hdXRvY2FzdChkZXZpY2VfdHlwZSUzRCUyMmN1ZGElMjIlMkMlMjBkdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTJDJTIwY2FjaGVfZW5hYmxlZCUzREZhbHNlKSUzQSUwQSUyMCUyMCUyMCUyMGZyYW1lcyUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcHJvbXB0JTNEJTIyQ2xvc2UtdXAlMjBvZiUyMGElMjBjaGFtZWxlb24ncyUyMGV5ZSUyQyUyMHdpdGglMjBpdHMlMjBzY2FseSUyMHNraW4lMjBjaGFuZ2luZyUyMGNvbG9yLiUyMFVsdHJhJTIwaGlnaCUyMHJlc29sdXRpb24lMjA0ay4lMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBuZWdhdGl2ZV9wcm9tcHQlM0QlMjIlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBoZWlnaHQlM0Q0ODAlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB3aWR0aCUzRDg0OCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG51bV9mcmFtZXMlM0Q4NSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q1MCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNENC41JTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbnVtX3ZpZGVvc19wZXJfcHJvbXB0JTNEMSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRHRvcmNoLkdlbmVyYXRvcihkZXZpY2UlM0QlMjJjdWRhJTIyKS5tYW51YWxfc2VlZCgwKSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG1heF9zZXF1ZW5jZV9sZW5ndGglM0QyNTYlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvdXRwdXRfdHlwZSUzRCUyMnBpbCUyMiUyQyUwQSUyMCUyMCUyMCUyMCkuZnJhbWVzJTVCMCU1RCUwQSUwQWV4cG9ydF90b192aWRlbyhmcmFtZXMlMkMlMjAlMjJvdXRwdXQubXA0JTIyJTJDJTIwZnBzJTNEMzAp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> MochiPipeline, MochiTransformer3DModel
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

model_id = <span class="hljs-string">&quot;genmo/mochi-1-preview&quot;</span>

ckpt_path = <span class="hljs-string">&quot;https://huggingface.co/Comfy-Org/mochi_preview_repackaged/blob/main/split_files/diffusion_models/mochi_preview_bf16.safetensors&quot;</span>

transformer = MochiTransformer3DModel.from_pretrained(ckpt_path, torch_dtype=torch.bfloat16)

pipe = MochiPipeline.from_pretrained(model_id,  transformer=transformer)
pipe.enable_model_cpu_offload()
pipe.enable_vae_tiling()

<span class="hljs-keyword">with</span> torch.autocast(device_type=<span class="hljs-string">&quot;cuda&quot;</span>, dtype=torch.bfloat16, cache_enabled=<span class="hljs-literal">False</span>):
    frames = pipe(
        prompt=<span class="hljs-string">&quot;Close-up of a chameleon&#x27;s eye, with its scaly skin changing color. Ultra high resolution 4k.&quot;</span>,
        negative_prompt=<span class="hljs-string">&quot;&quot;</span>,
        height=<span class="hljs-number">480</span>,
        width=<span class="hljs-number">848</span>,
        num_frames=<span class="hljs-number">85</span>,
        num_inference_steps=<span class="hljs-number">50</span>,
        guidance_scale=<span class="hljs-number">4.5</span>,
        num_videos_per_prompt=<span class="hljs-number">1</span>,
        generator=torch.Generator(device=<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">0</span>),
        max_sequence_length=<span class="hljs-number">256</span>,
        output_type=<span class="hljs-string">&quot;pil&quot;</span>,
    ).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">30</span>)`,wrap:!1}}),me=new k({props:{title:"MochiPipeline",local:"diffusers.MochiPipeline",headingTag:"h2"}}),de=new Y({props:{name:"class diffusers.MochiPipeline",anchor:"diffusers.MochiPipeline",parameters:[{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKLMochi"},{name:"text_encoder",val:": T5EncoderModel"},{name:"tokenizer",val:": T5TokenizerFast"},{name:"transformer",val:": MochiTransformer3DModel"},{name:"force_zeros_for_empty_prompt",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.MochiPipeline.transformer",description:`<strong>transformer</strong> (<a href="/docs/diffusers/main/en/api/models/mochi_transformer3d#diffusers.MochiTransformer3DModel">MochiTransformer3DModel</a>) &#x2014;
Conditional Transformer architecture to denoise the encoded video latents.`,name:"transformer"},{anchor:"diffusers.MochiPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler">FlowMatchEulerDiscreteScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>transformer</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.MochiPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl_mochi#diffusers.AutoencoderKLMochi">AutoencoderKLMochi</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode videos to and from latent representations.`,name:"vae"},{anchor:"diffusers.MochiPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>T5EncoderModel</code>) &#x2014;
<a href="https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel" rel="nofollow">T5</a>, specifically
the <a href="https://huggingface.co/google/t5-v1_1-xxl" rel="nofollow">google/t5-v1_1-xxl</a> variant.`,name:"text_encoder"},{anchor:"diffusers.MochiPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.MochiPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>T5TokenizerFast</code>) &#x2014;
Second Tokenizer of class
<a href="https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5TokenizerFast" rel="nofollow">T5TokenizerFast</a>.`,name:"tokenizer"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/mochi/pipeline_mochi.py#L138"}}),Me=new Y({props:{name:"__call__",anchor:"diffusers.MochiPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"negative_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 = 19"},{name:"num_inference_steps",val:": int = 64"},{name:"timesteps",val:": typing.List[int] = None"},{name:"guidance_scale",val:": float = 4.5"},{name:"num_videos_per_prompt",val:": typing.Optional[int] = 1"},{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:"prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = 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:"max_sequence_length",val:": int = 256"}],parametersDescription:[{anchor:"diffusers.MochiPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.MochiPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.default_height</code>) &#x2014;
The height in pixels of the generated image. This is set to 480 by default for the best results.`,name:"height"},{anchor:"diffusers.MochiPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.default_width</code>) &#x2014;
The width in pixels of the generated image. This is set to 848 by default for the best results.`,name:"width"},{anchor:"diffusers.MochiPipeline.__call__.num_frames",description:`<strong>num_frames</strong> (<code>int</code>, defaults to <code>19</code>) &#x2014;
The number of video frames to generate`,name:"num_frames"},{anchor:"diffusers.MochiPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.MochiPipeline.__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.MochiPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, defaults to <code>4.5</code>) &#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 image quality.`,name:"guidance_scale"},{anchor:"diffusers.MochiPipeline.__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.MochiPipeline.__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.MochiPipeline.__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 image
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.MochiPipeline.__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.MochiPipeline.__call__.prompt_attention_mask",description:`<strong>prompt_attention_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated attention mask for text embeddings.`,name:"prompt_attention_mask"},{anchor:"diffusers.MochiPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. For PixArt-Sigma 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.MochiPipeline.__call__.negative_prompt_attention_mask",description:`<strong>negative_prompt_attention_mask</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated attention mask for negative text embeddings.`,name:"negative_prompt_attention_mask"},{anchor:"diffusers.MochiPipeline.__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 image. 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.MochiPipeline.__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.mochi.MochiPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.MochiPipeline.__call__.attention_kwargs",description:`<strong>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:"attention_kwargs"},{anchor:"diffusers.MochiPipeline.__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.MochiPipeline.__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.MochiPipeline.__call__.max_sequence_length",description:`<strong>max_sequence_length</strong> (<code>int</code> defaults to <code>256</code>) &#x2014;
Maximum sequence length to use with the <code>prompt</code>.`,name:"max_sequence_length"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/mochi/pipeline_mochi.py#L497",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is <code>True</code>, <code>~pipelines.mochi.MochiPipelineOutput</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>~pipelines.mochi.MochiPipelineOutput</code> or <code>tuple</code></p>
`}}),V=new cs({props:{anchor:"diffusers.MochiPipeline.__call__.example",$$slots:{default:[us]},$$scope:{ctx:v}}}),he=new Y({props:{name:"disable_vae_slicing",anchor:"diffusers.MochiPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/mochi/pipeline_mochi.py#L403"}}),ue=new Y({props:{name:"disable_vae_tiling",anchor:"diffusers.MochiPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/mochi/pipeline_mochi.py#L430"}}),fe=new Y({props:{name:"enable_vae_slicing",anchor:"diffusers.MochiPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/mochi/pipeline_mochi.py#L390"}}),ye=new Y({props:{name:"enable_vae_tiling",anchor:"diffusers.MochiPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/mochi/pipeline_mochi.py#L416"}}),ge=new Y({props:{name:"encode_prompt",anchor:"diffusers.MochiPipeline.encode_prompt",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"num_videos_per_prompt",val:": int = 1"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"max_sequence_length",val:": int = 256"},{name:"device",val:": typing.Optional[torch.device] = None"},{name:"dtype",val:": typing.Optional[torch.dtype] = None"}],parametersDescription:[{anchor:"diffusers.MochiPipeline.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.MochiPipeline.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.MochiPipeline.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.MochiPipeline.encode_prompt.num_videos_per_prompt",description:`<strong>num_videos_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of videos that should be generated per prompt. torch device to place the resulting embeddings on`,name:"num_videos_per_prompt"},{anchor:"diffusers.MochiPipeline.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.MochiPipeline.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.MochiPipeline.encode_prompt.device",description:`<strong>device</strong> &#x2014; (<code>torch.device</code>, <em>optional</em>):
torch device`,name:"device"},{anchor:"diffusers.MochiPipeline.encode_prompt.dtype",description:`<strong>dtype</strong> &#x2014; (<code>torch.dtype</code>, <em>optional</em>):
torch dtype`,name:"dtype"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/mochi/pipeline_mochi.py#L254"}}),we=new k({props:{title:"MochiPipelineOutput",local:"diffusers.pipelines.mochi.pipeline_output.MochiPipelineOutput",headingTag:"h2"}}),be=new Y({props:{name:"class diffusers.pipelines.mochi.pipeline_output.MochiPipelineOutput",anchor:"diffusers.pipelines.mochi.pipeline_output.MochiPipelineOutput",parameters:[{name:"frames",val:": Tensor"}],parametersDescription:[{anchor:"diffusers.pipelines.mochi.pipeline_output.MochiPipelineOutput.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 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>.`,name:"frames"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/mochi/pipeline_output.py#L9"}}),_e=new ms({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/mochi.md"}}),{c(){r=a("meta"),f=l(),j=a("p"),b=l(),c(J.$$.fragment),_=l(),U=a("div"),U.innerHTML=Vt,Xe=l(),G=a("blockquote"),G.innerHTML=$t,Ee=l(),z=a("p"),z.innerHTML=Rt,Ve=l(),F=a("p"),F.innerHTML=xt,$e=l(),B=a("blockquote"),B.innerHTML=Nt,Re=l(),c(H.$$.fragment),xe=l(),q=a("p"),q.textContent=Qt,Ne=l(),S=a("p"),S.innerHTML=Yt,Qe=l(),c(P.$$.fragment),Ye=l(),c(L.$$.fragment),ze=l(),D=a("p"),D.innerHTML=zt,Fe=l(),c(O.$$.fragment),He=l(),c(K.$$.fragment),qe=l(),ee=a("p"),ee.innerHTML=Ft,Se=l(),c(te.$$.fragment),Pe=l(),c(se.$$.fragment),Le=l(),ne=a("p"),ne.innerHTML=Ht,De=l(),c(A.$$.fragment),Oe=l(),c(X.$$.fragment),Ke=l(),c(le.$$.fragment),et=l(),c(oe.$$.fragment),tt=l(),ae=a("p"),ae.innerHTML=qt,st=l(),c(ie.$$.fragment),nt=l(),c(re.$$.fragment),lt=l(),pe=a("p"),pe.innerHTML=St,ot=l(),c(E.$$.fragment),at=l(),c(ce.$$.fragment),it=l(),c(me.$$.fragment),rt=l(),y=a("div"),c(de.$$.fragment),gt=l(),Ue=a("p"),Ue.textContent=Pt,wt=l(),ve=a("p"),ve.innerHTML=Lt,bt=l(),Z=a("div"),c(Me.$$.fragment),_t=l(),Ze=a("p"),Ze.textContent=Dt,jt=l(),c(V.$$.fragment),Jt=l(),$=a("div"),c(he.$$.fragment),Tt=l(),Ie=a("p"),Ie.innerHTML=Ot,Ut=l(),R=a("div"),c(ue.$$.fragment),vt=l(),Ce=a("p"),Ce.innerHTML=Kt,Zt=l(),x=a("div"),c(fe.$$.fragment),It=l(),We=a("p"),We.textContent=es,Ct=l(),N=a("div"),c(ye.$$.fragment),Wt=l(),ke=a("p"),ke.textContent=ts,kt=l(),Q=a("div"),c(ge.$$.fragment),Gt=l(),Ge=a("p"),Ge.textContent=ss,pt=l(),c(we.$$.fragment),ct=l(),C=a("div"),c(be.$$.fragment),Bt=l(),Be=a("p"),Be.textContent=ns,mt=l(),c(_e.$$.fragment),dt=l(),Ae=a("p"),this.h()},l(e){const t=ps("svelte-u9bgzb",document.head);r=i(t,"META",{name:!0,content:!0}),t.forEach(s),f=o(e),j=i(e,"P",{}),I(j).forEach(s),b=o(e),m(J.$$.fragment,e),_=o(e),U=i(e,"DIV",{class:!0,"data-svelte-h":!0}),g(U)!=="svelte-si9ct8"&&(U.innerHTML=Vt),Xe=o(e),G=i(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),g(G)!=="svelte-qhuwko"&&(G.innerHTML=$t),Ee=o(e),z=i(e,"P",{"data-svelte-h":!0}),g(z)!=="svelte-19k93hq"&&(z.innerHTML=Rt),Ve=o(e),F=i(e,"P",{"data-svelte-h":!0}),g(F)!=="svelte-16aanyn"&&(F.innerHTML=xt),$e=o(e),B=i(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),g(B)!=="svelte-r1jcqf"&&(B.innerHTML=Nt),Re=o(e),m(H.$$.fragment,e),xe=o(e),q=i(e,"P",{"data-svelte-h":!0}),g(q)!=="svelte-1ou2pxc"&&(q.textContent=Qt),Ne=o(e),S=i(e,"P",{"data-svelte-h":!0}),g(S)!=="svelte-eo746u"&&(S.innerHTML=Yt),Qe=o(e),m(P.$$.fragment,e),Ye=o(e),m(L.$$.fragment,e),ze=o(e),D=i(e,"P",{"data-svelte-h":!0}),g(D)!=="svelte-w0d3wt"&&(D.innerHTML=zt),Fe=o(e),m(O.$$.fragment,e),He=o(e),m(K.$$.fragment,e),qe=o(e),ee=i(e,"P",{"data-svelte-h":!0}),g(ee)!=="svelte-gdmfoq"&&(ee.innerHTML=Ft),Se=o(e),m(te.$$.fragment,e),Pe=o(e),m(se.$$.fragment,e),Le=o(e),ne=i(e,"P",{"data-svelte-h":!0}),g(ne)!=="svelte-1ke8pbr"&&(ne.innerHTML=Ht),De=o(e),m(A.$$.fragment,e),Oe=o(e),m(X.$$.fragment,e),Ke=o(e),m(le.$$.fragment,e),et=o(e),m(oe.$$.fragment,e),tt=o(e),ae=i(e,"P",{"data-svelte-h":!0}),g(ae)!=="svelte-14s0l4"&&(ae.innerHTML=qt),st=o(e),m(ie.$$.fragment,e),nt=o(e),m(re.$$.fragment,e),lt=o(e),pe=i(e,"P",{"data-svelte-h":!0}),g(pe)!=="svelte-14rhs7p"&&(pe.innerHTML=St),ot=o(e),m(E.$$.fragment,e),at=o(e),m(ce.$$.fragment,e),it=o(e),m(me.$$.fragment,e),rt=o(e),y=i(e,"DIV",{class:!0});var w=I(y);m(de.$$.fragment,w),gt=o(w),Ue=i(w,"P",{"data-svelte-h":!0}),g(Ue)!=="svelte-11luvqp"&&(Ue.textContent=Pt),wt=o(w),ve=i(w,"P",{"data-svelte-h":!0}),g(ve)!=="svelte-1br2zew"&&(ve.innerHTML=Lt),bt=o(w),Z=i(w,"DIV",{class:!0});var W=I(Z);m(Me.$$.fragment,W),_t=o(W),Ze=i(W,"P",{"data-svelte-h":!0}),g(Ze)!=="svelte-v78lg8"&&(Ze.textContent=Dt),jt=o(W),m(V.$$.fragment,W),W.forEach(s),Jt=o(w),$=i(w,"DIV",{class:!0});var je=I($);m(he.$$.fragment,je),Tt=o(je),Ie=i(je,"P",{"data-svelte-h":!0}),g(Ie)!=="svelte-1s3c06i"&&(Ie.innerHTML=Ot),je.forEach(s),Ut=o(w),R=i(w,"DIV",{class:!0});var Je=I(R);m(ue.$$.fragment,Je),vt=o(Je),Ce=i(Je,"P",{"data-svelte-h":!0}),g(Ce)!=="svelte-pkn4ui"&&(Ce.innerHTML=Kt),Je.forEach(s),Zt=o(w),x=i(w,"DIV",{class:!0});var ht=I(x);m(fe.$$.fragment,ht),It=o(ht),We=i(ht,"P",{"data-svelte-h":!0}),g(We)!=="svelte-14bnrb6"&&(We.textContent=es),ht.forEach(s),Ct=o(w),N=i(w,"DIV",{class:!0});var ut=I(N);m(ye.$$.fragment,ut),Wt=o(ut),ke=i(ut,"P",{"data-svelte-h":!0}),g(ke)!=="svelte-1xwrf7t"&&(ke.textContent=ts),ut.forEach(s),kt=o(w),Q=i(w,"DIV",{class:!0});var ft=I(Q);m(ge.$$.fragment,ft),Gt=o(ft),Ge=i(ft,"P",{"data-svelte-h":!0}),g(Ge)!=="svelte-16q0ax1"&&(Ge.textContent=ss),ft.forEach(s),w.forEach(s),pt=o(e),m(we.$$.fragment,e),ct=o(e),C=i(e,"DIV",{class:!0});var yt=I(C);m(be.$$.fragment,yt),Bt=o(yt),Be=i(yt,"P",{"data-svelte-h":!0}),g(Be)!=="svelte-srx61f"&&(Be.textContent=ns),yt.forEach(s),mt=o(e),m(_e.$$.fragment,e),dt=o(e),Ae=i(e,"P",{}),I(Ae).forEach(s),this.h()},h(){T(r,"name","hf:doc:metadata"),T(r,"content",ys),T(U,"class","flex flex-wrap space-x-1"),T(G,"class","tip"),T(B,"class","tip"),T(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(C,"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){p(document.head,r),n(e,f,t),n(e,j,t),n(e,b,t),d(J,e,t),n(e,_,t),n(e,U,t),n(e,Xe,t),n(e,G,t),n(e,Ee,t),n(e,z,t),n(e,Ve,t),n(e,F,t),n(e,$e,t),n(e,B,t),n(e,Re,t),d(H,e,t),n(e,xe,t),n(e,q,t),n(e,Ne,t),n(e,S,t),n(e,Qe,t),d(P,e,t),n(e,Ye,t),d(L,e,t),n(e,ze,t),n(e,D,t),n(e,Fe,t),d(O,e,t),n(e,He,t),d(K,e,t),n(e,qe,t),n(e,ee,t),n(e,Se,t),d(te,e,t),n(e,Pe,t),d(se,e,t),n(e,Le,t),n(e,ne,t),n(e,De,t),d(A,e,t),n(e,Oe,t),d(X,e,t),n(e,Ke,t),d(le,e,t),n(e,et,t),d(oe,e,t),n(e,tt,t),n(e,ae,t),n(e,st,t),d(ie,e,t),n(e,nt,t),d(re,e,t),n(e,lt,t),n(e,pe,t),n(e,ot,t),d(E,e,t),n(e,at,t),d(ce,e,t),n(e,it,t),d(me,e,t),n(e,rt,t),n(e,y,t),d(de,y,null),p(y,gt),p(y,Ue),p(y,wt),p(y,ve),p(y,bt),p(y,Z),d(Me,Z,null),p(Z,_t),p(Z,Ze),p(Z,jt),d(V,Z,null),p(y,Jt),p(y,$),d(he,$,null),p($,Tt),p($,Ie),p(y,Ut),p(y,R),d(ue,R,null),p(R,vt),p(R,Ce),p(y,Zt),p(y,x),d(fe,x,null),p(x,It),p(x,We),p(y,Ct),p(y,N),d(ye,N,null),p(N,Wt),p(N,ke),p(y,kt),p(y,Q),d(ge,Q,null),p(Q,Gt),p(Q,Ge),n(e,pt,t),d(we,e,t),n(e,ct,t),n(e,C,t),d(be,C,null),p(C,Bt),p(C,Be),n(e,mt,t),d(_e,e,t),n(e,dt,t),n(e,Ae,t),Mt=!0},p(e,[t]){const w={};t&2&&(w.$$scope={dirty:t,ctx:e}),A.$set(w);const W={};t&2&&(W.$$scope={dirty:t,ctx:e}),X.$set(W);const je={};t&2&&(je.$$scope={dirty:t,ctx:e}),E.$set(je);const Je={};t&2&&(Je.$$scope={dirty:t,ctx:e}),V.$set(Je)},i(e){Mt||(M(J.$$.fragment,e),M(H.$$.fragment,e),M(P.$$.fragment,e),M(L.$$.fragment,e),M(O.$$.fragment,e),M(K.$$.fragment,e),M(te.$$.fragment,e),M(se.$$.fragment,e),M(A.$$.fragment,e),M(X.$$.fragment,e),M(le.$$.fragment,e),M(oe.$$.fragment,e),M(ie.$$.fragment,e),M(re.$$.fragment,e),M(E.$$.fragment,e),M(ce.$$.fragment,e),M(me.$$.fragment,e),M(de.$$.fragment,e),M(Me.$$.fragment,e),M(V.$$.fragment,e),M(he.$$.fragment,e),M(ue.$$.fragment,e),M(fe.$$.fragment,e),M(ye.$$.fragment,e),M(ge.$$.fragment,e),M(we.$$.fragment,e),M(be.$$.fragment,e),M(_e.$$.fragment,e),Mt=!0)},o(e){h(J.$$.fragment,e),h(H.$$.fragment,e),h(P.$$.fragment,e),h(L.$$.fragment,e),h(O.$$.fragment,e),h(K.$$.fragment,e),h(te.$$.fragment,e),h(se.$$.fragment,e),h(A.$$.fragment,e),h(X.$$.fragment,e),h(le.$$.fragment,e),h(oe.$$.fragment,e),h(ie.$$.fragment,e),h(re.$$.fragment,e),h(E.$$.fragment,e),h(ce.$$.fragment,e),h(me.$$.fragment,e),h(de.$$.fragment,e),h(Me.$$.fragment,e),h(V.$$.fragment,e),h(he.$$.fragment,e),h(ue.$$.fragment,e),h(fe.$$.fragment,e),h(ye.$$.fragment,e),h(ge.$$.fragment,e),h(we.$$.fragment,e),h(be.$$.fragment,e),h(_e.$$.fragment,e),Mt=!1},d(e){e&&(s(f),s(j),s(b),s(_),s(U),s(Xe),s(G),s(Ee),s(z),s(Ve),s(F),s($e),s(B),s(Re),s(xe),s(q),s(Ne),s(S),s(Qe),s(Ye),s(ze),s(D),s(Fe),s(He),s(qe),s(ee),s(Se),s(Pe),s(Le),s(ne),s(De),s(Oe),s(Ke),s(et),s(tt),s(ae),s(st),s(nt),s(lt),s(pe),s(ot),s(at),s(it),s(rt),s(y),s(pt),s(ct),s(C),s(mt),s(dt),s(Ae)),s(r),u(J,e),u(H,e),u(P,e),u(L,e),u(O,e),u(K,e),u(te,e),u(se,e),u(A,e),u(X,e),u(le,e),u(oe,e),u(ie,e),u(re,e),u(E,e),u(ce,e),u(me,e),u(de),u(Me),u(V),u(he),u(ue),u(fe),u(ye),u(ge),u(we,e),u(be),u(_e,e)}}}const ys='{"title":"Mochi 1 Preview","local":"mochi-1-preview","sections":[{"title":"Quantization","local":"quantization","sections":[],"depth":2},{"title":"Generating videos with Mochi-1 Preview","local":"generating-videos-with-mochi-1-preview","sections":[],"depth":2},{"title":"Using a lower precision variant to save memory","local":"using-a-lower-precision-variant-to-save-memory","sections":[],"depth":2},{"title":"Reproducing the results from the Genmo Mochi repo","local":"reproducing-the-results-from-the-genmo-mochi-repo","sections":[],"depth":2},{"title":"Running inference with multiple GPUs","local":"running-inference-with-multiple-gpus","sections":[],"depth":2},{"title":"Using single file loading with the Mochi Transformer","local":"using-single-file-loading-with-the-mochi-transformer","sections":[],"depth":2},{"title":"MochiPipeline","local":"diffusers.MochiPipeline","sections":[],"depth":2},{"title":"MochiPipelineOutput","local":"diffusers.pipelines.mochi.pipeline_output.MochiPipelineOutput","sections":[],"depth":2}],"depth":1}';function gs(v){return as(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class vs extends is{constructor(r){super(),rs(this,r,gs,fs,os,{})}}export{vs as component};
