import{s as se,o as ae,n as El}from"../chunks/scheduler.8c3d61f6.js";import{S as te,i as ne,g as u,s as M,r as y,A as oe,h as w,f as s,c as i,j as ee,u as m,x as b,k as Ql,y as Me,a,v as r,d,t as c,w as J}from"../chunks/index.da70eac4.js";import{C as f}from"../chunks/CodeBlock.a9c4becf.js";import{H as sl,E as ie}from"../chunks/getInferenceSnippets.cb466318.js";import{H as pe,a as Hl}from"../chunks/HfOption.6c3b4e77.js";function ye(Z){let n,p;return n=new f({props:{code:" ",highlighted:`<span class="hljs-comment"># pip install ftfy</span>
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoModel, WanPipeline
<span class="hljs-keyword">from</span> diffusers.hooks.group_offloading <span class="hljs-keyword">import</span> apply_group_offloading
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video, load_image
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> UMT5EncoderModel

text_encoder = UMT5EncoderModel.from_pretrained(<span class="hljs-string">&quot;Wan-AI/Wan2.1-T2V-14B-Diffusers&quot;</span>, subfolder=<span class="hljs-string">&quot;text_encoder&quot;</span>, torch_dtype=torch.bfloat16)
vae = AutoModel.from_pretrained(<span class="hljs-string">&quot;Wan-AI/Wan2.1-T2V-14B-Diffusers&quot;</span>, subfolder=<span class="hljs-string">&quot;vae&quot;</span>, torch_dtype=torch.float32)
transformer = AutoModel.from_pretrained(<span class="hljs-string">&quot;Wan-AI/Wan2.1-T2V-14B-Diffusers&quot;</span>, subfolder=<span class="hljs-string">&quot;transformer&quot;</span>, torch_dtype=torch.bfloat16)

<span class="hljs-comment"># group-offloading</span>
onload_device = torch.device(<span class="hljs-string">&quot;cuda&quot;</span>)
offload_device = torch.device(<span class="hljs-string">&quot;cpu&quot;</span>)
apply_group_offloading(text_encoder,
    onload_device=onload_device,
    offload_device=offload_device,
    offload_type=<span class="hljs-string">&quot;block_level&quot;</span>,
    num_blocks_per_group=<span class="hljs-number">4</span>
)
transformer.enable_group_offload(
    onload_device=onload_device,
    offload_device=offload_device,
    offload_type=<span class="hljs-string">&quot;leaf_level&quot;</span>,
    use_stream=<span class="hljs-literal">True</span>
)

pipeline = WanPipeline.from_pretrained(
    <span class="hljs-string">&quot;Wan-AI/Wan2.1-T2V-14B-Diffusers&quot;</span>,
    vae=vae,
    transformer=transformer,
    text_encoder=text_encoder,
    torch_dtype=torch.bfloat16
)
pipeline.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;&quot;&quot;
The camera rushes from far to near in a low-angle shot, 
revealing a white ferret on a log. It plays, leaps into the water, and emerges, as the camera zooms in 
for a close-up. Water splashes berry bushes nearby, while moss, snow, and leaves blanket the ground. 
Birch trees and a light blue sky frame the scene, with ferns in the foreground. Side lighting casts dynamic 
shadows and warm highlights. Medium composition, front view, low angle, with depth of field.
&quot;&quot;&quot;</span>
negative_prompt = <span class="hljs-string">&quot;&quot;&quot;
Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, 
low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, 
misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards
&quot;&quot;&quot;</span>

output = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    num_frames=<span class="hljs-number">81</span>,
    guidance_scale=<span class="hljs-number">5.0</span>,
).frames[<span class="hljs-number">0</span>]
export_to_video(output, <span class="hljs-string">&quot;output.mp4&quot;</span>, fps=<span class="hljs-number">16</span>)`,wrap:!1}}),{c(){y(n.$$.fragment)},l(t){m(n.$$.fragment,t)},m(t,T){r(n,t,T),p=!0},p:El,i(t){p||(d(n.$$.fragment,t),p=!0)},o(t){c(n.$$.fragment,t),p=!1},d(t){J(n,t)}}}function me(Z){let n,p;return n=new f({props:{code:"aW1wb3J0JTIwdG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WclMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTJDJTBBKSUwQSUwQSUyMyUyMG1vZGVsLW9mZmxvYWRpbmclMjBhbmQlMjB0aWxpbmclMEFwaXBlbGluZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQXBpcGVsaW5lLnZhZS5lbmFibGVfdGlsaW5nKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwZmx1ZmZ5JTIwdGVkZHklMjBiZWFyJTIwc2l0cyUyMG9uJTIwYSUyMGJlZCUyMG9mJTIwc29mdCUyMHBpbGxvd3MlMjBzdXJyb3VuZGVkJTIwYnklMjBjaGlsZHJlbidzJTIwdG95cy4lMjIlMEF2aWRlbyUyMCUzRCUyMHBpcGVsaW5lKHByb21wdCUzRHByb21wdCUyQyUyMG51bV9mcmFtZXMlM0Q2MSUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QzMCkuZnJhbWVzJTVCMCU1RCUwQWV4cG9ydF90b192aWRlbyh2aWRlbyUyQyUyMCUyMm91dHB1dC5tcDQlMjIlMkMlMjBmcHMlM0QxNSk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers importAutoModel, HunyuanVideoPipeline
<span class="hljs-keyword">from</span> diffusers.quantizers <span class="hljs-keyword">import</span> PipelineQuantizationConfig
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

<span class="hljs-comment"># quantize weights to int4 with bitsandbytes</span>
pipeline_quant_config = PipelineQuantizationConfig(
  quant_backend=<span class="hljs-string">&quot;bitsandbytes_4bit&quot;</span>,
  quant_kwargs={
    <span class="hljs-string">&quot;load_in_4bit&quot;</span>: <span class="hljs-literal">True</span>,
    <span class="hljs-string">&quot;bnb_4bit_quant_type&quot;</span>: <span class="hljs-string">&quot;nf4&quot;</span>,
    <span class="hljs-string">&quot;bnb_4bit_compute_dtype&quot;</span>: torch.bfloat16
    },
  components_to_quantize=<span class="hljs-string">&quot;transformer&quot;</span>
)

pipeline = HunyuanVideoPipeline.from_pretrained(
    <span class="hljs-string">&quot;hunyuanvideo-community/HunyuanVideo&quot;</span>,
    quantization_config=pipeline_quant_config,
    torch_dtype=torch.bfloat16,
)

<span class="hljs-comment"># model-offloading and tiling</span>
pipeline.enable_model_cpu_offload()
pipeline.vae.enable_tiling()

prompt = <span class="hljs-string">&quot;A fluffy teddy bear sits on a bed of soft pillows surrounded by children&#x27;s toys.&quot;</span>
video = pipeline(prompt=prompt, num_frames=<span class="hljs-number">61</span>, num_inference_steps=<span class="hljs-number">30</span>).frames[<span class="hljs-number">0</span>]
export_to_video(video, <span class="hljs-string">&quot;output.mp4&quot;</span>, fps=<span class="hljs-number">15</span>)`,wrap:!1}}),{c(){y(n.$$.fragment)},l(t){m(n.$$.fragment,t)},m(t,T){r(n,t,T),p=!0},p:El,i(t){p||(d(n.$$.fragment,t),p=!0)},o(t){c(n.$$.fragment,t),p=!1},d(t){J(n,t)}}}function re(Z){let n,p;return n=new f({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTFRYUGlwZWxpbmUlMkMlMjBBdXRvTW9kZWwlMEFmcm9tJTIwZGlmZnVzZXJzLmhvb2tzJTIwaW1wb3J0JTIwYXBwbHlfZ3JvdXBfb2ZmbG9hZGluZyUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBleHBvcnRfdG9fdmlkZW8lMEElMEElMjMlMjBmcDglMjBsYXllcndpc2UlMjB3ZWlnaHQtY2FzdGluZyUwQXRyYW5zZm9ybWVyJTIwJTNEJTIwQXV0b01vZGVsLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJMaWdodHJpY2tzJTJGTFRYLVZpZGVvJTIyJTJDJTBBJTIwJTIwJTIwJTIwc3ViZm9sZGVyJTNEJTIydHJhbnNmb3Jt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TJDJTIwaml0dGVyeSUyQyUyMGRpc3RvcnRlZCUyMiUwQSUwQXZpZGVvJTIwJTNEJTIwcGlwZWxpbmUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfcHJvbXB0JTNEbmVnYXRpdmVfcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBoZWlnaHQlM0Q1MTIlMkMlMEElMjAlMjAlMjAlMjBudW1fZnJhbWVzJTNEMTYxJTJDJTBBJTIwJTIwJTIwJTIwZGVjb2RlX3RpbWVzdGVwJTNEMC4wMyUyQyUwQSUyMCUyMCUyMCUyMGRlY29kZV9ub2lzZV9zY2FsZSUzRDAuMDI1JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBKS5mcmFtZXMlNUIwJTVEJTBBZXhwb3J0X3RvX3ZpZGVvKHZpZGVvJTJDJTIwJTIyb3V0cHV0Lm1wNCUyMiUyQyUyMGZwcyUzRDI0KQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LTXPipeline, AutoModel
<span class="hljs-keyword">from</span> diffusers.hooks <span class="hljs-keyword">import</span> apply_group_offloading
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

<span class="hljs-comment"># fp8 layerwise weight-casting</span>
transformer = AutoModel.from_pretrained(
    <span class="hljs-string">&quot;Lightricks/LTX-Video&quot;</span>,
    subfolder=<span class="hljs-string">&quot;transformer&quot;</span>,
    torch_dtype=torch.bfloat16
)
transformer.enable_layerwise_casting(
    storage_dtype=torch.float8_e4m3fn, compute_dtype=torch.bfloat16
)

pipeline = LTXPipeline.from_pretrained(<span class="hljs-string">&quot;Lightricks/LTX-Video&quot;</span>, transformer=transformer, torch_dtype=torch.bfloat16)

<span class="hljs-comment"># group-offloading</span>
onload_device = torch.device(<span class="hljs-string">&quot;cuda&quot;</span>)
offload_device = torch.device(<span class="hljs-string">&quot;cpu&quot;</span>)
pipeline.transformer.enable_group_offload(onload_device=onload_device, offload_device=offload_device, offload_type=<span class="hljs-string">&quot;leaf_level&quot;</span>, use_stream=<span class="hljs-literal">True</span>)
apply_group_offloading(pipeline.text_encoder, onload_device=onload_device, offload_type=<span class="hljs-string">&quot;block_level&quot;</span>, num_blocks_per_group=<span class="hljs-number">2</span>)
apply_group_offloading(pipeline.vae, onload_device=onload_device, offload_type=<span class="hljs-string">&quot;leaf_level&quot;</span>)

prompt = <span class="hljs-string">&quot;&quot;&quot;
A woman with long brown hair and light skin smiles at another woman with long blonde hair. The woman with brown hair wears a black jacket and has a small, barely noticeable mole on her right cheek. The camera angle is a close-up, focused on the woman with brown hair&#x27;s face. The lighting is warm and natural, likely from the setting sun, casting a soft glow on the scene. The scene appears to be real-life footage
&quot;&quot;&quot;</span>
negative_prompt = <span class="hljs-string">&quot;worst quality, inconsistent motion, blurry, jittery, distorted&quot;</span>

video = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    width=<span class="hljs-number">768</span>,
    height=<span class="hljs-number">512</span>,
    num_frames=<span class="hljs-number">161</span>,
    decode_timestep=<span class="hljs-number">0.03</span>,
    decode_noise_scale=<span class="hljs-number">0.025</span>,
    num_inference_steps=<span class="hljs-number">50</span>,
).frames[<span class="hljs-number">0</span>]
export_to_video(video, <span class="hljs-string">&quot;output.mp4&quot;</span>, fps=<span class="hljs-number">24</span>)`,wrap:!1}}),{c(){y(n.$$.fragment)},l(t){m(n.$$.fragment,t)},m(t,T){r(n,t,T),p=!0},p:El,i(t){p||(d(n.$$.fragment,t),p=!0)},o(t){c(n.$$.fragment,t),p=!1},d(t){J(n,t)}}}function de(Z){let n,p,t,T,h,B;return n=new Hl({props:{id:"popular models",option:"Wan2.1",$$slots:{default:[ye]},$$scope:{ctx:Z}}}),t=new Hl({props:{id:"popular models",option:"HunyuanVideo",$$slots:{default:[me]},$$scope:{ctx:Z}}}),h=new Hl({props:{id:"popular models",option:"LTX-Video",$$slots:{default:[re]},$$scope:{ctx:Z}}}),{c(){y(n.$$.fragment),p=M(),y(t.$$.fragment),T=M(),y(h.$$.fragment)},l(o){m(n.$$.fragment,o),p=i(o),m(t.$$.fragment,o),T=i(o),m(h.$$.fragment,o)},m(o,U){r(n,o,U),a(o,p,U),r(t,o,U),a(o,T,U),r(h,o,U),B=!0},p(o,U){const X={};U&2&&(X.$$scope={dirty:U,ctx:o}),n.$set(X);const j={};U&2&&(j.$$scope={dirty:U,ctx:o}),t.$set(j);const al={};U&2&&(al.$$scope={dirty:U,ctx:o}),h.$set(al)},i(o){B||(d(n.$$.fragment,o),d(t.$$.fragment,o),d(h.$$.fragment,o),B=!0)},o(o){c(n.$$.fragment,o),c(t.$$.fragment,o),c(h.$$.fragment,o),B=!1},d(o){o&&(s(p),s(T)),J(n,o),J(t,o),J(h,o)}}}function ce(Z){let n,p,t,T,h,B,o,U="Video generation models extend image generation (can be considered a 1-frame video) to also process data related to space and time. Making sure all this data - text, space, time - remain consistent and aligned from frame-to-frame is a big challenge in generating long and high-resolution videos.",X,j,al="Modern video models tackle this challenge with the diffusion transformer (DiT) architecture. This reduces computational costs and allows more efficient scaling to larger and higher-quality image and video data.",nl,v,Cl="Check out what some of these video models are capable of below.",ol,G,Ml,V,Fl="This guide will cover video generation basics such as which parameters to configure and how to reduce their memory usage.",il,I,_l="<p>If you’re interested in learning more about how to use a specific model, please refer to their pipeline API model card.</p>",pl,g,yl,k,zl="There are several parameters to configure in the pipeline that’ll affect video generation quality or speed. Experimenting with different parameter values is important for discovering the appropriate quality and speed tradeoff.",ml,R,rl,Y,Nl="A frame is a still image that is played in a sequence of other frames to create motion or a video. Control the number of frames generated per second with <code>num_frames</code>. Increasing <code>num_frames</code> increases perceived motion smoothness and visual coherence, making it especially important for videos with dynamic content. A higher <code>num_frames</code> value also increases video duration.",dl,Q,Sl='Some video models require more specific <code>num_frames</code> values for inference. For example, <a href="/docs/diffusers/main/en/api/pipelines/hunyuan_video#diffusers.HunyuanVideoPipeline">HunyuanVideoPipeline</a> recommends calculating the <code>num_frames</code> with <code>(4 * num_frames) +1</code>. Always check a pipelines API model card to see if there is a recommended value.',cl,H,Jl,E,ul,C,xl="Guidance scale or “cfg” controls how closely the generated frames adhere to the input conditioning (text, image or both). Increasing <code>guidance_scale</code> generates frames that resemble the input conditions more closely and includes finer details, but risk introducing artifacts and reducing output diversity. Lower <code>guidance_scale</code> values encourages looser prompt adherence and increased output variety, but details may not be as great. If it’s too low, it may ignore your prompt entirely and generate random noise.",wl,F,bl,_,hl,z,ql="A negative prompt is useful for excluding things you don’t want to see in the generated video. It is commonly used to refine the quality and alignment of the generated video by pushing the model away from undesirable elements like “blurry, distorted, ugly”. This can create cleaner and more focused videos.",Tl,N,Ul,S,Zl,x,Al='Recent video models like <a href="/docs/diffusers/main/en/api/pipelines/hunyuan_video#diffusers.HunyuanVideoPipeline">HunyuanVideoPipeline</a> and <a href="/docs/diffusers/main/en/api/pipelines/wan#diffusers.WanPipeline">WanPipeline</a>, which have 10B+ parameters, require a lot of memory and it often exceeds the memory available on consumer hardware. Diffusers offers several techniques for reducing the memory requirements of these large models.',jl,W,$l='<p>Refer to the <a href="../optimization/memory">Reduce memory usage</a> guide for more details about other memory saving techniques.</p>',Bl,q,Dl='One of these techniques is <a href="../optimization/memory#group-offloading">group-offloading</a>, which offloads groups of internal model layers (such as <code>torch.nn.Sequential</code>) to the CPU when it isn’t being used. These layers are only loaded when they’re needed for computation to avoid storing <strong>all</strong> the model components on the GPU. For a 14B parameter model like <a href="/docs/diffusers/main/en/api/pipelines/wan#diffusers.WanPipeline">WanPipeline</a>, group-offloading can lower the required memory to ~13GB of VRAM.',fl,A,Gl,$,Ll='Another option for reducing memory is to consider quantizing a model, which stores the model weights in a lower precision data type. However, quantization may impact video quality depending on the specific video model. Refer to the quantization <a href="../quantization/overview">Overivew</a> to learn more about the different supported quantization backends.',Il,D,Pl='The example below uses <a href="../quantization/bitsandbytes">bitsandbytes</a> to quantize a model.',Wl,L,Xl,P,vl,K,Kl='<a href="https://pytorch.org/tutorials/intermediate/torch_compile_tutorial_.html" rel="nofollow">torch.compile</a> can speedup inference by using optimized kernels. Compilation takes longer the first time, but once compiled, it is much faster. It is best to compile the pipeline once, and then use the pipeline multiple times without changing anything. A change, such as in the image size, triggers recompilation.',Vl,O,Ol="The example below compiles the transformer in the pipeline and uses the <code>&quot;max-autotune&quot;</code> mode to maximize performance.",gl,ll,kl,el,Rl,tl,Yl;return h=new sl({props:{title:"Video generation",local:"video-generation",headingTag:"h1"}}),G=new pe({props:{id:"popular models",options:["Wan2.1","HunyuanVideo","LTX-Video"],$$slots:{default:[de]},$$scope:{ctx:Z}}}),g=new sl({props:{title:"Pipeline parameters",local:"pipeline-parameters",headingTag:"h2"}}),R=new sl({props:{title:"num_frames",local:"numframes",headingTag:"h3"}}),H=new f({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTFRYUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX3ZpZGVvJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBMVFhQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyTGlnaHRyaWNrcyUyRkxUWC1WaWRlbyUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMEEpLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyJTIyJTIyJTBBQSUyMHdvbWFuJTIwd2l0aCUyMGxvbmclMjBicm93biUyMGhhaXIlMjBhbmQlMjBsaWdodCUyMHNraW4lMjBzbWlsZXMlMjBhdCUyMGFub3RoZXIlMjB3b21hbiUyMHdpdGglMjBs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JTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBKS5mcmFtZXMlNUIwJTVEJTBBZXhwb3J0X3RvX3ZpZGVvKHZpZGVvJTJDJTIwJTIyb3V0cHV0Lm1wNCUyMiUyQyUyMGZwcyUzRDI0KQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LTXPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

pipeline = LTXPipeline.from_pretrained(
    <span class="hljs-string">&quot;Lightricks/LTX-Video&quot;</span>, torch_dtype=torch.bfloat16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;&quot;&quot;
A woman with long brown hair and light skin smiles at another woman with long blonde hair. The woman 
with brown hair wears a black jacket and has a small, barely noticeable mole on her right cheek. The 
camera angle is a close-up, focused on the woman with brown hair&#x27;s face. The lighting is warm and 
natural, likely from the setting sun, casting a soft glow on the scene. The scene appears to be 
real-life footage
&quot;&quot;&quot;</span>

video = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    width=<span class="hljs-number">768</span>,
    height=<span class="hljs-number">512</span>,
    num_frames=<span class="hljs-number">161</span>,
    decode_timestep=<span class="hljs-number">0.03</span>,
    decode_noise_scale=<span class="hljs-number">0.025</span>,
    num_inference_steps=<span class="hljs-number">50</span>,
).frames[<span class="hljs-number">0</span>]
export_to_video(video, <span class="hljs-string">&quot;output.mp4&quot;</span>, fps=<span class="hljs-number">24</span>)`,wrap:!1}}),E=new sl({props:{title:"guidance_scale",local:"guidancescale",headingTag:"h3"}}),F=new f({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQ29nVmlkZW9YUGlwZWxpbmUlMkMlMjBDb2dWaWRlb1hUcmFuc2Zvcm1lcjNETW9kZWwlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTI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MlMjB0aGUlMjBpbm5vY2VuY2UlMjBhbmQlMjBpbWFnaW5hdGlvbiUyMG9mJTIwY2hpbGRob29kJTJDJTIwJTBBd2l0aCUyMHRoZSUyMHRveSUyMHNoaXAncyUyMGpvdXJuZXklMjBzeW1ib2xpemluZyUyMGVuZGxlc3MlMjBhZHZlbnR1cmVzJTIwaW4lMjBhJTIwd2hpbXNpY2FsJTJDJTIwaW5kb29yJTIwc2V0dGluZy4lMEElMjIlMjIlMjIlMEElMEF2aWRlbyUyMCUzRCUyMHBpcGVsaW5lKCUwQSUyMCUyMHByb21wdCUzRHByb21wdCUyQyUwQSUyMCUyMGd1aWRhbmNlX3NjYWxlJTNENiUyQyUwQSUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q1MCUwQSkuZnJhbWVzJTVCMCU1RCUwQWV4cG9ydF90b192aWRlbyh2aWRlbyUyQyUyMCUyMm91dHB1dC5tcDQlMjIlMkMlMjBmcHMlM0Q4KQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> CogVideoXPipeline, CogVideoXTransformer3DModel
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

pipeline = CogVideoXPipeline.from_pretrained(
  <span class="hljs-string">&quot;THUDM/CogVideoX-2b&quot;</span>,
  torch_dtype=torch.float16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;&quot;&quot;
A detailed wooden toy ship with intricately carved masts and sails is seen gliding smoothly over
a plush, blue carpet that mimics the waves of the sea. The ship&#x27;s hull is painted a rich brown, 
with tiny windows. The carpet, soft and textured, provides a perfect backdrop, resembling an 
oceanic expanse. Surrounding the ship are various other toys and children&#x27;s items, hinting at 
a playful environment. The scene captures the innocence and imagination of childhood, 
with the toy ship&#x27;s journey symbolizing endless adventures in a whimsical, indoor setting.
&quot;&quot;&quot;</span>

video = pipeline(
  prompt=prompt,
  guidance_scale=<span class="hljs-number">6</span>,
  num_inference_steps=<span class="hljs-number">50</span>
).frames[<span class="hljs-number">0</span>]
export_to_video(video, <span class="hljs-string">&quot;output.mp4&quot;</span>, fps=<span class="hljs-number">8</span>)`,wrap:!1}}),_=new sl({props:{title:"negative_prompt",local:"negativeprompt",headingTag:"h3"}}),N=new f({props:{code:"JTIzJTIwcGlwJTIwaW5zdGFsbCUyMGZ0ZnklMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBXYW5QaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMuc2NoZWR1bGVycy5zY2hlZHVsaW5nX3VuaXBjX211bHRpc3RlcCUyMGltcG9ydCUyMFVuaVBDTXVsdGlzdGVwU2NoZWR1bGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b192aWRlbyUwQSUwQXZhZSUyMCUzRCUyMEF1dG9lbmNvZGVyS0xXYW4uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMldhbi1BSSUyRldhbjIuMS1UMlYtMTRCLURpZmZ1c2VycyUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnZhZSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQzMiUwQSklMEFwaXBlbGluZSUyMCUzRCUyMFdhblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjJXYW4tQUklMkZXYW4yLjEtVDJWLTE0Qi1EaWZmdXNlcnMlMjIlMkMlMjB2YWUlM0R2YWUlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTBBKSUwQXBpcGVsaW5lLnNjaGVkdWxlciUyMCUzRCUyMFVuaVBDTXVsdGlzdGVwU2NoZWR1bGVyLmZyb21fY29uZmlnKCUwQSUyMCUyMHBpcGVsaW5lLnNjaGVkdWxlci5jb25maWclMkMlMjBmbG93X3NoaWZ0JT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bmQuJTIwJTBBQmlyY2glMjB0cmVlcyUyMGFuZCUyMGElMjBsaWdodCUyMGJsdWUlMjBza3klMjBmcmFtZSUyMHRoZSUyMHNjZW5lJTJDJTIwd2l0aCUyMGZlcm5zJTIwaW4lMjB0aGUlMjBmb3JlZ3JvdW5kLiUyMFNpZGUlMjBsaWdodGluZyUyMGNhc3RzJTIwJTBBZHluYW1pYyUyMHNoYWRvd3MlMjBhbmQlMjB3YXJtJTIwaGlnaGxpZ2h0cy4lMjBNZWRpdW0lMjBjb21wb3NpdGlvbiUyQyUyMGZyb250JTIwdmlldyUyQyUyMGxvdyUyMGFuZ2xlJTJDJTIwd2l0aCUyMGRlcHRoJTIwb2YlMjBmaWVsZC4lMEElMjIlMjIlMjIlMEElMEFvdXRwdXQlMjAlM0QlMjBwaXBlbGluZSglMEElMjAlMjBwcm9tcHQlM0Rwcm9tcHQlMkMlMEElMjAlMjBudW1fZnJhbWVzJTNEODElMkMlMEElMjAlMjBndWlkYW5jZV9zY2FsZSUzRDUuMCUyQyUwQSkuZnJhbWVzJTVCMCU1RCUwQWV4cG9ydF90b192aWRlbyhvdXRwdXQlMkMlMjAlMjJvdXRwdXQubXA0JTIyJTJDJTIwZnBzJTNEMTYp",highlighted:`<span class="hljs-comment"># pip install ftfy</span>
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> WanPipeline
<span class="hljs-keyword">from</span> diffusers.schedulers.scheduling_unipc_multistep <span class="hljs-keyword">import</span> UniPCMultistepScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

vae = AutoencoderKLWan.from_pretrained(
  <span class="hljs-string">&quot;Wan-AI/Wan2.1-T2V-14B-Diffusers&quot;</span>, subfolder=<span class="hljs-string">&quot;vae&quot;</span>, torch_dtype=torch.float32
)
pipeline = WanPipeline.from_pretrained(
  <span class="hljs-string">&quot;Wan-AI/Wan2.1-T2V-14B-Diffusers&quot;</span>, vae=vae, torch_dtype=torch.bfloat16
)
pipeline.scheduler = UniPCMultistepScheduler.from_config(
  pipeline.scheduler.config, flow_shift=<span class="hljs-number">5.0</span>
)
pipeline.to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipeline.load_lora_weights(<span class="hljs-string">&quot;benjamin-paine/steamboat-willie-14b&quot;</span>, adapter_name=<span class="hljs-string">&quot;steamboat-willie&quot;</span>)
pipeline.set_adapters(<span class="hljs-string">&quot;steamboat-willie&quot;</span>)

pipeline.enable_model_cpu_offload()

<span class="hljs-comment"># use &quot;steamboat willie style&quot; to trigger the LoRA</span>
prompt = <span class="hljs-string">&quot;&quot;&quot;
steamboat willie style, golden era animation, The camera rushes from far to near in a low-angle shot, 
revealing a white ferret on a log. It plays, leaps into the water, and emerges, as the camera zooms in 
for a close-up. Water splashes berry bushes nearby, while moss, snow, and leaves blanket the ground. 
Birch trees and a light blue sky frame the scene, with ferns in the foreground. Side lighting casts 
dynamic shadows and warm highlights. Medium composition, front view, low angle, with depth of field.
&quot;&quot;&quot;</span>

output = pipeline(
  prompt=prompt,
  num_frames=<span class="hljs-number">81</span>,
  guidance_scale=<span class="hljs-number">5.0</span>,
).frames[<span class="hljs-number">0</span>]
export_to_video(output, <span class="hljs-string">&quot;output.mp4&quot;</span>, fps=<span class="hljs-number">16</span>)`,wrap:!1}}),S=new sl({props:{title:"Reduce memory usage",local:"reduce-memory-usage",headingTag:"h2"}}),A=new f({props:{code:" ",highlighted:`<span class="hljs-comment"># pip install ftfy</span>
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoModel, WanPipeline
<span class="hljs-keyword">from</span> diffusers.hooks.group_offloading <span class="hljs-keyword">import</span> apply_group_offloading
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video, load_image
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> UMT5EncoderModel

text_encoder = UMT5EncoderModel.from_pretrained(<span class="hljs-string">&quot;Wan-AI/Wan2.1-T2V-14B-Diffusers&quot;</span>, subfolder=<span class="hljs-string">&quot;text_encoder&quot;</span>, torch_dtype=torch.bfloat16)
vae = AutoModel.from_pretrained(<span class="hljs-string">&quot;Wan-AI/Wan2.1-T2V-14B-Diffusers&quot;</span>, subfolder=<span class="hljs-string">&quot;vae&quot;</span>, torch_dtype=torch.float32)
transformer = AutoModel.from_pretrained(<span class="hljs-string">&quot;Wan-AI/Wan2.1-T2V-14B-Diffusers&quot;</span>, subfolder=<span class="hljs-string">&quot;transformer&quot;</span>, torch_dtype=torch.bfloat16)

<span class="hljs-comment"># group-offloading</span>
onload_device = torch.device(<span class="hljs-string">&quot;cuda&quot;</span>)
offload_device = torch.device(<span class="hljs-string">&quot;cpu&quot;</span>)
apply_group_offloading(text_encoder,
    onload_device=onload_device,
    offload_device=offload_device,
    offload_type=<span class="hljs-string">&quot;block_level&quot;</span>,
    num_blocks_per_group=<span class="hljs-number">4</span>
)
transformer.enable_group_offload(
    onload_device=onload_device,
    offload_device=offload_device,
    offload_type=<span class="hljs-string">&quot;leaf_level&quot;</span>,
    use_stream=<span class="hljs-literal">True</span>
)

pipeline = WanPipeline.from_pretrained(
    <span class="hljs-string">&quot;Wan-AI/Wan2.1-T2V-14B-Diffusers&quot;</span>,
    vae=vae,
    transformer=transformer,
    text_encoder=text_encoder,
    torch_dtype=torch.bfloat16
)
pipeline.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;&quot;&quot;
The camera rushes from far to near in a low-angle shot, 
revealing a white ferret on a log. It plays, leaps into the water, and emerges, as the camera zooms in 
for a close-up. Water splashes berry bushes nearby, while moss, snow, and leaves blanket the ground. 
Birch trees and a light blue sky frame the scene, with ferns in the foreground. Side lighting casts dynamic 
shadows and warm highlights. Medium composition, front view, low angle, with depth of field.
&quot;&quot;&quot;</span>
negative_prompt = <span class="hljs-string">&quot;&quot;&quot;
Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, 
low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, 
misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards
&quot;&quot;&quot;</span>

output = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    num_frames=<span class="hljs-number">81</span>,
    guidance_scale=<span class="hljs-number">5.0</span>,
).frames[<span class="hljs-number">0</span>]
export_to_video(output, <span class="hljs-string">&quot;output.mp4&quot;</span>, fps=<span class="hljs-number">16</span>)`,wrap:!1}}),L=new f({props:{code:"JTIzJTIwcGlwJTIwaW5zdGFsbCUyMGZ0ZnklMEElMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBXYW5QaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBBdXRvTW9kZWwlMkMlMjBXYW5QaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMucXVhbnRpemVycyUyMGltcG9ydCUyMFBpcGVsaW5lUXVhbnRpemF0aW9uQ29uZmlnJTBBZnJvbSUyMGRpZmZ1c2Vycy5zY2hlZHVsZXJzLnNjaGVkdWxpbmdfdW5pcGNfbXVsdGlzdGVwJTIwaW1wb3J0JTIwVW5pUENNdWx0aXN0ZXBTY2hlZHVsZXIlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwVU1UNUVuY29kZXJNb2RlbCUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBleHBvcnRfdG9fdmlkZW8lMEElMEElMjMlMjBxdWFudGl6ZSUyMHRyYW5zZm9ybWVyJTIwYW5kJTIwdGV4dCUyMGVuY29kZXIlMjB3ZWlnaHRzJTIwd2l0aCUyMGJpdHNhbmRieXRlcyUwQXBpcGVsaW5lX3F1YW50X2NvbmZpZyUyMCUz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MlMjBpbiUyMHRoZSUyMGZvcmVncm91bmQuJTIwU2lkZSUyMGxpZ2h0aW5nJTIwY2FzdHMlMjAlMEFkeW5hbWljJTIwc2hhZG93cyUyMGFuZCUyMHdhcm0lMjBoaWdobGlnaHRzLiUyME1lZGl1bSUyMGNvbXBvc2l0aW9uJTJDJTIwZnJvbnQlMjB2aWV3JTJDJTIwbG93JTIwYW5nbGUlMkMlMjB3aXRoJTIwZGVwdGglMjBvZiUyMGZpZWxkLiUwQSUyMiUyMiUyMiUwQSUwQW91dHB1dCUyMCUzRCUyMHBpcGVsaW5lKCUwQSUyMCUyMHByb21wdCUzRHByb21wdCUyQyUwQSUyMCUyMG51bV9mcmFtZXMlM0Q4MSUyQyUwQSUyMCUyMGd1aWRhbmNlX3NjYWxlJTNENS4wJTJDJTBBKS5mcmFtZXMlNUIwJTVEJTBBZXhwb3J0X3RvX3ZpZGVvKG91dHB1dCUyQyUyMCUyMm91dHB1dC5tcDQlMjIlMkMlMjBmcHMlM0QxNik=",highlighted:`<span class="hljs-comment"># pip install ftfy</span>

<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> WanPipeline
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoModel, WanPipeline
<span class="hljs-keyword">from</span> diffusers.quantizers <span class="hljs-keyword">import</span> PipelineQuantizationConfig
<span class="hljs-keyword">from</span> diffusers.schedulers.scheduling_unipc_multistep <span class="hljs-keyword">import</span> UniPCMultistepScheduler
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> UMT5EncoderModel
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

<span class="hljs-comment"># quantize transformer and text encoder weights with bitsandbytes</span>
pipeline_quant_config = PipelineQuantizationConfig(
  quant_backend=<span class="hljs-string">&quot;bitsandbytes_4bit&quot;</span>,
  quant_kwargs={<span class="hljs-string">&quot;load_in_4bit&quot;</span>: <span class="hljs-literal">True</span>},
  components_to_quantize=[<span class="hljs-string">&quot;transformer&quot;</span>, <span class="hljs-string">&quot;text_encoder&quot;</span>]
)

vae = AutoModel.from_pretrained(
  <span class="hljs-string">&quot;Wan-AI/Wan2.1-T2V-14B-Diffusers&quot;</span>, subfolder=<span class="hljs-string">&quot;vae&quot;</span>, torch_dtype=torch.float32
)
pipeline = WanPipeline.from_pretrained(
  <span class="hljs-string">&quot;Wan-AI/Wan2.1-T2V-14B-Diffusers&quot;</span>, vae=vae, quantization_config=pipeline_quant_config, torch_dtype=torch.bfloat16
)
pipeline.scheduler = UniPCMultistepScheduler.from_config(
  pipeline.scheduler.config, flow_shift=<span class="hljs-number">5.0</span>
)
pipeline.to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipeline.load_lora_weights(<span class="hljs-string">&quot;benjamin-paine/steamboat-willie-14b&quot;</span>, adapter_name=<span class="hljs-string">&quot;steamboat-willie&quot;</span>)
pipeline.set_adapters(<span class="hljs-string">&quot;steamboat-willie&quot;</span>)

pipeline.enable_model_cpu_offload()

<span class="hljs-comment"># use &quot;steamboat willie style&quot; to trigger the LoRA</span>
prompt = <span class="hljs-string">&quot;&quot;&quot;
steamboat willie style, golden era animation, The camera rushes from far to near in a low-angle shot, 
revealing a white ferret on a log. It plays, leaps into the water, and emerges, as the camera zooms in 
for a close-up. Water splashes berry bushes nearby, while moss, snow, and leaves blanket the ground. 
Birch trees and a light blue sky frame the scene, with ferns in the foreground. Side lighting casts 
dynamic shadows and warm highlights. Medium composition, front view, low angle, with depth of field.
&quot;&quot;&quot;</span>

output = pipeline(
  prompt=prompt,
  num_frames=<span class="hljs-number">81</span>,
  guidance_scale=<span class="hljs-number">5.0</span>,
).frames[<span class="hljs-number">0</span>]
export_to_video(output, <span class="hljs-string">&quot;output.mp4&quot;</span>, fps=<span class="hljs-number">16</span>)`,wrap:!1}}),P=new sl({props:{title:"Inference speed",local:"inference-speed",headingTag:"h2"}}),ll=new f({props:{code:"aW1wb3J0JTIwdG9yY2gl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VkJTIwYSUyMHJpY2glMjBicm93biUyQyUyMHdpdGglMjB0aW55JTIwd2luZG93cy4lMjBUaGUlMjBjYXJwZXQlMkMlMjBzb2Z0JTIwYW5kJTIwdGV4dHVyZWQlMkMlMjBwcm92aWRlcyUyMGElMjBwZXJmZWN0JTIwYmFja2Ryb3AlMkMlMjByZXNlbWJsaW5nJTIwYW4lMjBvY2VhbmljJTIwZXhwYW5zZS4lMjAlMEFTdXJyb3VuZGluZyUyMHRoZSUyMHNoaXAlMjBhcmUlMjB2YXJpb3VzJTIwb3RoZXIlMjB0b3lzJTIwYW5kJTIwY2hpbGRyZW4ncyUyMGl0ZW1zJTJDJTIwaGludGluZyUyMGF0JTIwYSUyMHBsYXlmdWwlMjBlbnZpcm9ubWVudC4lMjBUaGUlMjBzY2VuZSUyMGNhcHR1cmVzJTIwdGhlJTIwaW5ub2NlbmNlJTIwYW5kJTIwaW1hZ2luYXRpb24lMjBvZiUyMGNoaWxkaG9vZCUyQyUyMCUwQXdpdGglMjB0aGUlMjB0b3klMjBzaGlwJ3MlMjBqb3VybmV5JTIwc3ltYm9saXppbmclMjBlbmRsZXNzJTIwYWR2ZW50dXJlcyUyMGluJTIwYSUyMHdoaW1zaWNhbCUyQyUyMGluZG9vciUyMHNldHRpbmcuJTBBJTIyJTIyJTIyJTBBJTBBdmlkZW8lMjAlM0QlMjBwaXBlbGluZSglMEElMjAlMjBwcm9tcHQlM0Rwcm9tcHQlMkMlMEElMjAlMjBndWlkYW5jZV9zY2FsZSUzRDYlMkMlMEElMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTAlMEEpLmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fdmlkZW8odmlkZW8lMkMlMjAlMjJvdXRwdXQubXA0JTIyJTJDJTIwZnBzJTNEOCk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> CogVideoXPipeline, CogVideoXTransformer3DModel
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

pipeline = CogVideoXPipeline.from_pretrained(
  <span class="hljs-string">&quot;THUDM/CogVideoX-2b&quot;</span>,
  torch_dtype=torch.float16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># torch.compile</span>
pipeline.transformer.to(memory_format=torch.channels_last)
pipeline.transformer = torch.<span class="hljs-built_in">compile</span>(
    pipeline.transformer, mode=<span class="hljs-string">&quot;max-autotune&quot;</span>, fullgraph=<span class="hljs-literal">True</span>
)

prompt = <span class="hljs-string">&quot;&quot;&quot;
A detailed wooden toy ship with intricately carved masts and sails is seen gliding smoothly over a plush, blue carpet that mimics the waves of the sea. 
The ship&#x27;s hull is painted a rich brown, with tiny windows. The carpet, soft and textured, provides a perfect backdrop, resembling an oceanic expanse. 
Surrounding the ship are various other toys and children&#x27;s items, hinting at a playful environment. The scene captures the innocence and imagination of childhood, 
with the toy ship&#x27;s journey symbolizing endless adventures in a whimsical, indoor setting.
&quot;&quot;&quot;</span>

video = pipeline(
  prompt=prompt,
  guidance_scale=<span class="hljs-number">6</span>,
  num_inference_steps=<span class="hljs-number">50</span>
).frames[<span class="hljs-number">0</span>]
export_to_video(video, <span class="hljs-string">&quot;output.mp4&quot;</span>, fps=<span class="hljs-number">8</span>)`,wrap:!1}}),el=new ie({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/using-diffusers/text-img2vid.md"}}),{c(){n=u("meta"),p=M(),t=u("p"),T=M(),y(h.$$.fragment),B=M(),o=u("p"),o.textContent=U,X=M(),j=u("p"),j.textContent=al,nl=M(),v=u("p"),v.textContent=Cl,ol=M(),y(G.$$.fragment),Ml=M(),V=u("p"),V.textContent=Fl,il=M(),I=u("blockquote"),I.innerHTML=_l,pl=M(),y(g.$$.fragment),yl=M(),k=u("p"),k.textContent=zl,ml=M(),y(R.$$.fragment),rl=M(),Y=u("p"),Y.innerHTML=Nl,dl=M(),Q=u("p"),Q.innerHTML=Sl,cl=M(),y(H.$$.fragment),Jl=M(),y(E.$$.fragment),ul=M(),C=u("p"),C.innerHTML=xl,wl=M(),y(F.$$.fragment),bl=M(),y(_.$$.fragment),hl=M(),z=u("p"),z.textContent=ql,Tl=M(),y(N.$$.fragment),Ul=M(),y(S.$$.fragment),Zl=M(),x=u("p"),x.innerHTML=Al,jl=M(),W=u("blockquote"),W.innerHTML=$l,Bl=M(),q=u("p"),q.innerHTML=Dl,fl=M(),y(A.$$.fragment),Gl=M(),$=u("p"),$.innerHTML=Ll,Il=M(),D=u("p"),D.innerHTML=Pl,Wl=M(),y(L.$$.fragment),Xl=M(),y(P.$$.fragment),vl=M(),K=u("p"),K.innerHTML=Kl,Vl=M(),O=u("p"),O.innerHTML=Ol,gl=M(),y(ll.$$.fragment),kl=M(),y(el.$$.fragment),Rl=M(),tl=u("p"),this.h()},l(l){const e=oe("svelte-u9bgzb",document.head);n=w(e,"META",{name:!0,content:!0}),e.forEach(s),p=i(l),t=w(l,"P",{}),ee(t).forEach(s),T=i(l),m(h.$$.fragment,l),B=i(l),o=w(l,"P",{"data-svelte-h":!0}),b(o)!=="svelte-1bo3eh2"&&(o.textContent=U),X=i(l),j=w(l,"P",{"data-svelte-h":!0}),b(j)!=="svelte-i9eaqp"&&(j.textContent=al),nl=i(l),v=w(l,"P",{"data-svelte-h":!0}),b(v)!=="svelte-1aaeavb"&&(v.textContent=Cl),ol=i(l),m(G.$$.fragment,l),Ml=i(l),V=w(l,"P",{"data-svelte-h":!0}),b(V)!=="svelte-1q9es90"&&(V.textContent=Fl),il=i(l),I=w(l,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),b(I)!=="svelte-fdzb2f"&&(I.innerHTML=_l),pl=i(l),m(g.$$.fragment,l),yl=i(l),k=w(l,"P",{"data-svelte-h":!0}),b(k)!=="svelte-7qv10n"&&(k.textContent=zl),ml=i(l),m(R.$$.fragment,l),rl=i(l),Y=w(l,"P",{"data-svelte-h":!0}),b(Y)!=="svelte-nhumen"&&(Y.innerHTML=Nl),dl=i(l),Q=w(l,"P",{"data-svelte-h":!0}),b(Q)!=="svelte-1sbc2mp"&&(Q.innerHTML=Sl),cl=i(l),m(H.$$.fragment,l),Jl=i(l),m(E.$$.fragment,l),ul=i(l),C=w(l,"P",{"data-svelte-h":!0}),b(C)!=="svelte-7ligo6"&&(C.innerHTML=xl),wl=i(l),m(F.$$.fragment,l),bl=i(l),m(_.$$.fragment,l),hl=i(l),z=w(l,"P",{"data-svelte-h":!0}),b(z)!=="svelte-11664c2"&&(z.textContent=ql),Tl=i(l),m(N.$$.fragment,l),Ul=i(l),m(S.$$.fragment,l),Zl=i(l),x=w(l,"P",{"data-svelte-h":!0}),b(x)!=="svelte-11lrn3x"&&(x.innerHTML=Al),jl=i(l),W=w(l,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),b(W)!=="svelte-5g0o8l"&&(W.innerHTML=$l),Bl=i(l),q=w(l,"P",{"data-svelte-h":!0}),b(q)!=="svelte-16lygi9"&&(q.innerHTML=Dl),fl=i(l),m(A.$$.fragment,l),Gl=i(l),$=w(l,"P",{"data-svelte-h":!0}),b($)!=="svelte-8hypvu"&&($.innerHTML=Ll),Il=i(l),D=w(l,"P",{"data-svelte-h":!0}),b(D)!=="svelte-1b52ou4"&&(D.innerHTML=Pl),Wl=i(l),m(L.$$.fragment,l),Xl=i(l),m(P.$$.fragment,l),vl=i(l),K=w(l,"P",{"data-svelte-h":!0}),b(K)!=="svelte-1s92ub6"&&(K.innerHTML=Kl),Vl=i(l),O=w(l,"P",{"data-svelte-h":!0}),b(O)!=="svelte-113cz6n"&&(O.innerHTML=Ol),gl=i(l),m(ll.$$.fragment,l),kl=i(l),m(el.$$.fragment,l),Rl=i(l),tl=w(l,"P",{}),ee(tl).forEach(s),this.h()},h(){Ql(n,"name","hf:doc:metadata"),Ql(n,"content",Je),Ql(I,"class","tip"),Ql(W,"class","tip")},m(l,e){Me(document.head,n),a(l,p,e),a(l,t,e),a(l,T,e),r(h,l,e),a(l,B,e),a(l,o,e),a(l,X,e),a(l,j,e),a(l,nl,e),a(l,v,e),a(l,ol,e),r(G,l,e),a(l,Ml,e),a(l,V,e),a(l,il,e),a(l,I,e),a(l,pl,e),r(g,l,e),a(l,yl,e),a(l,k,e),a(l,ml,e),r(R,l,e),a(l,rl,e),a(l,Y,e),a(l,dl,e),a(l,Q,e),a(l,cl,e),r(H,l,e),a(l,Jl,e),r(E,l,e),a(l,ul,e),a(l,C,e),a(l,wl,e),r(F,l,e),a(l,bl,e),r(_,l,e),a(l,hl,e),a(l,z,e),a(l,Tl,e),r(N,l,e),a(l,Ul,e),r(S,l,e),a(l,Zl,e),a(l,x,e),a(l,jl,e),a(l,W,e),a(l,Bl,e),a(l,q,e),a(l,fl,e),r(A,l,e),a(l,Gl,e),a(l,$,e),a(l,Il,e),a(l,D,e),a(l,Wl,e),r(L,l,e),a(l,Xl,e),r(P,l,e),a(l,vl,e),a(l,K,e),a(l,Vl,e),a(l,O,e),a(l,gl,e),r(ll,l,e),a(l,kl,e),r(el,l,e),a(l,Rl,e),a(l,tl,e),Yl=!0},p(l,[e]){const le={};e&2&&(le.$$scope={dirty:e,ctx:l}),G.$set(le)},i(l){Yl||(d(h.$$.fragment,l),d(G.$$.fragment,l),d(g.$$.fragment,l),d(R.$$.fragment,l),d(H.$$.fragment,l),d(E.$$.fragment,l),d(F.$$.fragment,l),d(_.$$.fragment,l),d(N.$$.fragment,l),d(S.$$.fragment,l),d(A.$$.fragment,l),d(L.$$.fragment,l),d(P.$$.fragment,l),d(ll.$$.fragment,l),d(el.$$.fragment,l),Yl=!0)},o(l){c(h.$$.fragment,l),c(G.$$.fragment,l),c(g.$$.fragment,l),c(R.$$.fragment,l),c(H.$$.fragment,l),c(E.$$.fragment,l),c(F.$$.fragment,l),c(_.$$.fragment,l),c(N.$$.fragment,l),c(S.$$.fragment,l),c(A.$$.fragment,l),c(L.$$.fragment,l),c(P.$$.fragment,l),c(ll.$$.fragment,l),c(el.$$.fragment,l),Yl=!1},d(l){l&&(s(p),s(t),s(T),s(B),s(o),s(X),s(j),s(nl),s(v),s(ol),s(Ml),s(V),s(il),s(I),s(pl),s(yl),s(k),s(ml),s(rl),s(Y),s(dl),s(Q),s(cl),s(Jl),s(ul),s(C),s(wl),s(bl),s(hl),s(z),s(Tl),s(Ul),s(Zl),s(x),s(jl),s(W),s(Bl),s(q),s(fl),s(Gl),s($),s(Il),s(D),s(Wl),s(Xl),s(vl),s(K),s(Vl),s(O),s(gl),s(kl),s(Rl),s(tl)),s(n),J(h,l),J(G,l),J(g,l),J(R,l),J(H,l),J(E,l),J(F,l),J(_,l),J(N,l),J(S,l),J(A,l),J(L,l),J(P,l),J(ll,l),J(el,l)}}}const Je='{"title":"Video generation","local":"video-generation","sections":[{"title":"Pipeline parameters","local":"pipeline-parameters","sections":[{"title":"num_frames","local":"numframes","sections":[],"depth":3},{"title":"guidance_scale","local":"guidancescale","sections":[],"depth":3},{"title":"negative_prompt","local":"negativeprompt","sections":[],"depth":3}],"depth":2},{"title":"Reduce memory usage","local":"reduce-memory-usage","sections":[],"depth":2},{"title":"Inference speed","local":"inference-speed","sections":[],"depth":2}],"depth":1}';function ue(Z){return ae(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ze extends te{constructor(n){super(),ne(this,n,ue,ce,se,{})}}export{Ze as component};
