import{s as Jt,o as Tt,n as Re}from"../chunks/scheduler.8c3d61f6.js";import{S as jt,i as vt,g as c,s as i,r as y,A as Zt,h as u,f as n,c as r,j as I,x as g,u as M,k as H,l as Ut,y as d,a as p,v as w,d as J,t as T,w as j}from"../chunks/index.da70eac4.js";import{T as Vt}from"../chunks/Tip.1d9b8c37.js";import{D as le}from"../chunks/Docstring.9419aa1d.js";import{C as Qe}from"../chunks/CodeBlock.a9c4becf.js";import{E as It}from"../chunks/ExampleCodeBlock.1b2603c3.js";import{H as Ee,E as Wt}from"../chunks/getInferenceSnippets.39110341.js";import{H as Bt,a as wt}from"../chunks/HfOption.6ab18950.js";function kt(V){let s,_="Click on the HunyuanVideo models in the right sidebar for more examples of video generation tasks.",m,l,a='The examples below use a checkpoint from <a href="https://huggingface.co/hunyuanvideo-community" rel="nofollow">hunyuanvideo-community</a> because the weights are stored in a layout compatible with Diffusers.';return{c(){s=c("p"),s.textContent=_,m=i(),l=c("p"),l.innerHTML=a},l(t){s=u(t,"P",{"data-svelte-h":!0}),g(s)!=="svelte-14dkw5q"&&(s.textContent=_),m=r(t),l=u(t,"P",{"data-svelte-h":!0}),g(l)!=="svelte-kuk8k8"&&(l.innerHTML=a)},m(t,f){p(t,s,f),p(t,m,f),p(t,l,f)},p:Re,d(t){t&&(n(s),n(m),n(l))}}}function xt(V){let s,_='Refer to the <a href="../../optimization/memory">Reduce memory usage</a> guide for more details about the various memory saving techniques.',m,l,a="The quantized HunyuanVideo model below requires ~14GB of VRAM.",t,f,Z;return f=new Qe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQXV0b01vZGVsJTJDJTIwSHVueXVhblZpZGVvUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnF1YW50aXplcnMlMjBpbXBvcnQlMjBQaXBlbGluZVF1YW50aXphdGlvbkNvbmZpZyUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBv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VfbW9kZWxfY3B1X29mZmxvYWQoKSUwQXBpcGVsaW5lLnZhZS5lbmFibGVfdGlsaW5nKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwZmx1ZmZ5JTIwdGVkZHklMjBiZWFyJTIwc2l0cyUyMG9uJTIwYSUyMGJlZCUyMG9mJTIwc29mdCUyMHBpbGxvd3MlMjBzdXJyb3VuZGVkJTIwYnklMjBjaGlsZHJlbidzJTIwdG95cy4lMjIlMEF2aWRlbyUyMCUzRCUyMHBpcGVsaW5lKHByb21wdCUzRHByb21wdCUyQyUyMG51bV9mcmFtZXMlM0Q2MSUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QzMCkuZnJhbWVzJTVCMCU1RCUwQWV4cG9ydF90b192aWRlbyh2aWRlbyUyQyUyMCUyMm91dHB1dC5tcDQlMjIlMkMlMjBmcHMlM0QxNSk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoModel, 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(){s=c("p"),s.innerHTML=_,m=i(),l=c("p"),l.textContent=a,t=i(),y(f.$$.fragment)},l(h){s=u(h,"P",{"data-svelte-h":!0}),g(s)!=="svelte-iowzkr"&&(s.innerHTML=_),m=r(h),l=u(h,"P",{"data-svelte-h":!0}),g(l)!=="svelte-1lhulzs"&&(l.textContent=a),t=r(h),M(f.$$.fragment,h)},m(h,U){p(h,s,U),p(h,m,U),p(h,l,U),p(h,t,U),w(f,h,U),Z=!0},p:Re,i(h){Z||(J(f.$$.fragment,h),Z=!0)},o(h){T(f.$$.fragment,h),Z=!1},d(h){h&&(n(s),n(m),n(l),n(t)),j(f,h)}}}function Ht(V){let s,_='<a href="../../optimization/fp16#torchcompile">Compilation</a> is slow the first time but subsequent calls to the pipeline are faster.',m,l,a;return l=new Qe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQXV0b01vZGVsJTJDJTIwSHVueXVhblZpZGVvUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnF1YW50aXplcnMlMjBpbXBvcnQlMjBQaXBlbGluZVF1YW50aXphdGlvbkNvbmZpZyUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBleHBvcnRfdG9fdmlkZW8lMEElMEElMjMlMjBxdWFudGl6ZSUyMHdlaWdodHMlMjB0byUyMGludDQlMjB3aXRoJTIw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b21waWxlJTBBcGlwZWxpbmUudHJhbnNmb3JtZXIudG8obWVtb3J5X2Zvcm1hdCUzRHRvcmNoLmNoYW5uZWxzX2xhc3QpJTBBcGlwZWxpbmUudHJhbnNmb3JtZXIlMjAlM0QlMjB0b3JjaC5jb21waWxlKCUwQSUyMCUyMCUyMCUyMHBpcGVsaW5lLnRyYW5zZm9ybWVyJTJDJTIwbW9kZSUzRCUyMm1heC1hdXRvdHVuZSUyMiUyQyUyMGZ1bGxncmFwaCUzRFRydWUlMEEpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMGZsdWZmeSUyMHRlZGR5JTIwYmVhciUyMHNpdHMlMjBvbiUyMGElMjBiZWQlMjBvZiUyMHNvZnQlMjBwaWxsb3dzJTIwc3Vycm91bmRlZCUyMGJ5JTIwY2hpbGRyZW4ncyUyMHRveXMuJTIyJTBBdmlkZW8lMjAlM0QlMjBwaXBlbGluZShwcm9tcHQlM0Rwcm9tcHQlMkMlMjBudW1fZnJhbWVzJTNENjElMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMzApLmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fdmlkZW8odmlkZW8lMkMlMjAlMjJvdXRwdXQubXA0JTIyJTJDJTIwZnBzJTNEMTUp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoModel, 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()

<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;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(){s=c("p"),s.innerHTML=_,m=i(),y(l.$$.fragment)},l(t){s=u(t,"P",{"data-svelte-h":!0}),g(s)!=="svelte-dcc01q"&&(s.innerHTML=_),m=r(t),M(l.$$.fragment,t)},m(t,f){p(t,s,f),p(t,m,f),w(l,t,f),a=!0},p:Re,i(t){a||(J(l.$$.fragment,t),a=!0)},o(t){T(l.$$.fragment,t),a=!1},d(t){t&&(n(s),n(m)),j(l,t)}}}function $t(V){let s,_,m,l;return s=new wt({props:{id:"usage",option:"memory",$$slots:{default:[xt]},$$scope:{ctx:V}}}),m=new wt({props:{id:"usage",option:"inference speed",$$slots:{default:[Ht]},$$scope:{ctx:V}}}),{c(){y(s.$$.fragment),_=i(),y(m.$$.fragment)},l(a){M(s.$$.fragment,a),_=r(a),M(m.$$.fragment,a)},m(a,t){w(s,a,t),p(a,_,t),w(m,a,t),l=!0},p(a,t){const f={};t&2&&(f.$$scope={dirty:t,ctx:a}),s.$set(f);const Z={};t&2&&(Z.$$scope={dirty:t,ctx:a}),m.$set(Z)},i(a){l||(J(s.$$.fragment,a),J(m.$$.fragment,a),l=!0)},o(a){T(s.$$.fragment,a),T(m.$$.fragment,a),l=!1},d(a){a&&n(_),j(s,a),j(m,a)}}}function Gt(V){let s,_="Examples:",m,l,a;return l=new Qe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwSHVueXVhblZpZGVvUGlwZWxpbmUlMkMlMjBIdW55dWFuVmlkZW9UcmFuc2Zvcm1lcjNETW9kZWwlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX3ZpZGVvJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJodW55dWFudmlkZW8tY29tbXVuaXR5JTJGSHVueXVhblZpZGVvJTIyJTBBdHJhbnNmb3JtZXIlMjAlM0QlMjBIdW55dWFuVmlkZW9UcmFuc2Zvcm1lcjNETW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMG1vZGVsX2lkJTJDJTIwc3ViZm9sZGVyJTNEJTIydHJhbnNmb3JtZXIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTBBKSUwQXBpcGUlMjAlM0QlMjBIdW55dWFuVmlkZW9QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQobW9kZWxfaWQlMkMlMjB0cmFuc2Zvcm1lciUzRHRyYW5zZm9ybWVyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGUudmFlLmVuYWJsZV90aWxpbmcoKSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFvdXRwdXQlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMHByb21wdCUzRCUyMkElMjBjYXQlMjB3YWxrcyUyMG9uJTIwdGhlJTIwZ3Jhc3MlMkMlMjByZWFsaXN0aWMlMjIlMkMlMEElMjAlMjAlMjAlMjBoZWlnaHQlM0QzMjAlMkMlMEElMjAlMjAlMjAlMjB3aWR0aCUzRDUxMiUyQyUwQSUyMCUyMCUyMCUyMG51bV9mcmFtZXMlM0Q2MSUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QzMCUyQyUwQSkuZnJhbWVzJTVCMCU1RCUwQWV4cG9ydF90b192aWRlbyhvdXRwdXQlMkMlMjAlMjJvdXRwdXQubXA0JTIyJTJDJTIwZnBzJTNEMTUp",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> HunyuanVideoPipeline, HunyuanVideoTransformer3DModel
<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>model_id = <span class="hljs-string">&quot;hunyuanvideo-community/HunyuanVideo&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>transformer = HunyuanVideoTransformer3DModel.from_pretrained(
<span class="hljs-meta">... </span>    model_id, subfolder=<span class="hljs-string">&quot;transformer&quot;</span>, torch_dtype=torch.bfloat16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = HunyuanVideoPipeline.from_pretrained(model_id, transformer=transformer, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_tiling()
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>output = pipe(
<span class="hljs-meta">... </span>    prompt=<span class="hljs-string">&quot;A cat walks on the grass, realistic&quot;</span>,
<span class="hljs-meta">... </span>    height=<span class="hljs-number">320</span>,
<span class="hljs-meta">... </span>    width=<span class="hljs-number">512</span>,
<span class="hljs-meta">... </span>    num_frames=<span class="hljs-number">61</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">30</span>,
<span class="hljs-meta">... </span>).frames[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>export_to_video(output, <span class="hljs-string">&quot;output.mp4&quot;</span>, fps=<span class="hljs-number">15</span>)`,wrap:!1}}),{c(){s=c("p"),s.textContent=_,m=i(),y(l.$$.fragment)},l(t){s=u(t,"P",{"data-svelte-h":!0}),g(s)!=="svelte-kvfsh7"&&(s.textContent=_),m=r(t),M(l.$$.fragment,t)},m(t,f){p(t,s,f),p(t,m,f),w(l,t,f),a=!0},p:Re,i(t){a||(J(l.$$.fragment,t),a=!0)},o(t){T(l.$$.fragment,t),a=!1},d(t){t&&(n(s),n(m)),j(l,t)}}}function Ct(V){let s,_,m,l,a,t='<div class="flex flex-wrap space-x-1"><a href="https://huggingface.co/docs/diffusers/main/en/tutorials/using_peft_for_inference" target="_blank" rel="noopener"><img alt="LoRA" src="https://img.shields.io/badge/LoRA-d8b4fe?style=flat"/></a></div>',f,Z,h,U,lt='<a href="https://huggingface.co/papers/2412.03603" rel="nofollow">HunyuanVideo</a> is a 13B parameter diffusion transformer model designed to be competitive with closed-source video foundation models and enable wider community access. This model uses a “dual-stream to single-stream” architecture to separately process the video and text tokens first, before concatenating and feeding them to the transformer to fuse the multimodal information. A pretrained multimodal large language model (MLLM) is used as the encoder because it has better image-text alignment, better image detail description and reasoning, and it can be used as a zero-shot learner if system instructions are added to user prompts. Finally, HunyuanVideo uses a 3D causal variational autoencoder to more efficiently process video data at the original resolution and frame rate.',we,A,it='You can find all the original HunyuanVideo checkpoints under the <a href="https://huggingface.co/tencent" rel="nofollow">Tencent</a> organization.',Je,$,Te,q,rt="The example below demonstrates how to generate a video optimized for memory or inference speed.",je,G,ve,z,Ze,W,P,ie,dt='HunyuanVideo supports LoRAs with <a href="/docs/diffusers/main/en/api/loaders/lora#diffusers.loaders.HunyuanVideoLoraLoaderMixin.load_lora_weights">load_lora_weights()</a>.',Ae,L,re,pt="Show example code",qe,F,ze,de,ct="<p>Refer to the table below for recommended inference values.</p> <table><thead><tr><th>parameter</th> <th>recommended value</th></tr></thead> <tbody><tr><td>text encoder dtype</td> <td><code>torch.float16</code></td></tr> <tr><td>transformer dtype</td> <td><code>torch.bfloat16</code></td></tr> <tr><td>vae dtype</td> <td><code>torch.float16</code></td></tr> <tr><td><code>num_frames (k)</code></td> <td>4 * <code>k</code> + 1</td></tr></tbody></table>",Pe,pe,ut="<p>Try lower <code>shift</code> values (<code>2.0</code> to <code>5.0</code>) for lower resolution videos and higher <code>shift</code> values (<code>7.0</code> to <code>12.0</code>) for higher resolution images.</p>",Ue,Y,Ve,b,N,Le,ce,mt="Pipeline for text-to-video generation using HunyuanVideo.",Fe,ue,ft=`This model inherits from <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`,Ye,B,S,Ne,me,ht="The call function to the pipeline for generation.",Se,C,De,X,D,Oe,fe,gt=`Disable sliced VAE decoding. If <code>enable_vae_slicing</code> was previously enabled, this method will go back to
computing decoding in one step.`,Ke,E,O,et,he,_t=`Disable tiled VAE decoding. If <code>enable_vae_tiling</code> was previously enabled, this method will go back to
computing decoding in one step.`,tt,R,K,nt,ge,bt=`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.`,st,Q,ee,at,_e,yt=`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.`,Ie,te,We,k,ne,ot,be,Mt="Output class for HunyuanVideo pipelines.",Be,se,ke,Me,xe;return Z=new Ee({props:{title:"HunyuanVideo",local:"hunyuanvideo",headingTag:"h1"}}),$=new Vt({props:{warning:!1,$$slots:{default:[kt]},$$scope:{ctx:V}}}),G=new Bt({props:{id:"usage",options:["memory","inference speed"],$$slots:{default:[$t]},$$scope:{ctx:V}}}),z=new Ee({props:{title:"Notes",local:"notes",headingTag:"h2"}}),F=new Qe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQXV0b01vZGVsJTJDJTIwSHVueXVhblZpZGVvUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnF1YW50aXplcnMlMjBpbXBvcnQlMjBQaXBlbGluZVF1YW50aXphdGlvbkNvbmZpZyUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBleHBvcnRfdG9fdmlkZW8lMEElMEElMjMlMjBxdWFudGl6ZSUyMHdlaWdodHMlMjB0byUyMGludDQlMjB3aXRoJTIwYml0c2FuZGJ5dGVzJTBBcGlwZWxpbmVfcXVhbnRfY29uZmlnJTIwJTNEJTIwUGlwZWxpbmVRdWFudGl6YXRpb25Db25maWcoJTBBJTIwJTIwJTIwJTIwcXVhbnRfYmFja2VuZCUzRCUyMmJpdHNhbmRieXRlc180Yml0JTIyJTJDJTBBJTIwJTIwJTIwJTIwcXVhbnRfa3dhcmdzJTNEJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIybG9hZF9pbl80Yml0JTIyJTNBJTIwVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMmJuYl80Yml0X3F1YW50X3R5cGUlMjIlM0ElMjAlMjJuZjQlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjJibmJfNGJpdF9jb21wdXRlX2R0eXBlJTIyJTNBJTIwdG9yY2guYmZsb2F0MTYlMEEl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MHRoZSUyMHN0eWxlJTIwb2YlMjBTV1IuJTIwQSUyMGJsYWNrJTIwYW5kJTIwd2hpdGUlMjBhbmltYXRlZCUyMHNjZW5lJTIwZmVhdHVyaW5nJTIwYSUyMGZsdWZmeSUyMHRlZGR5JTIwYmVhciUyMHNpdHMlMjBvbiUyMGElMjBiZWQlMjBvZiUyMHNvZnQlMjBwaWxsb3dzJTIwc3Vycm91bmRlZCUyMGJ5JTIwY2hpbGRyZW4ncyUyMHRveXMuJTBBJTIyJTIyJTIyJTBBdmlkZW8lMjAlM0QlMjBwaXBlbGluZShwcm9tcHQlM0Rwcm9tcHQlMkMlMjBudW1fZnJhbWVzJTNENjElMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMzApLmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fdmlkZW8odmlkZW8lMkMlMjAlMjJvdXRwdXQubXA0JTIyJTJDJTIwZnBzJTNEMTUp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoModel, 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"># load LoRA weights</span>
pipeline.load_lora_weights(<span class="hljs-string">&quot;https://huggingface.co/lucataco/hunyuan-steamboat-willie-10&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>, <span class="hljs-number">0.9</span>)

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

<span class="hljs-comment"># use &quot;In the style of SWR&quot; to trigger the LoRA</span>
prompt = <span class="hljs-string">&quot;&quot;&quot;
In the style of SWR. A black and white animated scene featuring a fluffy teddy bear sits on a bed of soft pillows surrounded by children&#x27;s toys.
&quot;&quot;&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}}),Y=new Ee({props:{title:"HunyuanVideoPipeline",local:"diffusers.HunyuanVideoPipeline",headingTag:"h2"}}),N=new le({props:{name:"class diffusers.HunyuanVideoPipeline",anchor:"diffusers.HunyuanVideoPipeline",parameters:[{name:"text_encoder",val:": LlamaModel"},{name:"tokenizer",val:": LlamaTokenizerFast"},{name:"transformer",val:": HunyuanVideoTransformer3DModel"},{name:"vae",val:": AutoencoderKLHunyuanVideo"},{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"text_encoder_2",val:": CLIPTextModel"},{name:"tokenizer_2",val:": CLIPTokenizer"}],parametersDescription:[{anchor:"diffusers.HunyuanVideoPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>LlamaModel</code>) &#x2014;
<a href="https://huggingface.co/xtuner/llava-llama-3-8b-v1_1-transformers" rel="nofollow">Llava Llama3-8B</a>.`,name:"text_encoder"},{anchor:"diffusers.HunyuanVideoPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>LlamaTokenizer</code>) &#x2014;
Tokenizer from <a href="https://huggingface.co/xtuner/llava-llama-3-8b-v1_1-transformers" rel="nofollow">Llava Llama3-8B</a>.`,name:"tokenizer"},{anchor:"diffusers.HunyuanVideoPipeline.transformer",description:`<strong>transformer</strong> (<a href="/docs/diffusers/main/en/api/models/hunyuan_video_transformer_3d#diffusers.HunyuanVideoTransformer3DModel">HunyuanVideoTransformer3DModel</a>) &#x2014;
Conditional Transformer to denoise the encoded image latents.`,name:"transformer"},{anchor:"diffusers.HunyuanVideoPipeline.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.HunyuanVideoPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoder_kl_hunyuan_video#diffusers.AutoencoderKLHunyuanVideo">AutoencoderKLHunyuanVideo</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode videos to and from latent representations.`,name:"vae"},{anchor:"diffusers.HunyuanVideoPipeline.text_encoder_2",description:`<strong>text_encoder_2</strong> (<code>CLIPTextModel</code>) &#x2014;
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder_2"},{anchor:"diffusers.HunyuanVideoPipeline.tokenizer_2",description:`<strong>tokenizer_2</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_2"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video.py#L144"}}),S=new le({props:{name:"__call__",anchor:"diffusers.HunyuanVideoPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"prompt_2",val:": typing.Union[str, typing.List[str]] = None"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"negative_prompt_2",val:": typing.Union[str, typing.List[str]] = None"},{name:"height",val:": int = 720"},{name:"width",val:": int = 1280"},{name:"num_frames",val:": int = 129"},{name:"num_inference_steps",val:": int = 50"},{name:"sigmas",val:": typing.List[float] = None"},{name:"true_cfg_scale",val:": float = 1.0"},{name:"guidance_scale",val:": float = 6.0"},{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:"pooled_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_pooled_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.Union[typing.Callable[[int, int, typing.Dict], NoneType], diffusers.callbacks.PipelineCallback, diffusers.callbacks.MultiPipelineCallbacks, NoneType] = None"},{name:"callback_on_step_end_tensor_inputs",val:": typing.List[str] = ['latents']"},{name:"prompt_template",val:": typing.Dict[str, typing.Any] = {'template': '<|start_header_id|>system<|end_header_id|>\\n\\nDescribe the video by detailing the following aspects: 1. The main content and theme of the video.2. The color, shape, size, texture, quantity, text, and spatial relationships of the objects.3. Actions, events, behaviors temporal relationships, physical movement changes of the objects.4. background environment, light, style and atmosphere.5. camera angles, movements, and transitions used in the video:<|eot_id|><|start_header_id|>user<|end_header_id|>\\n\\n{}<|eot_id|>', 'crop_start': 95}"},{name:"max_sequence_length",val:": int = 256"}],parametersDescription:[{anchor:"diffusers.HunyuanVideoPipeline.__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.HunyuanVideoPipeline.__call__.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to be sent to <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is
will be used instead.`,name:"prompt_2"},{anchor:"diffusers.HunyuanVideoPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the 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>true_cfg_scale</code> is
not greater than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.HunyuanVideoPipeline.__call__.negative_prompt_2",description:`<strong>negative_prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_2</code> and
<code>text_encoder_2</code>. If not defined, <code>negative_prompt</code> is used in all the text-encoders.`,name:"negative_prompt_2"},{anchor:"diffusers.HunyuanVideoPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, defaults to <code>720</code>) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.HunyuanVideoPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, defaults to <code>1280</code>) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.HunyuanVideoPipeline.__call__.num_frames",description:`<strong>num_frames</strong> (<code>int</code>, defaults to <code>129</code>) &#x2014;
The number of frames in the generated video.`,name:"num_frames"},{anchor:"diffusers.HunyuanVideoPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, defaults to <code>50</code>) &#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.HunyuanVideoPipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>List[float]</code>, <em>optional</em>) &#x2014;
Custom sigmas to use for the denoising process with schedulers which support a <code>sigmas</code> argument in
their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is passed
will be used.`,name:"sigmas"},{anchor:"diffusers.HunyuanVideoPipeline.__call__.true_cfg_scale",description:`<strong>true_cfg_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
When &gt; 1.0 and a provided <code>negative_prompt</code>, enables true classifier-free guidance.`,name:"true_cfg_scale"},{anchor:"diffusers.HunyuanVideoPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, defaults to <code>6.0</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. Note that the only available
HunyuanVideo model is CFG-distilled, which means that traditional guidance between unconditional and
conditional latent is not applied.`,name:"guidance_scale"},{anchor:"diffusers.HunyuanVideoPipeline.__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 images to generate per prompt.`,name:"num_videos_per_prompt"},{anchor:"diffusers.HunyuanVideoPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make
generation deterministic.`,name:"generator"},{anchor:"diffusers.HunyuanVideoPipeline.__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 is generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.HunyuanVideoPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.HunyuanVideoPipeline.__call__.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting.
If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.HunyuanVideoPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</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.HunyuanVideoPipeline.__call__.negative_pooled_prompt_embeds",description:`<strong>negative_pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, pooled negative_prompt_embeds will be generated from <code>negative_prompt</code>
input argument.`,name:"negative_pooled_prompt_embeds"},{anchor:"diffusers.HunyuanVideoPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generated image. Choose between <code>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.HunyuanVideoPipeline.__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>HunyuanVideoPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.HunyuanVideoPipeline.__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.HunyuanVideoPipeline.__call__.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"},{anchor:"diffusers.HunyuanVideoPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <code>PipelineCallback</code>, <code>MultiPipelineCallbacks</code>, <em>optional</em>) &#x2014;
A function or a subclass of <code>PipelineCallback</code> or <code>MultiPipelineCallbacks</code> that is called at the end of
each denoising step during the inference. 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.HunyuanVideoPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) &#x2014;
The list of tensor inputs for the <code>callback_on_step_end</code> function. The tensors specified in the list
will be passed as <code>callback_kwargs</code> argument. You will only be able to include variables listed in the
<code>._callback_tensor_inputs</code> attribute of your pipeline class.`,name:"callback_on_step_end_tensor_inputs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video.py#L467",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is <code>True</code>, <code>HunyuanVideoPipelineOutput</code> is returned, otherwise a <code>tuple</code> is returned
where the first element is a list with the generated images and the second element is a list of <code>bool</code>s
indicating whether the corresponding generated image contains “not-safe-for-work” (nsfw) content.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>~HunyuanVideoPipelineOutput</code> or <code>tuple</code></p>
`}}),C=new It({props:{anchor:"diffusers.HunyuanVideoPipeline.__call__.example",$$slots:{default:[Gt]},$$scope:{ctx:V}}}),D=new le({props:{name:"disable_vae_slicing",anchor:"diffusers.HunyuanVideoPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video.py#L425"}}),O=new le({props:{name:"disable_vae_tiling",anchor:"diffusers.HunyuanVideoPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video.py#L440"}}),K=new le({props:{name:"enable_vae_slicing",anchor:"diffusers.HunyuanVideoPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video.py#L418"}}),ee=new le({props:{name:"enable_vae_tiling",anchor:"diffusers.HunyuanVideoPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video.py#L432"}}),te=new Ee({props:{title:"HunyuanVideoPipelineOutput",local:"diffusers.pipelines.hunyuan_video.pipeline_output.HunyuanVideoPipelineOutput",headingTag:"h2"}}),ne=new le({props:{name:"class diffusers.pipelines.hunyuan_video.pipeline_output.HunyuanVideoPipelineOutput",anchor:"diffusers.pipelines.hunyuan_video.pipeline_output.HunyuanVideoPipelineOutput",parameters:[{name:"frames",val:": Tensor"}],parametersDescription:[{anchor:"diffusers.pipelines.hunyuan_video.pipeline_output.HunyuanVideoPipelineOutput.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/hunyuan_video/pipeline_output.py#L11"}}),se=new Wt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/hunyuan_video.md"}}),{c(){s=c("meta"),_=i(),m=c("p"),l=i(),a=c("div"),a.innerHTML=t,f=i(),y(Z.$$.fragment),h=i(),U=c("p"),U.innerHTML=lt,we=i(),A=c("p"),A.innerHTML=it,Je=i(),y($.$$.fragment),Te=i(),q=c("p"),q.textContent=rt,je=i(),y(G.$$.fragment),ve=i(),y(z.$$.fragment),Ze=i(),W=c("ul"),P=c("li"),ie=c("p"),ie.innerHTML=dt,Ae=i(),L=c("details"),re=c("summary"),re.textContent=pt,qe=i(),y(F.$$.fragment),ze=i(),de=c("li"),de.innerHTML=ct,Pe=i(),pe=c("li"),pe.innerHTML=ut,Ue=i(),y(Y.$$.fragment),Ve=i(),b=c("div"),y(N.$$.fragment),Le=i(),ce=c("p"),ce.textContent=mt,Fe=i(),ue=c("p"),ue.innerHTML=ft,Ye=i(),B=c("div"),y(S.$$.fragment),Ne=i(),me=c("p"),me.textContent=ht,Se=i(),y(C.$$.fragment),De=i(),X=c("div"),y(D.$$.fragment),Oe=i(),fe=c("p"),fe.innerHTML=gt,Ke=i(),E=c("div"),y(O.$$.fragment),et=i(),he=c("p"),he.innerHTML=_t,tt=i(),R=c("div"),y(K.$$.fragment),nt=i(),ge=c("p"),ge.textContent=bt,st=i(),Q=c("div"),y(ee.$$.fragment),at=i(),_e=c("p"),_e.textContent=yt,Ie=i(),y(te.$$.fragment),We=i(),k=c("div"),y(ne.$$.fragment),ot=i(),be=c("p"),be.textContent=Mt,Be=i(),y(se.$$.fragment),ke=i(),Me=c("p"),this.h()},l(e){const o=Zt("svelte-u9bgzb",document.head);s=u(o,"META",{name:!0,content:!0}),o.forEach(n),_=r(e),m=u(e,"P",{}),I(m).forEach(n),l=r(e),a=u(e,"DIV",{style:!0,"data-svelte-h":!0}),g(a)!=="svelte-p206qu"&&(a.innerHTML=t),f=r(e),M(Z.$$.fragment,e),h=r(e),U=u(e,"P",{"data-svelte-h":!0}),g(U)!=="svelte-1hd212d"&&(U.innerHTML=lt),we=r(e),A=u(e,"P",{"data-svelte-h":!0}),g(A)!=="svelte-vyw78o"&&(A.innerHTML=it),Je=r(e),M($.$$.fragment,e),Te=r(e),q=u(e,"P",{"data-svelte-h":!0}),g(q)!=="svelte-pzhop3"&&(q.textContent=rt),je=r(e),M(G.$$.fragment,e),ve=r(e),M(z.$$.fragment,e),Ze=r(e),W=u(e,"UL",{});var x=I(W);P=u(x,"LI",{});var ae=I(P);ie=u(ae,"P",{"data-svelte-h":!0}),g(ie)!=="svelte-r93fzu"&&(ie.innerHTML=dt),Ae=r(ae),L=u(ae,"DETAILS",{});var oe=I(L);re=u(oe,"SUMMARY",{"data-svelte-h":!0}),g(re)!=="svelte-1m0l1gk"&&(re.textContent=pt),qe=r(oe),M(F.$$.fragment,oe),oe.forEach(n),ae.forEach(n),ze=r(x),de=u(x,"LI",{"data-svelte-h":!0}),g(de)!=="svelte-bm2kpe"&&(de.innerHTML=ct),Pe=r(x),pe=u(x,"LI",{"data-svelte-h":!0}),g(pe)!=="svelte-ck8fz4"&&(pe.innerHTML=ut),x.forEach(n),Ue=r(e),M(Y.$$.fragment,e),Ve=r(e),b=u(e,"DIV",{class:!0});var v=I(b);M(N.$$.fragment,v),Le=r(v),ce=u(v,"P",{"data-svelte-h":!0}),g(ce)!=="svelte-1a4x0ff"&&(ce.textContent=mt),Fe=r(v),ue=u(v,"P",{"data-svelte-h":!0}),g(ue)!=="svelte-496sm0"&&(ue.innerHTML=ft),Ye=r(v),B=u(v,"DIV",{class:!0});var ye=I(B);M(S.$$.fragment,ye),Ne=r(ye),me=u(ye,"P",{"data-svelte-h":!0}),g(me)!=="svelte-50j04k"&&(me.textContent=ht),Se=r(ye),M(C.$$.fragment,ye),ye.forEach(n),De=r(v),X=u(v,"DIV",{class:!0});var He=I(X);M(D.$$.fragment,He),Oe=r(He),fe=u(He,"P",{"data-svelte-h":!0}),g(fe)!=="svelte-1s3c06i"&&(fe.innerHTML=gt),He.forEach(n),Ke=r(v),E=u(v,"DIV",{class:!0});var $e=I(E);M(O.$$.fragment,$e),et=r($e),he=u($e,"P",{"data-svelte-h":!0}),g(he)!=="svelte-pkn4ui"&&(he.innerHTML=_t),$e.forEach(n),tt=r(v),R=u(v,"DIV",{class:!0});var Ge=I(R);M(K.$$.fragment,Ge),nt=r(Ge),ge=u(Ge,"P",{"data-svelte-h":!0}),g(ge)!=="svelte-14bnrb6"&&(ge.textContent=bt),Ge.forEach(n),st=r(v),Q=u(v,"DIV",{class:!0});var Ce=I(Q);M(ee.$$.fragment,Ce),at=r(Ce),_e=u(Ce,"P",{"data-svelte-h":!0}),g(_e)!=="svelte-1xwrf7t"&&(_e.textContent=yt),Ce.forEach(n),v.forEach(n),Ie=r(e),M(te.$$.fragment,e),We=r(e),k=u(e,"DIV",{class:!0});var Xe=I(k);M(ne.$$.fragment,Xe),ot=r(Xe),be=u(Xe,"P",{"data-svelte-h":!0}),g(be)!=="svelte-i6xdzu"&&(be.textContent=Mt),Xe.forEach(n),Be=r(e),M(se.$$.fragment,e),ke=r(e),Me=u(e,"P",{}),I(Me).forEach(n),this.h()},h(){H(s,"name","hf:doc:metadata"),H(s,"content",Xt),Ut(a,"float","right"),H(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H(k,"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,o){d(document.head,s),p(e,_,o),p(e,m,o),p(e,l,o),p(e,a,o),p(e,f,o),w(Z,e,o),p(e,h,o),p(e,U,o),p(e,we,o),p(e,A,o),p(e,Je,o),w($,e,o),p(e,Te,o),p(e,q,o),p(e,je,o),w(G,e,o),p(e,ve,o),w(z,e,o),p(e,Ze,o),p(e,W,o),d(W,P),d(P,ie),d(P,Ae),d(P,L),d(L,re),d(L,qe),w(F,L,null),d(W,ze),d(W,de),d(W,Pe),d(W,pe),p(e,Ue,o),w(Y,e,o),p(e,Ve,o),p(e,b,o),w(N,b,null),d(b,Le),d(b,ce),d(b,Fe),d(b,ue),d(b,Ye),d(b,B),w(S,B,null),d(B,Ne),d(B,me),d(B,Se),w(C,B,null),d(b,De),d(b,X),w(D,X,null),d(X,Oe),d(X,fe),d(b,Ke),d(b,E),w(O,E,null),d(E,et),d(E,he),d(b,tt),d(b,R),w(K,R,null),d(R,nt),d(R,ge),d(b,st),d(b,Q),w(ee,Q,null),d(Q,at),d(Q,_e),p(e,Ie,o),w(te,e,o),p(e,We,o),p(e,k,o),w(ne,k,null),d(k,ot),d(k,be),p(e,Be,o),w(se,e,o),p(e,ke,o),p(e,Me,o),xe=!0},p(e,[o]){const x={};o&2&&(x.$$scope={dirty:o,ctx:e}),$.$set(x);const ae={};o&2&&(ae.$$scope={dirty:o,ctx:e}),G.$set(ae);const oe={};o&2&&(oe.$$scope={dirty:o,ctx:e}),C.$set(oe)},i(e){xe||(J(Z.$$.fragment,e),J($.$$.fragment,e),J(G.$$.fragment,e),J(z.$$.fragment,e),J(F.$$.fragment,e),J(Y.$$.fragment,e),J(N.$$.fragment,e),J(S.$$.fragment,e),J(C.$$.fragment,e),J(D.$$.fragment,e),J(O.$$.fragment,e),J(K.$$.fragment,e),J(ee.$$.fragment,e),J(te.$$.fragment,e),J(ne.$$.fragment,e),J(se.$$.fragment,e),xe=!0)},o(e){T(Z.$$.fragment,e),T($.$$.fragment,e),T(G.$$.fragment,e),T(z.$$.fragment,e),T(F.$$.fragment,e),T(Y.$$.fragment,e),T(N.$$.fragment,e),T(S.$$.fragment,e),T(C.$$.fragment,e),T(D.$$.fragment,e),T(O.$$.fragment,e),T(K.$$.fragment,e),T(ee.$$.fragment,e),T(te.$$.fragment,e),T(ne.$$.fragment,e),T(se.$$.fragment,e),xe=!1},d(e){e&&(n(_),n(m),n(l),n(a),n(f),n(h),n(U),n(we),n(A),n(Je),n(Te),n(q),n(je),n(ve),n(Ze),n(W),n(Ue),n(Ve),n(b),n(Ie),n(We),n(k),n(Be),n(ke),n(Me)),n(s),j(Z,e),j($,e),j(G,e),j(z,e),j(F),j(Y,e),j(N),j(S),j(C),j(D),j(O),j(K),j(ee),j(te,e),j(ne),j(se,e)}}}const Xt='{"title":"HunyuanVideo","local":"hunyuanvideo","sections":[{"title":"Notes","local":"notes","sections":[],"depth":2},{"title":"HunyuanVideoPipeline","local":"diffusers.HunyuanVideoPipeline","sections":[],"depth":2},{"title":"HunyuanVideoPipelineOutput","local":"diffusers.pipelines.hunyuan_video.pipeline_output.HunyuanVideoPipelineOutput","sections":[],"depth":2}],"depth":1}';function Et(V){return Tt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Yt extends jt{constructor(s){super(),vt(this,s,Et,Ct,Jt,{})}}export{Yt as component};
