Buckets:
| import{s as Bs,o as Vs,n as dn}from"../chunks/scheduler.53228c21.js";import{S as Cs,i as ks,e as i,s,c as p,h as Ws,a as d,d as n,b as a,f as U,g as m,j as _,k as b,l as t,m as r,n as u,t as h,o as g,p as f}from"../chunks/index.100fac89.js";import{D as j}from"../chunks/Docstring.60584164.js";import{C as ne}from"../chunks/CodeBlock.d30a6509.js";import{E as ln}from"../chunks/ExampleCodeBlock.84c0636f.js";import{H as E,E as Rs}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.debde53c.js";function Ns(V){let c,X="Examples:",y,M,T;return M=new ne({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTFRYMlBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy5waXBlbGluZXMubHR4Mi5leHBvcnRfdXRpbHMlMjBpbXBvcnQlMjBlbmNvZGVfdmlkZW8lMEElMEFwaXBlJTIwJTNEJTIwTFRYMlBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJMaWdodHJpY2tzJTJGTFRYLTIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwd29tYW4lMjB3aXRoJTIwbG9uZyUyMGJyb3duJTIwaGFpciUyMGFuZCUyMGxpZ2h0JTIwc2tpbiUyMHNtaWxlcyUyMGF0JTIwYW5vdGhlciUyMHdvbWFuJTIwd2l0aCUyMGxvbmclMjBibG9uZGUlMjBoYWlyLiUyMFRoZSUyMHdvbWFuJTIwd2l0aCUyMGJyb3duJTIwaGFpciUyMHdlYXJzJTIwYSUyMGJsYWNrJTIwamFja2V0JTIwYW5kJTIwaGFzJTIwYSUyMHNtYWxsJTJDJTIwYmFyZWx5JTIwbm90aWNlYWJsZSUyMG1vbGUlMjBvbiUyMGhlciUyMH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MCUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF90eXBlJTNEJTIybnAlMjIlMkMlMEElMjAlMjAlMjAlMjByZXR1cm5fZGljdCUzREZhbHNlJTJDJTBBKSUwQSUwQWVuY29kZV92aWRlbyglMEElMjAlMjAlMjAlMjB2aWRlbyU1QjAlNUQlMkMlMEElMjAlMjAlMjAlMjBmcHMlM0RmcmFtZV9yYXRlJTJDJTBBJTIwJTIwJTIwJTIwYXVkaW8lM0RhdWRpbyU1QjAlNUQuZmxvYXQoKS5jcHUoKSUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvX3NhbXBsZV9yYXRlJTNEcGlwZS52b2NvZGVyLmNvbmZpZy5vdXRwdXRfc2FtcGxpbmdfcmF0ZSUyQyUyMCUyMCUyMyUyMHNob3VsZCUyMGJlJTIwMjQwMDAlMEElMjAlMjAlMjAlMjBvdXRwdXRfcGF0aCUzRCUyMnZpZGVvLm1wNCUyMiUyQyUwQSk=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LTX2Pipeline | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.export_utils <span class="hljs-keyword">import</span> encode_video | |
| <span class="hljs-meta">>>> </span>pipe = LTX2Pipeline.from_pretrained(<span class="hljs-string">"Lightricks/LTX-2"</span>, torch_dtype=torch.bfloat16) | |
| <span class="hljs-meta">>>> </span>pipe.enable_model_cpu_offload() | |
| <span class="hljs-meta">>>> </span>prompt = <span class="hljs-string">"A woman with long brown hair and light skin smiles at another woman with long blonde hair. The woman with brown hair wears a black jacket and has a small, barely noticeable mole on her right cheek. The camera angle is a close-up, focused on the woman with brown hair's face. The lighting is warm and natural, likely from the setting sun, casting a soft glow on the scene. The scene appears to be real-life footage"</span> | |
| <span class="hljs-meta">>>> </span>negative_prompt = <span class="hljs-string">"worst quality, inconsistent motion, blurry, jittery, distorted"</span> | |
| <span class="hljs-meta">>>> </span>frame_rate = <span class="hljs-number">24.0</span> | |
| <span class="hljs-meta">>>> </span>video, audio = pipe( | |
| <span class="hljs-meta">... </span> prompt=prompt, | |
| <span class="hljs-meta">... </span> negative_prompt=negative_prompt, | |
| <span class="hljs-meta">... </span> width=<span class="hljs-number">768</span>, | |
| <span class="hljs-meta">... </span> height=<span class="hljs-number">512</span>, | |
| <span class="hljs-meta">... </span> num_frames=<span class="hljs-number">121</span>, | |
| <span class="hljs-meta">... </span> frame_rate=frame_rate, | |
| <span class="hljs-meta">... </span> num_inference_steps=<span class="hljs-number">40</span>, | |
| <span class="hljs-meta">... </span> guidance_scale=<span class="hljs-number">4.0</span>, | |
| <span class="hljs-meta">... </span> output_type=<span class="hljs-string">"np"</span>, | |
| <span class="hljs-meta">... </span> return_dict=<span class="hljs-literal">False</span>, | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>encode_video( | |
| <span class="hljs-meta">... </span> video[<span class="hljs-number">0</span>], | |
| <span class="hljs-meta">... </span> fps=frame_rate, | |
| <span class="hljs-meta">... </span> audio=audio[<span class="hljs-number">0</span>].<span class="hljs-built_in">float</span>().cpu(), | |
| <span class="hljs-meta">... </span> audio_sample_rate=pipe.vocoder.config.output_sampling_rate, <span class="hljs-comment"># should be 24000</span> | |
| <span class="hljs-meta">... </span> output_path=<span class="hljs-string">"video.mp4"</span>, | |
| <span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){c=i("p"),c.textContent=X,y=s(),p(M.$$.fragment)},l(l){c=d(l,"P",{"data-svelte-h":!0}),_(c)!=="svelte-kvfsh7"&&(c.textContent=X),y=a(l),m(M.$$.fragment,l)},m(l,J){r(l,c,J),r(l,y,J),u(M,l,J),T=!0},p:dn,i(l){T||(h(M.$$.fragment,l),T=!0)},o(l){g(M.$$.fragment,l),T=!1},d(l){l&&(n(c),n(y)),f(M,l)}}}function Ls(V){let c,X="Examples:",y,M,T;return M=new ne({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kZW8ubXA0JTIyJTJDJTBBKQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LTX2ImageToVideoPipeline | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.export_utils <span class="hljs-keyword">import</span> encode_video | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image | |
| <span class="hljs-meta">>>> </span>pipe = LTX2ImageToVideoPipeline.from_pretrained(<span class="hljs-string">"Lightricks/LTX-2"</span>, torch_dtype=torch.bfloat16) | |
| <span class="hljs-meta">>>> </span>pipe.enable_model_cpu_offload() | |
| <span class="hljs-meta">>>> </span>image = load_image( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"https://huggingface.co/datasets/a-r-r-o-w/tiny-meme-dataset-captioned/resolve/main/images/8.png"</span> | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>prompt = <span class="hljs-string">"A young girl stands calmly in the foreground, looking directly at the camera, as a house fire rages in the background."</span> | |
| <span class="hljs-meta">>>> </span>negative_prompt = <span class="hljs-string">"worst quality, inconsistent motion, blurry, jittery, distorted"</span> | |
| <span class="hljs-meta">>>> </span>frame_rate = <span class="hljs-number">24.0</span> | |
| <span class="hljs-meta">>>> </span>video, audio = pipe( | |
| <span class="hljs-meta">... </span> image=image, | |
| <span class="hljs-meta">... </span> prompt=prompt, | |
| <span class="hljs-meta">... </span> negative_prompt=negative_prompt, | |
| <span class="hljs-meta">... </span> width=<span class="hljs-number">768</span>, | |
| <span class="hljs-meta">... </span> height=<span class="hljs-number">512</span>, | |
| <span class="hljs-meta">... </span> num_frames=<span class="hljs-number">121</span>, | |
| <span class="hljs-meta">... </span> frame_rate=frame_rate, | |
| <span class="hljs-meta">... </span> num_inference_steps=<span class="hljs-number">40</span>, | |
| <span class="hljs-meta">... </span> guidance_scale=<span class="hljs-number">4.0</span>, | |
| <span class="hljs-meta">... </span> output_type=<span class="hljs-string">"np"</span>, | |
| <span class="hljs-meta">... </span> return_dict=<span class="hljs-literal">False</span>, | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>encode_video( | |
| <span class="hljs-meta">... </span> video[<span class="hljs-number">0</span>], | |
| <span class="hljs-meta">... </span> fps=frame_rate, | |
| <span class="hljs-meta">... </span> audio=audio[<span class="hljs-number">0</span>].<span class="hljs-built_in">float</span>().cpu(), | |
| <span class="hljs-meta">... </span> audio_sample_rate=pipe.vocoder.config.output_sampling_rate, <span class="hljs-comment"># should be 24000</span> | |
| <span class="hljs-meta">... </span> output_path=<span class="hljs-string">"video.mp4"</span>, | |
| <span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){c=i("p"),c.textContent=X,y=s(),p(M.$$.fragment)},l(l){c=d(l,"P",{"data-svelte-h":!0}),_(c)!=="svelte-kvfsh7"&&(c.textContent=X),y=a(l),m(M.$$.fragment,l)},m(l,J){r(l,c,J),r(l,y,J),u(M,l,J),T=!0},p:dn,i(l){T||(h(M.$$.fragment,l),T=!0)},o(l){g(M.$$.fragment,l),T=!1},d(l){l&&(n(c),n(y)),f(M,l)}}}function Fs(V){let c,X="Examples:",y,M,T;return M=new ne({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTFRYMkNvbmRpdGlvblBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy5waXBlbGluZXMubHR4Mi5leHBvcnRfdXRpbHMlMjBpbXBvcnQlMjBlbmNvZGVfdmlkZW8lMEFmcm9tJTIwZGlmZnVzZXJzLnBpcGVsaW5lcy5sdHgyLnBpcGVsaW5lX2x0eDJfY29uZGl0aW9uJTIwaW1wb3J0JTIwTFRYMlZpZGVvQ29uZGl0aW9uJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG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I1NSkucm91bmQoKS5hc3R5cGUoJTIydWludDglMjIpJTBBdmlkZW8lMjAlM0QlMjB0b3JjaC5mcm9tX251bXB5KHZpZGVvKSUwQSUwQWVuY29kZV92aWRlbyglMEElMjAlMjAlMjAlMjB2aWRlbyU1QjAlNUQlMkMlMEElMjAlMjAlMjAlMjBmcHMlM0RmcmFtZV9yYXRlJTJDJTBBJTIwJTIwJTIwJTIwYXVkaW8lM0RhdWRpbyU1QjAlNUQuZmxvYXQoKS5jcHUoKSUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvX3NhbXBsZV9yYXRlJTNEcGlwZS52b2NvZGVyLmNvbmZpZy5vdXRwdXRfc2FtcGxpbmdfcmF0ZSUyQyUyMCUyMCUyMyUyMHNob3VsZCUyMGJlJTIwMjQwMDAlMEElMjAlMjAlMjAlMjBvdXRwdXRfcGF0aCUzRCUyMnZpZGVvLm1wNCUyMiUyQyUwQSk=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LTX2ConditionPipeline | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.export_utils <span class="hljs-keyword">import</span> encode_video | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.pipeline_ltx2_condition <span class="hljs-keyword">import</span> LTX2VideoCondition | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image | |
| <span class="hljs-meta">>>> </span>pipe = LTX2ConditionPipeline.from_pretrained(<span class="hljs-string">"Lightricks/LTX-2"</span>, torch_dtype=torch.bfloat16) | |
| <span class="hljs-meta">>>> </span>pipe.enable_model_cpu_offload() | |
| <span class="hljs-meta">>>> </span>first_image = load_image( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/flf2v_input_first_frame.png"</span> | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>last_image = load_image( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/flf2v_input_last_frame.png"</span> | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>first_cond = LTX2VideoCondition(frames=first_image, index=<span class="hljs-number">0</span>, strength=<span class="hljs-number">1.0</span>) | |
| <span class="hljs-meta">>>> </span>last_cond = LTX2VideoCondition(frames=last_image, index=-<span class="hljs-number">1</span>, strength=<span class="hljs-number">1.0</span>) | |
| <span class="hljs-meta">>>> </span>conditions = [first_cond, last_cond] | |
| <span class="hljs-meta">>>> </span>prompt = <span class="hljs-string">"CG animation style, a small blue bird takes off from the ground, flapping its wings."</span> | |
| <span class="hljs-meta">>>> </span>negative_prompt = <span class="hljs-string">"worst quality, inconsistent motion, blurry, jittery, distorted, static"</span> | |
| <span class="hljs-meta">>>> </span>frame_rate = <span class="hljs-number">24.0</span> | |
| <span class="hljs-meta">>>> </span>video = pipe( | |
| <span class="hljs-meta">... </span> conditions=conditions, | |
| <span class="hljs-meta">... </span> prompt=prompt, | |
| <span class="hljs-meta">... </span> negative_prompt=negative_prompt, | |
| <span class="hljs-meta">... </span> width=<span class="hljs-number">768</span>, | |
| <span class="hljs-meta">... </span> height=<span class="hljs-number">512</span>, | |
| <span class="hljs-meta">... </span> num_frames=<span class="hljs-number">121</span>, | |
| <span class="hljs-meta">... </span> frame_rate=frame_rate, | |
| <span class="hljs-meta">... </span> num_inference_steps=<span class="hljs-number">40</span>, | |
| <span class="hljs-meta">... </span> guidance_scale=<span class="hljs-number">4.0</span>, | |
| <span class="hljs-meta">... </span> output_type=<span class="hljs-string">"np"</span>, | |
| <span class="hljs-meta">... </span> return_dict=<span class="hljs-literal">False</span>, | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>video = (video * <span class="hljs-number">255</span>).<span class="hljs-built_in">round</span>().astype(<span class="hljs-string">"uint8"</span>) | |
| <span class="hljs-meta">>>> </span>video = torch.from_numpy(video) | |
| <span class="hljs-meta">>>> </span>encode_video( | |
| <span class="hljs-meta">... </span> video[<span class="hljs-number">0</span>], | |
| <span class="hljs-meta">... </span> fps=frame_rate, | |
| <span class="hljs-meta">... </span> audio=audio[<span class="hljs-number">0</span>].<span class="hljs-built_in">float</span>().cpu(), | |
| <span class="hljs-meta">... </span> audio_sample_rate=pipe.vocoder.config.output_sampling_rate, <span class="hljs-comment"># should be 24000</span> | |
| <span class="hljs-meta">... </span> output_path=<span class="hljs-string">"video.mp4"</span>, | |
| <span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){c=i("p"),c.textContent=X,y=s(),p(M.$$.fragment)},l(l){c=d(l,"P",{"data-svelte-h":!0}),_(c)!=="svelte-kvfsh7"&&(c.textContent=X),y=a(l),m(M.$$.fragment,l)},m(l,J){r(l,c,J),r(l,y,J),u(M,l,J),T=!0},p:dn,i(l){T||(h(M.$$.fragment,l),T=!0)},o(l){g(M.$$.fragment,l),T=!1},d(l){l&&(n(c),n(y)),f(M,l)}}}function Es(V){let c,X="Examples:",y,M,T;return M=new ne({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTFRYMkltYWdlVG9WaWRlb1BpcGVsaW5lJTJDJTIwTFRYMkxhdGVudFVwc2FtcGxlUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnBpcGVsaW5lcy5sdHgyLmV4cG9ydF91dGlscyUyMGltcG9ydCUyMGVuY29kZV92aWRlbyUwQWZyb20lMjBkaWZmdXNlcnMucGlwZWxpbmVzLmx0eDIubGF0ZW50X3Vwc2FtcGxlciUyMGltcG9ydCUyMExUWDJMYXRlbnRVcHNhbXBsZXJNb2RlbCUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX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WRlbyUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENTEyJTJDJTBBJTIwJTIwJTIwJTIwb3V0cHV0X3R5cGUlM0QlMjJucCUyMiUyQyUwQSUyMCUyMCUyMCUyMHJldHVybl9kaWN0JTNERmFsc2UlMkMlMEEpJTVCMCU1RCUwQSUwQWVuY29kZV92aWRlbyglMEElMjAlMjAlMjAlMjB2aWRlbyU1QjAlNUQlMkMlMEElMjAlMjAlMjAlMjBmcHMlM0RmcmFtZV9yYXRlJTJDJTBBJTIwJTIwJTIwJTIwYXVkaW8lM0RhdWRpbyU1QjAlNUQuZmxvYXQoKS5jcHUoKSUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvX3NhbXBsZV9yYXRlJTNEcGlwZS52b2NvZGVyLmNvbmZpZy5vdXRwdXRfc2FtcGxpbmdfcmF0ZSUyQyUyMCUyMCUyMyUyMHNob3VsZCUyMGJlJTIwMjQwMDAlMEElMjAlMjAlMjAlMjBvdXRwdXRfcGF0aCUzRCUyMnZpZGVvLm1wNCUyMiUyQyUwQSk=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LTX2ImageToVideoPipeline, LTX2LatentUpsamplePipeline | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.export_utils <span class="hljs-keyword">import</span> encode_video | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.latent_upsampler <span class="hljs-keyword">import</span> LTX2LatentUpsamplerModel | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image | |
| <span class="hljs-meta">>>> </span>pipe = LTX2ImageToVideoPipeline.from_pretrained(<span class="hljs-string">"Lightricks/LTX-2"</span>, torch_dtype=torch.bfloat16) | |
| <span class="hljs-meta">>>> </span>pipe.enable_model_cpu_offload() | |
| <span class="hljs-meta">>>> </span>image = load_image( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"https://huggingface.co/datasets/a-r-r-o-w/tiny-meme-dataset-captioned/resolve/main/images/8.png"</span> | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>prompt = <span class="hljs-string">"A young girl stands calmly in the foreground, looking directly at the camera, as a house fire rages in the background."</span> | |
| <span class="hljs-meta">>>> </span>negative_prompt = <span class="hljs-string">"worst quality, inconsistent motion, blurry, jittery, distorted"</span> | |
| <span class="hljs-meta">>>> </span>frame_rate = <span class="hljs-number">24.0</span> | |
| <span class="hljs-meta">>>> </span>video, audio = pipe( | |
| <span class="hljs-meta">... </span> image=image, | |
| <span class="hljs-meta">... </span> prompt=prompt, | |
| <span class="hljs-meta">... </span> negative_prompt=negative_prompt, | |
| <span class="hljs-meta">... </span> width=<span class="hljs-number">768</span>, | |
| <span class="hljs-meta">... </span> height=<span class="hljs-number">512</span>, | |
| <span class="hljs-meta">... </span> num_frames=<span class="hljs-number">121</span>, | |
| <span class="hljs-meta">... </span> frame_rate=frame_rate, | |
| <span class="hljs-meta">... </span> num_inference_steps=<span class="hljs-number">40</span>, | |
| <span class="hljs-meta">... </span> guidance_scale=<span class="hljs-number">4.0</span>, | |
| <span class="hljs-meta">... </span> output_type=<span class="hljs-string">"pil"</span>, | |
| <span class="hljs-meta">... </span> return_dict=<span class="hljs-literal">False</span>, | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>latent_upsampler = LTX2LatentUpsamplerModel.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"Lightricks/LTX-2"</span>, subfolder=<span class="hljs-string">"latent_upsampler"</span>, torch_dtype=torch.bfloat16 | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>upsample_pipe = LTX2LatentUpsamplePipeline(vae=pipe.vae, latent_upsampler=latent_upsampler) | |
| <span class="hljs-meta">>>> </span>upsample_pipe.vae.enable_tiling() | |
| <span class="hljs-meta">>>> </span>upsample_pipe.to(device=<span class="hljs-string">"cuda"</span>, dtype=torch.bfloat16) | |
| <span class="hljs-meta">>>> </span>video = upsample_pipe( | |
| <span class="hljs-meta">... </span> video=video, | |
| <span class="hljs-meta">... </span> width=<span class="hljs-number">768</span>, | |
| <span class="hljs-meta">... </span> height=<span class="hljs-number">512</span>, | |
| <span class="hljs-meta">... </span> output_type=<span class="hljs-string">"np"</span>, | |
| <span class="hljs-meta">... </span> return_dict=<span class="hljs-literal">False</span>, | |
| <span class="hljs-meta">... </span>)[<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>encode_video( | |
| <span class="hljs-meta">... </span> video[<span class="hljs-number">0</span>], | |
| <span class="hljs-meta">... </span> fps=frame_rate, | |
| <span class="hljs-meta">... </span> audio=audio[<span class="hljs-number">0</span>].<span class="hljs-built_in">float</span>().cpu(), | |
| <span class="hljs-meta">... </span> audio_sample_rate=pipe.vocoder.config.output_sampling_rate, <span class="hljs-comment"># should be 24000</span> | |
| <span class="hljs-meta">... </span> output_path=<span class="hljs-string">"video.mp4"</span>, | |
| <span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){c=i("p"),c.textContent=X,y=s(),p(M.$$.fragment)},l(l){c=d(l,"P",{"data-svelte-h":!0}),_(c)!=="svelte-kvfsh7"&&(c.textContent=X),y=a(l),m(M.$$.fragment,l)},m(l,J){r(l,c,J),r(l,y,J),u(M,l,J),T=!0},p:dn,i(l){T||(h(M.$$.fragment,l),T=!0)},o(l){g(M.$$.fragment,l),T=!1},d(l){l&&(n(c),n(y)),f(M,l)}}}function Qs(V){let c,X,y,M,T,l,J,qn='<img alt="LoRA" src="https://img.shields.io/badge/LoRA-d8b4fe?style=flat"/>',wt,se,Kn="LTX-2 is a DiT-based audio-video foundation model designed to generate synchronized video and audio within a single model. It brings together the core building blocks of modern video generation, with open weights and a focus on practical, local execution.",bt,ae,On='You can find all the original LTX-Video checkpoints under the <a href="https://huggingface.co/Lightricks" rel="nofollow">Lightricks</a> organization.',Ut,oe,es='The original codebase for LTX-2 can be found <a href="https://github.com/Lightricks/LTX-2" rel="nofollow">here</a>.',vt,le,jt,ie,ts="Recommended pipeline to achieve production quality generation, this pipeline is composed of two stages:",Zt,de,ns="<li>Stage 1: Generate a video at the target resolution using diffusion sampling with classifier-free guidance (CFG). This stage produces a coherent low-noise video sequence that respects the text/image conditioning.</li> <li>Stage 2: Upsample the Stage 1 output by 2 and refine details using a distilled LoRA model to improve fidelity and visual quality. Stage 2 may apply lighter CFG to preserve the structure from Stage 1 while enhancing texture and sharpness.</li>",It,re,ss="Sample usage of text-to-video two stages pipeline",Xt,ce,Gt,pe,xt,me,as="Fastest two-stages generation pipeline using a distilled checkpoint.",Bt,ue,Vt,he,Ct,ge,os="You can use <code>LTX2ConditionPipeline</code> to specify image and/or video conditions at arbitrary latent indices. For example, we can specify both a first-frame and last-frame condition to perform first-last-frame-to-video (FLF2V) generation:",kt,fe,Wt,_e,ls="You can use both image and video conditions:",Rt,Me,Nt,Te,is="Because the conditioning is done via latent frames, the 8 data space frames corresponding to the specified latent frame for an image condition will tend to be static.",Lt,ye,Ft,I,Je,rn,He,ds="Pipeline for text-to-video generation.",cn,Pe,rs='Reference: <a href="https://github.com/Lightricks/LTX-Video" rel="nofollow">https://github.com/Lightricks/LTX-Video</a>',pn,C,we,mn,$e,cs="Function invoked when calling the pipeline for generation.",un,Q,hn,Y,be,gn,De,ps="Encodes the prompt into text encoder hidden states.",fn,S,Ue,_n,qe,ms=`Enhances the supplied <code>prompt</code> by generating a new prompt using the current text encoder (default is a | |
| <code>transformers.Gemma3ForConditionalGeneration</code> model) from it and a system prompt.`,Et,ve,Qt,v,je,Mn,Ke,us="Pipeline for image-to-video generation.",Tn,Oe,hs='Reference: <a href="https://github.com/Lightricks/LTX-Video" rel="nofollow">https://github.com/Lightricks/LTX-Video</a>',yn,et,gs="TODO",Jn,k,Ze,wn,tt,fs="Function invoked when calling the pipeline for generation.",bn,A,Un,z,Ie,vn,nt,_s="Encodes the prompt into text encoder hidden states.",jn,H,Xe,Zn,st,Ms=`Enhances the supplied <code>prompt</code> by generating a new prompt using the current text encoder (default is a | |
| <code>transformers.Gemma3ForConditionalGeneration</code> model) from it and a system prompt.`,Yt,Ge,St,w,xe,In,at,Ts="Pipeline for video generation which allows image conditions to be inserted at arbitary parts of the video.",Xn,ot,ys='Reference: <a href="https://github.com/Lightricks/LTX-Video" rel="nofollow">https://github.com/Lightricks/LTX-Video</a>',Gn,lt,Js="TODO",xn,W,Be,Bn,it,ws="Function invoked when calling the pipeline for generation.",Vn,P,Cn,$,Ve,kn,dt,bs="Applies visual conditioning frames to an initial latent.",Wn,D,Ce,Rn,rt,Us="Encodes the prompt into text encoder hidden states.",Nn,q,ke,Ln,ct,vs="Preprocesses the condition images/videos to torch tensors.",Fn,K,We,En,pt,js="Trim a conditioning sequence to the allowed number of frames.",At,Re,zt,B,Ne,Qn,R,Le,Yn,mt,Zs="Function invoked when calling the pipeline for generation.",Sn,O,An,ee,Fe,zn,ut,Is=`Applies Adaptive Instance Normalization (AdaIN) to a latent tensor based on statistics from a reference latent | |
| tensor.`,Hn,N,Ee,Pn,ht,Xs=`Applies a non-linear tone-mapping function to latent values to reduce their dynamic range in a perceptually | |
| smooth way using a sigmoid-based compression.`,$n,gt,Gs=`This is useful for regularizing high-variance latents or for conditioning outputs during generation, especially | |
| when controlling dynamic behavior with a <code>compression</code> factor.`,Ht,Qe,Pt,L,Ye,Dn,ft,xs="Output class for LTX pipelines.",$t,Se,Dt,Jt,qt;return T=new E({props:{title:"LTX-2",local:"ltx-2",headingTag:"h1"}}),le=new E({props:{title:"Two-stages Generation",local:"two-stages-generation",headingTag:"h2"}}),ce=new ne({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRmxvd01hdGNoRXVsZXJEaX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HJlbm9pc2UlMjB3aXRoJTIwZmlyc3QlMjBzaWdtYSUyMHZhbHVlJTIwaHR0cHMlM0ElMkYlMkZnaXRodWIuY29tJTJGTGlnaHRyaWNrcyUyRkxUWC0yJTJGYmxvYiUyRm1haW4lMkZwYWNrYWdlcyUyRmx0eC1waXBlbGluZXMlMkZzcmMlMkZsdHhfcGlwZWxpbmVzJTJGdGkydmlkX3R3b19zdGFnZXMucHklMjNMMjE4JTBBJTIwJTIwJTIwJTIwc2lnbWFzJTNEU1RBR0VfMl9ESVNUSUxMRURfU0lHTUFfVkFMVUVTJTJDJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0QxLjAlMkMlMEElMjAlMjAlMjAlMjBvdXRwdXRfdHlwZSUzRCUyMm5wJTIyJTJDJTBBJTIwJTIwJTIwJTIwcmV0dXJuX2RpY3QlM0RGYWxzZSUyQyUwQSklMEElMEFlbmNvZGVfdmlkZW8oJTBBJTIwJTIwJTIwJTIwdmlkZW8lNUIwJTVEJTJDJTBBJTIwJTIwJTIwJTIwZnBzJTNEZnJhbWVfcmF0ZSUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvJTNEYXVkaW8lNUIwJTVELmZsb2F0KCkuY3B1KCklMkMlMEElMjAlMjAlMjAlMjBhdWRpb19zYW1wbGVfcmF0ZSUzRHBpcGUudm9jb2Rlci5jb25maWcub3V0cHV0X3NhbXBsaW5nX3JhdGUlMkMlMEElMjAlMjAlMjAlMjBvdXRwdXRfcGF0aCUzRCUyMmx0eDJfbG9yYV9kaXN0aWxsZWRfc2FtcGxlLm1wNCUyMiUyQyUwQSk=",highlighted:`<span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlowMatchEulerDiscreteScheduler | |
| <span class="hljs-keyword">from</span> diffusers.pipelines.ltx2 <span class="hljs-keyword">import</span> LTX2Pipeline, LTX2LatentUpsamplePipeline | |
| <span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.latent_upsampler <span class="hljs-keyword">import</span> LTX2LatentUpsamplerModel | |
| <span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.utils <span class="hljs-keyword">import</span> STAGE_2_DISTILLED_SIGMA_VALUES | |
| <span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.export_utils <span class="hljs-keyword">import</span> encode_video | |
| device = <span class="hljs-string">"cuda:0"</span> | |
| width = <span class="hljs-number">768</span> | |
| height = <span class="hljs-number">512</span> | |
| pipe = LTX2Pipeline.from_pretrained( | |
| <span class="hljs-string">"Lightricks/LTX-2"</span>, torch_dtype=torch.bfloat16 | |
| ) | |
| pipe.enable_sequential_cpu_offload(device=device) | |
| prompt = <span class="hljs-string">"A beautiful sunset over the ocean"</span> | |
| negative_prompt = <span class="hljs-string">"shaky, glitchy, low quality, worst quality, deformed, distorted, disfigured, motion smear, motion artifacts, fused fingers, bad anatomy, weird hand, ugly, transition, static."</span> | |
| <span class="hljs-comment"># Stage 1 default (non-distilled) inference</span> | |
| frame_rate = <span class="hljs-number">24.0</span> | |
| video_latent, audio_latent = pipe( | |
| prompt=prompt, | |
| negative_prompt=negative_prompt, | |
| width=width, | |
| height=height, | |
| num_frames=<span class="hljs-number">121</span>, | |
| frame_rate=frame_rate, | |
| num_inference_steps=<span class="hljs-number">40</span>, | |
| sigmas=<span class="hljs-literal">None</span>, | |
| guidance_scale=<span class="hljs-number">4.0</span>, | |
| output_type=<span class="hljs-string">"latent"</span>, | |
| return_dict=<span class="hljs-literal">False</span>, | |
| ) | |
| latent_upsampler = LTX2LatentUpsamplerModel.from_pretrained( | |
| <span class="hljs-string">"Lightricks/LTX-2"</span>, | |
| subfolder=<span class="hljs-string">"latent_upsampler"</span>, | |
| torch_dtype=torch.bfloat16, | |
| ) | |
| upsample_pipe = LTX2LatentUpsamplePipeline(vae=pipe.vae, latent_upsampler=latent_upsampler) | |
| upsample_pipe.enable_model_cpu_offload(device=device) | |
| upscaled_video_latent = upsample_pipe( | |
| latents=video_latent, | |
| output_type=<span class="hljs-string">"latent"</span>, | |
| return_dict=<span class="hljs-literal">False</span>, | |
| )[<span class="hljs-number">0</span>] | |
| <span class="hljs-comment"># Load Stage 2 distilled LoRA</span> | |
| pipe.load_lora_weights( | |
| <span class="hljs-string">"Lightricks/LTX-2"</span>, adapter_name=<span class="hljs-string">"stage_2_distilled"</span>, weight_name=<span class="hljs-string">"ltx-2-19b-distilled-lora-384.safetensors"</span> | |
| ) | |
| pipe.set_adapters(<span class="hljs-string">"stage_2_distilled"</span>, <span class="hljs-number">1.0</span>) | |
| <span class="hljs-comment"># VAE tiling is usually necessary to avoid OOM error when VAE decoding</span> | |
| pipe.vae.enable_tiling() | |
| <span class="hljs-comment"># Change scheduler to use Stage 2 distilled sigmas as is</span> | |
| new_scheduler = FlowMatchEulerDiscreteScheduler.from_config( | |
| pipe.scheduler.config, use_dynamic_shifting=<span class="hljs-literal">False</span>, shift_terminal=<span class="hljs-literal">None</span> | |
| ) | |
| pipe.scheduler = new_scheduler | |
| <span class="hljs-comment"># Stage 2 inference with distilled LoRA and sigmas</span> | |
| video, audio = pipe( | |
| latents=upscaled_video_latent, | |
| audio_latents=audio_latent, | |
| prompt=prompt, | |
| negative_prompt=negative_prompt, | |
| num_inference_steps=<span class="hljs-number">3</span>, | |
| noise_scale=STAGE_2_DISTILLED_SIGMA_VALUES[<span class="hljs-number">0</span>], <span class="hljs-comment"># renoise with first sigma value https://github.com/Lightricks/LTX-2/blob/main/packages/ltx-pipelines/src/ltx_pipelines/ti2vid_two_stages.py#L218</span> | |
| sigmas=STAGE_2_DISTILLED_SIGMA_VALUES, | |
| guidance_scale=<span class="hljs-number">1.0</span>, | |
| output_type=<span class="hljs-string">"np"</span>, | |
| return_dict=<span class="hljs-literal">False</span>, | |
| ) | |
| encode_video( | |
| video[<span class="hljs-number">0</span>], | |
| fps=frame_rate, | |
| audio=audio[<span class="hljs-number">0</span>].<span class="hljs-built_in">float</span>().cpu(), | |
| audio_sample_rate=pipe.vocoder.config.output_sampling_rate, | |
| output_path=<span class="hljs-string">"ltx2_lora_distilled_sample.mp4"</span>, | |
| )`,wrap:!1}}),pe=new E({props:{title:"Distilled checkpoint generation",local:"distilled-checkpoint-generation",headingTag:"h2"}}),ue=new ne({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzLnBpcGVsaW5lcy5sdHgyJTIwaW1wb3J0JTIwTFRYMlBpcGVsaW5lJTJDJTIwTFRYMkxhdGVudFVwc2FtcGxlUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnBpcGVsaW5lcy5sdHgyLmxhdGVudF91cHNhbXBsZXIlMjBpbXBvcnQlMjBMVFgyTGF0ZW50VXBzYW1wbGVyTW9kZWwlMEFmcm9tJTIwZGlmZnVzZXJzLnBpcGVsaW5lcy5sdHgyLnV0aWxzJTIwaW1wb3J0JTIwRElTVElMTEVEX1NJR01BX1ZBTFVFUyUyQyUyMFNUQUdFXzJfRElTVElMTEVEX1NJR01BX1ZBTFVFUyUwQWZyb20lMjBkaWZmdXNlcnMucGlwZWxpbmVzLmx0eDIuZXhwb3J0X3V0aWxzJTIwaW1wb3J0JTIwZW5jb2RlX3ZpZGVvJTBBJTBBZGV2aWNlJTIwJTNEJTIwJTIyY3VkYSUyMiUwQXdpZHRoJTIwJTNEJTIwNzY4JTBBaGVpZ2h0JTIwJTNEJTIwNTEyJTBBcmFuZG9tX3NlZWQlMjAlM0QlMjA0MiUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLkdlbmVyYXRvcihkZXZpY2UpLm1hbnVhbF9zZWVkKHJhbmRvbV9zZWVkKSUwQW1vZGVsX3BhdGglMjAlM0QlMjAlMjJyb290b25jaGFpciUyRkxUWC0yLTE5Yi1kaXN0aWxsZWQlMjIlMEElMEFwaXBlJTIwJTNEJTIwTFRYMlBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjBtb2RlbF9wYXRoJTJDJTIwdG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U1QjAlNUQuZmxvYXQoKS5jcHUoKSUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvX3NhbXBsZV9yYXRlJTNEcGlwZS52b2NvZGVyLmNvbmZpZy5vdXRwdXRfc2FtcGxpbmdfcmF0ZSUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF9wYXRoJTNEJTIybHR4Ml9kaXN0aWxsZWRfc2FtcGxlLm1wNCUyMiUyQyUwQSk=",highlighted:`<span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers.pipelines.ltx2 <span class="hljs-keyword">import</span> LTX2Pipeline, LTX2LatentUpsamplePipeline | |
| <span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.latent_upsampler <span class="hljs-keyword">import</span> LTX2LatentUpsamplerModel | |
| <span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.utils <span class="hljs-keyword">import</span> DISTILLED_SIGMA_VALUES, STAGE_2_DISTILLED_SIGMA_VALUES | |
| <span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.export_utils <span class="hljs-keyword">import</span> encode_video | |
| device = <span class="hljs-string">"cuda"</span> | |
| width = <span class="hljs-number">768</span> | |
| height = <span class="hljs-number">512</span> | |
| random_seed = <span class="hljs-number">42</span> | |
| generator = torch.Generator(device).manual_seed(random_seed) | |
| model_path = <span class="hljs-string">"rootonchair/LTX-2-19b-distilled"</span> | |
| pipe = LTX2Pipeline.from_pretrained( | |
| model_path, torch_dtype=torch.bfloat16 | |
| ) | |
| pipe.enable_sequential_cpu_offload(device=device) | |
| prompt = <span class="hljs-string">"A beautiful sunset over the ocean"</span> | |
| negative_prompt = <span class="hljs-string">"shaky, glitchy, low quality, worst quality, deformed, distorted, disfigured, motion smear, motion artifacts, fused fingers, bad anatomy, weird hand, ugly, transition, static."</span> | |
| frame_rate = <span class="hljs-number">24.0</span> | |
| video_latent, audio_latent = pipe( | |
| prompt=prompt, | |
| negative_prompt=negative_prompt, | |
| width=width, | |
| height=height, | |
| num_frames=<span class="hljs-number">121</span>, | |
| frame_rate=frame_rate, | |
| num_inference_steps=<span class="hljs-number">8</span>, | |
| sigmas=DISTILLED_SIGMA_VALUES, | |
| guidance_scale=<span class="hljs-number">1.0</span>, | |
| generator=generator, | |
| output_type=<span class="hljs-string">"latent"</span>, | |
| return_dict=<span class="hljs-literal">False</span>, | |
| ) | |
| latent_upsampler = LTX2LatentUpsamplerModel.from_pretrained( | |
| model_path, | |
| subfolder=<span class="hljs-string">"latent_upsampler"</span>, | |
| torch_dtype=torch.bfloat16, | |
| ) | |
| upsample_pipe = LTX2LatentUpsamplePipeline(vae=pipe.vae, latent_upsampler=latent_upsampler) | |
| upsample_pipe.enable_model_cpu_offload(device=device) | |
| upscaled_video_latent = upsample_pipe( | |
| latents=video_latent, | |
| output_type=<span class="hljs-string">"latent"</span>, | |
| return_dict=<span class="hljs-literal">False</span>, | |
| )[<span class="hljs-number">0</span>] | |
| video, audio = pipe( | |
| latents=upscaled_video_latent, | |
| audio_latents=audio_latent, | |
| prompt=prompt, | |
| negative_prompt=negative_prompt, | |
| num_inference_steps=<span class="hljs-number">3</span>, | |
| noise_scale=STAGE_2_DISTILLED_SIGMA_VALUES[<span class="hljs-number">0</span>], <span class="hljs-comment"># renoise with first sigma value https://github.com/Lightricks/LTX-2/blob/main/packages/ltx-pipelines/src/ltx_pipelines/distilled.py#L178</span> | |
| sigmas=STAGE_2_DISTILLED_SIGMA_VALUES, | |
| generator=generator, | |
| guidance_scale=<span class="hljs-number">1.0</span>, | |
| output_type=<span class="hljs-string">"np"</span>, | |
| return_dict=<span class="hljs-literal">False</span>, | |
| ) | |
| encode_video( | |
| video[<span class="hljs-number">0</span>], | |
| fps=frame_rate, | |
| audio=audio[<span class="hljs-number">0</span>].<span class="hljs-built_in">float</span>().cpu(), | |
| audio_sample_rate=pipe.vocoder.config.output_sampling_rate, | |
| output_path=<span class="hljs-string">"ltx2_distilled_sample.mp4"</span>, | |
| )`,wrap:!1}}),he=new E({props:{title:"Condition Pipeline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fcmF0ZSUzRHBpcGUudm9jb2Rlci5jb25maWcub3V0cHV0X3NhbXBsaW5nX3JhdGUlMkMlMEElMjAlMjAlMjAlMjBvdXRwdXRfcGF0aCUzRCUyMmx0eDJfZGlzdGlsbGVkX2ZsZjJ2Lm1wNCUyMiUyQyUwQSk=",highlighted:`<span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LTX2ConditionPipeline, LTX2LatentUpsamplePipeline | |
| <span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.latent_upsampler <span class="hljs-keyword">import</span> LTX2LatentUpsamplerModel | |
| <span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.pipeline_ltx2_condition <span class="hljs-keyword">import</span> LTX2VideoCondition | |
| <span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.utils <span class="hljs-keyword">import</span> DISTILLED_SIGMA_VALUES, STAGE_2_DISTILLED_SIGMA_VALUES | |
| <span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.export_utils <span class="hljs-keyword">import</span> encode_video | |
| <span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image | |
| device = <span class="hljs-string">"cuda"</span> | |
| width = <span class="hljs-number">768</span> | |
| height = <span class="hljs-number">512</span> | |
| random_seed = <span class="hljs-number">42</span> | |
| generator = torch.Generator(device).manual_seed(random_seed) | |
| model_path = <span class="hljs-string">"rootonchair/LTX-2-19b-distilled"</span> | |
| pipe = LTX2ConditionPipeline.from_pretrained(model_path, torch_dtype=torch.bfloat16) | |
| pipe.enable_sequential_cpu_offload(device=device) | |
| pipe.vae.enable_tiling() | |
| prompt = ( | |
| <span class="hljs-string">"CG animation style, a small blue bird takes off from the ground, flapping its wings. The bird's feathers are "</span> | |
| <span class="hljs-string">"delicate, with a unique pattern on its chest. The background shows a blue sky with white clouds under bright "</span> | |
| <span class="hljs-string">"sunshine. The camera follows the bird upward, capturing its flight and the vastness of the sky from a close-up, "</span> | |
| <span class="hljs-string">"low-angle perspective."</span> | |
| ) | |
| first_image = load_image( | |
| <span class="hljs-string">"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/flf2v_input_first_frame.png"</span>, | |
| ) | |
| last_image = load_image( | |
| <span class="hljs-string">"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/flf2v_input_last_frame.png"</span>, | |
| ) | |
| first_cond = LTX2VideoCondition(frames=first_image, index=<span class="hljs-number">0</span>, strength=<span class="hljs-number">1.0</span>) | |
| last_cond = LTX2VideoCondition(frames=last_image, index=-<span class="hljs-number">1</span>, strength=<span class="hljs-number">1.0</span>) | |
| conditions = [first_cond, last_cond] | |
| frame_rate = <span class="hljs-number">24.0</span> | |
| video_latent, audio_latent = pipe( | |
| conditions=conditions, | |
| prompt=prompt, | |
| width=width, | |
| height=height, | |
| num_frames=<span class="hljs-number">121</span>, | |
| frame_rate=frame_rate, | |
| num_inference_steps=<span class="hljs-number">8</span>, | |
| sigmas=DISTILLED_SIGMA_VALUES, | |
| guidance_scale=<span class="hljs-number">1.0</span>, | |
| generator=generator, | |
| output_type=<span class="hljs-string">"latent"</span>, | |
| return_dict=<span class="hljs-literal">False</span>, | |
| ) | |
| latent_upsampler = LTX2LatentUpsamplerModel.from_pretrained( | |
| model_path, | |
| subfolder=<span class="hljs-string">"latent_upsampler"</span>, | |
| torch_dtype=torch.bfloat16, | |
| ) | |
| upsample_pipe = LTX2LatentUpsamplePipeline(vae=pipe.vae, latent_upsampler=latent_upsampler) | |
| upsample_pipe.enable_model_cpu_offload(device=device) | |
| upscaled_video_latent = upsample_pipe( | |
| latents=video_latent, | |
| output_type=<span class="hljs-string">"latent"</span>, | |
| return_dict=<span class="hljs-literal">False</span>, | |
| )[<span class="hljs-number">0</span>] | |
| video, audio = pipe( | |
| latents=upscaled_video_latent, | |
| audio_latents=audio_latent, | |
| prompt=prompt, | |
| width=width * <span class="hljs-number">2</span>, | |
| height=height * <span class="hljs-number">2</span>, | |
| num_inference_steps=<span class="hljs-number">3</span>, | |
| sigmas=STAGE_2_DISTILLED_SIGMA_VALUES, | |
| generator=generator, | |
| guidance_scale=<span class="hljs-number">1.0</span>, | |
| output_type=<span class="hljs-string">"np"</span>, | |
| return_dict=<span class="hljs-literal">False</span>, | |
| ) | |
| encode_video( | |
| video[<span class="hljs-number">0</span>], | |
| fps=frame_rate, | |
| audio=audio[<span class="hljs-number">0</span>].<span class="hljs-built_in">float</span>().cpu(), | |
| audio_sample_rate=pipe.vocoder.config.output_sampling_rate, | |
| output_path=<span class="hljs-string">"ltx2_distilled_flf2v.mp4"</span>, | |
| )`,wrap:!1}}),Me=new ne({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTFRYMkNvbmRpdGlvblBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy5waXBlbGluZXMubHR4Mi5waXBlbGluZV9sdHgyX2NvbmRpdGlvbiUyMGltcG9ydCUyMExUWDJWaWRlb0NvbmRpdGlvbiUwQWZyb20lMjBkaWZmdXNlcnMucGlwZWxpbmVzLmx0eDIuZXhwb3J0X3V0aWxzJTIwaW1wb3J0JTIwZW5jb2RlX3ZpZGVvJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMkMlMjBsb2FkX3ZpZGVvJTBBJTBBZGV2aWNlJTIwJTNEJTIwJTIyY3VkYSUyMiUwQXdpZHRoJTIwJTNEJTIwNzY4JTBBaGVpZ2h0JTIwJTNEJTIwNTEyJTBBcmFuZG9tX3NlZWQlMjAlM0QlMjA0MiUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLkdlbmVyYXRvcihkZXZpY2UpLm1hbnVhbF9zZWVkKHJhbmRvbV9zZWVkKSUwQW1vZGVsX3BhdGglMjAlM0QlMjAlMjJyb290b25jaGFpciUyRkxUWC0yLTE5Yi1kaXN0aWxsZWQlMjIlMEElMEFwaXBlJTI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MGhlaWdodCUzRGhlaWdodCUyQyUwQSUyMCUyMCUyMCUyMG51bV9mcmFtZXMlM0QxMjElMkMlMEElMjAlMjAlMjAlMjBmcmFtZV9yYXRlJTNEZnJhbWVfcmF0ZSUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q0MCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNENC4wJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwb3V0cHV0X3R5cGUlM0QlMjJucCUyMiUyQyUwQSUyMCUyMCUyMCUyMHJldHVybl9kaWN0JTNERmFsc2UlMkMlMEEpJTBBJTBBZW5jb2RlX3ZpZGVvKCUwQSUyMCUyMCUyMCUyMHZpZGVvJTVCMCU1RCUyQyUwQSUyMCUyMCUyMCUyMGZwcyUzRGZyYW1lX3JhdGUlMkMlMEElMjAlMjAlMjAlMjBhdWRpbyUzRGF1ZGlvJTVCMCU1RC5mbG9hdCgpLmNwdSgpJTJDJTBBJTIwJTIwJTIwJTIwYXVkaW9fc2FtcGxlX3JhdGUlM0RwaXBlLnZvY29kZXIuY29uZmlnLm91dHB1dF9zYW1wbGluZ19yYXRlJTJDJTBBJTIwJTIwJTIwJTIwb3V0cHV0X3BhdGglM0QlMjJsdHgyX2NvbmRfdmlkZW8ubXA0JTIyJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LTX2ConditionPipeline | |
| <span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.pipeline_ltx2_condition <span class="hljs-keyword">import</span> LTX2VideoCondition | |
| <span class="hljs-keyword">from</span> diffusers.pipelines.ltx2.export_utils <span class="hljs-keyword">import</span> encode_video | |
| <span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image, load_video | |
| device = <span class="hljs-string">"cuda"</span> | |
| width = <span class="hljs-number">768</span> | |
| height = <span class="hljs-number">512</span> | |
| random_seed = <span class="hljs-number">42</span> | |
| generator = torch.Generator(device).manual_seed(random_seed) | |
| model_path = <span class="hljs-string">"rootonchair/LTX-2-19b-distilled"</span> | |
| pipe = LTX2ConditionPipeline.from_pretrained(model_path, torch_dtype=torch.bfloat16) | |
| pipe.enable_sequential_cpu_offload(device=device) | |
| pipe.vae.enable_tiling() | |
| prompt = ( | |
| <span class="hljs-string">"The video depicts a long, straight highway stretching into the distance, flanked by metal guardrails. The road is "</span> | |
| <span class="hljs-string">"divided into multiple lanes, with a few vehicles visible in the far distance. The surrounding landscape features "</span> | |
| <span class="hljs-string">"dry, grassy fields on one side and rolling hills on the other. The sky is mostly clear with a few scattered "</span> | |
| <span class="hljs-string">"clouds, suggesting a bright, sunny day. And then the camera switch to a winding mountain road covered in snow, "</span> | |
| <span class="hljs-string">"with a single vehicle traveling along it. The road is flanked by steep, rocky cliffs and sparse vegetation. The "</span> | |
| <span class="hljs-string">"landscape is characterized by rugged terrain and a river visible in the distance. The scene captures the "</span> | |
| <span class="hljs-string">"solitude and beauty of a winter drive through a mountainous region."</span> | |
| ) | |
| negative_prompt = ( | |
| <span class="hljs-string">"blurry, out of focus, overexposed, underexposed, low contrast, washed out colors, excessive noise, "</span> | |
| <span class="hljs-string">"grainy texture, poor lighting, flickering, motion blur, distorted proportions, unnatural skin tones, "</span> | |
| <span class="hljs-string">"deformed facial features, asymmetrical face, missing facial features, extra limbs, disfigured hands, "</span> | |
| <span class="hljs-string">"wrong hand count, artifacts around text, inconsistent perspective, camera shake, incorrect depth of "</span> | |
| <span class="hljs-string">"field, background too sharp, background clutter, distracting reflections, harsh shadows, inconsistent "</span> | |
| <span class="hljs-string">"lighting direction, color banding, cartoonish rendering, 3D CGI look, unrealistic materials, uncanny "</span> | |
| <span class="hljs-string">"valley effect, incorrect ethnicity, wrong gender, exaggerated expressions, wrong gaze direction, "</span> | |
| <span class="hljs-string">"mismatched lip sync, silent or muted audio, distorted voice, robotic voice, echo, background noise, "</span> | |
| <span class="hljs-string">"off-sync audio, incorrect dialogue, added dialogue, repetitive speech, jittery movement, awkward "</span> | |
| <span class="hljs-string">"pauses, incorrect timing, unnatural transitions, inconsistent framing, tilted camera, flat lighting, "</span> | |
| <span class="hljs-string">"inconsistent tone, cinematic oversaturation, stylized filters, or AI artifacts."</span> | |
| ) | |
| cond_video = load_video( | |
| <span class="hljs-string">"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cosmos/cosmos-video2world-input-vid.mp4"</span> | |
| ) | |
| cond_image = load_image( | |
| <span class="hljs-string">"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cosmos/cosmos-video2world-input.jpg"</span> | |
| ) | |
| video_cond = LTX2VideoCondition(frames=cond_video, index=<span class="hljs-number">0</span>, strength=<span class="hljs-number">1.0</span>) | |
| image_cond = LTX2VideoCondition(frames=cond_image, index=<span class="hljs-number">8</span>, strength=<span class="hljs-number">1.0</span>) | |
| conditions = [video_cond, image_cond] | |
| frame_rate = <span class="hljs-number">24.0</span> | |
| video, audio = pipe( | |
| conditions=conditions, | |
| prompt=prompt, | |
| negative_prompt=negative_prompt, | |
| width=width, | |
| height=height, | |
| num_frames=<span class="hljs-number">121</span>, | |
| frame_rate=frame_rate, | |
| num_inference_steps=<span class="hljs-number">40</span>, | |
| guidance_scale=<span class="hljs-number">4.0</span>, | |
| generator=generator, | |
| output_type=<span class="hljs-string">"np"</span>, | |
| return_dict=<span class="hljs-literal">False</span>, | |
| ) | |
| encode_video( | |
| video[<span class="hljs-number">0</span>], | |
| fps=frame_rate, | |
| audio=audio[<span class="hljs-number">0</span>].<span class="hljs-built_in">float</span>().cpu(), | |
| audio_sample_rate=pipe.vocoder.config.output_sampling_rate, | |
| output_path=<span class="hljs-string">"ltx2_cond_video.mp4"</span>, | |
| )`,wrap:!1}}),ye=new E({props:{title:"LTX2Pipeline",local:"diffusers.LTX2Pipeline",headingTag:"h2"}}),Je=new j({props:{name:"class diffusers.LTX2Pipeline",anchor:"diffusers.LTX2Pipeline",parameters:[{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKLLTX2Video"},{name:"audio_vae",val:": AutoencoderKLLTX2Audio"},{name:"text_encoder",val:": Gemma3ForConditionalGeneration"},{name:"tokenizer",val:": transformers.models.gemma.tokenization_gemma.GemmaTokenizer | transformers.models.gemma.tokenization_gemma_fast.GemmaTokenizerFast"},{name:"connectors",val:": LTX2TextConnectors"},{name:"transformer",val:": LTX2VideoTransformer3DModel"},{name:"vocoder",val:": diffusers.pipelines.ltx2.vocoder.LTX2Vocoder | diffusers.pipelines.ltx2.vocoder.LTX2VocoderWithBWE"},{name:"processor",val:": transformers.models.gemma3.processing_gemma3.Gemma3Processor | None = None"}],parametersDescription:[{anchor:"diffusers.LTX2Pipeline.transformer",description:`<strong>transformer</strong> (<a href="/docs/diffusers/pr_13331/en/api/models/ltx_video_transformer3d#diffusers.LTXVideoTransformer3DModel">LTXVideoTransformer3DModel</a>) — | |
| Conditional Transformer architecture to denoise the encoded video latents.`,name:"transformer"},{anchor:"diffusers.LTX2Pipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_13331/en/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler">FlowMatchEulerDiscreteScheduler</a>) — | |
| A scheduler to be used in combination with <code>transformer</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.LTX2Pipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_13331/en/api/models/autoencoderkl_ltx_video#diffusers.AutoencoderKLLTXVideo">AutoencoderKLLTXVideo</a>) — | |
| Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.LTX2Pipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>T5EncoderModel</code>) — | |
| <a href="https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5EncoderModel" rel="nofollow">T5</a>, specifically | |
| the <a href="https://huggingface.co/google/t5-v1_1-xxl" rel="nofollow">google/t5-v1_1-xxl</a> variant.`,name:"text_encoder"},{anchor:"diffusers.LTX2Pipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) — | |
| Tokenizer of class | |
| <a href="https://huggingface.co/docs/transformers/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.LTX2Pipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>T5TokenizerFast</code>) — | |
| Second Tokenizer of class | |
| <a href="https://huggingface.co/docs/transformers/en/model_doc/t5#transformers.T5TokenizerFast" rel="nofollow">T5TokenizerFast</a>.`,name:"tokenizer"},{anchor:"diffusers.LTX2Pipeline.connectors",description:`<strong>connectors</strong> (<code>LTX2TextConnectors</code>) — | |
| Text connector stack used to adapt text encoder hidden states for the video and audio branches.`,name:"connectors"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2.py#L185"}}),we=new j({props:{name:"__call__",anchor:"diffusers.LTX2Pipeline.__call__",parameters:[{name:"prompt",val:": str | list[str] = None"},{name:"negative_prompt",val:": str | list[str] | None = None"},{name:"height",val:": int = 512"},{name:"width",val:": int = 768"},{name:"num_frames",val:": int = 121"},{name:"frame_rate",val:": float = 24.0"},{name:"num_inference_steps",val:": int = 40"},{name:"sigmas",val:": list[float] | None = None"},{name:"timesteps",val:": list = None"},{name:"guidance_scale",val:": float = 4.0"},{name:"stg_scale",val:": float = 0.0"},{name:"modality_scale",val:": float = 1.0"},{name:"guidance_rescale",val:": float = 0.0"},{name:"audio_guidance_scale",val:": float | None = None"},{name:"audio_stg_scale",val:": float | None = None"},{name:"audio_modality_scale",val:": float | None = None"},{name:"audio_guidance_rescale",val:": float | None = None"},{name:"spatio_temporal_guidance_blocks",val:": list[int] | None = None"},{name:"noise_scale",val:": float = 0.0"},{name:"num_videos_per_prompt",val:": int = 1"},{name:"generator",val:": torch._C.Generator | list[torch._C.Generator] | None = None"},{name:"latents",val:": torch.Tensor | None = None"},{name:"audio_latents",val:": torch.Tensor | None = None"},{name:"prompt_embeds",val:": torch.Tensor | None = None"},{name:"prompt_attention_mask",val:": torch.Tensor | None = None"},{name:"negative_prompt_embeds",val:": torch.Tensor | None = None"},{name:"negative_prompt_attention_mask",val:": torch.Tensor | None = None"},{name:"decode_timestep",val:": float | list[float] = 0.0"},{name:"decode_noise_scale",val:": float | list[float] | None = None"},{name:"use_cross_timestep",val:": bool = False"},{name:"system_prompt",val:": str | None = None"},{name:"prompt_max_new_tokens",val:": int = 512"},{name:"prompt_enhancement_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"prompt_enhancement_seed",val:": int = 10"},{name:"output_type",val:": str = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"attention_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": list = ['latents']"},{name:"max_sequence_length",val:": int = 1024"}],parametersDescription:[{anchor:"diffusers.LTX2Pipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| 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.LTX2Pipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>512</code>) — | |
| The height in pixels of the generated image. This is set to 480 by default for the best results.`,name:"height"},{anchor:"diffusers.LTX2Pipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>768</code>) — | |
| The width in pixels of the generated image. This is set to 848 by default for the best results.`,name:"width"},{anchor:"diffusers.LTX2Pipeline.__call__.num_frames",description:`<strong>num_frames</strong> (<code>int</code>, <em>optional</em>, defaults to <code>121</code>) — | |
| The number of video frames to generate`,name:"num_frames"},{anchor:"diffusers.LTX2Pipeline.__call__.frame_rate",description:`<strong>frame_rate</strong> (<code>float</code>, <em>optional</em>, defaults to <code>24.0</code>) — | |
| The frames per second (FPS) of the generated video.`,name:"frame_rate"},{anchor:"diffusers.LTX2Pipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 40) — | |
| 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.LTX2Pipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>List[float]</code>, <em>optional</em>) — | |
| 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.LTX2Pipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>list[int]</code>, <em>optional</em>) — | |
| Custom timesteps to use for the denoising process with schedulers which support a <code>timesteps</code> argument | |
| in their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is | |
| passed will be used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.LTX2Pipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>4.0</code>) — | |
| 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 > 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. Used for the video modality (there is | |
| a separate value <code>audio_guidance_scale</code> for the audio modality).`,name:"guidance_scale"},{anchor:"diffusers.LTX2Pipeline.__call__.stg_scale",description:`<strong>stg_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>0.0</code>) — | |
| Video guidance scale for Spatio-Temporal Guidance (STG), proposed in <a href="https://arxiv.org/abs/2411.18664" rel="nofollow">Spatiotemporal Skip Guidance for | |
| Enhanced Video Diffusion Sampling</a>. STG uses a CFG-like estimate | |
| where we move the sample away from a weak sample from a perturbed version of the denoising model. | |
| Enabling STG will result in an additional denoising model forward pass; the default value of <code>0.0</code> | |
| means that STG is disabled.`,name:"stg_scale"},{anchor:"diffusers.LTX2Pipeline.__call__.modality_scale",description:`<strong>modality_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1.0</code>) — | |
| Video guidance scale for LTX-2.X modality isolation guidance, where we move the sample away from a | |
| weaker sample generated by the denoising model withy cross-modality (audio-to-video and video-to-audio) | |
| cross attention disabled using a CFG-like estimate. Enabling modality guidance will result in an | |
| additional denoising model forward pass; the default value of <code>1.0</code> means that modality guidance is | |
| disabled.`,name:"modality_scale"},{anchor:"diffusers.LTX2Pipeline.__call__.guidance_rescale",description:`<strong>guidance_rescale</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| Guidance rescale factor proposed by <a href="https://huggingface.co/papers/2305.08891" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are | |
| Flawed</a> <code>guidance_scale</code> is defined as <code>φ</code> in equation 16. of | |
| <a href="https://huggingface.co/papers/2305.08891" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are | |
| Flawed</a>. Guidance rescale factor should fix overexposure when | |
| using zero terminal SNR. Used for the video modality.`,name:"guidance_rescale"},{anchor:"diffusers.LTX2Pipeline.__call__.audio_guidance_scale",description:`<strong>audio_guidance_scale</strong> (<code>float</code>, <em>optional</em> defaults to <code>None</code>) — | |
| Audio guidance scale for CFG with respect to the negative prompt. The CFG update rule is the same for | |
| video and audio, but they can use different values for the guidance scale. The LTX-2.X authors suggest | |
| that the <code>audio_guidance_scale</code> should be higher relative to the video <code>guidance_scale</code> (e.g. for | |
| LTX-2.3 they suggest 3.0 for video and 7.0 for audio). If <code>None</code>, defaults to the video value | |
| <code>guidance_scale</code>.`,name:"audio_guidance_scale"},{anchor:"diffusers.LTX2Pipeline.__call__.audio_stg_scale",description:`<strong>audio_stg_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| Audio guidance scale for STG. As with CFG, the STG update rule is otherwise the same for video and | |
| audio. For LTX-2.3, a value of 1.0 is suggested for both video and audio. If <code>None</code>, defaults to the | |
| video value <code>stg_scale</code>.`,name:"audio_stg_scale"},{anchor:"diffusers.LTX2Pipeline.__call__.audio_modality_scale",description:`<strong>audio_modality_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| Audio guidance scale for LTX-2.X modality isolation guidance. As with CFG, the modality guidance rule | |
| is otherwise the same for video and audio. For LTX-2.3, a value of 3.0 is suggested for both video and | |
| audio. If <code>None</code>, defaults to the video value <code>modality_scale</code>.`,name:"audio_modality_scale"},{anchor:"diffusers.LTX2Pipeline.__call__.audio_guidance_rescale",description:`<strong>audio_guidance_rescale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| A separate guidance rescale factor for the audio modality. If <code>None</code>, defaults to the video value | |
| <code>guidance_rescale</code>.`,name:"audio_guidance_rescale"},{anchor:"diffusers.LTX2Pipeline.__call__.spatio_temporal_guidance_blocks",description:`<strong>spatio_temporal_guidance_blocks</strong> (<code>list[int]</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| The zero-indexed transformer block indices at which to apply STG. Must be supplied if STG is used | |
| (<code>stg_scale</code> or <code>audio_stg_scale</code> is greater than <code>0</code>). A value of <code>[29]</code> is recommended for LTX-2.0 | |
| and <code>[28]</code> is recommended for LTX-2.3.`,name:"spatio_temporal_guidance_blocks"},{anchor:"diffusers.LTX2Pipeline.__call__.noise_scale",description:`<strong>noise_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>0.0</code>) — | |
| The interpolation factor between random noise and denoised latents at each timestep. Applying noise to | |
| the <code>latents</code> and <code>audio_latents</code> before continue denoising.`,name:"noise_scale"},{anchor:"diffusers.LTX2Pipeline.__call__.num_videos_per_prompt",description:`<strong>num_videos_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of videos to generate per prompt.`,name:"num_videos_per_prompt"},{anchor:"diffusers.LTX2Pipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>list[torch.Generator]</code>, <em>optional</em>) — | |
| One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a> | |
| to make generation deterministic.`,name:"generator"},{anchor:"diffusers.LTX2Pipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for video | |
| generation. Can be used to tweak the same generation with different prompts. If not provided, a latents | |
| tensor will be generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.LTX2Pipeline.__call__.audio_latents",description:`<strong>audio_latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for audio | |
| generation. Can be used to tweak the same generation with different prompts. If not provided, a latents | |
| tensor will be generated by sampling using the supplied random <code>generator</code>.`,name:"audio_latents"},{anchor:"diffusers.LTX2Pipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not | |
| provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.LTX2Pipeline.__call__.prompt_attention_mask",description:`<strong>prompt_attention_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated attention mask for text embeddings.`,name:"prompt_attention_mask"},{anchor:"diffusers.LTX2Pipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| Pre-generated negative text embeddings. For PixArt-Sigma this negative prompt should be "". If not | |
| provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.LTX2Pipeline.__call__.negative_prompt_attention_mask",description:`<strong>negative_prompt_attention_mask</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| Pre-generated attention mask for negative text embeddings.`,name:"negative_prompt_attention_mask"},{anchor:"diffusers.LTX2Pipeline.__call__.decode_timestep",description:`<strong>decode_timestep</strong> (<code>float</code>, defaults to <code>0.0</code>) — | |
| The timestep at which generated video is decoded.`,name:"decode_timestep"},{anchor:"diffusers.LTX2Pipeline.__call__.decode_noise_scale",description:`<strong>decode_noise_scale</strong> (<code>float</code>, defaults to <code>None</code>) — | |
| The interpolation factor between random noise and denoised latents at the decode timestep.`,name:"decode_noise_scale"},{anchor:"diffusers.LTX2Pipeline.__call__.use_cross_timestep",description:`<strong>use_cross_timestep</strong> (<code>bool</code> <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to use the cross modality (audio is the cross modality of video, and vice versa) sigma when | |
| calculating the cross attention modulation parameters. <code>True</code> is the newer (e.g. LTX-2.3) behavior; | |
| <code>False</code> is the legacy LTX-2.0 behavior.`,name:"use_cross_timestep"},{anchor:"diffusers.LTX2Pipeline.__call__.system_prompt",description:`<strong>system_prompt</strong> (<code>str</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| Optional system prompt to use for prompt enhancement. The system prompt will be used by the current | |
| text encoder (by default, a <code>Gemma3ForConditionalGeneration</code> model) to generate an enhanced prompt from | |
| the original <code>prompt</code> to condition generation. If not supplied, prompt enhancement will not be | |
| performed.`,name:"system_prompt"},{anchor:"diffusers.LTX2Pipeline.__call__.prompt_max_new_tokens",description:`<strong>prompt_max_new_tokens</strong> (<code>int</code>, <em>optional</em>, defaults to <code>512</code>) — | |
| The maximum number of new tokens to generate when performing prompt enhancement.`,name:"prompt_max_new_tokens"},{anchor:"diffusers.LTX2Pipeline.__call__.prompt_enhancement_kwargs",description:`<strong>prompt_enhancement_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| Keyword arguments for <code>self.text_encoder.generate</code>. If not supplied, default arguments of | |
| <code>do_sample=True</code> and <code>temperature=0.7</code> will be used. See | |
| <a href="https://huggingface.co/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate" rel="nofollow">https://huggingface.co/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate</a> | |
| for more details.`,name:"prompt_enhancement_kwargs"},{anchor:"diffusers.LTX2Pipeline.__call__.prompt_enhancement_seed",description:`<strong>prompt_enhancement_seed</strong> (<code>int</code>, <em>optional</em>, default to <code>10</code>) — | |
| Random seed for any random operations during prompt enhancement.`,name:"prompt_enhancement_seed"},{anchor:"diffusers.LTX2Pipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| The output format of the generate image. Choose between | |
| <a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.LTX2Pipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <code>~pipelines.ltx.LTX2PipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.LTX2Pipeline.__call__.attention_kwargs",description:`<strong>attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) — | |
| 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.LTX2Pipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) — | |
| A function that calls at the end of each denoising steps during the inference. The function is called | |
| with the following arguments: <code>callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)</code>. <code>callback_kwargs</code> will include a list of all tensors as specified by | |
| <code>callback_on_step_end_tensor_inputs</code>.`,name:"callback_on_step_end"},{anchor:"diffusers.LTX2Pipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>, defaults to <code>["latents"]</code>) — | |
| The list of tensor inputs for the <code>callback_on_step_end</code> function. The tensors specified in the list | |
| will be passed as <code>callback_kwargs</code> argument. You will only be able to include variables listed in the | |
| <code>._callback_tensor_inputs</code> attribute of your pipeline class.`,name:"callback_on_step_end_tensor_inputs"},{anchor:"diffusers.LTX2Pipeline.__call__.max_sequence_length",description:`<strong>max_sequence_length</strong> (<code>int</code>, <em>optional</em>, defaults to <code>1024</code>) — | |
| Maximum sequence length to use with the <code>prompt</code>.`,name:"max_sequence_length"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2.py#L808",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>If <code>return_dict</code> is <code>True</code>, <code>~pipelines.ltx.LTX2PipelineOutput</code> is returned, otherwise a <code>tuple</code> is | |
| returned where the first element is a list with the generated images.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>~pipelines.ltx.LTX2PipelineOutput</code> or <code>tuple</code></p> | |
| `}}),Q=new ln({props:{anchor:"diffusers.LTX2Pipeline.__call__.example",$$slots:{default:[Ns]},$$scope:{ctx:V}}}),be=new j({props:{name:"encode_prompt",anchor:"diffusers.LTX2Pipeline.encode_prompt",parameters:[{name:"prompt",val:": str | list[str]"},{name:"negative_prompt",val:": str | list[str] | None = None"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"num_videos_per_prompt",val:": int = 1"},{name:"prompt_embeds",val:": torch.Tensor | None = None"},{name:"negative_prompt_embeds",val:": torch.Tensor | None = None"},{name:"prompt_attention_mask",val:": torch.Tensor | None = None"},{name:"negative_prompt_attention_mask",val:": torch.Tensor | None = None"},{name:"max_sequence_length",val:": int = 1024"},{name:"scale_factor",val:": int = 8"},{name:"device",val:": torch.device | None = None"},{name:"dtype",val:": torch.dtype | None = None"}],parametersDescription:[{anchor:"diffusers.LTX2Pipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| prompt to be encoded`,name:"prompt"},{anchor:"diffusers.LTX2Pipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation. If not defined, one has to pass | |
| <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is | |
| less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.LTX2Pipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to use classifier free guidance or not.`,name:"do_classifier_free_guidance"},{anchor:"diffusers.LTX2Pipeline.encode_prompt.num_videos_per_prompt",description:`<strong>num_videos_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| Number of videos that should be generated per prompt. torch device to place the resulting embeddings on`,name:"num_videos_per_prompt"},{anchor:"diffusers.LTX2Pipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not | |
| provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.LTX2Pipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| 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.LTX2Pipeline.encode_prompt.device",description:`<strong>device</strong> — (<code>torch.device</code>, <em>optional</em>): | |
| torch device`,name:"device"},{anchor:"diffusers.LTX2Pipeline.encode_prompt.dtype",description:`<strong>dtype</strong> — (<code>torch.dtype</code>, <em>optional</em>): | |
| torch dtype`,name:"dtype"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2.py#L337"}}),Ue=new j({props:{name:"enhance_prompt",anchor:"diffusers.LTX2Pipeline.enhance_prompt",parameters:[{name:"prompt",val:": str"},{name:"system_prompt",val:": str"},{name:"max_new_tokens",val:": int = 512"},{name:"seed",val:": int = 10"},{name:"generator",val:": torch._C.Generator | None = None"},{name:"generation_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"device",val:": str | torch.device | None = None"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2.py#L423"}}),ve=new E({props:{title:"LTX2ImageToVideoPipeline",local:"diffusers.LTX2ImageToVideoPipeline",headingTag:"h2"}}),je=new j({props:{name:"class diffusers.LTX2ImageToVideoPipeline",anchor:"diffusers.LTX2ImageToVideoPipeline",parameters:[{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKLLTX2Video"},{name:"audio_vae",val:": AutoencoderKLLTX2Audio"},{name:"text_encoder",val:": Gemma3ForConditionalGeneration"},{name:"tokenizer",val:": transformers.models.gemma.tokenization_gemma.GemmaTokenizer | transformers.models.gemma.tokenization_gemma_fast.GemmaTokenizerFast"},{name:"connectors",val:": LTX2TextConnectors"},{name:"transformer",val:": LTX2VideoTransformer3DModel"},{name:"vocoder",val:": diffusers.pipelines.ltx2.vocoder.LTX2Vocoder | diffusers.pipelines.ltx2.vocoder.LTX2VocoderWithBWE"},{name:"processor",val:": transformers.models.gemma3.processing_gemma3.Gemma3Processor | None = None"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py#L205"}}),Ze=new j({props:{name:"__call__",anchor:"diffusers.LTX2ImageToVideoPipeline.__call__",parameters:[{name:"image",val:": PIL.Image.Image | numpy.ndarray | torch.Tensor | list[PIL.Image.Image] | list[numpy.ndarray] | list[torch.Tensor] = None"},{name:"prompt",val:": str | list[str] = None"},{name:"negative_prompt",val:": str | list[str] | None = None"},{name:"height",val:": int = 512"},{name:"width",val:": int = 768"},{name:"num_frames",val:": int = 121"},{name:"frame_rate",val:": float = 24.0"},{name:"num_inference_steps",val:": int = 40"},{name:"sigmas",val:": list[float] | None = None"},{name:"timesteps",val:": list[int] | None = None"},{name:"guidance_scale",val:": float = 4.0"},{name:"stg_scale",val:": float = 0.0"},{name:"modality_scale",val:": float = 1.0"},{name:"guidance_rescale",val:": float = 0.0"},{name:"audio_guidance_scale",val:": float | None = None"},{name:"audio_stg_scale",val:": float | None = None"},{name:"audio_modality_scale",val:": float | None = None"},{name:"audio_guidance_rescale",val:": float | None = None"},{name:"spatio_temporal_guidance_blocks",val:": list[int] | None = None"},{name:"noise_scale",val:": float = 0.0"},{name:"num_videos_per_prompt",val:": int = 1"},{name:"generator",val:": torch._C.Generator | list[torch._C.Generator] | None = None"},{name:"latents",val:": torch.Tensor | None = None"},{name:"audio_latents",val:": torch.Tensor | None = None"},{name:"prompt_embeds",val:": torch.Tensor | None = None"},{name:"prompt_attention_mask",val:": torch.Tensor | None = None"},{name:"negative_prompt_embeds",val:": torch.Tensor | None = None"},{name:"negative_prompt_attention_mask",val:": torch.Tensor | None = None"},{name:"decode_timestep",val:": float | list[float] = 0.0"},{name:"decode_noise_scale",val:": float | list[float] | None = None"},{name:"use_cross_timestep",val:": bool = False"},{name:"system_prompt",val:": str | None = None"},{name:"prompt_max_new_tokens",val:": int = 512"},{name:"prompt_enhancement_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"prompt_enhancement_seed",val:": int = 10"},{name:"output_type",val:": str = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"attention_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": list = ['latents']"},{name:"max_sequence_length",val:": int = 1024"}],parametersDescription:[{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.image",description:`<strong>image</strong> (<code>PipelineImageInput</code>) — | |
| The input image to condition the generation on. Must be an image, a list of images or a <code>torch.Tensor</code>.`,name:"image"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| 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.LTX2ImageToVideoPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>512</code>) — | |
| The height in pixels of the generated image. This is set to 480 by default for the best results.`,name:"height"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>768</code>) — | |
| The width in pixels of the generated image. This is set to 848 by default for the best results.`,name:"width"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.num_frames",description:`<strong>num_frames</strong> (<code>int</code>, <em>optional</em>, defaults to <code>121</code>) — | |
| The number of video frames to generate`,name:"num_frames"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.frame_rate",description:`<strong>frame_rate</strong> (<code>float</code>, <em>optional</em>, defaults to <code>24.0</code>) — | |
| The frames per second (FPS) of the generated video.`,name:"frame_rate"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 40) — | |
| 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.LTX2ImageToVideoPipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>List[float]</code>, <em>optional</em>) — | |
| 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.LTX2ImageToVideoPipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>List[int]</code>, <em>optional</em>) — | |
| Custom timesteps to use for the denoising process with schedulers which support a <code>timesteps</code> argument | |
| in their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is | |
| passed will be used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>4.0</code>) — | |
| 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 > 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. Used for the video modality (there is | |
| a separate value <code>audio_guidance_scale</code> for the audio modality).`,name:"guidance_scale"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.stg_scale",description:`<strong>stg_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>0.0</code>) — | |
| Video guidance scale for Spatio-Temporal Guidance (STG), proposed in <a href="https://arxiv.org/abs/2411.18664" rel="nofollow">Spatiotemporal Skip Guidance for | |
| Enhanced Video Diffusion Sampling</a>. STG uses a CFG-like estimate | |
| where we move the sample away from a weak sample from a perturbed version of the denoising model. | |
| Enabling STG will result in an additional denoising model forward pass; the default value of <code>0.0</code> | |
| means that STG is disabled.`,name:"stg_scale"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.modality_scale",description:`<strong>modality_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1.0</code>) — | |
| Video guidance scale for LTX-2.X modality isolation guidance, where we move the sample away from a | |
| weaker sample generated by the denoising model withy cross-modality (audio-to-video and video-to-audio) | |
| cross attention disabled using a CFG-like estimate. Enabling modality guidance will result in an | |
| additional denoising model forward pass; the default value of <code>1.0</code> means that modality guidance is | |
| disabled.`,name:"modality_scale"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.guidance_rescale",description:`<strong>guidance_rescale</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| Guidance rescale factor proposed by <a href="https://huggingface.co/papers/2305.08891" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are | |
| Flawed</a> <code>guidance_scale</code> is defined as <code>φ</code> in equation 16. of | |
| <a href="https://huggingface.co/papers/2305.08891" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are | |
| Flawed</a>. Guidance rescale factor should fix overexposure when | |
| using zero terminal SNR. Used for the video modality.`,name:"guidance_rescale"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.audio_guidance_scale",description:`<strong>audio_guidance_scale</strong> (<code>float</code>, <em>optional</em> defaults to <code>None</code>) — | |
| Audio guidance scale for CFG with respect to the negative prompt. The CFG update rule is the same for | |
| video and audio, but they can use different values for the guidance scale. The LTX-2.X authors suggest | |
| that the <code>audio_guidance_scale</code> should be higher relative to the video <code>guidance_scale</code> (e.g. for | |
| LTX-2.3 they suggest 3.0 for video and 7.0 for audio). If <code>None</code>, defaults to the video value | |
| <code>guidance_scale</code>.`,name:"audio_guidance_scale"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.audio_stg_scale",description:`<strong>audio_stg_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| Audio guidance scale for STG. As with CFG, the STG update rule is otherwise the same for video and | |
| audio. For LTX-2.3, a value of 1.0 is suggested for both video and audio. If <code>None</code>, defaults to the | |
| video value <code>stg_scale</code>.`,name:"audio_stg_scale"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.audio_modality_scale",description:`<strong>audio_modality_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| Audio guidance scale for LTX-2.X modality isolation guidance. As with CFG, the modality guidance rule | |
| is otherwise the same for video and audio. For LTX-2.3, a value of 3.0 is suggested for both video and | |
| audio. If <code>None</code>, defaults to the video value <code>modality_scale</code>.`,name:"audio_modality_scale"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.audio_guidance_rescale",description:`<strong>audio_guidance_rescale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| A separate guidance rescale factor for the audio modality. If <code>None</code>, defaults to the video value | |
| <code>guidance_rescale</code>.`,name:"audio_guidance_rescale"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.spatio_temporal_guidance_blocks",description:`<strong>spatio_temporal_guidance_blocks</strong> (<code>list[int]</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| The zero-indexed transformer block indices at which to apply STG. Must be supplied if STG is used | |
| (<code>stg_scale</code> or <code>audio_stg_scale</code> is greater than <code>0</code>). A value of <code>[29]</code> is recommended for LTX-2.0 | |
| and <code>[28]</code> is recommended for LTX-2.3.`,name:"spatio_temporal_guidance_blocks"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.noise_scale",description:`<strong>noise_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>0.0</code>) — | |
| The interpolation factor between random noise and denoised latents at each timestep. Applying noise to | |
| the <code>latents</code> and <code>audio_latents</code> before continue denoising.`,name:"noise_scale"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.num_videos_per_prompt",description:`<strong>num_videos_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of videos to generate per prompt.`,name:"num_videos_per_prompt"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>list[torch.Generator]</code>, <em>optional</em>) — | |
| One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a> | |
| to make generation deterministic.`,name:"generator"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for video | |
| generation. Can be used to tweak the same generation with different prompts. If not provided, a latents | |
| tensor will be generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.audio_latents",description:`<strong>audio_latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for audio | |
| generation. Can be used to tweak the same generation with different prompts. If not provided, a latents | |
| tensor will be generated by sampling using the supplied random <code>generator</code>.`,name:"audio_latents"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not | |
| provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.prompt_attention_mask",description:`<strong>prompt_attention_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated attention mask for text embeddings.`,name:"prompt_attention_mask"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| Pre-generated negative text embeddings. For PixArt-Sigma this negative prompt should be "". If not | |
| provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.negative_prompt_attention_mask",description:`<strong>negative_prompt_attention_mask</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| Pre-generated attention mask for negative text embeddings.`,name:"negative_prompt_attention_mask"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.decode_timestep",description:`<strong>decode_timestep</strong> (<code>float</code>, defaults to <code>0.0</code>) — | |
| The timestep at which generated video is decoded.`,name:"decode_timestep"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.decode_noise_scale",description:`<strong>decode_noise_scale</strong> (<code>float</code>, defaults to <code>None</code>) — | |
| The interpolation factor between random noise and denoised latents at the decode timestep.`,name:"decode_noise_scale"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.use_cross_timestep",description:`<strong>use_cross_timestep</strong> (<code>bool</code> <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to use the cross modality (audio is the cross modality of video, and vice versa) sigma when | |
| calculating the cross attention modulation parameters. <code>True</code> is the newer (e.g. LTX-2.3) behavior; | |
| <code>False</code> is the legacy LTX-2.0 behavior.`,name:"use_cross_timestep"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.system_prompt",description:`<strong>system_prompt</strong> (<code>str</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| Optional system prompt to use for prompt enhancement. The system prompt will be used by the current | |
| text encoder (by default, a <code>Gemma3ForConditionalGeneration</code> model) to generate an enhanced prompt from | |
| the original <code>prompt</code> to condition generation. If not supplied, prompt enhancement will not be | |
| performed.`,name:"system_prompt"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.prompt_max_new_tokens",description:`<strong>prompt_max_new_tokens</strong> (<code>int</code>, <em>optional</em>, defaults to <code>512</code>) — | |
| The maximum number of new tokens to generate when performing prompt enhancement.`,name:"prompt_max_new_tokens"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.prompt_enhancement_kwargs",description:`<strong>prompt_enhancement_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| Keyword arguments for <code>self.text_encoder.generate</code>. If not supplied, default arguments of | |
| <code>do_sample=True</code> and <code>temperature=0.7</code> will be used. See | |
| <a href="https://huggingface.co/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate" rel="nofollow">https://huggingface.co/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate</a> | |
| for more details.`,name:"prompt_enhancement_kwargs"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.prompt_enhancement_seed",description:`<strong>prompt_enhancement_seed</strong> (<code>int</code>, <em>optional</em>, default to <code>10</code>) — | |
| Random seed for any random operations during prompt enhancement.`,name:"prompt_enhancement_seed"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| The output format of the generate image. Choose between | |
| <a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <code>~pipelines.ltx.LTX2PipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.attention_kwargs",description:`<strong>attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) — | |
| 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.LTX2ImageToVideoPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) — | |
| A function that calls at the end of each denoising steps during the inference. The function is called | |
| with the following arguments: <code>callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)</code>. <code>callback_kwargs</code> will include a list of all tensors as specified by | |
| <code>callback_on_step_end_tensor_inputs</code>.`,name:"callback_on_step_end"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) — | |
| The list of tensor inputs for the <code>callback_on_step_end</code> function. The tensors specified in the list | |
| will be passed as <code>callback_kwargs</code> argument. You will only be able to include variables listed in the | |
| <code>._callback_tensor_inputs</code> attribute of your pipeline class.`,name:"callback_on_step_end_tensor_inputs"},{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.max_sequence_length",description:`<strong>max_sequence_length</strong> (<code>int</code>, <em>optional</em>, defaults to <code>1024</code>) — | |
| Maximum sequence length to use with the <code>prompt</code>.`,name:"max_sequence_length"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py#L868",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>If <code>return_dict</code> is <code>True</code>, <code>~pipelines.ltx.LTX2PipelineOutput</code> is returned, otherwise a <code>tuple</code> is | |
| returned where the first element is a list with the generated images.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>~pipelines.ltx.LTX2PipelineOutput</code> or <code>tuple</code></p> | |
| `}}),A=new ln({props:{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.example",$$slots:{default:[Ls]},$$scope:{ctx:V}}}),Ie=new j({props:{name:"encode_prompt",anchor:"diffusers.LTX2ImageToVideoPipeline.encode_prompt",parameters:[{name:"prompt",val:": str | list[str]"},{name:"negative_prompt",val:": str | list[str] | None = None"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"num_videos_per_prompt",val:": int = 1"},{name:"prompt_embeds",val:": torch.Tensor | None = None"},{name:"negative_prompt_embeds",val:": torch.Tensor | None = None"},{name:"prompt_attention_mask",val:": torch.Tensor | None = None"},{name:"negative_prompt_attention_mask",val:": torch.Tensor | None = None"},{name:"max_sequence_length",val:": int = 1024"},{name:"scale_factor",val:": int = 8"},{name:"device",val:": torch.device | None = None"},{name:"dtype",val:": torch.dtype | None = None"}],parametersDescription:[{anchor:"diffusers.LTX2ImageToVideoPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| prompt to be encoded`,name:"prompt"},{anchor:"diffusers.LTX2ImageToVideoPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation. If not defined, one has to pass | |
| <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is | |
| less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.LTX2ImageToVideoPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to use classifier free guidance or not.`,name:"do_classifier_free_guidance"},{anchor:"diffusers.LTX2ImageToVideoPipeline.encode_prompt.num_videos_per_prompt",description:`<strong>num_videos_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| Number of videos that should be generated per prompt. torch device to place the resulting embeddings on`,name:"num_videos_per_prompt"},{anchor:"diffusers.LTX2ImageToVideoPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not | |
| provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.LTX2ImageToVideoPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| 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.LTX2ImageToVideoPipeline.encode_prompt.device",description:`<strong>device</strong> — (<code>torch.device</code>, <em>optional</em>): | |
| torch device`,name:"device"},{anchor:"diffusers.LTX2ImageToVideoPipeline.encode_prompt.dtype",description:`<strong>dtype</strong> — (<code>torch.dtype</code>, <em>optional</em>): | |
| torch dtype`,name:"dtype"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py#L342"}}),Xe=new j({props:{name:"enhance_prompt",anchor:"diffusers.LTX2ImageToVideoPipeline.enhance_prompt",parameters:[{name:"image",val:": PIL.Image.Image | numpy.ndarray | torch.Tensor | list[PIL.Image.Image] | list[numpy.ndarray] | list[torch.Tensor]"},{name:"prompt",val:": str"},{name:"system_prompt",val:": str"},{name:"max_new_tokens",val:": int = 512"},{name:"seed",val:": int = 10"},{name:"generator",val:": torch._C.Generator | None = None"},{name:"generation_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"device",val:": str | torch.device | None = None"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py#L428"}}),Ge=new E({props:{title:"LTX2ConditionPipeline",local:"diffusers.LTX2ConditionPipeline",headingTag:"h2"}}),xe=new j({props:{name:"class diffusers.LTX2ConditionPipeline",anchor:"diffusers.LTX2ConditionPipeline",parameters:[{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKLLTX2Video"},{name:"audio_vae",val:": AutoencoderKLLTX2Audio"},{name:"text_encoder",val:": Gemma3ForConditionalGeneration"},{name:"tokenizer",val:": transformers.models.gemma.tokenization_gemma.GemmaTokenizer | transformers.models.gemma.tokenization_gemma_fast.GemmaTokenizerFast"},{name:"connectors",val:": LTX2TextConnectors"},{name:"transformer",val:": LTX2VideoTransformer3DModel"},{name:"vocoder",val:": diffusers.pipelines.ltx2.vocoder.LTX2Vocoder | diffusers.pipelines.ltx2.vocoder.LTX2VocoderWithBWE"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py#L235"}}),Be=new j({props:{name:"__call__",anchor:"diffusers.LTX2ConditionPipeline.__call__",parameters:[{name:"conditions",val:": diffusers.pipelines.ltx2.pipeline_ltx2_condition.LTX2VideoCondition | list[diffusers.pipelines.ltx2.pipeline_ltx2_condition.LTX2VideoCondition] | None = None"},{name:"prompt",val:": str | list[str] = None"},{name:"negative_prompt",val:": str | list[str] | None = None"},{name:"height",val:": int = 512"},{name:"width",val:": int = 768"},{name:"num_frames",val:": int = 121"},{name:"frame_rate",val:": float = 24.0"},{name:"num_inference_steps",val:": int = 40"},{name:"sigmas",val:": list[float] | None = None"},{name:"timesteps",val:": list[float] | None = None"},{name:"guidance_scale",val:": float = 4.0"},{name:"stg_scale",val:": float = 0.0"},{name:"modality_scale",val:": float = 1.0"},{name:"guidance_rescale",val:": float = 0.0"},{name:"audio_guidance_scale",val:": float | None = None"},{name:"audio_stg_scale",val:": float | None = None"},{name:"audio_modality_scale",val:": float | None = None"},{name:"audio_guidance_rescale",val:": float | None = None"},{name:"spatio_temporal_guidance_blocks",val:": list[int] | None = None"},{name:"noise_scale",val:": float | None = None"},{name:"num_videos_per_prompt",val:": int | None = 1"},{name:"generator",val:": torch._C.Generator | list[torch._C.Generator] | None = None"},{name:"latents",val:": torch.Tensor | None = None"},{name:"audio_latents",val:": torch.Tensor | None = None"},{name:"prompt_embeds",val:": torch.Tensor | None = None"},{name:"prompt_attention_mask",val:": torch.Tensor | None = None"},{name:"negative_prompt_embeds",val:": torch.Tensor | None = None"},{name:"negative_prompt_attention_mask",val:": torch.Tensor | None = None"},{name:"decode_timestep",val:": float | list[float] = 0.0"},{name:"decode_noise_scale",val:": float | list[float] | None = None"},{name:"use_cross_timestep",val:": bool = False"},{name:"output_type",val:": str = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"attention_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": list = ['latents']"},{name:"max_sequence_length",val:": int = 1024"}],parametersDescription:[{anchor:"diffusers.LTX2ConditionPipeline.__call__.conditions",description:`<strong>conditions</strong> (<code>List[LTXVideoCondition], *optional*</code>) — | |
| The list of frame-conditioning items for the video generation.`,name:"conditions"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| 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.LTX2ConditionPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>512</code>) — | |
| The height in pixels of the generated image. This is set to 480 by default for the best results.`,name:"height"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>768</code>) — | |
| The width in pixels of the generated image. This is set to 848 by default for the best results.`,name:"width"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.num_frames",description:`<strong>num_frames</strong> (<code>int</code>, <em>optional</em>, defaults to <code>121</code>) — | |
| The number of video frames to generate`,name:"num_frames"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.frame_rate",description:`<strong>frame_rate</strong> (<code>float</code>, <em>optional</em>, defaults to <code>24.0</code>) — | |
| The frames per second (FPS) of the generated video.`,name:"frame_rate"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 40) — | |
| 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.LTX2ConditionPipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>List[float]</code>, <em>optional</em>) — | |
| 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.LTX2ConditionPipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>List[int]</code>, <em>optional</em>) — | |
| Custom timesteps to use for the denoising process with schedulers which support a <code>timesteps</code> argument | |
| in their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is | |
| passed will be used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>4.0</code>) — | |
| 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 > 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. Used for the video modality (there is | |
| a separate value <code>audio_guidance_scale</code> for the audio modality).`,name:"guidance_scale"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.stg_scale",description:`<strong>stg_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>0.0</code>) — | |
| Video guidance scale for Spatio-Temporal Guidance (STG), proposed in <a href="https://arxiv.org/abs/2411.18664" rel="nofollow">Spatiotemporal Skip Guidance for | |
| Enhanced Video Diffusion Sampling</a>. STG uses a CFG-like estimate | |
| where we move the sample away from a weak sample from a perturbed version of the denoising model. | |
| Enabling STG will result in an additional denoising model forward pass; the default value of <code>0.0</code> | |
| means that STG is disabled.`,name:"stg_scale"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.modality_scale",description:`<strong>modality_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1.0</code>) — | |
| Video guidance scale for LTX-2.X modality isolation guidance, where we move the sample away from a | |
| weaker sample generated by the denoising model withy cross-modality (audio-to-video and video-to-audio) | |
| cross attention disabled using a CFG-like estimate. Enabling modality guidance will result in an | |
| additional denoising model forward pass; the default value of <code>1.0</code> means that modality guidance is | |
| disabled.`,name:"modality_scale"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.guidance_rescale",description:`<strong>guidance_rescale</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| Guidance rescale factor proposed by <a href="https://huggingface.co/papers/2305.08891" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are | |
| Flawed</a> <code>guidance_scale</code> is defined as <code>φ</code> in equation 16. of | |
| <a href="https://huggingface.co/papers/2305.08891" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are | |
| Flawed</a>. Guidance rescale factor should fix overexposure when | |
| using zero terminal SNR. Used for the video modality.`,name:"guidance_rescale"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.audio_guidance_scale",description:`<strong>audio_guidance_scale</strong> (<code>float</code>, <em>optional</em> defaults to <code>None</code>) — | |
| Audio guidance scale for CFG with respect to the negative prompt. The CFG update rule is the same for | |
| video and audio, but they can use different values for the guidance scale. The LTX-2.X authors suggest | |
| that the <code>audio_guidance_scale</code> should be higher relative to the video <code>guidance_scale</code> (e.g. for | |
| LTX-2.3 they suggest 3.0 for video and 7.0 for audio). If <code>None</code>, defaults to the video value | |
| <code>guidance_scale</code>.`,name:"audio_guidance_scale"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.audio_stg_scale",description:`<strong>audio_stg_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| Audio guidance scale for STG. As with CFG, the STG update rule is otherwise the same for video and | |
| audio. For LTX-2.3, a value of 1.0 is suggested for both video and audio. If <code>None</code>, defaults to the | |
| video value <code>stg_scale</code>.`,name:"audio_stg_scale"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.audio_modality_scale",description:`<strong>audio_modality_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| Audio guidance scale for LTX-2.X modality isolation guidance. As with CFG, the modality guidance rule | |
| is otherwise the same for video and audio. For LTX-2.3, a value of 3.0 is suggested for both video and | |
| audio. If <code>None</code>, defaults to the video value <code>modality_scale</code>.`,name:"audio_modality_scale"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.audio_guidance_rescale",description:`<strong>audio_guidance_rescale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| A separate guidance rescale factor for the audio modality. If <code>None</code>, defaults to the video value | |
| <code>guidance_rescale</code>.`,name:"audio_guidance_rescale"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.spatio_temporal_guidance_blocks",description:`<strong>spatio_temporal_guidance_blocks</strong> (<code>list[int]</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| The zero-indexed transformer block indices at which to apply STG. Must be supplied if STG is used | |
| (<code>stg_scale</code> or <code>audio_stg_scale</code> is greater than <code>0</code>). A value of <code>[29]</code> is recommended for LTX-2.0 | |
| and <code>[28]</code> is recommended for LTX-2.3.`,name:"spatio_temporal_guidance_blocks"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.noise_scale",description:`<strong>noise_scale</strong> (<code>float</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| The interpolation factor between random noise and denoised latents at each timestep. Applying noise to | |
| the <code>latents</code> and <code>audio_latents</code> before continue denoising. If not set, will be inferred from the | |
| sigma schedule.`,name:"noise_scale"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.num_videos_per_prompt",description:`<strong>num_videos_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of videos to generate per prompt.`,name:"num_videos_per_prompt"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) — | |
| One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a> | |
| to make generation deterministic.`,name:"generator"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for video | |
| generation. Can be used to tweak the same generation with different prompts. If not provided, a latents | |
| tensor will be generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.audio_latents",description:`<strong>audio_latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for audio | |
| generation. Can be used to tweak the same generation with different prompts. If not provided, a latents | |
| tensor will be generated by sampling using the supplied random <code>generator</code>.`,name:"audio_latents"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not | |
| provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.prompt_attention_mask",description:`<strong>prompt_attention_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated attention mask for text embeddings.`,name:"prompt_attention_mask"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| Pre-generated negative text embeddings. For PixArt-Sigma this negative prompt should be "". If not | |
| provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.negative_prompt_attention_mask",description:`<strong>negative_prompt_attention_mask</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| Pre-generated attention mask for negative text embeddings.`,name:"negative_prompt_attention_mask"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.decode_timestep",description:`<strong>decode_timestep</strong> (<code>float</code>, defaults to <code>0.0</code>) — | |
| The timestep at which generated video is decoded.`,name:"decode_timestep"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.decode_noise_scale",description:`<strong>decode_noise_scale</strong> (<code>float</code>, defaults to <code>None</code>) — | |
| The interpolation factor between random noise and denoised latents at the decode timestep.`,name:"decode_noise_scale"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.use_cross_timestep",description:`<strong>use_cross_timestep</strong> (<code>bool</code> <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to use the cross modality (audio is the cross modality of video, and vice versa) sigma when | |
| calculating the cross attention modulation parameters. <code>True</code> is the newer (e.g. LTX-2.3) behavior; | |
| <code>False</code> is the legacy LTX-2.0 behavior.`,name:"use_cross_timestep"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| The output format of the generate image. Choose between | |
| <a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <code>~pipelines.ltx.LTX2PipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.attention_kwargs",description:`<strong>attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) — | |
| 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.LTX2ConditionPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) — | |
| A function that calls at the end of each denoising steps during the inference. The function is called | |
| with the following arguments: <code>callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)</code>. <code>callback_kwargs</code> will include a list of all tensors as specified by | |
| <code>callback_on_step_end_tensor_inputs</code>.`,name:"callback_on_step_end"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) — | |
| The list of tensor inputs for the <code>callback_on_step_end</code> function. The tensors specified in the list | |
| will be passed as <code>callback_kwargs</code> argument. You will only be able to include variables listed in the | |
| <code>._callback_tensor_inputs</code> attribute of your pipeline class.`,name:"callback_on_step_end_tensor_inputs"},{anchor:"diffusers.LTX2ConditionPipeline.__call__.max_sequence_length",description:`<strong>max_sequence_length</strong> (<code>int</code>, <em>optional</em>, defaults to <code>1024</code>) — | |
| Maximum sequence length to use with the <code>prompt</code>.`,name:"max_sequence_length"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py#L997",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>If <code>return_dict</code> is <code>True</code>, <code>~pipelines.ltx.LTX2PipelineOutput</code> is returned, otherwise a <code>tuple</code> is | |
| returned where the first element is a list with the generated images.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>~pipelines.ltx.LTX2PipelineOutput</code> or <code>tuple</code></p> | |
| `}}),P=new ln({props:{anchor:"diffusers.LTX2ConditionPipeline.__call__.example",$$slots:{default:[Fs]},$$scope:{ctx:V}}}),Ve=new j({props:{name:"apply_visual_conditioning",anchor:"diffusers.LTX2ConditionPipeline.apply_visual_conditioning",parameters:[{name:"latents",val:": Tensor"},{name:"conditioning_mask",val:": Tensor"},{name:"condition_latents",val:": list"},{name:"condition_strengths",val:": list"},{name:"condition_indices",val:": list"},{name:"latent_height",val:": int"},{name:"latent_width",val:": int"}],parametersDescription:[{anchor:"diffusers.LTX2ConditionPipeline.apply_visual_conditioning.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>) — | |
| Initial packed (patchified) latents of shape [batch_size, patch_seq_len, hidden_dim].`,name:"latents"},{anchor:"diffusers.LTX2ConditionPipeline.apply_visual_conditioning.conditioning_mask",description:`<strong>conditioning_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Initial packed (patchified) conditioning mask of shape [batch_size, patch_seq_len, 1] with values in | |
| [0, 1] where 0 means that the denoising model output will be fully used and 1 means that the condition | |
| will be fully used (with intermediate values specifying a blend of the denoised and latent values).`,name:"conditioning_mask"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py#L756",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>Returns a 3-tuple of tensors where:</p> | |
| <ol> | |
| <li>The first element is the packed video latents (with unchanged shape [batch_size, patch_seq_len, | |
| hidden_dim]) with the conditions applied</li> | |
| <li>The second element is the packed conditioning mask with conditioning strengths applied</li> | |
| <li>The third element holds the clean conditioning latents.</li> | |
| </ol> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>Tuple[torch.Tensor, torch.Tensor, torch.Tensor]</code></p> | |
| `}}),Ce=new j({props:{name:"encode_prompt",anchor:"diffusers.LTX2ConditionPipeline.encode_prompt",parameters:[{name:"prompt",val:": str | list[str]"},{name:"negative_prompt",val:": str | list[str] | None = None"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"num_videos_per_prompt",val:": int = 1"},{name:"prompt_embeds",val:": torch.Tensor | None = None"},{name:"negative_prompt_embeds",val:": torch.Tensor | None = None"},{name:"prompt_attention_mask",val:": torch.Tensor | None = None"},{name:"negative_prompt_attention_mask",val:": torch.Tensor | None = None"},{name:"max_sequence_length",val:": int = 1024"},{name:"scale_factor",val:": int = 8"},{name:"device",val:": torch.device | None = None"},{name:"dtype",val:": torch.dtype | None = None"}],parametersDescription:[{anchor:"diffusers.LTX2ConditionPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| prompt to be encoded`,name:"prompt"},{anchor:"diffusers.LTX2ConditionPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation. If not defined, one has to pass | |
| <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is | |
| less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.LTX2ConditionPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to use classifier free guidance or not.`,name:"do_classifier_free_guidance"},{anchor:"diffusers.LTX2ConditionPipeline.encode_prompt.num_videos_per_prompt",description:`<strong>num_videos_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| Number of videos that should be generated per prompt. torch device to place the resulting embeddings on`,name:"num_videos_per_prompt"},{anchor:"diffusers.LTX2ConditionPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not | |
| provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.LTX2ConditionPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| 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.LTX2ConditionPipeline.encode_prompt.device",description:`<strong>device</strong> — (<code>torch.device</code>, <em>optional</em>): | |
| torch device`,name:"device"},{anchor:"diffusers.LTX2ConditionPipeline.encode_prompt.dtype",description:`<strong>dtype</strong> — (<code>torch.dtype</code>, <em>optional</em>): | |
| torch dtype`,name:"dtype"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py#L369"}}),ke=new j({props:{name:"preprocess_conditions",anchor:"diffusers.LTX2ConditionPipeline.preprocess_conditions",parameters:[{name:"conditions",val:": diffusers.pipelines.ltx2.pipeline_ltx2_condition.LTX2VideoCondition | list[diffusers.pipelines.ltx2.pipeline_ltx2_condition.LTX2VideoCondition] | None = None"},{name:"height",val:": int = 512"},{name:"width",val:": int = 768"},{name:"num_frames",val:": int = 121"},{name:"device",val:": torch.device | None = None"}],parametersDescription:[{anchor:"diffusers.LTX2ConditionPipeline.preprocess_conditions.conditions",description:`<strong>conditions</strong> (<code>LTX2VideoCondition</code> or <code>List[LTX2VideoCondition]</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| A list of image/video condition instances.`,name:"conditions"},{anchor:"diffusers.LTX2ConditionPipeline.preprocess_conditions.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>512</code>) — | |
| The desired height in pixels.`,name:"height"},{anchor:"diffusers.LTX2ConditionPipeline.preprocess_conditions.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>768</code>) — | |
| The desired width in pixels.`,name:"width"},{anchor:"diffusers.LTX2ConditionPipeline.preprocess_conditions.num_frames",description:`<strong>num_frames</strong> (<code>int</code>, <em>optional</em>, defaults to <code>121</code>) — | |
| The desired number of frames in the generated video.`,name:"num_frames"},{anchor:"diffusers.LTX2ConditionPipeline.preprocess_conditions.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| The device on which to put the preprocessed image/video tensors.`,name:"device"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py#L674",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>Returns a 3-tuple of lists of length <code>len(conditions)</code> as follows:</p> | |
| <ol> | |
| <li>The first list is a list of preprocessed video tensors of shape [batch_size=1, num_channels, | |
| num_frames, height, width].</li> | |
| <li>The second list is a list of conditioning strengths.</li> | |
| <li>The third list is a list of indices in latent space to insert the corresponding condition.</li> | |
| </ol> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>Tuple[List[torch.Tensor], List[float], List[int]]</code></p> | |
| `}}),We=new j({props:{name:"trim_conditioning_sequence",anchor:"diffusers.LTX2ConditionPipeline.trim_conditioning_sequence",parameters:[{name:"start_frame",val:": int"},{name:"sequence_num_frames",val:": int"},{name:"target_num_frames",val:": int"}],parametersDescription:[{anchor:"diffusers.LTX2ConditionPipeline.trim_conditioning_sequence.start_frame",description:"<strong>start_frame</strong> (int) — The target frame number of the first frame in the sequence.",name:"start_frame"},{anchor:"diffusers.LTX2ConditionPipeline.trim_conditioning_sequence.sequence_num_frames",description:"<strong>sequence_num_frames</strong> (int) — The number of frames in the sequence.",name:"sequence_num_frames"},{anchor:"diffusers.LTX2ConditionPipeline.trim_conditioning_sequence.target_num_frames",description:"<strong>target_num_frames</strong> (int) — The target number of frames in the generated video.",name:"target_num_frames"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py#L657",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>updated sequence length</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>int</p> | |
| `}}),Re=new E({props:{title:"LTX2LatentUpsamplePipeline",local:"diffusers.LTX2LatentUpsamplePipeline",headingTag:"h2"}}),Ne=new j({props:{name:"class diffusers.LTX2LatentUpsamplePipeline",anchor:"diffusers.LTX2LatentUpsamplePipeline",parameters:[{name:"vae",val:": AutoencoderKLLTX2Video"},{name:"latent_upsampler",val:": LTX2LatentUpsamplerModel"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2_latent_upsample.py#L104"}}),Le=new j({props:{name:"__call__",anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__",parameters:[{name:"video",val:": list[PIL.Image.Image | numpy.ndarray | torch.Tensor | list[PIL.Image.Image] | list[numpy.ndarray] | list[torch.Tensor]] | None = None"},{name:"height",val:": int = 512"},{name:"width",val:": int = 768"},{name:"num_frames",val:": int = 121"},{name:"spatial_patch_size",val:": int = 1"},{name:"temporal_patch_size",val:": int = 1"},{name:"latents",val:": torch.Tensor | None = None"},{name:"latents_normalized",val:": bool = False"},{name:"decode_timestep",val:": float | list[float] = 0.0"},{name:"decode_noise_scale",val:": float | list[float] | None = None"},{name:"adain_factor",val:": float = 0.0"},{name:"tone_map_compression_ratio",val:": float = 0.0"},{name:"generator",val:": torch._C.Generator | list[torch._C.Generator] | None = None"},{name:"output_type",val:": str | None = 'pil'"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.video",description:`<strong>video</strong> (<code>list[PipelineImageInput]</code>, <em>optional</em>) — | |
| The video to be upsampled (such as a LTX 2.0 first stage output). If not supplied, <code>latents</code> should be | |
| supplied.`,name:"video"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>512</code>) — | |
| The height in pixels of the input video (not the generated video, which will have a larger resolution).`,name:"height"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>768</code>) — | |
| The width in pixels of the input video (not the generated video, which will have a larger resolution).`,name:"width"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.num_frames",description:`<strong>num_frames</strong> (<code>int</code>, <em>optional</em>, defaults to <code>121</code>) — | |
| The number of frames in the input video.`,name:"num_frames"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.spatial_patch_size",description:`<strong>spatial_patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>1</code>) — | |
| The spatial patch size of the video latents. Used when <code>latents</code> is supplied if unpacking is necessary.`,name:"spatial_patch_size"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.temporal_patch_size",description:`<strong>temporal_patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>1</code>) — | |
| The temporal patch size of the video latents. Used when <code>latents</code> is supplied if unpacking is | |
| necessary.`,name:"temporal_patch_size"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated video latents. This can be supplied in place of the <code>video</code> argument. Can either be a | |
| patch sequence of shape <code>(batch_size, seq_len, hidden_dim)</code> or a video latent of shape <code>(batch_size, latent_channels, latent_frames, latent_height, latent_width)</code>.`,name:"latents"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.latents_normalized",description:`<strong>latents_normalized</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| If <code>latents</code> are supplied, whether the <code>latents</code> are normalized using the VAE latent mean and std. If | |
| <code>True</code>, the <code>latents</code> will be denormalized before being supplied to the latent upsampler.`,name:"latents_normalized"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.decode_timestep",description:`<strong>decode_timestep</strong> (<code>float</code>, defaults to <code>0.0</code>) — | |
| The timestep at which generated video is decoded.`,name:"decode_timestep"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.decode_noise_scale",description:`<strong>decode_noise_scale</strong> (<code>float</code>, defaults to <code>None</code>) — | |
| The interpolation factor between random noise and denoised latents at the decode timestep.`,name:"decode_noise_scale"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.adain_factor",description:`<strong>adain_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>0.0</code>) — | |
| Adaptive Instance Normalization (AdaIN) blending factor between the upsampled and original latents. | |
| Should be in [-10.0, 10.0]; supplying 0.0 (the default) means that AdaIN is not performed.`,name:"adain_factor"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.tone_map_compression_ratio",description:`<strong>tone_map_compression_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to <code>0.0</code>) — | |
| The compression strength for tone mapping, which will reduce the dynamic range of the latent values. | |
| This is useful for regularizing high-variance latents or for conditioning outputs during generation. | |
| Should be in [0, 1], where 0.0 (the default) means tone mapping is not applied and 1.0 corresponds to | |
| the full compression effect.`,name:"tone_map_compression_ratio"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>list[torch.Generator]</code>, <em>optional</em>) — | |
| One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a> | |
| to make generation deterministic.`,name:"generator"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| The output format of the generate image. Choose between | |
| <a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <code>~pipelines.ltx.LTXPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2_latent_upsample.py#L264",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>If <code>return_dict</code> is <code>True</code>, <code>~pipelines.ltx.LTXPipelineOutput</code> is returned, otherwise a <code>tuple</code> is | |
| returned where the first element is the upsampled video.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>~pipelines.ltx.LTXPipelineOutput</code> or <code>tuple</code></p> | |
| `}}),O=new ln({props:{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.example",$$slots:{default:[Es]},$$scope:{ctx:V}}}),Fe=new j({props:{name:"adain_filter_latent",anchor:"diffusers.LTX2LatentUpsamplePipeline.adain_filter_latent",parameters:[{name:"latents",val:": Tensor"},{name:"reference_latents",val:": Tensor"},{name:"factor",val:": float = 1.0"}],parametersDescription:[{anchor:"diffusers.LTX2LatentUpsamplePipeline.adain_filter_latent.latent",description:`<strong>latent</strong> (<code>torch.Tensor</code>) — | |
| Input latents to normalize`,name:"latent"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.adain_filter_latent.reference_latents",description:`<strong>reference_latents</strong> (<code>torch.Tensor</code>) — | |
| The reference latents providing style statistics.`,name:"reference_latents"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.adain_filter_latent.factor",description:`<strong>factor</strong> (<code>float</code>) — | |
| Blending factor between original and transformed latent. Range: -10.0 to 10.0, Default: 1.0`,name:"factor"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2_latent_upsample.py#L168",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The transformed latent tensor</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>torch.Tensor</p> | |
| `}}),Ee=new j({props:{name:"tone_map_latents",anchor:"diffusers.LTX2LatentUpsamplePipeline.tone_map_latents",parameters:[{name:"latents",val:": Tensor"},{name:"compression",val:": float"}],parametersDescription:[{anchor:"diffusers.LTX2LatentUpsamplePipeline.tone_map_latents.latents",description:`<strong>latents</strong> — torch.Tensor | |
| Input latent tensor with arbitrary shape. Expected to be roughly in [-1, 1] or [0, 1] range.`,name:"latents"},{anchor:"diffusers.LTX2LatentUpsamplePipeline.tone_map_latents.compression",description:`<strong>compression</strong> — float | |
| Compression strength in the range [0, 1]. | |
| <ul> | |
| <li>0.0: No tone-mapping (identity transform)</li> | |
| <li>1.0: Full compression effect</li> | |
| </ul>`,name:"compression"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_ltx2_latent_upsample.py#L196",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>torch.Tensor | |
| The tone-mapped latent tensor of the same shape as input.</p> | |
| `}}),Qe=new E({props:{title:"LTX2PipelineOutput",local:"diffusers.pipelines.ltx2.pipeline_output.LTX2PipelineOutput",headingTag:"h2"}}),Ye=new j({props:{name:"class diffusers.pipelines.ltx2.pipeline_output.LTX2PipelineOutput",anchor:"diffusers.pipelines.ltx2.pipeline_output.LTX2PipelineOutput",parameters:[{name:"frames",val:": Tensor"},{name:"audio",val:": Tensor"}],parametersDescription:[{anchor:"diffusers.pipelines.ltx2.pipeline_output.LTX2PipelineOutput.frames",description:`<strong>frames</strong> (<code>torch.Tensor</code>, <code>np.ndarray</code>, or list[list[PIL.Image.Image]]) — | |
| 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"},{anchor:"diffusers.pipelines.ltx2.pipeline_output.LTX2PipelineOutput.audio",description:`<strong>audio</strong> (<code>torch.Tensor</code>, <code>np.ndarray</code>) — | |
| TODO`,name:"audio"}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/pipelines/ltx2/pipeline_output.py#L9"}}),Se=new Rs({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/ltx2.md"}}),{c(){c=i("meta"),X=s(),y=i("p"),M=s(),p(T.$$.fragment),l=s(),J=i("div"),J.innerHTML=qn,wt=s(),se=i("p"),se.textContent=Kn,bt=s(),ae=i("p"),ae.innerHTML=On,Ut=s(),oe=i("p"),oe.innerHTML=es,vt=s(),p(le.$$.fragment),jt=s(),ie=i("p"),ie.textContent=ts,Zt=s(),de=i("ul"),de.innerHTML=ns,It=s(),re=i("p"),re.textContent=ss,Xt=s(),p(ce.$$.fragment),Gt=s(),p(pe.$$.fragment),xt=s(),me=i("p"),me.textContent=as,Bt=s(),p(ue.$$.fragment),Vt=s(),p(he.$$.fragment),Ct=s(),ge=i("p"),ge.innerHTML=os,kt=s(),p(fe.$$.fragment),Wt=s(),_e=i("p"),_e.textContent=ls,Rt=s(),p(Me.$$.fragment),Nt=s(),Te=i("p"),Te.textContent=is,Lt=s(),p(ye.$$.fragment),Ft=s(),I=i("div"),p(Je.$$.fragment),rn=s(),He=i("p"),He.textContent=ds,cn=s(),Pe=i("p"),Pe.innerHTML=rs,pn=s(),C=i("div"),p(we.$$.fragment),mn=s(),$e=i("p"),$e.textContent=cs,un=s(),p(Q.$$.fragment),hn=s(),Y=i("div"),p(be.$$.fragment),gn=s(),De=i("p"),De.textContent=ps,fn=s(),S=i("div"),p(Ue.$$.fragment),_n=s(),qe=i("p"),qe.innerHTML=ms,Et=s(),p(ve.$$.fragment),Qt=s(),v=i("div"),p(je.$$.fragment),Mn=s(),Ke=i("p"),Ke.textContent=us,Tn=s(),Oe=i("p"),Oe.innerHTML=hs,yn=s(),et=i("p"),et.textContent=gs,Jn=s(),k=i("div"),p(Ze.$$.fragment),wn=s(),tt=i("p"),tt.textContent=fs,bn=s(),p(A.$$.fragment),Un=s(),z=i("div"),p(Ie.$$.fragment),vn=s(),nt=i("p"),nt.textContent=_s,jn=s(),H=i("div"),p(Xe.$$.fragment),Zn=s(),st=i("p"),st.innerHTML=Ms,Yt=s(),p(Ge.$$.fragment),St=s(),w=i("div"),p(xe.$$.fragment),In=s(),at=i("p"),at.textContent=Ts,Xn=s(),ot=i("p"),ot.innerHTML=ys,Gn=s(),lt=i("p"),lt.textContent=Js,xn=s(),W=i("div"),p(Be.$$.fragment),Bn=s(),it=i("p"),it.textContent=ws,Vn=s(),p(P.$$.fragment),Cn=s(),$=i("div"),p(Ve.$$.fragment),kn=s(),dt=i("p"),dt.textContent=bs,Wn=s(),D=i("div"),p(Ce.$$.fragment),Rn=s(),rt=i("p"),rt.textContent=Us,Nn=s(),q=i("div"),p(ke.$$.fragment),Ln=s(),ct=i("p"),ct.textContent=vs,Fn=s(),K=i("div"),p(We.$$.fragment),En=s(),pt=i("p"),pt.textContent=js,At=s(),p(Re.$$.fragment),zt=s(),B=i("div"),p(Ne.$$.fragment),Qn=s(),R=i("div"),p(Le.$$.fragment),Yn=s(),mt=i("p"),mt.textContent=Zs,Sn=s(),p(O.$$.fragment),An=s(),ee=i("div"),p(Fe.$$.fragment),zn=s(),ut=i("p"),ut.textContent=Is,Hn=s(),N=i("div"),p(Ee.$$.fragment),Pn=s(),ht=i("p"),ht.textContent=Xs,$n=s(),gt=i("p"),gt.innerHTML=Gs,Ht=s(),p(Qe.$$.fragment),Pt=s(),L=i("div"),p(Ye.$$.fragment),Dn=s(),ft=i("p"),ft.textContent=xs,$t=s(),p(Se.$$.fragment),Dt=s(),Jt=i("p"),this.h()},l(e){const o=Ws("svelte-u9bgzb",document.head);c=d(o,"META",{name:!0,content:!0}),o.forEach(n),X=a(e),y=d(e,"P",{}),U(y).forEach(n),M=a(e),m(T.$$.fragment,e),l=a(e),J=d(e,"DIV",{class:!0,"data-svelte-h":!0}),_(J)!=="svelte-si9ct8"&&(J.innerHTML=qn),wt=a(e),se=d(e,"P",{"data-svelte-h":!0}),_(se)!=="svelte-1bue6ym"&&(se.textContent=Kn),bt=a(e),ae=d(e,"P",{"data-svelte-h":!0}),_(ae)!=="svelte-1134kk7"&&(ae.innerHTML=On),Ut=a(e),oe=d(e,"P",{"data-svelte-h":!0}),_(oe)!=="svelte-qw2r3a"&&(oe.innerHTML=es),vt=a(e),m(le.$$.fragment,e),jt=a(e),ie=d(e,"P",{"data-svelte-h":!0}),_(ie)!=="svelte-7k8pa1"&&(ie.textContent=ts),Zt=a(e),de=d(e,"UL",{"data-svelte-h":!0}),_(de)!=="svelte-12js9fh"&&(de.innerHTML=ns),It=a(e),re=d(e,"P",{"data-svelte-h":!0}),_(re)!=="svelte-v5oo8i"&&(re.textContent=ss),Xt=a(e),m(ce.$$.fragment,e),Gt=a(e),m(pe.$$.fragment,e),xt=a(e),me=d(e,"P",{"data-svelte-h":!0}),_(me)!=="svelte-71u96j"&&(me.textContent=as),Bt=a(e),m(ue.$$.fragment,e),Vt=a(e),m(he.$$.fragment,e),Ct=a(e),ge=d(e,"P",{"data-svelte-h":!0}),_(ge)!=="svelte-rabflj"&&(ge.innerHTML=os),kt=a(e),m(fe.$$.fragment,e),Wt=a(e),_e=d(e,"P",{"data-svelte-h":!0}),_(_e)!=="svelte-1nr79xi"&&(_e.textContent=ls),Rt=a(e),m(Me.$$.fragment,e),Nt=a(e),Te=d(e,"P",{"data-svelte-h":!0}),_(Te)!=="svelte-q9sktm"&&(Te.textContent=is),Lt=a(e),m(ye.$$.fragment,e),Ft=a(e),I=d(e,"DIV",{class:!0});var G=U(I);m(Je.$$.fragment,G),rn=a(G),He=d(G,"P",{"data-svelte-h":!0}),_(He)!=="svelte-19ipoo4"&&(He.textContent=ds),cn=a(G),Pe=d(G,"P",{"data-svelte-h":!0}),_(Pe)!=="svelte-1sr6eg8"&&(Pe.innerHTML=rs),pn=a(G),C=d(G,"DIV",{class:!0});var F=U(C);m(we.$$.fragment,F),mn=a(F),$e=d(F,"P",{"data-svelte-h":!0}),_($e)!=="svelte-v78lg8"&&($e.textContent=cs),un=a(F),m(Q.$$.fragment,F),F.forEach(n),hn=a(G),Y=d(G,"DIV",{class:!0});var Ae=U(Y);m(be.$$.fragment,Ae),gn=a(Ae),De=d(Ae,"P",{"data-svelte-h":!0}),_(De)!=="svelte-16q0ax1"&&(De.textContent=ps),Ae.forEach(n),fn=a(G),S=d(G,"DIV",{class:!0});var ze=U(S);m(Ue.$$.fragment,ze),_n=a(ze),qe=d(ze,"P",{"data-svelte-h":!0}),_(qe)!=="svelte-ycu0kg"&&(qe.innerHTML=ms),ze.forEach(n),G.forEach(n),Et=a(e),m(ve.$$.fragment,e),Qt=a(e),v=d(e,"DIV",{class:!0});var x=U(v);m(je.$$.fragment,x),Mn=a(x),Ke=d(x,"P",{"data-svelte-h":!0}),_(Ke)!=="svelte-10tczlw"&&(Ke.textContent=us),Tn=a(x),Oe=d(x,"P",{"data-svelte-h":!0}),_(Oe)!=="svelte-1sr6eg8"&&(Oe.innerHTML=hs),yn=a(x),et=d(x,"P",{"data-svelte-h":!0}),_(et)!=="svelte-1yyqpus"&&(et.textContent=gs),Jn=a(x),k=d(x,"DIV",{class:!0});var _t=U(k);m(Ze.$$.fragment,_t),wn=a(_t),tt=d(_t,"P",{"data-svelte-h":!0}),_(tt)!=="svelte-v78lg8"&&(tt.textContent=fs),bn=a(_t),m(A.$$.fragment,_t),_t.forEach(n),Un=a(x),z=d(x,"DIV",{class:!0});var Kt=U(z);m(Ie.$$.fragment,Kt),vn=a(Kt),nt=d(Kt,"P",{"data-svelte-h":!0}),_(nt)!=="svelte-16q0ax1"&&(nt.textContent=_s),Kt.forEach(n),jn=a(x),H=d(x,"DIV",{class:!0});var Ot=U(H);m(Xe.$$.fragment,Ot),Zn=a(Ot),st=d(Ot,"P",{"data-svelte-h":!0}),_(st)!=="svelte-ycu0kg"&&(st.innerHTML=Ms),Ot.forEach(n),x.forEach(n),Yt=a(e),m(Ge.$$.fragment,e),St=a(e),w=d(e,"DIV",{class:!0});var Z=U(w);m(xe.$$.fragment,Z),In=a(Z),at=d(Z,"P",{"data-svelte-h":!0}),_(at)!=="svelte-8bvrgw"&&(at.textContent=Ts),Xn=a(Z),ot=d(Z,"P",{"data-svelte-h":!0}),_(ot)!=="svelte-1sr6eg8"&&(ot.innerHTML=ys),Gn=a(Z),lt=d(Z,"P",{"data-svelte-h":!0}),_(lt)!=="svelte-1yyqpus"&&(lt.textContent=Js),xn=a(Z),W=d(Z,"DIV",{class:!0});var Mt=U(W);m(Be.$$.fragment,Mt),Bn=a(Mt),it=d(Mt,"P",{"data-svelte-h":!0}),_(it)!=="svelte-v78lg8"&&(it.textContent=ws),Vn=a(Mt),m(P.$$.fragment,Mt),Mt.forEach(n),Cn=a(Z),$=d(Z,"DIV",{class:!0});var en=U($);m(Ve.$$.fragment,en),kn=a(en),dt=d(en,"P",{"data-svelte-h":!0}),_(dt)!=="svelte-1l041al"&&(dt.textContent=bs),en.forEach(n),Wn=a(Z),D=d(Z,"DIV",{class:!0});var tn=U(D);m(Ce.$$.fragment,tn),Rn=a(tn),rt=d(tn,"P",{"data-svelte-h":!0}),_(rt)!=="svelte-16q0ax1"&&(rt.textContent=Us),tn.forEach(n),Nn=a(Z),q=d(Z,"DIV",{class:!0});var nn=U(q);m(ke.$$.fragment,nn),Ln=a(nn),ct=d(nn,"P",{"data-svelte-h":!0}),_(ct)!=="svelte-176er7i"&&(ct.textContent=vs),nn.forEach(n),Fn=a(Z),K=d(Z,"DIV",{class:!0});var sn=U(K);m(We.$$.fragment,sn),En=a(sn),pt=d(sn,"P",{"data-svelte-h":!0}),_(pt)!=="svelte-1eod455"&&(pt.textContent=js),sn.forEach(n),Z.forEach(n),At=a(e),m(Re.$$.fragment,e),zt=a(e),B=d(e,"DIV",{class:!0});var te=U(B);m(Ne.$$.fragment,te),Qn=a(te),R=d(te,"DIV",{class:!0});var Tt=U(R);m(Le.$$.fragment,Tt),Yn=a(Tt),mt=d(Tt,"P",{"data-svelte-h":!0}),_(mt)!=="svelte-v78lg8"&&(mt.textContent=Zs),Sn=a(Tt),m(O.$$.fragment,Tt),Tt.forEach(n),An=a(te),ee=d(te,"DIV",{class:!0});var an=U(ee);m(Fe.$$.fragment,an),zn=a(an),ut=d(an,"P",{"data-svelte-h":!0}),_(ut)!=="svelte-tr32vd"&&(ut.textContent=Is),an.forEach(n),Hn=a(te),N=d(te,"DIV",{class:!0});var yt=U(N);m(Ee.$$.fragment,yt),Pn=a(yt),ht=d(yt,"P",{"data-svelte-h":!0}),_(ht)!=="svelte-1p9wfz7"&&(ht.textContent=Xs),$n=a(yt),gt=d(yt,"P",{"data-svelte-h":!0}),_(gt)!=="svelte-7cxa61"&&(gt.innerHTML=Gs),yt.forEach(n),te.forEach(n),Ht=a(e),m(Qe.$$.fragment,e),Pt=a(e),L=d(e,"DIV",{class:!0});var on=U(L);m(Ye.$$.fragment,on),Dn=a(on),ft=d(on,"P",{"data-svelte-h":!0}),_(ft)!=="svelte-ia4jjd"&&(ft.textContent=xs),on.forEach(n),$t=a(e),m(Se.$$.fragment,e),Dt=a(e),Jt=d(e,"P",{}),U(Jt).forEach(n),this.h()},h(){b(c,"name","hf:doc:metadata"),b(c,"content",Ys),b(J,"class","flex flex-wrap space-x-1"),b(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(L,"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){t(document.head,c),r(e,X,o),r(e,y,o),r(e,M,o),u(T,e,o),r(e,l,o),r(e,J,o),r(e,wt,o),r(e,se,o),r(e,bt,o),r(e,ae,o),r(e,Ut,o),r(e,oe,o),r(e,vt,o),u(le,e,o),r(e,jt,o),r(e,ie,o),r(e,Zt,o),r(e,de,o),r(e,It,o),r(e,re,o),r(e,Xt,o),u(ce,e,o),r(e,Gt,o),u(pe,e,o),r(e,xt,o),r(e,me,o),r(e,Bt,o),u(ue,e,o),r(e,Vt,o),u(he,e,o),r(e,Ct,o),r(e,ge,o),r(e,kt,o),u(fe,e,o),r(e,Wt,o),r(e,_e,o),r(e,Rt,o),u(Me,e,o),r(e,Nt,o),r(e,Te,o),r(e,Lt,o),u(ye,e,o),r(e,Ft,o),r(e,I,o),u(Je,I,null),t(I,rn),t(I,He),t(I,cn),t(I,Pe),t(I,pn),t(I,C),u(we,C,null),t(C,mn),t(C,$e),t(C,un),u(Q,C,null),t(I,hn),t(I,Y),u(be,Y,null),t(Y,gn),t(Y,De),t(I,fn),t(I,S),u(Ue,S,null),t(S,_n),t(S,qe),r(e,Et,o),u(ve,e,o),r(e,Qt,o),r(e,v,o),u(je,v,null),t(v,Mn),t(v,Ke),t(v,Tn),t(v,Oe),t(v,yn),t(v,et),t(v,Jn),t(v,k),u(Ze,k,null),t(k,wn),t(k,tt),t(k,bn),u(A,k,null),t(v,Un),t(v,z),u(Ie,z,null),t(z,vn),t(z,nt),t(v,jn),t(v,H),u(Xe,H,null),t(H,Zn),t(H,st),r(e,Yt,o),u(Ge,e,o),r(e,St,o),r(e,w,o),u(xe,w,null),t(w,In),t(w,at),t(w,Xn),t(w,ot),t(w,Gn),t(w,lt),t(w,xn),t(w,W),u(Be,W,null),t(W,Bn),t(W,it),t(W,Vn),u(P,W,null),t(w,Cn),t(w,$),u(Ve,$,null),t($,kn),t($,dt),t(w,Wn),t(w,D),u(Ce,D,null),t(D,Rn),t(D,rt),t(w,Nn),t(w,q),u(ke,q,null),t(q,Ln),t(q,ct),t(w,Fn),t(w,K),u(We,K,null),t(K,En),t(K,pt),r(e,At,o),u(Re,e,o),r(e,zt,o),r(e,B,o),u(Ne,B,null),t(B,Qn),t(B,R),u(Le,R,null),t(R,Yn),t(R,mt),t(R,Sn),u(O,R,null),t(B,An),t(B,ee),u(Fe,ee,null),t(ee,zn),t(ee,ut),t(B,Hn),t(B,N),u(Ee,N,null),t(N,Pn),t(N,ht),t(N,$n),t(N,gt),r(e,Ht,o),u(Qe,e,o),r(e,Pt,o),r(e,L,o),u(Ye,L,null),t(L,Dn),t(L,ft),r(e,$t,o),u(Se,e,o),r(e,Dt,o),r(e,Jt,o),qt=!0},p(e,[o]){const G={};o&2&&(G.$$scope={dirty:o,ctx:e}),Q.$set(G);const F={};o&2&&(F.$$scope={dirty:o,ctx:e}),A.$set(F);const Ae={};o&2&&(Ae.$$scope={dirty:o,ctx:e}),P.$set(Ae);const ze={};o&2&&(ze.$$scope={dirty:o,ctx:e}),O.$set(ze)},i(e){qt||(h(T.$$.fragment,e),h(le.$$.fragment,e),h(ce.$$.fragment,e),h(pe.$$.fragment,e),h(ue.$$.fragment,e),h(he.$$.fragment,e),h(fe.$$.fragment,e),h(Me.$$.fragment,e),h(ye.$$.fragment,e),h(Je.$$.fragment,e),h(we.$$.fragment,e),h(Q.$$.fragment,e),h(be.$$.fragment,e),h(Ue.$$.fragment,e),h(ve.$$.fragment,e),h(je.$$.fragment,e),h(Ze.$$.fragment,e),h(A.$$.fragment,e),h(Ie.$$.fragment,e),h(Xe.$$.fragment,e),h(Ge.$$.fragment,e),h(xe.$$.fragment,e),h(Be.$$.fragment,e),h(P.$$.fragment,e),h(Ve.$$.fragment,e),h(Ce.$$.fragment,e),h(ke.$$.fragment,e),h(We.$$.fragment,e),h(Re.$$.fragment,e),h(Ne.$$.fragment,e),h(Le.$$.fragment,e),h(O.$$.fragment,e),h(Fe.$$.fragment,e),h(Ee.$$.fragment,e),h(Qe.$$.fragment,e),h(Ye.$$.fragment,e),h(Se.$$.fragment,e),qt=!0)},o(e){g(T.$$.fragment,e),g(le.$$.fragment,e),g(ce.$$.fragment,e),g(pe.$$.fragment,e),g(ue.$$.fragment,e),g(he.$$.fragment,e),g(fe.$$.fragment,e),g(Me.$$.fragment,e),g(ye.$$.fragment,e),g(Je.$$.fragment,e),g(we.$$.fragment,e),g(Q.$$.fragment,e),g(be.$$.fragment,e),g(Ue.$$.fragment,e),g(ve.$$.fragment,e),g(je.$$.fragment,e),g(Ze.$$.fragment,e),g(A.$$.fragment,e),g(Ie.$$.fragment,e),g(Xe.$$.fragment,e),g(Ge.$$.fragment,e),g(xe.$$.fragment,e),g(Be.$$.fragment,e),g(P.$$.fragment,e),g(Ve.$$.fragment,e),g(Ce.$$.fragment,e),g(ke.$$.fragment,e),g(We.$$.fragment,e),g(Re.$$.fragment,e),g(Ne.$$.fragment,e),g(Le.$$.fragment,e),g(O.$$.fragment,e),g(Fe.$$.fragment,e),g(Ee.$$.fragment,e),g(Qe.$$.fragment,e),g(Ye.$$.fragment,e),g(Se.$$.fragment,e),qt=!1},d(e){e&&(n(X),n(y),n(M),n(l),n(J),n(wt),n(se),n(bt),n(ae),n(Ut),n(oe),n(vt),n(jt),n(ie),n(Zt),n(de),n(It),n(re),n(Xt),n(Gt),n(xt),n(me),n(Bt),n(Vt),n(Ct),n(ge),n(kt),n(Wt),n(_e),n(Rt),n(Nt),n(Te),n(Lt),n(Ft),n(I),n(Et),n(Qt),n(v),n(Yt),n(St),n(w),n(At),n(zt),n(B),n(Ht),n(Pt),n(L),n($t),n(Dt),n(Jt)),n(c),f(T,e),f(le,e),f(ce,e),f(pe,e),f(ue,e),f(he,e),f(fe,e),f(Me,e),f(ye,e),f(Je),f(we),f(Q),f(be),f(Ue),f(ve,e),f(je),f(Ze),f(A),f(Ie),f(Xe),f(Ge,e),f(xe),f(Be),f(P),f(Ve),f(Ce),f(ke),f(We),f(Re,e),f(Ne),f(Le),f(O),f(Fe),f(Ee),f(Qe,e),f(Ye),f(Se,e)}}}const Ys='{"title":"LTX-2","local":"ltx-2","sections":[{"title":"Two-stages Generation","local":"two-stages-generation","sections":[],"depth":2},{"title":"Distilled checkpoint generation","local":"distilled-checkpoint-generation","sections":[],"depth":2},{"title":"Condition Pipeline Generation","local":"condition-pipeline-generation","sections":[],"depth":2},{"title":"LTX2Pipeline","local":"diffusers.LTX2Pipeline","sections":[],"depth":2},{"title":"LTX2ImageToVideoPipeline","local":"diffusers.LTX2ImageToVideoPipeline","sections":[],"depth":2},{"title":"LTX2ConditionPipeline","local":"diffusers.LTX2ConditionPipeline","sections":[],"depth":2},{"title":"LTX2LatentUpsamplePipeline","local":"diffusers.LTX2LatentUpsamplePipeline","sections":[],"depth":2},{"title":"LTX2PipelineOutput","local":"diffusers.pipelines.ltx2.pipeline_output.LTX2PipelineOutput","sections":[],"depth":2}],"depth":1}';function Ss(V){return Vs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qs extends Cs{constructor(c){super(),ks(this,c,Ss,Qs,Bs,{})}}export{qs as component}; | |
Xet Storage Details
- Size:
- 180 kB
- Xet hash:
- a964de68be457c92c1930715479d9a8a8674326fe17d9f6d169af22cd2737ec8
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.