import{s as te,o as ne,n as Cl}from"../chunks/scheduler.53228c21.js";import{S as oe,i as Me,e as u,s as o,c as y,h as ie,a as w,d as s,b as M,f as ae,g as m,j as h,k as Hl,l as pe,m as a,n as r,t as d,o as c,p as J}from"../chunks/index.100fac89.js";import{C as ye}from"../chunks/CopyLLMTxtMenu.2cdbb51f.js";import{C as B}from"../chunks/CodeBlock.d30a6509.js";import{H as al,E as me}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.3fcbbc76.js";import{H as re,a as El}from"../chunks/HfOption.fad27e59.js";function de(Z){let n,p;return n=new B({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,U){r(n,t,U),p=!0},p:Cl,i(t){p||(d(n.$$.fragment,t),p=!0)},o(t){c(n.$$.fragment,t),p=!1},d(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yMHF1YW50aXphdGlvbl9jb25maWclM0RwaXBlbGluZV9xdWFudF9jb25maWclMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTJDJTBBKSUwQSUwQSUyMyUyMG1vZGVsLW9mZmxvYWRpbmclMjBhbmQlMjB0aWxpbmclMEFwaXBlbGluZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQXBpcGVsaW5lLnZhZS5lbmFibGVfdGlsaW5nKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwZmx1ZmZ5JTIwdGVkZHklMjBiZWFyJTIwc2l0cyUyMG9uJTIwYSUyMGJlZCUyMG9mJTIwc29mdCUyMHBpbGxvd3MlMjBzdXJyb3VuZGVkJTIwYnklMjBjaGlsZHJlbidzJTIwdG95cy4lMjIlMEF2aWRlbyUyMCUzRCUyMHBpcGVsaW5lKHByb21wdCUzRHByb21wdCUyQyUyMG51bV9mcmFtZXMlM0Q2MSUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QzMCkuZnJhbWVzJTVCMCU1RCUwQWV4cG9ydF90b192aWRlbyh2aWRlbyUyQyUyMCUyMm91dHB1dC5tcDQlMjIlMkMlMjBmcHMlM0QxNSk=",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,U){r(n,t,U),p=!0},p:Cl,i(t){p||(d(n.$$.fragment,t),p=!0)},o(t){c(n.$$.fragment,t),p=!1},d(t){J(n,t)}}}function Je(Z){let n,p;return n=new B({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTFRYUGlwZWxpbmUlMkMlMjBBdXRvTW9kZWwlMEFmcm9tJTIwZGlmZnVzZXJzLmhvb2tzJTIwaW1wb3J0JTIwYXBwbHlfZ3JvdXBfb2ZmbG9hZGluZyUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBleHBvcnRfdG9fdmlkZW8lMEElMEElMjMlMjBmcDglMjBsYXllcndpc2UlMjB3ZWlnaHQtY2FzdGluZyUwQXRyYW5zZm9ybWVyJTIwJTNEJTIwQXV0b01vZGVsLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJMaWdodHJpY2tzJTJGTFRYLVZpZGVvJTIyJTJ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JTJDJTIwaW5jb25zaXN0ZW50JTIwbW90aW9uJTJDJTIwYmx1cnJ5JTJDJTIwaml0dGVyeSUyQyUyMGRpc3RvcnRlZCUyMiUwQSUwQXZpZGVvJTIwJTNEJTIwcGlwZWxpbmUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfcHJvbXB0JTNEbmVnYXRpdmVfcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBoZWlnaHQlM0Q1MTIlMkMlMEElMjAlMjAlMjAlMjBudW1fZnJhbWVzJTNEMTYxJTJDJTBBJTIwJTIwJTIwJTIwZGVjb2RlX3RpbWVzdGVwJTNEMC4wMyUyQyUwQSUyMCUyMCUyMCUyMGRlY29kZV9ub2lzZV9zY2FsZSUzRDAuMDI1JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBKS5mcmFtZXMlNUIwJTVEJTBBZXhwb3J0X3RvX3ZpZGVvKHZpZGVvJTJDJTIwJTIyb3V0cHV0Lm1wNCUyMiUyQyUyMGZwcyUzRDI0KQ==",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,U){r(n,t,U),p=!0},p:Cl,i(t){p||(d(n.$$.fragment,t),p=!0)},o(t){c(n.$$.fragment,t),p=!1},d(t){J(n,t)}}}function ue(Z){let n,p,t,U,T,f;return n=new El({props:{id:"popular models",option:"Wan2.1",$$slots:{default:[de]},$$scope:{ctx:Z}}}),t=new El({props:{id:"popular models",option:"HunyuanVideo",$$slots:{default:[ce]},$$scope:{ctx:Z}}}),T=new El({props:{id:"popular models",option:"LTX-Video",$$slots:{default:[Je]},$$scope:{ctx:Z}}}),{c(){y(n.$$.fragment),p=o(),y(t.$$.fragment),U=o(),y(T.$$.fragment)},l(i){m(n.$$.fragment,i),p=M(i),m(t.$$.fragment,i),U=M(i),m(T.$$.fragment,i)},m(i,b){r(n,i,b),a(i,p,b),r(t,i,b),a(i,U,b),r(T,i,b),f=!0},p(i,b){const j={};b&2&&(j.$$scope={dirty:b,ctx:i}),n.$set(j);const tl={};b&2&&(tl.$$scope={dirty:b,ctx:i}),t.$set(tl);const X={};b&2&&(X.$$scope={dirty:b,ctx:i}),T.$set(X)},i(i){f||(d(n.$$.fragment,i),d(t.$$.fragment,i),d(T.$$.fragment,i),f=!0)},o(i){c(n.$$.fragment,i),c(t.$$.fragment,i),c(T.$$.fragment,i),f=!1},d(i){i&&(s(p),s(U)),J(n,i),J(t,i),J(T,i)}}}function we(Z){let n,p,t,U,T,f,i,b,j,tl="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,v,Fl="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.",ol,V,_l="Check out what some of these video models are capable of below.",Ml,G,il,g,zl="This guide will cover video generation basics such as which parameters to configure and how to reduce their memory usage.",pl,I,Nl="<p>If you’re interested in learning more about how to use a specific model, please refer to their pipeline API model card.</p>",yl,k,ml,R,Sl="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.",rl,Y,dl,Q,xl="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.",cl,H,ql='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.',Jl,E,ul,C,wl,F,$l="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.",bl,_,hl,z,Tl,N,Al="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.",Ul,S,Zl,x,jl,q,Dl='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.',fl,W,Ll='<p>Refer to the <a href="../optimization/memory">Reduce memory usage</a> guide for more details about other memory saving techniques.</p>',Bl,$,Pl='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.',Gl,A,Il,D,Kl='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.',Wl,L,Ol='The example below uses <a href="../quantization/bitsandbytes">bitsandbytes</a> to quantize a model.',Xl,P,vl,K,Vl,O,le='<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.',gl,ll,ee="The example below compiles the transformer in the pipeline and uses the <code>&quot;max-autotune&quot;</code> mode to maximize performance.",kl,el,Rl,sl,Yl,nl,Ql;return T=new ye({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),i=new al({props:{title:"Video generation",local:"video-generation",headingTag:"h1"}}),G=new re({props:{id:"popular models",options:["Wan2.1","HunyuanVideo","LTX-Video"],$$slots:{default:[ue]},$$scope:{ctx:Z}}}),k=new al({props:{title:"Pipeline parameters",local:"pipeline-parameters",headingTag:"h2"}}),Y=new al({props:{title:"num_frames",local:"numframes",headingTag:"h3"}}),E=new B({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTFRYUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX3ZpZGVvJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBMVFhQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyTGlnaHRyaWNrcyUyRkxUWC1WaWRlbyUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMEEpLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyJTIyJTIyJTBBQSUyMHdvbWFuJTIwd2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IwZGVjb2RlX3RpbWVzdGVwJTNEMC4wMyUyQyUwQSUyMCUyMCUyMCUyMGRlY29kZV9ub2lzZV9zY2FsZSUzRDAuMDI1JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBKS5mcmFtZXMlNUIwJTVEJTBBZXhwb3J0X3RvX3ZpZGVvKHZpZGVvJTJDJTIwJTIyb3V0cHV0Lm1wNCUyMiUyQyUyMGZwcyUzRDI0KQ==",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}}),C=new al({props:{title:"guidance_scale",local:"guidancescale",headingTag:"h3"}}),_=new B({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J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idzJTIwaXRlbXMlMkMlMjBoaW50aW5nJTIwYXQlMjAlMEFhJTIwcGxheWZ1bCUyMGVudmlyb25tZW50LiUyMFRoZSUyMHNjZW5lJTIwY2FwdHVyZXMlMjB0aGUlMjBpbm5vY2VuY2UlMjBhbmQlMjBpbWFnaW5hdGlvbiUyMG9mJTIwY2hpbGRob29kJTJDJTIwJTBBd2l0aCUyMHRoZSUyMHRveSUyMHNoaXAncyUyMGpvdXJuZXklMjBzeW1ib2xpemluZyUyMGVuZGxlc3MlMjBhZHZlbnR1cmVzJTIwaW4lMjBhJTIwd2hpbXNpY2FsJTJDJTIwaW5kb29yJTIwc2V0dGluZy4lMEElMjIlMjIlMjIlMEElMEF2aWRlbyUyMCUzRCUyMHBpcGVsaW5lKCUwQSUyMCUyMHByb21wdCUzRHByb21wdCUyQyUwQSUyMCUyMGd1aWRhbmNlX3NjYWxlJTNENiUyQyUwQSUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q1MCUwQSkuZnJhbWVzJTVCMCU1RCUwQWV4cG9ydF90b192aWRlbyh2aWRlbyUyQyUyMCUyMm91dHB1dC5tcDQlMjIlMkMlMjBmcHMlM0Q4KQ==",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}}),z=new al({props:{title:"negative_prompt",local:"negativeprompt",headingTag:"h3"}}),S=new B({props:{code:"JTIzJTIwcGlwJTIwaW5zdGFsbCUyMGZ0ZnklMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBXYW5QaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMuc2NoZWR1bGVycy5zY2hlZHVsaW5nX3VuaXBjX211bHRpc3RlcCUyMGltcG9ydCUyMFVuaVBDTXVsdGlzdGVwU2NoZWR1bGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b192aWRlbyUwQSUwQXZhZSUyMCUzRCUyMEF1dG9lbmNvZGVyS0xXYW4uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMldhbi1BSSUyRldhbjIuMS1UMlYtMTRCLURpZmZ1c2VycyUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnZhZSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQzMiUwQSklMEFwaXBlbGluZSUyMCUzRCUyMFdhblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjJXYW4tQUklMkZXYW4yLjEtVDJWLTE0Qi1EaWZmdXNlcnMlMjIlMkMlMjB2YWUlM0R2YWUlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTBBKSUwQXBpcGVsaW5lLnNjaGVkdWxlciUyMCUzRCUyMFVua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zaGVzJTIwbmVhcmJ5JTJDJTIwd2hpbGUlMjBtb3NzJTJDJTIwc25vdyUyQyUyMGFuZCUyMGxlYXZlcyUyMGJsYW5rZXQlMjB0aGUlMjBncm91bmQuJTIwJTBBQmlyY2glMjB0cmVlcyUyMGFuZCUyMGElMjBsaWdodCUyMGJsdWUlMjBza3klMjBmcmFtZSUyMHRoZSUyMHNjZW5lJTJDJTIwd2l0aCUyMGZlcm5zJTIwaW4lMjB0aGUlMjBmb3JlZ3JvdW5kLiUyMFNpZGUlMjBsaWdodGluZyUyMGNhc3RzJTIwJTBBZHluYW1pYyUyMHNoYWRvd3MlMjBhbmQlMjB3YXJtJTIwaGlnaGxpZ2h0cy4lMjBNZWRpdW0lMjBjb21wb3NpdGlvbiUyQyUyMGZyb250JTIwdmlldyUyQyUyMGxvdyUyMGFuZ2xlJTJDJTIwd2l0aCUyMGRlcHRoJTIwb2YlMjBmaWVsZC4lMEElMjIlMjIlMjIlMEElMEFvdXRwdXQlMjAlM0QlMjBwaXBlbGluZSglMEElMjAlMjBwcm9tcHQlM0Rwcm9tcHQlMkMlMEElMjAlMjBudW1fZnJhbWVzJTNEODElMkMlMEElMjAlMjBndWlkYW5jZV9zY2FsZSUzRDUuMCUyQyUwQSkuZnJhbWVzJTVCMCU1RCUwQWV4cG9ydF90b192aWRlbyhvdXRwdXQlMkMlMjAlMjJvdXRwdXQubXA0JTIyJTJDJTIwZnBzJTNEMTYp",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}}),x=new al({props:{title:"Reduce memory usage",local:"reduce-memory-usage",headingTag:"h2"}}),A=new B({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}}),P=new B({props:{code:"JTIzJTIwcGlwJTIwaW5zdGFsbCUyMGZ0ZnklMEElMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBXYW5QaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBBdXRvTW9kZWwlMkMlMjBXYW5QaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMucXVhbnRpemVycyUyMGltcG9ydCUyMFBpcGVsaW5lUXVhbnRpemF0aW9uQ29uZmlnJTBBZnJvbSUyMGRpZmZ1c2Vycy5zY2hlZHVsZXJzLnNjaGVkdWxpbmdfdW5pcGNfbXVsdGlzdGVwJTIwaW1wb3J0JTIwVW5pUENNdWx0aXN0ZXBTY2hlZHVsZXIlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwVU1UNUVuY29kZXJNb2RlbCUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBleHBvcnRfdG9fdmlkZW8lMEElMEElMjMlMjBxdWFudGl6ZSUyMHRyYW5zZm9ybWVyJTIw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aCUyMHRyZWVzJTIwYW5kJTIwYSUyMGxpZ2h0JTIwYmx1ZSUyMHNreSUyMGZyYW1lJTIwdGhlJTIwc2NlbmUlMkMlMjB3aXRoJTIwZmVybnMlMjBpbiUyMHRoZSUyMGZvcmVncm91bmQuJTIwU2lkZSUyMGxpZ2h0aW5nJTIwY2FzdHMlMjAlMEFkeW5hbWljJTIwc2hhZG93cyUyMGFuZCUyMHdhcm0lMjBoaWdobGlnaHRzLiUyME1lZGl1bSUyMGNvbXBvc2l0aW9uJTJDJTIwZnJvbnQlMjB2aWV3JTJDJTIwbG93JTIwYW5nbGUlMkMlMjB3aXRoJTIwZGVwdGglMjBvZiUyMGZpZWxkLiUwQSUyMiUyMiUyMiUwQSUwQW91dHB1dCUyMCUzRCUyMHBpcGVsaW5lKCUwQSUyMCUyMHByb21wdCUzRHByb21wdCUyQyUwQSUyMCUyMG51bV9mcmFtZXMlM0Q4MSUyQyUwQSUyMCUyMGd1aWRhbmNlX3NjYWxlJTNENS4wJTJDJTBBKS5mcmFtZXMlNUIwJTVEJTBBZXhwb3J0X3RvX3ZpZGVvKG91dHB1dCUyQyUyMCUyMm91dHB1dC5tcDQlMjIlMkMlMjBmcHMlM0QxNik=",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}}),K=new al({props:{title:"Inference speed",local:"inference-speed",headingTag:"h2"}}),el=new B({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQ29nVmlkZW9YUGlwZWxpbmUlMkMlMjBDb2dWaWRlb1hUcmFuc2Zvcm1lcjNETW9kZWwlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX3ZpZGVvJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBDb2dWaWRlb1hQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIyVEhVRE0lMkZDb2dWaWRlb1gtMmIlMjIlMkMlMEElMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpLnRvKCUyMmN1ZGElMjIpJTBBJTBBJTIzJTIwdG9yY2guY29tcGlsZSUwQXBpcGVsaW5lLnRyYW5zZm9ybWVyLnRvKG1lbW9yeV9mb3JtYXQlM0R0b3JjaC5jaGFubmVsc19sYXN0KSUwQXBpcGVsaW5lLnRyYW5zZm9ybWVyJTIwJTNEJTIwdG9yY2guY29tcGlsZSglMEElMjAlMjAlMjAlMjBwaXBlbGluZS50cmFuc2Zvcm1lciUyQyUyMG1vZGUlM0QlMjJtYXgtYXV0b3R1bmUlMjIlMkMlMjBmdWxsZ3JhcGglM0RUcnVlJTBBKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMiUyMiUyMiUwQUElMjBkZXRhaWxlZCUyMHdvb2RlbiUyMHRveSUyMHNoaXAlMjB3aXRoJTIwaW50cmljYXRlbHklMjBjYXJ2ZWQlMjBtYXN0cyUyMGFuZCUyMHNhaWxzJTIwaXMlMjBzZWVuJTIwZ2xpZGluZyUyMHNtb290aGx5JTIwb3ZlciUyMGElMjBwbHVzaCUyQyUyMGJsdWUlMjBjYXJwZXQlMjB0aGF0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TNEOCk=",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}}),sl=new me({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/using-diffusers/text-img2vid.md"}}),{c(){n=u("meta"),p=o(),t=u("p"),U=o(),y(T.$$.fragment),f=o(),y(i.$$.fragment),b=o(),j=u("p"),j.textContent=tl,X=o(),v=u("p"),v.textContent=Fl,ol=o(),V=u("p"),V.textContent=_l,Ml=o(),y(G.$$.fragment),il=o(),g=u("p"),g.textContent=zl,pl=o(),I=u("blockquote"),I.innerHTML=Nl,yl=o(),y(k.$$.fragment),ml=o(),R=u("p"),R.textContent=Sl,rl=o(),y(Y.$$.fragment),dl=o(),Q=u("p"),Q.innerHTML=xl,cl=o(),H=u("p"),H.innerHTML=ql,Jl=o(),y(E.$$.fragment),ul=o(),y(C.$$.fragment),wl=o(),F=u("p"),F.innerHTML=$l,bl=o(),y(_.$$.fragment),hl=o(),y(z.$$.fragment),Tl=o(),N=u("p"),N.textContent=Al,Ul=o(),y(S.$$.fragment),Zl=o(),y(x.$$.fragment),jl=o(),q=u("p"),q.innerHTML=Dl,fl=o(),W=u("blockquote"),W.innerHTML=Ll,Bl=o(),$=u("p"),$.innerHTML=Pl,Gl=o(),y(A.$$.fragment),Il=o(),D=u("p"),D.innerHTML=Kl,Wl=o(),L=u("p"),L.innerHTML=Ol,Xl=o(),y(P.$$.fragment),vl=o(),y(K.$$.fragment),Vl=o(),O=u("p"),O.innerHTML=le,gl=o(),ll=u("p"),ll.innerHTML=ee,kl=o(),y(el.$$.fragment),Rl=o(),y(sl.$$.fragment),Yl=o(),nl=u("p"),this.h()},l(l){const e=ie("svelte-u9bgzb",document.head);n=w(e,"META",{name:!0,content:!0}),e.forEach(s),p=M(l),t=w(l,"P",{}),ae(t).forEach(s),U=M(l),m(T.$$.fragment,l),f=M(l),m(i.$$.fragment,l),b=M(l),j=w(l,"P",{"data-svelte-h":!0}),h(j)!=="svelte-1bo3eh2"&&(j.textContent=tl),X=M(l),v=w(l,"P",{"data-svelte-h":!0}),h(v)!=="svelte-i9eaqp"&&(v.textContent=Fl),ol=M(l),V=w(l,"P",{"data-svelte-h":!0}),h(V)!=="svelte-1aaeavb"&&(V.textContent=_l),Ml=M(l),m(G.$$.fragment,l),il=M(l),g=w(l,"P",{"data-svelte-h":!0}),h(g)!=="svelte-1q9es90"&&(g.textContent=zl),pl=M(l),I=w(l,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),h(I)!=="svelte-fdzb2f"&&(I.innerHTML=Nl),yl=M(l),m(k.$$.fragment,l),ml=M(l),R=w(l,"P",{"data-svelte-h":!0}),h(R)!=="svelte-7qv10n"&&(R.textContent=Sl),rl=M(l),m(Y.$$.fragment,l),dl=M(l),Q=w(l,"P",{"data-svelte-h":!0}),h(Q)!=="svelte-nhumen"&&(Q.innerHTML=xl),cl=M(l),H=w(l,"P",{"data-svelte-h":!0}),h(H)!=="svelte-1sbc2mp"&&(H.innerHTML=ql),Jl=M(l),m(E.$$.fragment,l),ul=M(l),m(C.$$.fragment,l),wl=M(l),F=w(l,"P",{"data-svelte-h":!0}),h(F)!=="svelte-7ligo6"&&(F.innerHTML=$l),bl=M(l),m(_.$$.fragment,l),hl=M(l),m(z.$$.fragment,l),Tl=M(l),N=w(l,"P",{"data-svelte-h":!0}),h(N)!=="svelte-11664c2"&&(N.textContent=Al),Ul=M(l),m(S.$$.fragment,l),Zl=M(l),m(x.$$.fragment,l),jl=M(l),q=w(l,"P",{"data-svelte-h":!0}),h(q)!=="svelte-11lrn3x"&&(q.innerHTML=Dl),fl=M(l),W=w(l,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),h(W)!=="svelte-5g0o8l"&&(W.innerHTML=Ll),Bl=M(l),$=w(l,"P",{"data-svelte-h":!0}),h($)!=="svelte-16lygi9"&&($.innerHTML=Pl),Gl=M(l),m(A.$$.fragment,l),Il=M(l),D=w(l,"P",{"data-svelte-h":!0}),h(D)!=="svelte-8hypvu"&&(D.innerHTML=Kl),Wl=M(l),L=w(l,"P",{"data-svelte-h":!0}),h(L)!=="svelte-1b52ou4"&&(L.innerHTML=Ol),Xl=M(l),m(P.$$.fragment,l),vl=M(l),m(K.$$.fragment,l),Vl=M(l),O=w(l,"P",{"data-svelte-h":!0}),h(O)!=="svelte-1s92ub6"&&(O.innerHTML=le),gl=M(l),ll=w(l,"P",{"data-svelte-h":!0}),h(ll)!=="svelte-113cz6n"&&(ll.innerHTML=ee),kl=M(l),m(el.$$.fragment,l),Rl=M(l),m(sl.$$.fragment,l),Yl=M(l),nl=w(l,"P",{}),ae(nl).forEach(s),this.h()},h(){Hl(n,"name","hf:doc:metadata"),Hl(n,"content",be),Hl(I,"class","tip"),Hl(W,"class","tip")},m(l,e){pe(document.head,n),a(l,p,e),a(l,t,e),a(l,U,e),r(T,l,e),a(l,f,e),r(i,l,e),a(l,b,e),a(l,j,e),a(l,X,e),a(l,v,e),a(l,ol,e),a(l,V,e),a(l,Ml,e),r(G,l,e),a(l,il,e),a(l,g,e),a(l,pl,e),a(l,I,e),a(l,yl,e),r(k,l,e),a(l,ml,e),a(l,R,e),a(l,rl,e),r(Y,l,e),a(l,dl,e),a(l,Q,e),a(l,cl,e),a(l,H,e),a(l,Jl,e),r(E,l,e),a(l,ul,e),r(C,l,e),a(l,wl,e),a(l,F,e),a(l,bl,e),r(_,l,e),a(l,hl,e),r(z,l,e),a(l,Tl,e),a(l,N,e),a(l,Ul,e),r(S,l,e),a(l,Zl,e),r(x,l,e),a(l,jl,e),a(l,q,e),a(l,fl,e),a(l,W,e),a(l,Bl,e),a(l,$,e),a(l,Gl,e),r(A,l,e),a(l,Il,e),a(l,D,e),a(l,Wl,e),a(l,L,e),a(l,Xl,e),r(P,l,e),a(l,vl,e),r(K,l,e),a(l,Vl,e),a(l,O,e),a(l,gl,e),a(l,ll,e),a(l,kl,e),r(el,l,e),a(l,Rl,e),r(sl,l,e),a(l,Yl,e),a(l,nl,e),Ql=!0},p(l,[e]){const se={};e&2&&(se.$$scope={dirty:e,ctx:l}),G.$set(se)},i(l){Ql||(d(T.$$.fragment,l),d(i.$$.fragment,l),d(G.$$.fragment,l),d(k.$$.fragment,l),d(Y.$$.fragment,l),d(E.$$.fragment,l),d(C.$$.fragment,l),d(_.$$.fragment,l),d(z.$$.fragment,l),d(S.$$.fragment,l),d(x.$$.fragment,l),d(A.$$.fragment,l),d(P.$$.fragment,l),d(K.$$.fragment,l),d(el.$$.fragment,l),d(sl.$$.fragment,l),Ql=!0)},o(l){c(T.$$.fragment,l),c(i.$$.fragment,l),c(G.$$.fragment,l),c(k.$$.fragment,l),c(Y.$$.fragment,l),c(E.$$.fragment,l),c(C.$$.fragment,l),c(_.$$.fragment,l),c(z.$$.fragment,l),c(S.$$.fragment,l),c(x.$$.fragment,l),c(A.$$.fragment,l),c(P.$$.fragment,l),c(K.$$.fragment,l),c(el.$$.fragment,l),c(sl.$$.fragment,l),Ql=!1},d(l){l&&(s(p),s(t),s(U),s(f),s(b),s(j),s(X),s(v),s(ol),s(V),s(Ml),s(il),s(g),s(pl),s(I),s(yl),s(ml),s(R),s(rl),s(dl),s(Q),s(cl),s(H),s(Jl),s(ul),s(wl),s(F),s(bl),s(hl),s(Tl),s(N),s(Ul),s(Zl),s(jl),s(q),s(fl),s(W),s(Bl),s($),s(Gl),s(Il),s(D),s(Wl),s(L),s(Xl),s(vl),s(Vl),s(O),s(gl),s(ll),s(kl),s(Rl),s(Yl),s(nl)),s(n),J(T,l),J(i,l),J(G,l),J(k,l),J(Y,l),J(E,l),J(C,l),J(_,l),J(z,l),J(S,l),J(x,l),J(A,l),J(P,l),J(K,l),J(el,l),J(sl,l)}}}const be='{"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 he(Z){return ne(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ge extends oe{constructor(n){super(),Me(this,n,he,we,te,{})}}export{Ge as component};
