import{s as Ca,o as Ha,n as Xa}from"../chunks/scheduler.53228c21.js";import{S as xa,i as Ra,e as i,s as t,c,h as Ya,a as r,d as n,b as s,f as U,g as d,j as _,k as Z,l as o,m as l,n as u,t as h,o as g,p as f}from"../chunks/index.100fac89.js";import{D as me}from"../chunks/Docstring.22cc8849.js";import{C as we}from"../chunks/CodeBlock.d30a6509.js";import{E as Ga}from"../chunks/ExampleCodeBlock.1963d52f.js";import{H as T,E as Na}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c9001d7a.js";function Ea(ce){let p,w;return p=new we({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwSHVueXVhblZpZGVvRnJhbWVwYWNrUGlwZWxpbmUlMkMlMjBIdW55dWFuVmlkZW9GcmFtZXBhY2tUcmFuc2Zvcm1lcjNETW9kZWwlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX3ZpZGVvJTJDJTIwbG9hZF9pbWFnZSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBTaWdsaXBJbWFnZVByb2Nlc3NvciUyQyUyMFNpZ2xpcFZpc2lvbk1vZGVsJTBBJTBBdHJhbnNmb3JtZXIlMjAlM0QlMjBIdW55dWFuVmlkZW9GcmFtZXBhY2tUcmFuc2Zvcm1lcjNETW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmxsbHlhc3ZpZWwlMkZGcmFtZVBhY2tJMlZfSFklMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTBBKSUwQWZlYXR1cmVfZXh0cmFjdG9yJTIwJTNEJTIwU2lnbGlwSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmxsbHlhc3ZpZWwlMkZmbHV4X3JlZHV4X2JmbCU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lwZSglMEElMjAlMjAlMjAlMjBpbWFnZSUzRGltYWdlJTJDJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEJTIyQSUyMHBlbmd1aW4lMjBkYW5jaW5nJTIwaW4lMjB0aGUlMjBzbm93JTIyJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNEODMyJTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q0ODAlMkMlMEElMjAlMjAlMjAlMjBudW1fZnJhbWVzJTNEOTElMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMzAlMkMlMEElMjAlMjAlMjAlMjBndWlkYW5jZV9zY2FsZSUzRDkuMCUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRHRvcmNoLkdlbmVyYXRvcigpLm1hbnVhbF9zZWVkKDApJTJDJTBBJTIwJTIwJTIwJTIwc2FtcGxpbmdfdHlwZSUzRCUyMmludmVydGVkX2FudGlfZHJpZnRpbmclMjIlMkMlMEEpLmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fdmlkZW8ob3V0cHV0JTJDJTIwJTIyb3V0cHV0Lm1wNCUyMiUyQyUyMGZwcyUzRDMwKQ==",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> HunyuanVideoFramepackPipeline, HunyuanVideoFramepackTransformer3DModel
<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, load_image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SiglipImageProcessor, SiglipVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>transformer = HunyuanVideoFramepackTransformer3DModel.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;lllyasviel/FramePackI2V_HY&quot;</span>, torch_dtype=torch.bfloat16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = SiglipImageProcessor.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;lllyasviel/flux_redux_bfl&quot;</span>, subfolder=<span class="hljs-string">&quot;feature_extractor&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_encoder = SiglipVisionModel.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;lllyasviel/flux_redux_bfl&quot;</span>, subfolder=<span class="hljs-string">&quot;image_encoder&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = HunyuanVideoFramepackPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;hunyuanvideo-community/HunyuanVideo&quot;</span>,
<span class="hljs-meta">... </span>    transformer=transformer,
<span class="hljs-meta">... </span>    feature_extractor=feature_extractor,
<span class="hljs-meta">... </span>    image_encoder=image_encoder,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>)
<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>image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/penguin.png&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>output = pipe(
<span class="hljs-meta">... </span>    image=image,
<span class="hljs-meta">... </span>    prompt=<span class="hljs-string">&quot;A penguin dancing in the snow&quot;</span>,
<span class="hljs-meta">... </span>    height=<span class="hljs-number">832</span>,
<span class="hljs-meta">... </span>    width=<span class="hljs-number">480</span>,
<span class="hljs-meta">... </span>    num_frames=<span class="hljs-number">91</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">30</span>,
<span class="hljs-meta">... </span>    guidance_scale=<span class="hljs-number">9.0</span>,
<span class="hljs-meta">... </span>    generator=torch.Generator().manual_seed(<span class="hljs-number">0</span>),
<span class="hljs-meta">... </span>    sampling_type=<span class="hljs-string">&quot;inverted_anti_drifting&quot;</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">30</span>)`,wrap:!1}}),{c(){c(p.$$.fragment)},l(m){d(p.$$.fragment,m)},m(m,v){u(p,m,v),w=!0},p:Xa,i(m){w||(h(p.$$.fragment,m),w=!0)},o(m){g(p.$$.fragment,m),w=!1},d(m){f(p,m)}}}function Qa(ce){let p,w;return p=new we({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwSHVueXVhblZpZGVvRnJhbWVwYWNrUGlwZWxpbmUlMkMlMjBIdW55dWFuVmlkZW9GcmFtZXBhY2tUcmFuc2Zvcm1lcjNETW9kZWwlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX3ZpZGVvJTJDJTIwbG9hZF9pbWFnZSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBTaWdsaXBJbWFnZVByb2Nlc3NvciUyQyUyMFNpZ2xpcFZpc2lvbk1vZGVsJTBBJTBBdHJhbnNmb3JtZXIlMjAlM0QlMjBIdW55dWFuVmlkZW9GcmFtZXBhY2tUcmFuc2Zvcm1lcjNETW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmxsbHlhc3ZpZWwlMkZGcmFtZVBhY2tJMlZfSFklMjIlMkMlMjB0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lMkZmbGYydl9pbnB1dF9sYXN0X2ZyYW1lLnBuZyUyMiUwQSklMEFvdXRwdXQlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMGltYWdlJTNEZmlyc3RfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBsYXN0X2ltYWdlJTNEbGFzdF9pbWFnZSUyQyUwQSUyMCUyMCUyMCUyMHByb21wdCUzRHByb21wdCUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDUxMiUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNENTEyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2ZyYW1lcyUzRDkxJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDMwJTJDJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0Q5LjAlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0R0b3JjaC5HZW5lcmF0b3IoKS5tYW51YWxfc2VlZCgwKSUyQyUwQSUyMCUyMCUyMCUyMHNhbXBsaW5nX3R5cGUlM0QlMjJpbnZlcnRlZF9hbnRpX2RyaWZ0aW5nJTIyJTJDJTBBKS5mcmFtZXMlNUIwJTVEJTBBZXhwb3J0X3RvX3ZpZGVvKG91dHB1dCUyQyUyMCUyMm91dHB1dC5tcDQlMjIlMkMlMjBmcHMlM0QzMCk=",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> HunyuanVideoFramepackPipeline, HunyuanVideoFramepackTransformer3DModel
<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, load_image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SiglipImageProcessor, SiglipVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>transformer = HunyuanVideoFramepackTransformer3DModel.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;lllyasviel/FramePackI2V_HY&quot;</span>, torch_dtype=torch.bfloat16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = SiglipImageProcessor.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;lllyasviel/flux_redux_bfl&quot;</span>, subfolder=<span class="hljs-string">&quot;feature_extractor&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_encoder = SiglipVisionModel.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;lllyasviel/flux_redux_bfl&quot;</span>, subfolder=<span class="hljs-string">&quot;image_encoder&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = HunyuanVideoFramepackPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;hunyuanvideo-community/HunyuanVideo&quot;</span>,
<span class="hljs-meta">... </span>    transformer=transformer,
<span class="hljs-meta">... </span>    feature_extractor=feature_extractor,
<span class="hljs-meta">... </span>    image_encoder=image_encoder,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>)
<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>prompt = <span class="hljs-string">&quot;CG animation style, a small blue bird takes off from the ground, flapping its wings. The bird&#x27;s feathers are delicate, with a unique pattern on its chest. The background shows a blue sky with white clouds under bright sunshine. The camera follows the bird upward, capturing its flight and the vastness of the sky from a close-up, low-angle perspective.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>first_image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/flf2v_input_first_frame.png&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/flf2v_input_last_frame.png&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>output = pipe(
<span class="hljs-meta">... </span>    image=first_image,
<span class="hljs-meta">... </span>    last_image=last_image,
<span class="hljs-meta">... </span>    prompt=prompt,
<span class="hljs-meta">... </span>    height=<span class="hljs-number">512</span>,
<span class="hljs-meta">... </span>    width=<span class="hljs-number">512</span>,
<span class="hljs-meta">... </span>    num_frames=<span class="hljs-number">91</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">30</span>,
<span class="hljs-meta">... </span>    guidance_scale=<span class="hljs-number">9.0</span>,
<span class="hljs-meta">... </span>    generator=torch.Generator().manual_seed(<span class="hljs-number">0</span>),
<span class="hljs-meta">... </span>    sampling_type=<span class="hljs-string">&quot;inverted_anti_drifting&quot;</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">30</span>)`,wrap:!1}}),{c(){c(p.$$.fragment)},l(m){d(p.$$.fragment,m)},m(m,v){u(p,m,v),w=!0},p:Xa,i(m){w||(h(p.$$.fragment,m),w=!0)},o(m){g(p.$$.fragment,m),w=!1},d(m){f(p,m)}}}function $a(ce){let p,w,m,v,C,Ze,V,fa='<img alt="LoRA" src="https://img.shields.io/badge/LoRA-d8b4fe?style=flat"/>',Te,H,ya='<a href="https://huggingface.co/papers/2504.12626" rel="nofollow">Packing Input Frame Context in Next-Frame Prediction Models for Video Generation</a> by Lvmin Zhang and Maneesh Agrawala.',je,x,Ma="<em>We present a neural network structure, FramePack, to train next-frame (or next-frame-section) prediction models for video generation. The FramePack compresses input frames to make the transformer context length a fixed number regardless of the video length. As a result, we are able to process a large number of frames using video diffusion with computation bottleneck similar to image diffusion. This also makes the training video batch sizes significantly higher (batch sizes become comparable to image diffusion training). We also propose an anti-drifting sampling method that generates frames in inverted temporal order with early-established endpoints to avoid exposure bias (error accumulation over iterations). Finally, we show that existing video diffusion models can be finetuned with FramePack, and their visual quality may be improved because the next-frame prediction supports more balanced diffusion schedulers with less extreme flow shift timesteps.</em>",Ue,W,ba='<p>Make sure to check out the Schedulers <a href="../../using-diffusers/schedulers">guide</a> to learn how to explore the tradeoff between scheduler speed and quality, and see the <a href="../../using-diffusers/loading#reuse-a-pipeline">reuse components across pipelines</a> section to learn how to efficiently load the same components into multiple pipelines.</p>',ve,R,Ve,Y,_a='<thead><tr><th align="left">Model name</th> <th align="left">Description</th></tr></thead> <tbody><tr><td align="left">- <a href="https://huggingface.co/lllyasviel/FramePackI2V_HY" rel="nofollow"><code>lllyasviel/FramePackI2V_HY</code></a></td> <td align="left">Trained with the “inverted anti-drifting” strategy as described in the paper. Inference requires setting <code>sampling_type=&quot;inverted_anti_drifting&quot;</code> when running the pipeline.</td></tr> <tr><td align="left">- <a href="https://huggingface.co/lllyasviel/FramePack_F1_I2V_HY_20250503" rel="nofollow"><code>lllyasviel/FramePack_F1_I2V_HY_20250503</code></a></td> <td align="left">Trained with a novel anti-drifting strategy but inference is performed in “vanilla” strategy as described in the paper. Inference requires setting <code>sampling_type=&quot;vanilla&quot;</code> when running the pipeline.</td></tr></tbody>',We,N,ke,E,Ja="Refer to the pipeline documentation for basic usage examples. The following section contains examples of offloading, different sampling methods, quantization, and more.",Ie,Q,Fe,$,wa="The following example shows how to use Framepack with start and end image controls, using the inverted anti-drifiting sampling model.",Be,S,Ge,z,Xe,A,Za="The following example shows how to use Framepack with the F1 model trained with vanilla sampling but new regulation approach for anti-drifting.",Ce,P,He,q,xe,L,Ta='Group offloading (<a href="/docs/diffusers/main/en/api/utilities#diffusers.hooks.apply_group_offloading">apply_group_offloading()</a>) provides aggressive memory optimizations for offloading internal parts of any model to the CPU, with possibly no additional overhead to generation time. If you have very low VRAM available, this approach may be suitable for you depending on the amount of CPU RAM available.',Re,D,Ye,K,Ne,y,O,Ke,de,ja="Pipeline for text-to-video generation using HunyuanVideo.",Oe,ue,Ua=`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.).`,ea,b,ee,aa,he,va="The call function to the pipeline for generation.",na,ge,Va="Examples:",ta,ae,sa,k,la,ne,oa,I,ia,F,te,ra,fe,Wa=`Disable sliced VAE decoding. If <code>enable_vae_slicing</code> was previously enabled, this method will go back to
computing decoding in one step.`,pa,B,se,ma,ye,ka=`Disable tiled VAE decoding. If <code>enable_vae_tiling</code> was previously enabled, this method will go back to
computing decoding in one step.`,ca,G,le,da,Me,Ia=`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.`,ua,X,oe,ha,be,Fa=`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.`,Ee,ie,Qe,j,re,ga,_e,Ba="Output class for HunyuanVideo pipelines.",$e,pe,Se,Je,ze;return C=new T({props:{title:"Framepack",local:"framepack",headingTag:"h1"}}),R=new T({props:{title:"Available models",local:"available-models",headingTag:"h2"}}),N=new T({props:{title:"Usage",local:"usage",headingTag:"h2"}}),Q=new T({props:{title:"First and last frame to video",local:"first-and-last-frame-to-video",headingTag:"h3"}}),S=new we({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwSHVueXVhblZpZGVvRnJhbWVwYWNrUGlwZWxpbmUlMkMlMjBIdW55dWFuVmlkZW9GcmFt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yKCkubWFudWFsX3NlZWQoMCklMkMlMEElMjAlMjAlMjAlMjBzYW1wbGluZ190eXBlJTNEJTIyaW52ZXJ0ZWRfYW50aV9kcmlmdGluZyUyMiUyQyUwQSkuZnJhbWVzJTVCMCU1RCUwQWV4cG9ydF90b192aWRlbyhvdXRwdXQlMkMlMjAlMjJvdXRwdXQubXA0JTIyJTJDJTIwZnBzJTNEMzAp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> HunyuanVideoFramepackPipeline, HunyuanVideoFramepackTransformer3DModel
<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> SiglipImageProcessor, SiglipVisionModel

transformer = HunyuanVideoFramepackTransformer3DModel.from_pretrained(
    <span class="hljs-string">&quot;lllyasviel/FramePackI2V_HY&quot;</span>, torch_dtype=torch.bfloat16
)
feature_extractor = SiglipImageProcessor.from_pretrained(
    <span class="hljs-string">&quot;lllyasviel/flux_redux_bfl&quot;</span>, subfolder=<span class="hljs-string">&quot;feature_extractor&quot;</span>
)
image_encoder = SiglipVisionModel.from_pretrained(
    <span class="hljs-string">&quot;lllyasviel/flux_redux_bfl&quot;</span>, subfolder=<span class="hljs-string">&quot;image_encoder&quot;</span>, torch_dtype=torch.float16
)
pipe = HunyuanVideoFramepackPipeline.from_pretrained(
    <span class="hljs-string">&quot;hunyuanvideo-community/HunyuanVideo&quot;</span>,
    transformer=transformer,
    feature_extractor=feature_extractor,
    image_encoder=image_encoder,
    torch_dtype=torch.float16,
)

<span class="hljs-comment"># Enable memory optimizations</span>
pipe.enable_model_cpu_offload()
pipe.vae.enable_tiling()

prompt = <span class="hljs-string">&quot;CG animation style, a small blue bird takes off from the ground, flapping its wings. The bird&#x27;s feathers are delicate, with a unique pattern on its chest. The background shows a blue sky with white clouds under bright sunshine. The camera follows the bird upward, capturing its flight and the vastness of the sky from a close-up, low-angle perspective.&quot;</span>
first_image = load_image(
    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/flf2v_input_first_frame.png&quot;</span>
)
last_image = load_image(
    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/flf2v_input_last_frame.png&quot;</span>
)
output = pipe(
    image=first_image,
    last_image=last_image,
    prompt=prompt,
    height=<span class="hljs-number">512</span>,
    width=<span class="hljs-number">512</span>,
    num_frames=<span class="hljs-number">91</span>,
    num_inference_steps=<span class="hljs-number">30</span>,
    guidance_scale=<span class="hljs-number">9.0</span>,
    generator=torch.Generator().manual_seed(<span class="hljs-number">0</span>),
    sampling_type=<span class="hljs-string">&quot;inverted_anti_drifting&quot;</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">30</span>)`,wrap:!1}}),z=new T({props:{title:"Vanilla sampling",local:"vanilla-sampling",headingTag:"h3"}}),P=new we({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwSHVueXVhblZpZGVvRnJhbWVwYWNrUGlwZWxpbmUlMkMlMjBIdW55dWFuVmlkZW9GcmFtZXBhY2tUcmFuc2Zvcm1lcjNETW9kZWwlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX3ZpZGVvJTJDJTIwbG9hZF9pbWFnZSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBTaWdsaXBJbWFnZVByb2Nlc3NvciUyQyUyMFNpZ2xpcFZpc2lvbk1vZGVsJTBBJTBBdHJhbnNmb3JtZXIlMjAlM0QlMjBIdW55dWFuVmlkZW9GcmFtZXBhY2tUcmFuc2Zvcm1lcjNETW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmx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lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQXBpcGUudmFlLmVuYWJsZV90aWxpbmcoKSUwQSUwQWltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZkaWZmdXNlcnMlMkZwZW5ndWluLnBuZyUyMiUwQSklMEFvdXRwdXQlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMGltYWdlJTNEaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBwcm9tcHQlM0QlMjJBJTIwcGVuZ3VpbiUyMGRhbmNpbmclMjBpbiUyMHRoZSUyMHNub3clMjIlMkMlMEElMjAlMjAlMjAlMjBoZWlnaHQlM0Q4MzIlMkMlMEElMjAlMjAlMjAlMjB3aWR0aCUzRDQ4MCUyQyUwQSUyMCUyMCUyMCUyMG51bV9mcmFtZXMlM0Q5MSUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QzMCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEOS4wJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEdG9yY2guR2VuZXJhdG9yKCkubWFudWFsX3NlZWQoMCklMkMlMEElMjAlMjAlMjAlMjBzYW1wbGluZ190eXBlJTNEJTIydmFuaWxsYSUyMiUyQyUwQSkuZnJhbWVzJTVCMCU1RCUwQWV4cG9ydF90b192aWRlbyhvdXRwdXQlMkMlMjAlMjJvdXRwdXQubXA0JTIyJTJDJTIwZnBzJTNEMzAp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> HunyuanVideoFramepackPipeline, HunyuanVideoFramepackTransformer3DModel
<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> SiglipImageProcessor, SiglipVisionModel

transformer = HunyuanVideoFramepackTransformer3DModel.from_pretrained(
    <span class="hljs-string">&quot;lllyasviel/FramePack_F1_I2V_HY_20250503&quot;</span>, torch_dtype=torch.bfloat16
)
feature_extractor = SiglipImageProcessor.from_pretrained(
    <span class="hljs-string">&quot;lllyasviel/flux_redux_bfl&quot;</span>, subfolder=<span class="hljs-string">&quot;feature_extractor&quot;</span>
)
image_encoder = SiglipVisionModel.from_pretrained(
    <span class="hljs-string">&quot;lllyasviel/flux_redux_bfl&quot;</span>, subfolder=<span class="hljs-string">&quot;image_encoder&quot;</span>, torch_dtype=torch.float16
)
pipe = HunyuanVideoFramepackPipeline.from_pretrained(
    <span class="hljs-string">&quot;hunyuanvideo-community/HunyuanVideo&quot;</span>,
    transformer=transformer,
    feature_extractor=feature_extractor,
    image_encoder=image_encoder,
    torch_dtype=torch.float16,
)

<span class="hljs-comment"># Enable memory optimizations</span>
pipe.enable_model_cpu_offload()
pipe.vae.enable_tiling()

image = load_image(
    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/penguin.png&quot;</span>
)
output = pipe(
    image=image,
    prompt=<span class="hljs-string">&quot;A penguin dancing in the snow&quot;</span>,
    height=<span class="hljs-number">832</span>,
    width=<span class="hljs-number">480</span>,
    num_frames=<span class="hljs-number">91</span>,
    num_inference_steps=<span class="hljs-number">30</span>,
    guidance_scale=<span class="hljs-number">9.0</span>,
    generator=torch.Generator().manual_seed(<span class="hljs-number">0</span>),
    sampling_type=<span class="hljs-string">&quot;vanilla&quot;</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">30</span>)`,wrap:!1}}),q=new T({props:{title:"Group offloading",local:"group-offloading",headingTag:"h3"}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kYlMjAxMDI0KiozJTNBLjNmJTdEJTIwR0IlMjIpJTBBZXhwb3J0X3RvX3ZpZGVvKG91dHB1dCUyQyUyMCUyMm91dHB1dC5tcDQlMjIlMkMlMjBmcHMlM0QzMCk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> HunyuanVideoFramepackPipeline, HunyuanVideoFramepackTransformer3DModel
<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, load_image
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SiglipImageProcessor, SiglipVisionModel

transformer = HunyuanVideoFramepackTransformer3DModel.from_pretrained(
    <span class="hljs-string">&quot;lllyasviel/FramePack_F1_I2V_HY_20250503&quot;</span>, torch_dtype=torch.bfloat16
)
feature_extractor = SiglipImageProcessor.from_pretrained(
    <span class="hljs-string">&quot;lllyasviel/flux_redux_bfl&quot;</span>, subfolder=<span class="hljs-string">&quot;feature_extractor&quot;</span>
)
image_encoder = SiglipVisionModel.from_pretrained(
    <span class="hljs-string">&quot;lllyasviel/flux_redux_bfl&quot;</span>, subfolder=<span class="hljs-string">&quot;image_encoder&quot;</span>, torch_dtype=torch.float16
)
pipe = HunyuanVideoFramepackPipeline.from_pretrained(
    <span class="hljs-string">&quot;hunyuanvideo-community/HunyuanVideo&quot;</span>,
    transformer=transformer,
    feature_extractor=feature_extractor,
    image_encoder=image_encoder,
    torch_dtype=torch.float16,
)

<span class="hljs-comment"># Enable 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>)
<span class="hljs-built_in">list</span>(<span class="hljs-built_in">map</span>(
    <span class="hljs-keyword">lambda</span> x: apply_group_offloading(x, onload_device, offload_device, offload_type=<span class="hljs-string">&quot;leaf_level&quot;</span>, use_stream=<span class="hljs-literal">True</span>, low_cpu_mem_usage=<span class="hljs-literal">True</span>),
    [pipe.text_encoder, pipe.text_encoder_2, pipe.transformer]
))
pipe.image_encoder.to(onload_device)
pipe.vae.to(onload_device)
pipe.vae.enable_tiling()

image = load_image(
    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/penguin.png&quot;</span>
)
output = pipe(
    image=image,
    prompt=<span class="hljs-string">&quot;A penguin dancing in the snow&quot;</span>,
    height=<span class="hljs-number">832</span>,
    width=<span class="hljs-number">480</span>,
    num_frames=<span class="hljs-number">91</span>,
    num_inference_steps=<span class="hljs-number">30</span>,
    guidance_scale=<span class="hljs-number">9.0</span>,
    generator=torch.Generator().manual_seed(<span class="hljs-number">0</span>),
    sampling_type=<span class="hljs-string">&quot;vanilla&quot;</span>,
).frames[<span class="hljs-number">0</span>]
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Max memory: <span class="hljs-subst">{torch.cuda.max_memory_allocated() / <span class="hljs-number">1024</span>**<span class="hljs-number">3</span>:<span class="hljs-number">.3</span>f}</span> GB&quot;</span>)
export_to_video(output, <span class="hljs-string">&quot;output.mp4&quot;</span>, fps=<span class="hljs-number">30</span>)`,wrap:!1}}),K=new T({props:{title:"HunyuanVideoFramepackPipeline",local:"diffusers.HunyuanVideoFramepackPipeline",headingTag:"h2"}}),O=new me({props:{name:"class diffusers.HunyuanVideoFramepackPipeline",anchor:"diffusers.HunyuanVideoFramepackPipeline",parameters:[{name:"text_encoder",val:": LlamaModel"},{name:"tokenizer",val:": LlamaTokenizerFast"},{name:"transformer",val:": HunyuanVideoFramepackTransformer3DModel"},{name:"vae",val:": AutoencoderKLHunyuanVideo"},{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"text_encoder_2",val:": CLIPTextModel"},{name:"tokenizer_2",val:": CLIPTokenizer"},{name:"image_encoder",val:": SiglipVisionModel"},{name:"feature_extractor",val:": SiglipImageProcessor"}],parametersDescription:[{anchor:"diffusers.HunyuanVideoFramepackPipeline.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.HunyuanVideoFramepackPipeline.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.HunyuanVideoFramepackPipeline.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.HunyuanVideoFramepackPipeline.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.HunyuanVideoFramepackPipeline.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.HunyuanVideoFramepackPipeline.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.HunyuanVideoFramepackPipeline.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_framepack.py#L243"}}),ee=new me({props:{name:"__call__",anchor:"diffusers.HunyuanVideoFramepackPipeline.__call__",parameters:[{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor]]"},{name:"last_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.Tensor], NoneType] = None"},{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:"latent_window_size",val:": int = 9"},{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:"image_latents",val:": typing.Optional[torch.Tensor] = None"},{name:"last_image_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"},{name:"sampling_type",val:": FramepackSamplingType = <FramepackSamplingType.INVERTED_ANTI_DRIFTING: 'inverted_anti_drifting'>"}],parametersDescription:[{anchor:"diffusers.HunyuanVideoFramepackPipeline.__call__.image",description:`<strong>image</strong> (<code>PIL.Image.Image</code> or <code>np.ndarray</code> or <code>torch.Tensor</code>) &#x2014;
The image to be used as the starting point for the video generation.`,name:"image"},{anchor:"diffusers.HunyuanVideoFramepackPipeline.__call__.last_image",description:`<strong>last_image</strong> (<code>PIL.Image.Image</code> or <code>np.ndarray</code> or <code>torch.Tensor</code>, <em>optional</em>) &#x2014;
The optional last image to be used as the ending point for the video generation. This is useful for
generating transitions between two images.`,name:"last_image"},{anchor:"diffusers.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__call__.image_latents",description:`<strong>image_latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-encoded image latents. If not provided, the image will be encoded using the VAE.`,name:"image_latents"},{anchor:"diffusers.HunyuanVideoFramepackPipeline.__call__.last_image_latents",description:`<strong>last_image_latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-encoded last image latents. If not provided, the last image will be encoded using the VAE.`,name:"last_image_latents"},{anchor:"diffusers.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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>HunyuanVideoFramepackPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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.HunyuanVideoFramepackPipeline.__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_framepack.py#L641",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is <code>True</code>, <code>HunyuanVideoFramepackPipelineOutput</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>~HunyuanVideoFramepackPipelineOutput</code> or <code>tuple</code></p>
`}}),ae=new T({props:{title:"Image-to-Video",local:"image-to-video",headingTag:"h5"}}),k=new Ga({props:{anchor:"diffusers.HunyuanVideoFramepackPipeline.__call__.example",$$slots:{default:[Ea]},$$scope:{ctx:ce}}}),ne=new T({props:{title:"First and Last Image-to-Video",local:"first-and-last-image-to-video",headingTag:"h5"}}),I=new Ga({props:{anchor:"diffusers.HunyuanVideoFramepackPipeline.__call__.example-2",$$slots:{default:[Qa]},$$scope:{ctx:ce}}}),te=new me({props:{name:"disable_vae_slicing",anchor:"diffusers.HunyuanVideoFramepackPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video_framepack.py#L581"}}),se=new me({props:{name:"disable_vae_tiling",anchor:"diffusers.HunyuanVideoFramepackPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video_framepack.py#L608"}}),le=new me({props:{name:"enable_vae_slicing",anchor:"diffusers.HunyuanVideoFramepackPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video_framepack.py#L568"}}),oe=new me({props:{name:"enable_vae_tiling",anchor:"diffusers.HunyuanVideoFramepackPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video_framepack.py#L594"}}),ie=new T({props:{title:"HunyuanVideoPipelineOutput",local:"diffusers.pipelines.hunyuan_video.pipeline_output.HunyuanVideoPipelineOutput",headingTag:"h2"}}),re=new me({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#L12"}}),pe=new Na({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/framepack.md"}}),{c(){p=i("meta"),w=t(),m=i("p"),v=t(),c(C.$$.fragment),Ze=t(),V=i("div"),V.innerHTML=fa,Te=t(),H=i("p"),H.innerHTML=ya,je=t(),x=i("p"),x.innerHTML=Ma,Ue=t(),W=i("blockquote"),W.innerHTML=ba,ve=t(),c(R.$$.fragment),Ve=t(),Y=i("table"),Y.innerHTML=_a,We=t(),c(N.$$.fragment),ke=t(),E=i("p"),E.textContent=Ja,Ie=t(),c(Q.$$.fragment),Fe=t(),$=i("p"),$.textContent=wa,Be=t(),c(S.$$.fragment),Ge=t(),c(z.$$.fragment),Xe=t(),A=i("p"),A.textContent=Za,Ce=t(),c(P.$$.fragment),He=t(),c(q.$$.fragment),xe=t(),L=i("p"),L.innerHTML=Ta,Re=t(),c(D.$$.fragment),Ye=t(),c(K.$$.fragment),Ne=t(),y=i("div"),c(O.$$.fragment),Ke=t(),de=i("p"),de.textContent=ja,Oe=t(),ue=i("p"),ue.innerHTML=Ua,ea=t(),b=i("div"),c(ee.$$.fragment),aa=t(),he=i("p"),he.textContent=va,na=t(),ge=i("p"),ge.textContent=Va,ta=t(),c(ae.$$.fragment),sa=t(),c(k.$$.fragment),la=t(),c(ne.$$.fragment),oa=t(),c(I.$$.fragment),ia=t(),F=i("div"),c(te.$$.fragment),ra=t(),fe=i("p"),fe.innerHTML=Wa,pa=t(),B=i("div"),c(se.$$.fragment),ma=t(),ye=i("p"),ye.innerHTML=ka,ca=t(),G=i("div"),c(le.$$.fragment),da=t(),Me=i("p"),Me.textContent=Ia,ua=t(),X=i("div"),c(oe.$$.fragment),ha=t(),be=i("p"),be.textContent=Fa,Ee=t(),c(ie.$$.fragment),Qe=t(),j=i("div"),c(re.$$.fragment),ga=t(),_e=i("p"),_e.textContent=Ba,$e=t(),c(pe.$$.fragment),Se=t(),Je=i("p"),this.h()},l(e){const a=Ya("svelte-u9bgzb",document.head);p=r(a,"META",{name:!0,content:!0}),a.forEach(n),w=s(e),m=r(e,"P",{}),U(m).forEach(n),v=s(e),d(C.$$.fragment,e),Ze=s(e),V=r(e,"DIV",{class:!0,"data-svelte-h":!0}),_(V)!=="svelte-si9ct8"&&(V.innerHTML=fa),Te=s(e),H=r(e,"P",{"data-svelte-h":!0}),_(H)!=="svelte-1hpc6jc"&&(H.innerHTML=ya),je=s(e),x=r(e,"P",{"data-svelte-h":!0}),_(x)!=="svelte-1cw1ia9"&&(x.innerHTML=Ma),Ue=s(e),W=r(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),_(W)!=="svelte-r1jcqf"&&(W.innerHTML=ba),ve=s(e),d(R.$$.fragment,e),Ve=s(e),Y=r(e,"TABLE",{"data-svelte-h":!0}),_(Y)!=="svelte-1to8fyy"&&(Y.innerHTML=_a),We=s(e),d(N.$$.fragment,e),ke=s(e),E=r(e,"P",{"data-svelte-h":!0}),_(E)!=="svelte-1e7rgkz"&&(E.textContent=Ja),Ie=s(e),d(Q.$$.fragment,e),Fe=s(e),$=r(e,"P",{"data-svelte-h":!0}),_($)!=="svelte-5069ac"&&($.textContent=wa),Be=s(e),d(S.$$.fragment,e),Ge=s(e),d(z.$$.fragment,e),Xe=s(e),A=r(e,"P",{"data-svelte-h":!0}),_(A)!=="svelte-18fuv5c"&&(A.textContent=Za),Ce=s(e),d(P.$$.fragment,e),He=s(e),d(q.$$.fragment,e),xe=s(e),L=r(e,"P",{"data-svelte-h":!0}),_(L)!=="svelte-1p7ulp4"&&(L.innerHTML=Ta),Re=s(e),d(D.$$.fragment,e),Ye=s(e),d(K.$$.fragment,e),Ne=s(e),y=r(e,"DIV",{class:!0});var M=U(y);d(O.$$.fragment,M),Ke=s(M),de=r(M,"P",{"data-svelte-h":!0}),_(de)!=="svelte-1a4x0ff"&&(de.textContent=ja),Oe=s(M),ue=r(M,"P",{"data-svelte-h":!0}),_(ue)!=="svelte-496sm0"&&(ue.innerHTML=Ua),ea=s(M),b=r(M,"DIV",{class:!0});var J=U(b);d(ee.$$.fragment,J),aa=s(J),he=r(J,"P",{"data-svelte-h":!0}),_(he)!=="svelte-50j04k"&&(he.textContent=va),na=s(J),ge=r(J,"P",{"data-svelte-h":!0}),_(ge)!=="svelte-kvfsh7"&&(ge.textContent=Va),ta=s(J),d(ae.$$.fragment,J),sa=s(J),d(k.$$.fragment,J),la=s(J),d(ne.$$.fragment,J),oa=s(J),d(I.$$.fragment,J),J.forEach(n),ia=s(M),F=r(M,"DIV",{class:!0});var Ae=U(F);d(te.$$.fragment,Ae),ra=s(Ae),fe=r(Ae,"P",{"data-svelte-h":!0}),_(fe)!=="svelte-1s3c06i"&&(fe.innerHTML=Wa),Ae.forEach(n),pa=s(M),B=r(M,"DIV",{class:!0});var Pe=U(B);d(se.$$.fragment,Pe),ma=s(Pe),ye=r(Pe,"P",{"data-svelte-h":!0}),_(ye)!=="svelte-pkn4ui"&&(ye.innerHTML=ka),Pe.forEach(n),ca=s(M),G=r(M,"DIV",{class:!0});var qe=U(G);d(le.$$.fragment,qe),da=s(qe),Me=r(qe,"P",{"data-svelte-h":!0}),_(Me)!=="svelte-14bnrb6"&&(Me.textContent=Ia),qe.forEach(n),ua=s(M),X=r(M,"DIV",{class:!0});var Le=U(X);d(oe.$$.fragment,Le),ha=s(Le),be=r(Le,"P",{"data-svelte-h":!0}),_(be)!=="svelte-1xwrf7t"&&(be.textContent=Fa),Le.forEach(n),M.forEach(n),Ee=s(e),d(ie.$$.fragment,e),Qe=s(e),j=r(e,"DIV",{class:!0});var De=U(j);d(re.$$.fragment,De),ga=s(De),_e=r(De,"P",{"data-svelte-h":!0}),_(_e)!=="svelte-i6xdzu"&&(_e.textContent=Ba),De.forEach(n),$e=s(e),d(pe.$$.fragment,e),Se=s(e),Je=r(e,"P",{}),U(Je).forEach(n),this.h()},h(){Z(p,"name","hf:doc:metadata"),Z(p,"content",Sa),Z(V,"class","flex flex-wrap space-x-1"),Z(W,"class","tip"),Z(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Z(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Z(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Z(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Z(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Z(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Z(j,"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,a){o(document.head,p),l(e,w,a),l(e,m,a),l(e,v,a),u(C,e,a),l(e,Ze,a),l(e,V,a),l(e,Te,a),l(e,H,a),l(e,je,a),l(e,x,a),l(e,Ue,a),l(e,W,a),l(e,ve,a),u(R,e,a),l(e,Ve,a),l(e,Y,a),l(e,We,a),u(N,e,a),l(e,ke,a),l(e,E,a),l(e,Ie,a),u(Q,e,a),l(e,Fe,a),l(e,$,a),l(e,Be,a),u(S,e,a),l(e,Ge,a),u(z,e,a),l(e,Xe,a),l(e,A,a),l(e,Ce,a),u(P,e,a),l(e,He,a),u(q,e,a),l(e,xe,a),l(e,L,a),l(e,Re,a),u(D,e,a),l(e,Ye,a),u(K,e,a),l(e,Ne,a),l(e,y,a),u(O,y,null),o(y,Ke),o(y,de),o(y,Oe),o(y,ue),o(y,ea),o(y,b),u(ee,b,null),o(b,aa),o(b,he),o(b,na),o(b,ge),o(b,ta),u(ae,b,null),o(b,sa),u(k,b,null),o(b,la),u(ne,b,null),o(b,oa),u(I,b,null),o(y,ia),o(y,F),u(te,F,null),o(F,ra),o(F,fe),o(y,pa),o(y,B),u(se,B,null),o(B,ma),o(B,ye),o(y,ca),o(y,G),u(le,G,null),o(G,da),o(G,Me),o(y,ua),o(y,X),u(oe,X,null),o(X,ha),o(X,be),l(e,Ee,a),u(ie,e,a),l(e,Qe,a),l(e,j,a),u(re,j,null),o(j,ga),o(j,_e),l(e,$e,a),u(pe,e,a),l(e,Se,a),l(e,Je,a),ze=!0},p(e,[a]){const M={};a&2&&(M.$$scope={dirty:a,ctx:e}),k.$set(M);const J={};a&2&&(J.$$scope={dirty:a,ctx:e}),I.$set(J)},i(e){ze||(h(C.$$.fragment,e),h(R.$$.fragment,e),h(N.$$.fragment,e),h(Q.$$.fragment,e),h(S.$$.fragment,e),h(z.$$.fragment,e),h(P.$$.fragment,e),h(q.$$.fragment,e),h(D.$$.fragment,e),h(K.$$.fragment,e),h(O.$$.fragment,e),h(ee.$$.fragment,e),h(ae.$$.fragment,e),h(k.$$.fragment,e),h(ne.$$.fragment,e),h(I.$$.fragment,e),h(te.$$.fragment,e),h(se.$$.fragment,e),h(le.$$.fragment,e),h(oe.$$.fragment,e),h(ie.$$.fragment,e),h(re.$$.fragment,e),h(pe.$$.fragment,e),ze=!0)},o(e){g(C.$$.fragment,e),g(R.$$.fragment,e),g(N.$$.fragment,e),g(Q.$$.fragment,e),g(S.$$.fragment,e),g(z.$$.fragment,e),g(P.$$.fragment,e),g(q.$$.fragment,e),g(D.$$.fragment,e),g(K.$$.fragment,e),g(O.$$.fragment,e),g(ee.$$.fragment,e),g(ae.$$.fragment,e),g(k.$$.fragment,e),g(ne.$$.fragment,e),g(I.$$.fragment,e),g(te.$$.fragment,e),g(se.$$.fragment,e),g(le.$$.fragment,e),g(oe.$$.fragment,e),g(ie.$$.fragment,e),g(re.$$.fragment,e),g(pe.$$.fragment,e),ze=!1},d(e){e&&(n(w),n(m),n(v),n(Ze),n(V),n(Te),n(H),n(je),n(x),n(Ue),n(W),n(ve),n(Ve),n(Y),n(We),n(ke),n(E),n(Ie),n(Fe),n($),n(Be),n(Ge),n(Xe),n(A),n(Ce),n(He),n(xe),n(L),n(Re),n(Ye),n(Ne),n(y),n(Ee),n(Qe),n(j),n($e),n(Se),n(Je)),n(p),f(C,e),f(R,e),f(N,e),f(Q,e),f(S,e),f(z,e),f(P,e),f(q,e),f(D,e),f(K,e),f(O),f(ee),f(ae),f(k),f(ne),f(I),f(te),f(se),f(le),f(oe),f(ie,e),f(re),f(pe,e)}}}const Sa='{"title":"Framepack","local":"framepack","sections":[{"title":"Available models","local":"available-models","sections":[],"depth":2},{"title":"Usage","local":"usage","sections":[{"title":"First and last frame to video","local":"first-and-last-frame-to-video","sections":[],"depth":3},{"title":"Vanilla sampling","local":"vanilla-sampling","sections":[],"depth":3},{"title":"Group offloading","local":"group-offloading","sections":[],"depth":3}],"depth":2},{"title":"HunyuanVideoFramepackPipeline","local":"diffusers.HunyuanVideoFramepackPipeline","sections":[{"title":"Image-to-Video","local":"image-to-video","sections":[],"depth":5},{"title":"First and Last Image-to-Video","local":"first-and-last-image-to-video","sections":[],"depth":5}],"depth":2},{"title":"HunyuanVideoPipelineOutput","local":"diffusers.pipelines.hunyuan_video.pipeline_output.HunyuanVideoPipelineOutput","sections":[],"depth":2}],"depth":1}';function za(ce){return Ha(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Oa extends xa{constructor(p){super(),Ra(this,p,za,$a,Ca,{})}}export{Oa as component};
