Buckets:
| import{s as fa,o as _a,n as Bn}from"../chunks/scheduler.53228c21.js";import{S as Ta,i as ya,e as l,s as a,c,h as wa,a as i,d as t,b as o,f as U,g as m,j as p,k as b,l as n,m as d,n as u,t as h,o as g,p as M}from"../chunks/index.cac5d66a.js";import{D as v}from"../chunks/Docstring.41979c71.js";import{C as Y}from"../chunks/CodeBlock.606cbaf4.js";import{E as Vn}from"../chunks/ExampleCodeBlock.cbf08b0e.js";import{H as k,E as Ja}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.e4b76f09.js";function ba(W){let f,X="Examples:",y,_,T;return _=new Y({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTFRYMlBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy5waXBlbGluZXMubHR4Mi5leHBvcnRfdXRpbHMlMjBpbXBvcnQlMjBlbmNvZGVfdmlkZW8lMEElMEFwaXBlJTIwJTNEJTIwTFRYMlBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJMaWdodHJpY2tzJTJGTFRYLTIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwd29tYW4lMjB3aXRoJTIwbG9uZyUyMGJyb3duJTIwaGFpciUyMGFuZCUyMGxpZ2h0JTIwc2tpbiUyMHNtaWxlcyUyMGF0JTIwYW5vdGhlciUyMHdvbWFuJTIwd2l0aCUyMGxvbmclMjBibG9uZGUlMjBoYWlyLiUyMFRoZSUyMHdvbWFuJTIwd2l0aCUyMGJyb3duJTIwaGFpciUyMHdlYXJzJTIwYSUyMGJsYWNrJTIwamFja2V0JTIwYW5kJTIwaGFzJTIwYSUyMHNtYWxsJTJDJTIwYmFyZWx5JTIwbm90aWNlYWJsZSUyMG1vbGUlMjBvbiUyMGh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UzRDQuMCUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF90eXBlJTNEJTIybnAlMjIlMkMlMEElMjAlMjAlMjAlMjByZXR1cm5fZGljdCUzREZhbHNlJTJDJTBBKSUwQSUwQWVuY29kZV92aWRlbyglMEElMjAlMjAlMjAlMjB2aWRlbyU1QjAlNUQlMkMlMEElMjAlMjAlMjAlMjBmcHMlM0RmcmFtZV9yYXRlJTJDJTBBJTIwJTIwJTIwJTIwYXVkaW8lM0RhdWRpbyU1QjAlNUQuZmxvYXQoKS5jcHUoKSUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvX3NhbXBsZV9yYXRlJTNEcGlwZS52b2NvZGVyLmNvbmZpZy5vdXRwdXRfc2FtcGxpbmdfcmF0ZSUyQyUyMCUyMCUyMyUyMHNob3VsZCUyMGJlJTIwMjQwMDAlMEElMjAlMjAlMjAlMjBvdXRwdXRfcGF0aCUzRCUyMnZpZGVvLm1wNCUyMiUyQyUwQSk=",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>)`,lang:"py",wrap:!1}}),{c(){f=l("p"),f.textContent=X,y=a(),c(_.$$.fragment)},l(r){f=i(r,"P",{"data-svelte-h":!0}),p(f)!=="svelte-kvfsh7"&&(f.textContent=X),y=o(r),m(_.$$.fragment,r)},m(r,J){d(r,f,J),d(r,y,J),u(_,r,J),T=!0},p:Bn,i(r){T||(h(_.$$.fragment,r),T=!0)},o(r){g(_.$$.fragment,r),T=!1},d(r){r&&(t(f),t(y)),M(_,r)}}}function Ua(W){let f,X="Examples:",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XRoJTNEJTIydmlkZW8ubXA0JTIyJTJDJTBBKQ==",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>)`,lang:"py",wrap:!1}}),{c(){f=l("p"),f.textContent=X,y=a(),c(_.$$.fragment)},l(r){f=i(r,"P",{"data-svelte-h":!0}),p(f)!=="svelte-kvfsh7"&&(f.textContent=X),y=o(r),m(_.$$.fragment,r)},m(r,J){d(r,f,J),d(r,y,J),u(_,r,J),T=!0},p:Bn,i(r){T||(h(_.$$.fragment,r),T=!0)},o(r){g(_.$$.fragment,r),T=!1},d(r){r&&(t(f),t(y)),M(_,r)}}}function ja(W){let f,X="Examples:",y,_,T;return _=new Y({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTFRYMkNvbmRpdGlvblBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy5waXBlbGluZXMubHR4Mi5leHBvcnRfdXRpbHMlMjBpbXBvcnQlMjBlbmNvZGVfdmlkZW8lMEFmcm9tJTIwZGlmZnVzZXJzLnBpcGVsaW5lcy5sdHgyLnBpcGVsaW5lX2x0eDJfY29uZGl0aW9uJTIwaW1wb3J0JTIwTFRYMlZpZGVvQ29uZGl0aW9uJTBBZnJvbSUyMGRpZmZ1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wKHZpZGVvJTIwKiUyMDI1NSkucm91bmQoKS5hc3R5cGUoJTIydWludDglMjIpJTBBdmlkZW8lMjAlM0QlMjB0b3JjaC5mcm9tX251bXB5KHZpZGVvKSUwQSUwQWVuY29kZV92aWRlbyglMEElMjAlMjAlMjAlMjB2aWRlbyU1QjAlNUQlMkMlMEElMjAlMjAlMjAlMjBmcHMlM0RmcmFtZV9yYXRlJTJDJTBBJTIwJTIwJTIwJTIwYXVkaW8lM0RhdWRpbyU1QjAlNUQuZmxvYXQoKS5jcHUoKSUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvX3NhbXBsZV9yYXRlJTNEcGlwZS52b2NvZGVyLmNvbmZpZy5vdXRwdXRfc2FtcGxpbmdfcmF0ZSUyQyUyMCUyMCUyMyUyMHNob3VsZCUyMGJlJTIwMjQwMDAlMEElMjAlMjAlMjAlMjBvdXRwdXRfcGF0aCUzRCUyMnZpZGVvLm1wNCUyMiUyQyUwQSk=",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>)`,lang:"py",wrap:!1}}),{c(){f=l("p"),f.textContent=X,y=a(),c(_.$$.fragment)},l(r){f=i(r,"P",{"data-svelte-h":!0}),p(f)!=="svelte-kvfsh7"&&(f.textContent=X),y=o(r),m(_.$$.fragment,r)},m(r,J){d(r,f,J),d(r,y,J),u(_,r,J),T=!0},p:Bn,i(r){T||(h(_.$$.fragment,r),T=!0)},o(r){g(_.$$.fragment,r),T=!1},d(r){r&&(t(f),t(y)),M(_,r)}}}function va(W){let f,X="Examples:",y,_,T;return _=new Y({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTFRYMkltYWdlVG9WaWRlb1BpcGVsaW5lJTJDJTIwTFRYMkxhdGVudFVwc2FtcGxlUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnBpcGVsaW5lcy5sdHgyLmV4cG9ydF91dGlscyUyMGltcG9ydCUyMGVuY29kZV92aWRlbyUwQWZyb20lMjBkaWZmdXNlcnMucGlwZWxpbmVzLmx0eDIubGF0ZW50X3Vwc2FtcGxlciUyMGltcG9ydCUyMExUWDJMYXRlbnRVcHNhbXBsZXJNb2RlbCUwQWZyb20lMjBkaWZmdXNlcnMudXRp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JTIwJTIwJTIwdmlkZW8lM0R2aWRlbyUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENTEyJTJDJTBBJTIwJTIwJTIwJTIwb3V0cHV0X3R5cGUlM0QlMjJucCUyMiUyQyUwQSUyMCUyMCUyMCUyMHJldHVybl9kaWN0JTNERmFsc2UlMkMlMEEpJTVCMCU1RCUwQSUwQWVuY29kZV92aWRlbyglMEElMjAlMjAlMjAlMjB2aWRlbyU1QjAlNUQlMkMlMEElMjAlMjAlMjAlMjBmcHMlM0RmcmFtZV9yYXRlJTJDJTBBJTIwJTIwJTIwJTIwYXVkaW8lM0RhdWRpbyU1QjAlNUQuZmxvYXQoKS5jcHUoKSUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvX3NhbXBsZV9yYXRlJTNEcGlwZS52b2NvZGVyLmNvbmZpZy5vdXRwdXRfc2FtcGxpbmdfcmF0ZSUyQyUyMCUyMCUyMyUyMHNob3VsZCUyMGJlJTIwMjQwMDAlMEElMjAlMjAlMjAlMjBvdXRwdXRfcGF0aCUzRCUyMnZpZGVvLm1wNCUyMiUyQyUwQSk=",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>)`,lang:"py",wrap:!1}}),{c(){f=l("p"),f.textContent=X,y=a(),c(_.$$.fragment)},l(r){f=i(r,"P",{"data-svelte-h":!0}),p(f)!=="svelte-kvfsh7"&&(f.textContent=X),y=o(r),m(_.$$.fragment,r)},m(r,J){d(r,f,J),d(r,y,J),u(_,r,J),T=!0},p:Bn,i(r){T||(h(_.$$.fragment,r),T=!0)},o(r){g(_.$$.fragment,r),T=!1},d(r){r&&(t(f),t(y)),M(_,r)}}}function Za(W){let f,X,y,_,T,r,J,Zs='<img alt="LoRA" src="https://img.shields.io/badge/LoRA-d8b4fe?style=flat"/>',Lt,oe,Gs='<a href="https://hf.co/papers/2601.03233" rel="nofollow">LTX-2</a> is a DiT-based 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.',Et,le,Xs='You can find all the original LTX-Video checkpoints under the <a href="https://huggingface.co/Lightricks" rel="nofollow">Lightricks</a> organization.',Ft,ie,Is='The original codebase for LTX-2 can be found <a href="https://github.com/Lightricks/LTX-2" rel="nofollow">here</a>.',Qt,de,Yt,re,Vs="Recommended pipeline to achieve production quality generation, this pipeline is composed of two stages:",At,pe,Bs="<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>",St,ce,Cs="Sample usage of text-to-video two stages pipeline",Ht,me,zt,ue,Pt,he,ks="Fastest two-stages generation pipeline using a distilled checkpoint.",$t,ge,Dt,Me,qt,fe,Ws="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,_e,Ot,Te,xs="You can use both image and video conditions:",en,ye,tn,we,Rs="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.",nn,Je,sn,be,Ns="LTX-2.X pipelines support multimodal guidance. It is composed of three terms, all using a CFG-style update rule:",an,Ue,Ls='<li>Classifier-Free Guidance (CFG): standard <a href="https://huggingface.co/papers/2207.12598" rel="nofollow">CFG</a> where the perturbed (“weaker”) output is generated using the negative prompt.</li> <li>Spatio-Temporal Guidance (STG): <a href="https://huggingface.co/papers/2411.18664" rel="nofollow">STG</a> moves away from a perturbed output created from short-cutting self-attention operations and substitutes in the attention values instead. The idea is that this creates sharper videos and better spatiotemporal consistency.</li> <li>Modality Isolation Guidance: moves away from a perturbed output created from disabling cross-modality (audio-to-video and video-to-audio) cross attention. This guidance is more specific to <a href="https://huggingface.co/papers/2601.03233" rel="nofollow">LTX-2.X</a> models, with the idea that this produces better consistency between the generated audio and video.</li>',on,je,Es='These are controlled by the <code>guidance_scale</code>, <code>stg_scale</code>, and <code>modality_scale</code> arguments and can be set separately for video and audio. Additionally, for STG the transformer block indices where self-attention is skipped needs to be specified via the <code>spatio_temporal_guidance_blocks</code> argument. The LTX-2.X pipelines also support <a href="https://huggingface.co/papers/2305.08891" rel="nofollow">guidance rescaling</a> to help reduce over-exposure, which can be a problem when the guidance scales are set to high values.',ln,ve,dn,Ze,rn,Ge,Fs='The LTX-2.X models are sensitive to prompting style. Refer to the <a href="https://ltx.io/model/model-blog/prompting-guide-for-ltx-2" rel="nofollow">official prompting guide</a> for recommendations on how to write a good prompt. Using prompt enhancement, where the supplied prompts are enhanced using the pipeline’s text encoder (by default a <a href="https://huggingface.co/google/gemma-3-12b-it-qat-q4_0-unquantized" rel="nofollow">Gemma 3</a> model) given a system prompt, can also improve sample quality. The optional <code>processor</code> pipeline component needs to be present to use prompt enhancement. Enable prompt enhancement by supplying a <code>system_prompt</code> argument:',pn,Xe,cn,Ie,mn,G,Ve,Cn,at,Qs="Pipeline for text-to-video generation.",kn,ot,Ys='Reference: <a href="https://github.com/Lightricks/LTX-Video" rel="nofollow">https://github.com/Lightricks/LTX-Video</a>',Wn,x,Be,xn,lt,As="Function invoked when calling the pipeline for generation.",Rn,H,Nn,z,Ce,Ln,it,Ss="Encodes the prompt into text encoder hidden states.",En,P,ke,Fn,dt,Hs=`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.`,un,We,hn,Z,xe,Qn,rt,zs="Pipeline for image-to-video generation.",Yn,pt,Ps='Reference: <a href="https://github.com/Lightricks/LTX-Video" rel="nofollow">https://github.com/Lightricks/LTX-Video</a>',An,ct,$s="TODO",Sn,R,Re,Hn,mt,Ds="Function invoked when calling the pipeline for generation.",zn,$,Pn,D,Ne,$n,ut,qs="Encodes the prompt into text encoder hidden states.",Dn,q,Le,qn,ht,Ks=`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.`,gn,Ee,Mn,w,Fe,Kn,gt,Os="Pipeline for video generation which allows image conditions to be inserted at arbitary parts of the video.",On,Mt,ea='Reference: <a href="https://github.com/Lightricks/LTX-Video" rel="nofollow">https://github.com/Lightricks/LTX-Video</a>',es,ft,ta="TODO",ts,N,Qe,ns,_t,na="Function invoked when calling the pipeline for generation.",ss,K,as,L,Ye,os,Tt,sa="Apply first-frame visual conditioning by overwriting tokens at the first-frame positions.",ls,yt,aa=`Only conditions with <code>latent_idx == 0</code> are applied here (matching <code>VideoConditionByLatentIndex</code> in the | |
| reference implementation). Conditions at non-zero latent indices are appended as separate keyframe tokens via | |
| <code>prepare_keyframe_extras</code> (matching <code>VideoConditionByKeyframeIndex</code>) and are skipped here.`,is,O,Ae,ds,wt,oa="Encodes the prompt into text encoder hidden states.",rs,V,Se,ps,Jt,la="Prepare noisy video latents, applying frame conditions.",cs,bt,ia=`First-frame conditions (<code>latent_idx == 0</code>) are applied by overwriting tokens at the first-frame positions | |
| (<code>VideoConditionByLatentIndex</code> semantics). Non-first-frame conditions (<code>latent_idx > 0</code>) are concatenated onto | |
| the main latent sequence with per-token <code>conditioning_mask = strength</code> (<code>VideoConditionByKeyframeIndex</code> | |
| semantics) — the denoising loop’s existing timestep formula <code>t * (1 - conditioning_mask)</code> and post-process | |
| blend <code>denoised * (1 - conditioning_mask) + clean * conditioning_mask</code> then drive them across steps.`,ms,Ut,da="Returns a 4-tuple:",us,jt,ra=`<li><code>latents</code>: packed noisy latents (base tokens + any keyframe tokens cat’d onto the sequence dim).</li> <li><code>conditioning_mask</code>: packed conditioning mask with values in <code>[0, 1]</code> — <code>1</code> at first-frame positions, | |
| <code>strength</code> at keyframe positions, <code>0</code> elsewhere.</li> <li><code>clean_latents</code>: clean condition values at conditioned positions (zeros elsewhere); same shape as | |
| <code>latents</code>.</li> <li><code>keyframe_coords</code>: <code>[B, 3, num_keyframe_patches, 2]</code> positional coordinates to append to <code>video_coords</code>, | |
| or <code>None</code> if there are no non-first-frame conditions.</li>`,hs,ee,He,gs,vt,pa="Preprocesses the condition images/videos to torch tensors.",Ms,te,ze,fs,Zt,ca="Trim a conditioning sequence to the allowed number of frames.",fn,Pe,_n,C,$e,_s,E,De,Ts,Gt,ma="Function invoked when calling the pipeline for generation.",ys,ne,ws,se,qe,Js,Xt,ua=`Applies Adaptive Instance Normalization (AdaIN) to a latent tensor based on statistics from a reference latent | |
| tensor.`,bs,F,Ke,Us,It,ha=`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.`,js,Vt,ga=`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.`,Tn,Oe,yn,A,et,vs,Bt,Ma="Output class for LTX pipelines.",wn,tt,Jn,Nt,bn;return T=new k({props:{title:"LTX-2",local:"ltx-2",headingTag:"h1"}}),de=new k({props:{title:"Two-stages Generation",local:"two-stages-generation",headingTag:"h2"}}),me=new Y({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRmxvd01hdGNoRXVsZXJEaXNjcmV0ZVNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMucGlwZWxpbmVzLmx0eDIlMjBpbXBvcnQlMjBMVFgyUGlwZWxpbmUlMkMlMjBMVFgyTGF0ZW50VXBzYW1wbGVQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMucGlwZWxpbmVzLmx0eDIubGF0ZW50X3Vwc2FtcGxlciUyMGltcG9ydCUyMExUWDJMYXRlbnRVcHNhbXBsZXJNb2RlbCUwQWZyb20lMjBkaWZmdXNlcnMucGlwZWxpbmVzLmx0eDIudXRpbHMlM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TJTJDJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0QxLjAlMkMlMEElMjAlMjAlMjAlMjBvdXRwdXRfdHlwZSUzRCUyMm5wJTIyJTJDJTBBJTIwJTIwJTIwJTIwcmV0dXJuX2RpY3QlM0RGYWxzZSUyQyUwQSklMEElMEFlbmNvZGVfdmlkZW8oJTBBJTIwJTIwJTIwJTIwdmlkZW8lNUIwJTVEJTJDJTBBJTIwJTIwJTIwJTIwZnBzJTNEZnJhbWVfcmF0ZSUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvJTNEYXVkaW8lNUIwJTVELmZsb2F0KCkuY3B1KCklMkMlMEElMjAlMjAlMjAlMjBhdWRpb19zYW1wbGVfcmF0ZSUzRHBpcGUudm9jb2Rlci5jb25maWcub3V0cHV0X3NhbXBsaW5nX3JhdGUlMkMlMEElMjAlMjAlMjAlMjBvdXRwdXRfcGF0aCUzRCUyMmx0eDJfbG9yYV9kaXN0aWxsZWRfc2FtcGxlLm1wNCUyMiUyQyUwQSk=",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>, | |
| )`,lang:"py",wrap:!1}}),ue=new k({props:{title:"Distilled checkpoint generation",local:"distilled-checkpoint-generation",headingTag:"h2"}}),ge=new Y({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzLnBpcGVsaW5lcy5sdHgyJTIwaW1wb3J0JTIwTFRYMlBpcGVsaW5lJTJDJTIwTFRYMkxhdGVudFVwc2FtcGxlUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnV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lMjAlMjBub2lzZV9zY2FsZSUzRFNUQUdFXzJfRElTVElMTEVEX1NJR01BX1ZBTFVFUyU1QjAlNUQlMkMlMjAlMjMlMjByZW5vaXNlJTIwd2l0aCUyMGZpcnN0JTIwc2lnbWElMjB2YWx1ZSUyMGh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRkxpZ2h0cmlja3MlMkZMVFgtMiUyRmJsb2IlMkZtYWluJTJGcGFja2FnZXMlMkZsdHgtcGlwZWxpbmVzJTJGc3JjJTJGbHR4X3BpcGVsaW5lcyUyRmRpc3RpbGxlZC5weSUyM0wxNzglMEElMjAlMjAlMjAlMjBzaWdtYXMlM0RTVEFHRV8yX0RJU1RJTExFRF9TSUdNQV9WQUxVRVMlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IlMkMlMEElMjAlMjAlMjAlMjBndWlkYW5jZV9zY2FsZSUzRDEuMCUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF90eXBlJTNEJTIybnAlMjIlMkMlMEElMjAlMjAlMjAlMjByZXR1cm5fZGljdCUzREZhbHNlJTJDJTBBKSUwQSUwQWVuY29kZV92aWRlbyglMEElMjAlMjAlMjAlMjB2aWRlbyU1QjAlNUQlMkMlMEElMjAlMjAlMjAlMjBmcHMlM0RmcmFtZV9yYXRlJTJDJTBBJTIwJTIwJTIwJTIwYXVkaW8lM0RhdWRpbyU1QjAlNUQuZmxvYXQoKS5jcHUoKSUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvX3NhbXBsZV9yYXRlJTNEcGlwZS52b2NvZGVyLmNvbmZpZy5vdXRwdXRfc2FtcGxpbmdfcmF0ZSUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF9wYXRoJTNEJTIybHR4Ml9kaXN0aWxsZWRfc2FtcGxlLm1wNCUyMiUyQyUwQSk=",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>, | |
| )`,lang:"py",wrap:!1}}),Me=new k({props:{title:"Condition Pipeline Generation",local:"condition-pipeline-generation",headingTag:"h2"}}),_e=new Y({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTFRYMkNvbmRpdGlvblBpcGVsaW5lJTJDJTIwTFRYMkxhdGVudFVwc2FtcGxlUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnBpcGVsaW5lcy5sdHgyLmxhdGVudF91cHNhbXBsZXIlMjBpbXBvcnQlMjBMVFgyTGF0ZW50VXBzYW1wbGVyTW9kZWwlM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X2xhdGVudHMlM0RhdWRpb19sYXRlbnQlMkMlMEElMjAlMjAlMjAlMjBwcm9tcHQlM0Rwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjB3aWR0aCUzRHdpZHRoJTIwKiUyMDIlMkMlMEElMjAlMjAlMjAlMjBoZWlnaHQlM0RoZWlnaHQlMjAqJTIwMiUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QzJTJDJTBBJTIwJTIwJTIwJTIwc2lnbWFzJTNEU1RBR0VfMl9ESVNUSUxMRURfU0lHTUFfVkFMVUVTJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0QxLjAlMkMlMEElMjAlMjAlMjAlMjBvdXRwdXRfdHlwZSUzRCUyMm5wJTIyJTJDJTBBJTIwJTIwJTIwJTIwcmV0dXJuX2RpY3QlM0RGYWxzZSUyQyUwQSklMEElMEFlbmNvZGVfdmlkZW8oJTBBJTIwJTIwJTIwJTIwdmlkZW8lNUIwJTVEJTJDJTBBJTIwJTIwJTIwJTIwZnBzJTNEZnJhbWVfcmF0ZSUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvJTNEYXVkaW8lNUIwJTVELmZsb2F0KCkuY3B1KCklMkMlMEElMjAlMjAlMjAlMjBhdWRpb19zYW1wbGVfcmF0ZSUzRHBpcGUudm9jb2Rlci5jb25maWcub3V0cHV0X3NhbXBsaW5nX3JhdGUlMkMlMEElMjAlMjAlMjAlMjBvdXRwdXRfcGF0aCUzRCUyMmx0eDJfZGlzdGlsbGVkX2ZsZjJ2Lm1wNCUyMiUyQyUwQSk=",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">"ltx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NlJTJDJTBBKSUwQSUwQWVuY29kZV92aWRlbyglMEElMjAlMjAlMjAlMjB2aWRlbyU1QjAlNUQlMkMlMEElMjAlMjAlMjAlMjBmcHMlM0RmcmFtZV9yYXRlJTJDJTBBJTIwJTIwJTIwJTIwYXVkaW8lM0RhdWRpbyU1QjAlNUQuZmxvYXQoKS5jcHUoKSUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvX3NhbXBsZV9yYXRlJTNEcGlwZS52b2NvZGVyLmNvbmZpZy5vdXRwdXRfc2FtcGxpbmdfcmF0ZSUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF9wYXRoJTNEJTIybHR4Ml9jb25kX3ZpZGVvLm1wNCUyMiUyQyUwQSk=",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.pipelines.ltx2.utils <span class="hljs-keyword">import</span> DEFAULT_NEGATIVE_PROMPT | |
| <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> | |
| ) | |
| 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=DEFAULT_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>, | |
| )`,lang:"py",wrap:!1}}),Je=new k({props:{title:"Multimodal Guidance",local:"multimodal-guidance",headingTag:"h2"}}),ve=new Y({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTFRYMkltYWdlVG9WaWRlb1BpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy5waXBlbGluZXMubHR4Mi5leHBvcnRfdXRpbHMlMjBpbXBvcnQlMjBlbmNvZGVfdmlkZW8lMEFmcm9tJTIwZGlmZnVzZXJzLnBpcGVsaW5lcy5sdHgyLnV0aWxzJTIwaW1wb3J0JTIwREVGQVVMVF9ORUdBVElWRV9QUk9NUFQlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQWRldmljZSUyMCUzRCUyMCUyMmN1ZGElMjIlMEF3aWR0aCUyMCUzRCUyMDc2OCUwQWhlaWdodCUyMCUzRCUyMDUxMiUwQXJhbmRvbV9zZWVkJTIwJTNEJTIwNDIlMEFmcmFtZV9yYXRlJTIwJTNEJTIwMjQuMCUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLkdlbmVyYXRvcihkZXZpY2UpLm1hbnVhbF9zZWVkKHJhbmRvbV9zZWVkKSUwQW1vZGVsX3BhdGglMjAlM0QlMjAlMjJkaWZmdXNlcnMlMkZMVFgtMi4zLURpZmZ1c2VycyUyMiUwQSUwQXBpcGUlMjAlM0QlMjBMVFgySW1hZ2VUb1ZpZGVvUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX3BhdGglMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQXBpcGUuZW5hYmxlX3NlcXVlbnRpYWxfY3B1X29mZmxvYWQoZGV2aWNlJTNEZGV2aWNlKSUwQXBpcGUud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MuMCUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvX2d1aWRhbmNlX3Jlc2NhbGUlM0QwLjclMkMlMEElMjAlMjAlMjAlMjBzcGF0aW9fdGVtcG9yYWxfZ3VpZGFuY2VfYmxvY2tzJTNEJTVCMjglNUQlMkMlMEElMjAlMjAlMjAlMjB1c2VfY3Jvc3NfdGltZXN0ZXAlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwb3V0cHV0X3R5cGUlM0QlMjJucCUyMiUyQyUwQSUyMCUyMCUyMCUyMHJldHVybl9kaWN0JTNERmFsc2UlMkMlMEEpJTBBJTBBZW5jb2RlX3ZpZGVvKCUwQSUyMCUyMCUyMCUyMHZpZGVvJTVCMCU1RCUyQyUwQSUyMCUyMCUyMCUyMGZwcyUzRGZyYW1lX3JhdGUlMkMlMEElMjAlMjAlMjAlMjBhdWRpbyUzRGF1ZGlvJTVCMCU1RC5mbG9hdCgpLmNwdSgpJTJDJTBBJTIwJTIwJTIwJTIwYXVkaW9fc2FtcGxlX3JhdGUlM0RwaXBlLnZvY29kZXIuY29uZmlnLm91dHB1dF9zYW1wbGluZ19yYXRlJTJDJTBBJTIwJTIwJTIwJTIwb3V0cHV0X3BhdGglM0QlMjJsdHgyXzNfaTJ2X3N0YWdlXzEubXA0JTIyJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LTX2ImageToVideoPipeline | |
| <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.pipelines.ltx2.utils <span class="hljs-keyword">import</span> DEFAULT_NEGATIVE_PROMPT | |
| <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> | |
| frame_rate = <span class="hljs-number">24.0</span> | |
| generator = torch.Generator(device).manual_seed(random_seed) | |
| model_path = <span class="hljs-string">"diffusers/LTX-2.3-Diffusers"</span> | |
| pipe = LTX2ImageToVideoPipeline.from_pretrained(model_path, torch_dtype=torch.bfloat16) | |
| pipe.enable_sequential_cpu_offload(device=device) | |
| pipe.vae.enable_tiling() | |
| prompt = ( | |
| <span class="hljs-string">"An astronaut hatches from a fragile egg on the surface of the Moon, the shell cracking and peeling apart in "</span> | |
| <span class="hljs-string">"gentle low-gravity motion. Fine lunar dust lifts and drifts outward with each movement, floating in slow arcs "</span> | |
| <span class="hljs-string">"before settling back onto the ground. The astronaut pushes free in a deliberate, weightless motion, small "</span> | |
| <span class="hljs-string">"fragments of the egg tumbling and spinning through the air. In the background, the deep darkness of space subtly "</span> | |
| <span class="hljs-string">"shifts as stars glide with the camera's movement, emphasizing vast depth and scale. The camera performs a "</span> | |
| <span class="hljs-string">"smooth, cinematic slow push-in, with natural parallax between the foreground dust, the astronaut, and the "</span> | |
| <span class="hljs-string">"distant starfield. Ultra-realistic detail, physically accurate low-gravity motion, cinematic lighting, and a "</span> | |
| <span class="hljs-string">"breath-taking, movie-like shot."</span> | |
| ) | |
| image = load_image( | |
| <span class="hljs-string">"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/astronaut.jpg"</span>, | |
| ) | |
| video, audio = pipe( | |
| image=image, | |
| prompt=prompt, | |
| negative_prompt=DEFAULT_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">30</span>, | |
| guidance_scale=<span class="hljs-number">3.0</span>, <span class="hljs-comment"># Recommended LTX-2.3 guidance parameters</span> | |
| stg_scale=<span class="hljs-number">1.0</span>, <span class="hljs-comment"># Note that 0.0 (not 1.0) means that STG is disabled (all other guidance is disabled at 1.0)</span> | |
| modality_scale=<span class="hljs-number">3.0</span>, | |
| guidance_rescale=<span class="hljs-number">0.7</span>, | |
| audio_guidance_scale=<span class="hljs-number">7.0</span>, <span class="hljs-comment"># Note that a higher CFG guidance scale is recommended for audio</span> | |
| audio_stg_scale=<span class="hljs-number">1.0</span>, | |
| audio_modality_scale=<span class="hljs-number">3.0</span>, | |
| audio_guidance_rescale=<span class="hljs-number">0.7</span>, | |
| spatio_temporal_guidance_blocks=[<span class="hljs-number">28</span>], | |
| use_cross_timestep=<span class="hljs-literal">True</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_3_i2v_stage_1.mp4"</span>, | |
| )`,lang:"py",wrap:!1}}),Ze=new k({props:{title:"Prompt Enhancement",local:"prompt-enhancement",headingTag:"h2"}}),Xe=new Y({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwR2VtbWEzUHJvY2Vzc29yJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMExUWDJQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMucGlwZWxpbmVzLmx0eDIuZXhwb3J0X3V0aWxzJTIwaW1wb3J0JTIwZW5jb2RlX3ZpZGVvJTBBZnJvbSUyMGRpZmZ1c2Vycy5waXBlbGluZXMubHR4Mi51dGlscyUyMGltcG9ydCUyMERFRkFVTFRfTkVHQVRJVkVfUFJPTVBUJTJDJTIwVDJWX0RFRkFVTFRfU1lTVEVNX1BST01QVCUwQSUwQWRldmljZSUyMCUzRCUyMCUyMmN1ZGElMjI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jZV9zY2FsZSUzRDcuMCUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvX3N0Z19zY2FsZSUzRDEuMCUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvX21vZGFsaXR5X3NjYWxlJTNEMy4wJTJDJTBBJTIwJTIwJTIwJTIwYXVkaW9fZ3VpZGFuY2VfcmVzY2FsZSUzRDAuNyUyQyUwQSUyMCUyMCUyMCUyMHNwYXRpb190ZW1wb3JhbF9ndWlkYW5jZV9ibG9ja3MlM0QlNUIyOCU1RCUyQyUwQSUyMCUyMCUyMCUyMHVzZV9jcm9zc190aW1lc3RlcCUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBzeXN0ZW1fcHJvbXB0JTNEVDJWX0RFRkFVTFRfU1lTVEVNX1BST01QVCUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF90eXBlJTNEJTIybnAlMjIlMkMlMEElMjAlMjAlMjAlMjByZXR1cm5fZGljdCUzREZhbHNlJTJDJTBBKSUwQSUwQWVuY29kZV92aWRlbyglMEElMjAlMjAlMjAlMjB2aWRlbyU1QjAlNUQlMkMlMEElMjAlMjAlMjAlMjBmcHMlM0RmcmFtZV9yYXRlJTJDJTBBJTIwJTIwJTIwJTIwYXVkaW8lM0RhdWRpbyU1QjAlNUQuZmxvYXQoKS5jcHUoKSUyQyUwQSUyMCUyMCUyMCUyMGF1ZGlvX3NhbXBsZV9yYXRlJTNEcGlwZS52b2NvZGVyLmNvbmZpZy5vdXRwdXRfc2FtcGxpbmdfcmF0ZSUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF9wYXRoJTNEJTIybHR4Ml8zX3Qydl9zdGFnZV8xLm1wNCUyMiUyQyUwQSk=",highlighted:`<span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Gemma3Processor | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LTX2Pipeline | |
| <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.pipelines.ltx2.utils <span class="hljs-keyword">import</span> DEFAULT_NEGATIVE_PROMPT, T2V_DEFAULT_SYSTEM_PROMPT | |
| 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> | |
| frame_rate = <span class="hljs-number">24.0</span> | |
| generator = torch.Generator(device).manual_seed(random_seed) | |
| model_path = <span class="hljs-string">"diffusers/LTX-2.3-Diffusers"</span> | |
| pipe = LTX2Pipeline.from_pretrained(model_path, torch_dtype=torch.bfloat16) | |
| pipe.enable_model_cpu_offload(device=device) | |
| pipe.vae.enable_tiling() | |
| <span class="hljs-keyword">if</span> <span class="hljs-built_in">getattr</span>(pipe, <span class="hljs-string">"processor"</span>, <span class="hljs-literal">None</span>) <span class="hljs-keyword">is</span> <span class="hljs-literal">None</span>: | |
| processor = Gemma3Processor.from_pretrained(<span class="hljs-string">"google/gemma-3-12b-it-qat-q4_0-unquantized"</span>) | |
| pipe.processor = processor | |
| prompt = ( | |
| <span class="hljs-string">"An astronaut hatches from a fragile egg on the surface of the Moon, the shell cracking and peeling apart in "</span> | |
| <span class="hljs-string">"gentle low-gravity motion. Fine lunar dust lifts and drifts outward with each movement, floating in slow arcs "</span> | |
| <span class="hljs-string">"before settling back onto the ground. The astronaut pushes free in a deliberate, weightless motion, small "</span> | |
| <span class="hljs-string">"fragments of the egg tumbling and spinning through the air. In the background, the deep darkness of space subtly "</span> | |
| <span class="hljs-string">"shifts as stars glide with the camera's movement, emphasizing vast depth and scale. The camera performs a "</span> | |
| <span class="hljs-string">"smooth, cinematic slow push-in, with natural parallax between the foreground dust, the astronaut, and the "</span> | |
| <span class="hljs-string">"distant starfield. Ultra-realistic detail, physically accurate low-gravity motion, cinematic lighting, and a "</span> | |
| <span class="hljs-string">"breath-taking, movie-like shot."</span> | |
| ) | |
| video, audio = pipe( | |
| prompt=prompt, | |
| negative_prompt=DEFAULT_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">30</span>, | |
| guidance_scale=<span class="hljs-number">3.0</span>, | |
| stg_scale=<span class="hljs-number">1.0</span>, | |
| modality_scale=<span class="hljs-number">3.0</span>, | |
| guidance_rescale=<span class="hljs-number">0.7</span>, | |
| audio_guidance_scale=<span class="hljs-number">7.0</span>, | |
| audio_stg_scale=<span class="hljs-number">1.0</span>, | |
| audio_modality_scale=<span class="hljs-number">3.0</span>, | |
| audio_guidance_rescale=<span class="hljs-number">0.7</span>, | |
| spatio_temporal_guidance_blocks=[<span class="hljs-number">28</span>], | |
| use_cross_timestep=<span class="hljs-literal">True</span>, | |
| system_prompt=T2V_DEFAULT_SYSTEM_PROMPT, | |
| 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_3_t2v_stage_1.mp4"</span>, | |
| )`,lang:"py",wrap:!1}}),Ie=new k({props:{title:"LTX2Pipeline",local:"diffusers.LTX2Pipeline",headingTag:"h2"}}),Ve=new v({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:": GemmaTokenizer"},{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_13803/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_13803/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_13803/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_13803/src/diffusers/pipelines/ltx2/pipeline_ltx2.py#L185"}}),Be=new v({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__.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 (<code>guidance_scale < 1</code>).`,name:"negative_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_13803/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> | |
| `}}),H=new Vn({props:{anchor:"diffusers.LTX2Pipeline.__call__.example",$$slots:{default:[ba]},$$scope:{ctx:W}}}),Ce=new v({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_13803/src/diffusers/pipelines/ltx2/pipeline_ltx2.py#L337"}}),ke=new v({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_13803/src/diffusers/pipelines/ltx2/pipeline_ltx2.py#L423"}}),We=new k({props:{title:"LTX2ImageToVideoPipeline",local:"diffusers.LTX2ImageToVideoPipeline",headingTag:"h2"}}),xe=new v({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:": GemmaTokenizer"},{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_13803/src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py#L205"}}),Re=new v({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__.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 (<code>guidance_scale < 1</code>).`,name:"negative_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_13803/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> | |
| `}}),$=new Vn({props:{anchor:"diffusers.LTX2ImageToVideoPipeline.__call__.example",$$slots:{default:[Ua]},$$scope:{ctx:W}}}),Ne=new v({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_13803/src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py#L342"}}),Le=new v({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_13803/src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py#L428"}}),Ee=new k({props:{title:"LTX2ConditionPipeline",local:"diffusers.LTX2ConditionPipeline",headingTag:"h2"}}),Fe=new v({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:": GemmaTokenizer"},{name:"connectors",val:": LTX2TextConnectors"},{name:"transformer",val:": LTX2VideoTransformer3DModel"},{name:"vocoder",val:": diffusers.pipelines.ltx2.vocoder.LTX2Vocoder | diffusers.pipelines.ltx2.vocoder.LTX2VocoderWithBWE"},{name:"audio_scheduler",val:": diffusers.schedulers.scheduling_flow_match_euler_discrete.FlowMatchEulerDiscreteScheduler | None = None"}],source:"https://github.com/huggingface/diffusers/blob/vr_13803/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py#L236"}}),Qe=new v({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__.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 (<code>guidance_scale < 1</code>).`,name:"negative_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_13803/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py#L1174",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> | |
| `}}),K=new Vn({props:{anchor:"diffusers.LTX2ConditionPipeline.__call__.example",$$slots:{default:[ja]},$$scope:{ctx:W}}}),Ye=new v({props:{name:"apply_first_frame_conditioning",anchor:"diffusers.LTX2ConditionPipeline.apply_first_frame_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_first_frame_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_first_frame_conditioning.conditioning_mask",description:`<strong>conditioning_mask</strong> (<code>torch.Tensor</code>) — | |
| Initial packed (patchified) conditioning mask of shape [batch_size, patch_seq_len, 1] with values in | |
| [0, 1] where 0 means the denoising model output will be fully used and 1 means the condition will be | |
| fully used.`,name:"conditioning_mask"}],source:"https://github.com/huggingface/diffusers/blob/vr_13803/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py#L793",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>Returns a 3-tuple of tensors where:</p> | |
| <ol> | |
| <li>The packed video latents with first-frame conditions applied.</li> | |
| <li>The packed conditioning mask with first-frame strengths applied.</li> | |
| <li>The clean conditioning latents at first-frame positions (zeros elsewhere).</li> | |
| </ol> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>Tuple[torch.Tensor, torch.Tensor, torch.Tensor]</code></p> | |
| `}}),Ae=new v({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_13803/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py#L381"}}),Se=new v({props:{name:"prepare_latents",anchor:"diffusers.LTX2ConditionPipeline.prepare_latents",parameters:[{name:"conditions",val:": diffusers.pipelines.ltx2.pipeline_ltx2_condition.LTX2VideoCondition | list[diffusers.pipelines.ltx2.pipeline_ltx2_condition.LTX2VideoCondition] | None = None"},{name:"batch_size",val:": int = 1"},{name:"num_channels_latents",val:": int = 128"},{name:"height",val:": int = 512"},{name:"width",val:": int = 768"},{name:"num_frames",val:": int = 121"},{name:"frame_rate",val:": float = 24.0"},{name:"noise_scale",val:": float = 1.0"},{name:"dtype",val:": torch.dtype | None = None"},{name:"device",val:": torch.device | None = None"},{name:"generator",val:": torch._C.Generator | None = None"},{name:"latents",val:": torch.Tensor | None = None"}],source:"https://github.com/huggingface/diffusers/blob/vr_13803/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py#L900"}}),He=new v({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_13803/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py#L686",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>Returns a 4-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 latent-space indices for each condition.</li> | |
| <li>The fourth list is a list of (trimmed) pixel-space frame counts per condition. This is needed | |
| for keyframe coord semantics (single-pixel-frame keyframes have a clamped temporal extent).</li> | |
| </ol> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>Tuple[List[torch.Tensor], List[float], List[int], List[int]]</code></p> | |
| `}}),ze=new v({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_13803/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py#L669",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> | |
| `}}),Pe=new k({props:{title:"LTX2LatentUpsamplePipeline",local:"diffusers.LTX2LatentUpsamplePipeline",headingTag:"h2"}}),$e=new v({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_13803/src/diffusers/pipelines/ltx2/pipeline_ltx2_latent_upsample.py#L104"}}),De=new v({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_13803/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> | |
| `}}),ne=new Vn({props:{anchor:"diffusers.LTX2LatentUpsamplePipeline.__call__.example",$$slots:{default:[va]},$$scope:{ctx:W}}}),qe=new v({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_13803/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> | |
| `}}),Ke=new v({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_13803/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> | |
| `}}),Oe=new k({props:{title:"LTX2PipelineOutput",local:"diffusers.pipelines.ltx2.pipeline_output.LTX2PipelineOutput",headingTag:"h2"}}),et=new v({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_13803/src/diffusers/pipelines/ltx2/pipeline_output.py#L9"}}),tt=new Ja({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/ltx2.md"}}),{c(){f=l("meta"),X=a(),y=l("p"),_=a(),c(T.$$.fragment),r=a(),J=l("div"),J.innerHTML=Zs,Lt=a(),oe=l("p"),oe.innerHTML=Gs,Et=a(),le=l("p"),le.innerHTML=Xs,Ft=a(),ie=l("p"),ie.innerHTML=Is,Qt=a(),c(de.$$.fragment),Yt=a(),re=l("p"),re.textContent=Vs,At=a(),pe=l("ul"),pe.innerHTML=Bs,St=a(),ce=l("p"),ce.textContent=Cs,Ht=a(),c(me.$$.fragment),zt=a(),c(ue.$$.fragment),Pt=a(),he=l("p"),he.textContent=ks,$t=a(),c(ge.$$.fragment),Dt=a(),c(Me.$$.fragment),qt=a(),fe=l("p"),fe.innerHTML=Ws,Kt=a(),c(_e.$$.fragment),Ot=a(),Te=l("p"),Te.textContent=xs,en=a(),c(ye.$$.fragment),tn=a(),we=l("p"),we.textContent=Rs,nn=a(),c(Je.$$.fragment),sn=a(),be=l("p"),be.textContent=Ns,an=a(),Ue=l("ol"),Ue.innerHTML=Ls,on=a(),je=l("p"),je.innerHTML=Es,ln=a(),c(ve.$$.fragment),dn=a(),c(Ze.$$.fragment),rn=a(),Ge=l("p"),Ge.innerHTML=Fs,pn=a(),c(Xe.$$.fragment),cn=a(),c(Ie.$$.fragment),mn=a(),G=l("div"),c(Ve.$$.fragment),Cn=a(),at=l("p"),at.textContent=Qs,kn=a(),ot=l("p"),ot.innerHTML=Ys,Wn=a(),x=l("div"),c(Be.$$.fragment),xn=a(),lt=l("p"),lt.textContent=As,Rn=a(),c(H.$$.fragment),Nn=a(),z=l("div"),c(Ce.$$.fragment),Ln=a(),it=l("p"),it.textContent=Ss,En=a(),P=l("div"),c(ke.$$.fragment),Fn=a(),dt=l("p"),dt.innerHTML=Hs,un=a(),c(We.$$.fragment),hn=a(),Z=l("div"),c(xe.$$.fragment),Qn=a(),rt=l("p"),rt.textContent=zs,Yn=a(),pt=l("p"),pt.innerHTML=Ps,An=a(),ct=l("p"),ct.textContent=$s,Sn=a(),R=l("div"),c(Re.$$.fragment),Hn=a(),mt=l("p"),mt.textContent=Ds,zn=a(),c($.$$.fragment),Pn=a(),D=l("div"),c(Ne.$$.fragment),$n=a(),ut=l("p"),ut.textContent=qs,Dn=a(),q=l("div"),c(Le.$$.fragment),qn=a(),ht=l("p"),ht.innerHTML=Ks,gn=a(),c(Ee.$$.fragment),Mn=a(),w=l("div"),c(Fe.$$.fragment),Kn=a(),gt=l("p"),gt.textContent=Os,On=a(),Mt=l("p"),Mt.innerHTML=ea,es=a(),ft=l("p"),ft.textContent=ta,ts=a(),N=l("div"),c(Qe.$$.fragment),ns=a(),_t=l("p"),_t.textContent=na,ss=a(),c(K.$$.fragment),as=a(),L=l("div"),c(Ye.$$.fragment),os=a(),Tt=l("p"),Tt.textContent=sa,ls=a(),yt=l("p"),yt.innerHTML=aa,is=a(),O=l("div"),c(Ae.$$.fragment),ds=a(),wt=l("p"),wt.textContent=oa,rs=a(),V=l("div"),c(Se.$$.fragment),ps=a(),Jt=l("p"),Jt.textContent=la,cs=a(),bt=l("p"),bt.innerHTML=ia,ms=a(),Ut=l("p"),Ut.textContent=da,us=a(),jt=l("ul"),jt.innerHTML=ra,hs=a(),ee=l("div"),c(He.$$.fragment),gs=a(),vt=l("p"),vt.textContent=pa,Ms=a(),te=l("div"),c(ze.$$.fragment),fs=a(),Zt=l("p"),Zt.textContent=ca,fn=a(),c(Pe.$$.fragment),_n=a(),C=l("div"),c($e.$$.fragment),_s=a(),E=l("div"),c(De.$$.fragment),Ts=a(),Gt=l("p"),Gt.textContent=ma,ys=a(),c(ne.$$.fragment),ws=a(),se=l("div"),c(qe.$$.fragment),Js=a(),Xt=l("p"),Xt.textContent=ua,bs=a(),F=l("div"),c(Ke.$$.fragment),Us=a(),It=l("p"),It.textContent=ha,js=a(),Vt=l("p"),Vt.innerHTML=ga,Tn=a(),c(Oe.$$.fragment),yn=a(),A=l("div"),c(et.$$.fragment),vs=a(),Bt=l("p"),Bt.textContent=Ma,wn=a(),c(tt.$$.fragment),Jn=a(),Nt=l("p"),this.h()},l(e){const s=wa("svelte-u9bgzb",document.head);f=i(s,"META",{name:!0,content:!0}),s.forEach(t),X=o(e),y=i(e,"P",{}),U(y).forEach(t),_=o(e),m(T.$$.fragment,e),r=o(e),J=i(e,"DIV",{class:!0,"data-svelte-h":!0}),p(J)!=="svelte-si9ct8"&&(J.innerHTML=Zs),Lt=o(e),oe=i(e,"P",{"data-svelte-h":!0}),p(oe)!=="svelte-3vo67t"&&(oe.innerHTML=Gs),Et=o(e),le=i(e,"P",{"data-svelte-h":!0}),p(le)!=="svelte-1134kk7"&&(le.innerHTML=Xs),Ft=o(e),ie=i(e,"P",{"data-svelte-h":!0}),p(ie)!=="svelte-qw2r3a"&&(ie.innerHTML=Is),Qt=o(e),m(de.$$.fragment,e),Yt=o(e),re=i(e,"P",{"data-svelte-h":!0}),p(re)!=="svelte-7k8pa1"&&(re.textContent=Vs),At=o(e),pe=i(e,"UL",{"data-svelte-h":!0}),p(pe)!=="svelte-12js9fh"&&(pe.innerHTML=Bs),St=o(e),ce=i(e,"P",{"data-svelte-h":!0}),p(ce)!=="svelte-v5oo8i"&&(ce.textContent=Cs),Ht=o(e),m(me.$$.fragment,e),zt=o(e),m(ue.$$.fragment,e),Pt=o(e),he=i(e,"P",{"data-svelte-h":!0}),p(he)!=="svelte-71u96j"&&(he.textContent=ks),$t=o(e),m(ge.$$.fragment,e),Dt=o(e),m(Me.$$.fragment,e),qt=o(e),fe=i(e,"P",{"data-svelte-h":!0}),p(fe)!=="svelte-rabflj"&&(fe.innerHTML=Ws),Kt=o(e),m(_e.$$.fragment,e),Ot=o(e),Te=i(e,"P",{"data-svelte-h":!0}),p(Te)!=="svelte-1nr79xi"&&(Te.textContent=xs),en=o(e),m(ye.$$.fragment,e),tn=o(e),we=i(e,"P",{"data-svelte-h":!0}),p(we)!=="svelte-q9sktm"&&(we.textContent=Rs),nn=o(e),m(Je.$$.fragment,e),sn=o(e),be=i(e,"P",{"data-svelte-h":!0}),p(be)!=="svelte-mni5wh"&&(be.textContent=Ns),an=o(e),Ue=i(e,"OL",{"data-svelte-h":!0}),p(Ue)!=="svelte-azzl8m"&&(Ue.innerHTML=Ls),on=o(e),je=i(e,"P",{"data-svelte-h":!0}),p(je)!=="svelte-1k5mdn5"&&(je.innerHTML=Es),ln=o(e),m(ve.$$.fragment,e),dn=o(e),m(Ze.$$.fragment,e),rn=o(e),Ge=i(e,"P",{"data-svelte-h":!0}),p(Ge)!=="svelte-iec67l"&&(Ge.innerHTML=Fs),pn=o(e),m(Xe.$$.fragment,e),cn=o(e),m(Ie.$$.fragment,e),mn=o(e),G=i(e,"DIV",{class:!0});var I=U(G);m(Ve.$$.fragment,I),Cn=o(I),at=i(I,"P",{"data-svelte-h":!0}),p(at)!=="svelte-19ipoo4"&&(at.textContent=Qs),kn=o(I),ot=i(I,"P",{"data-svelte-h":!0}),p(ot)!=="svelte-1sr6eg8"&&(ot.innerHTML=Ys),Wn=o(I),x=i(I,"DIV",{class:!0});var S=U(x);m(Be.$$.fragment,S),xn=o(S),lt=i(S,"P",{"data-svelte-h":!0}),p(lt)!=="svelte-v78lg8"&&(lt.textContent=As),Rn=o(S),m(H.$$.fragment,S),S.forEach(t),Nn=o(I),z=i(I,"DIV",{class:!0});var nt=U(z);m(Ce.$$.fragment,nt),Ln=o(nt),it=i(nt,"P",{"data-svelte-h":!0}),p(it)!=="svelte-16q0ax1"&&(it.textContent=Ss),nt.forEach(t),En=o(I),P=i(I,"DIV",{class:!0});var st=U(P);m(ke.$$.fragment,st),Fn=o(st),dt=i(st,"P",{"data-svelte-h":!0}),p(dt)!=="svelte-ycu0kg"&&(dt.innerHTML=Hs),st.forEach(t),I.forEach(t),un=o(e),m(We.$$.fragment,e),hn=o(e),Z=i(e,"DIV",{class:!0});var B=U(Z);m(xe.$$.fragment,B),Qn=o(B),rt=i(B,"P",{"data-svelte-h":!0}),p(rt)!=="svelte-10tczlw"&&(rt.textContent=zs),Yn=o(B),pt=i(B,"P",{"data-svelte-h":!0}),p(pt)!=="svelte-1sr6eg8"&&(pt.innerHTML=Ps),An=o(B),ct=i(B,"P",{"data-svelte-h":!0}),p(ct)!=="svelte-1yyqpus"&&(ct.textContent=$s),Sn=o(B),R=i(B,"DIV",{class:!0});var Ct=U(R);m(Re.$$.fragment,Ct),Hn=o(Ct),mt=i(Ct,"P",{"data-svelte-h":!0}),p(mt)!=="svelte-v78lg8"&&(mt.textContent=Ds),zn=o(Ct),m($.$$.fragment,Ct),Ct.forEach(t),Pn=o(B),D=i(B,"DIV",{class:!0});var Un=U(D);m(Ne.$$.fragment,Un),$n=o(Un),ut=i(Un,"P",{"data-svelte-h":!0}),p(ut)!=="svelte-16q0ax1"&&(ut.textContent=qs),Un.forEach(t),Dn=o(B),q=i(B,"DIV",{class:!0});var jn=U(q);m(Le.$$.fragment,jn),qn=o(jn),ht=i(jn,"P",{"data-svelte-h":!0}),p(ht)!=="svelte-ycu0kg"&&(ht.innerHTML=Ks),jn.forEach(t),B.forEach(t),gn=o(e),m(Ee.$$.fragment,e),Mn=o(e),w=i(e,"DIV",{class:!0});var j=U(w);m(Fe.$$.fragment,j),Kn=o(j),gt=i(j,"P",{"data-svelte-h":!0}),p(gt)!=="svelte-8bvrgw"&&(gt.textContent=Os),On=o(j),Mt=i(j,"P",{"data-svelte-h":!0}),p(Mt)!=="svelte-1sr6eg8"&&(Mt.innerHTML=ea),es=o(j),ft=i(j,"P",{"data-svelte-h":!0}),p(ft)!=="svelte-1yyqpus"&&(ft.textContent=ta),ts=o(j),N=i(j,"DIV",{class:!0});var kt=U(N);m(Qe.$$.fragment,kt),ns=o(kt),_t=i(kt,"P",{"data-svelte-h":!0}),p(_t)!=="svelte-v78lg8"&&(_t.textContent=na),ss=o(kt),m(K.$$.fragment,kt),kt.forEach(t),as=o(j),L=i(j,"DIV",{class:!0});var Wt=U(L);m(Ye.$$.fragment,Wt),os=o(Wt),Tt=i(Wt,"P",{"data-svelte-h":!0}),p(Tt)!=="svelte-1ykv0p4"&&(Tt.textContent=sa),ls=o(Wt),yt=i(Wt,"P",{"data-svelte-h":!0}),p(yt)!=="svelte-gkp5jx"&&(yt.innerHTML=aa),Wt.forEach(t),is=o(j),O=i(j,"DIV",{class:!0});var vn=U(O);m(Ae.$$.fragment,vn),ds=o(vn),wt=i(vn,"P",{"data-svelte-h":!0}),p(wt)!=="svelte-16q0ax1"&&(wt.textContent=oa),vn.forEach(t),rs=o(j),V=i(j,"DIV",{class:!0});var Q=U(V);m(Se.$$.fragment,Q),ps=o(Q),Jt=i(Q,"P",{"data-svelte-h":!0}),p(Jt)!=="svelte-14h95ik"&&(Jt.textContent=la),cs=o(Q),bt=i(Q,"P",{"data-svelte-h":!0}),p(bt)!=="svelte-4xxbdz"&&(bt.innerHTML=ia),ms=o(Q),Ut=i(Q,"P",{"data-svelte-h":!0}),p(Ut)!=="svelte-5nbc7d"&&(Ut.textContent=da),us=o(Q),jt=i(Q,"UL",{"data-svelte-h":!0}),p(jt)!=="svelte-14hshfo"&&(jt.innerHTML=ra),Q.forEach(t),hs=o(j),ee=i(j,"DIV",{class:!0});var Zn=U(ee);m(He.$$.fragment,Zn),gs=o(Zn),vt=i(Zn,"P",{"data-svelte-h":!0}),p(vt)!=="svelte-176er7i"&&(vt.textContent=pa),Zn.forEach(t),Ms=o(j),te=i(j,"DIV",{class:!0});var Gn=U(te);m(ze.$$.fragment,Gn),fs=o(Gn),Zt=i(Gn,"P",{"data-svelte-h":!0}),p(Zt)!=="svelte-1eod455"&&(Zt.textContent=ca),Gn.forEach(t),j.forEach(t),fn=o(e),m(Pe.$$.fragment,e),_n=o(e),C=i(e,"DIV",{class:!0});var ae=U(C);m($e.$$.fragment,ae),_s=o(ae),E=i(ae,"DIV",{class:!0});var xt=U(E);m(De.$$.fragment,xt),Ts=o(xt),Gt=i(xt,"P",{"data-svelte-h":!0}),p(Gt)!=="svelte-v78lg8"&&(Gt.textContent=ma),ys=o(xt),m(ne.$$.fragment,xt),xt.forEach(t),ws=o(ae),se=i(ae,"DIV",{class:!0});var Xn=U(se);m(qe.$$.fragment,Xn),Js=o(Xn),Xt=i(Xn,"P",{"data-svelte-h":!0}),p(Xt)!=="svelte-tr32vd"&&(Xt.textContent=ua),Xn.forEach(t),bs=o(ae),F=i(ae,"DIV",{class:!0});var Rt=U(F);m(Ke.$$.fragment,Rt),Us=o(Rt),It=i(Rt,"P",{"data-svelte-h":!0}),p(It)!=="svelte-1p9wfz7"&&(It.textContent=ha),js=o(Rt),Vt=i(Rt,"P",{"data-svelte-h":!0}),p(Vt)!=="svelte-7cxa61"&&(Vt.innerHTML=ga),Rt.forEach(t),ae.forEach(t),Tn=o(e),m(Oe.$$.fragment,e),yn=o(e),A=i(e,"DIV",{class:!0});var In=U(A);m(et.$$.fragment,In),vs=o(In),Bt=i(In,"P",{"data-svelte-h":!0}),p(Bt)!=="svelte-ia4jjd"&&(Bt.textContent=Ma),In.forEach(t),wn=o(e),m(tt.$$.fragment,e),Jn=o(e),Nt=i(e,"P",{}),U(Nt).forEach(t),this.h()},h(){b(f,"name","hf:doc:metadata"),b(f,"content",Ga),b(J,"class","flex flex-wrap space-x-1"),b(x,"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(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(G,"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(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(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(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(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(O,"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(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(te,"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(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(A,"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,s){n(document.head,f),d(e,X,s),d(e,y,s),d(e,_,s),u(T,e,s),d(e,r,s),d(e,J,s),d(e,Lt,s),d(e,oe,s),d(e,Et,s),d(e,le,s),d(e,Ft,s),d(e,ie,s),d(e,Qt,s),u(de,e,s),d(e,Yt,s),d(e,re,s),d(e,At,s),d(e,pe,s),d(e,St,s),d(e,ce,s),d(e,Ht,s),u(me,e,s),d(e,zt,s),u(ue,e,s),d(e,Pt,s),d(e,he,s),d(e,$t,s),u(ge,e,s),d(e,Dt,s),u(Me,e,s),d(e,qt,s),d(e,fe,s),d(e,Kt,s),u(_e,e,s),d(e,Ot,s),d(e,Te,s),d(e,en,s),u(ye,e,s),d(e,tn,s),d(e,we,s),d(e,nn,s),u(Je,e,s),d(e,sn,s),d(e,be,s),d(e,an,s),d(e,Ue,s),d(e,on,s),d(e,je,s),d(e,ln,s),u(ve,e,s),d(e,dn,s),u(Ze,e,s),d(e,rn,s),d(e,Ge,s),d(e,pn,s),u(Xe,e,s),d(e,cn,s),u(Ie,e,s),d(e,mn,s),d(e,G,s),u(Ve,G,null),n(G,Cn),n(G,at),n(G,kn),n(G,ot),n(G,Wn),n(G,x),u(Be,x,null),n(x,xn),n(x,lt),n(x,Rn),u(H,x,null),n(G,Nn),n(G,z),u(Ce,z,null),n(z,Ln),n(z,it),n(G,En),n(G,P),u(ke,P,null),n(P,Fn),n(P,dt),d(e,un,s),u(We,e,s),d(e,hn,s),d(e,Z,s),u(xe,Z,null),n(Z,Qn),n(Z,rt),n(Z,Yn),n(Z,pt),n(Z,An),n(Z,ct),n(Z,Sn),n(Z,R),u(Re,R,null),n(R,Hn),n(R,mt),n(R,zn),u($,R,null),n(Z,Pn),n(Z,D),u(Ne,D,null),n(D,$n),n(D,ut),n(Z,Dn),n(Z,q),u(Le,q,null),n(q,qn),n(q,ht),d(e,gn,s),u(Ee,e,s),d(e,Mn,s),d(e,w,s),u(Fe,w,null),n(w,Kn),n(w,gt),n(w,On),n(w,Mt),n(w,es),n(w,ft),n(w,ts),n(w,N),u(Qe,N,null),n(N,ns),n(N,_t),n(N,ss),u(K,N,null),n(w,as),n(w,L),u(Ye,L,null),n(L,os),n(L,Tt),n(L,ls),n(L,yt),n(w,is),n(w,O),u(Ae,O,null),n(O,ds),n(O,wt),n(w,rs),n(w,V),u(Se,V,null),n(V,ps),n(V,Jt),n(V,cs),n(V,bt),n(V,ms),n(V,Ut),n(V,us),n(V,jt),n(w,hs),n(w,ee),u(He,ee,null),n(ee,gs),n(ee,vt),n(w,Ms),n(w,te),u(ze,te,null),n(te,fs),n(te,Zt),d(e,fn,s),u(Pe,e,s),d(e,_n,s),d(e,C,s),u($e,C,null),n(C,_s),n(C,E),u(De,E,null),n(E,Ts),n(E,Gt),n(E,ys),u(ne,E,null),n(C,ws),n(C,se),u(qe,se,null),n(se,Js),n(se,Xt),n(C,bs),n(C,F),u(Ke,F,null),n(F,Us),n(F,It),n(F,js),n(F,Vt),d(e,Tn,s),u(Oe,e,s),d(e,yn,s),d(e,A,s),u(et,A,null),n(A,vs),n(A,Bt),d(e,wn,s),u(tt,e,s),d(e,Jn,s),d(e,Nt,s),bn=!0},p(e,[s]){const I={};s&2&&(I.$$scope={dirty:s,ctx:e}),H.$set(I);const S={};s&2&&(S.$$scope={dirty:s,ctx:e}),$.$set(S);const nt={};s&2&&(nt.$$scope={dirty:s,ctx:e}),K.$set(nt);const st={};s&2&&(st.$$scope={dirty:s,ctx:e}),ne.$set(st)},i(e){bn||(h(T.$$.fragment,e),h(de.$$.fragment,e),h(me.$$.fragment,e),h(ue.$$.fragment,e),h(ge.$$.fragment,e),h(Me.$$.fragment,e),h(_e.$$.fragment,e),h(ye.$$.fragment,e),h(Je.$$.fragment,e),h(ve.$$.fragment,e),h(Ze.$$.fragment,e),h(Xe.$$.fragment,e),h(Ie.$$.fragment,e),h(Ve.$$.fragment,e),h(Be.$$.fragment,e),h(H.$$.fragment,e),h(Ce.$$.fragment,e),h(ke.$$.fragment,e),h(We.$$.fragment,e),h(xe.$$.fragment,e),h(Re.$$.fragment,e),h($.$$.fragment,e),h(Ne.$$.fragment,e),h(Le.$$.fragment,e),h(Ee.$$.fragment,e),h(Fe.$$.fragment,e),h(Qe.$$.fragment,e),h(K.$$.fragment,e),h(Ye.$$.fragment,e),h(Ae.$$.fragment,e),h(Se.$$.fragment,e),h(He.$$.fragment,e),h(ze.$$.fragment,e),h(Pe.$$.fragment,e),h($e.$$.fragment,e),h(De.$$.fragment,e),h(ne.$$.fragment,e),h(qe.$$.fragment,e),h(Ke.$$.fragment,e),h(Oe.$$.fragment,e),h(et.$$.fragment,e),h(tt.$$.fragment,e),bn=!0)},o(e){g(T.$$.fragment,e),g(de.$$.fragment,e),g(me.$$.fragment,e),g(ue.$$.fragment,e),g(ge.$$.fragment,e),g(Me.$$.fragment,e),g(_e.$$.fragment,e),g(ye.$$.fragment,e),g(Je.$$.fragment,e),g(ve.$$.fragment,e),g(Ze.$$.fragment,e),g(Xe.$$.fragment,e),g(Ie.$$.fragment,e),g(Ve.$$.fragment,e),g(Be.$$.fragment,e),g(H.$$.fragment,e),g(Ce.$$.fragment,e),g(ke.$$.fragment,e),g(We.$$.fragment,e),g(xe.$$.fragment,e),g(Re.$$.fragment,e),g($.$$.fragment,e),g(Ne.$$.fragment,e),g(Le.$$.fragment,e),g(Ee.$$.fragment,e),g(Fe.$$.fragment,e),g(Qe.$$.fragment,e),g(K.$$.fragment,e),g(Ye.$$.fragment,e),g(Ae.$$.fragment,e),g(Se.$$.fragment,e),g(He.$$.fragment,e),g(ze.$$.fragment,e),g(Pe.$$.fragment,e),g($e.$$.fragment,e),g(De.$$.fragment,e),g(ne.$$.fragment,e),g(qe.$$.fragment,e),g(Ke.$$.fragment,e),g(Oe.$$.fragment,e),g(et.$$.fragment,e),g(tt.$$.fragment,e),bn=!1},d(e){e&&(t(X),t(y),t(_),t(r),t(J),t(Lt),t(oe),t(Et),t(le),t(Ft),t(ie),t(Qt),t(Yt),t(re),t(At),t(pe),t(St),t(ce),t(Ht),t(zt),t(Pt),t(he),t($t),t(Dt),t(qt),t(fe),t(Kt),t(Ot),t(Te),t(en),t(tn),t(we),t(nn),t(sn),t(be),t(an),t(Ue),t(on),t(je),t(ln),t(dn),t(rn),t(Ge),t(pn),t(cn),t(mn),t(G),t(un),t(hn),t(Z),t(gn),t(Mn),t(w),t(fn),t(_n),t(C),t(Tn),t(yn),t(A),t(wn),t(Jn),t(Nt)),t(f),M(T,e),M(de,e),M(me,e),M(ue,e),M(ge,e),M(Me,e),M(_e,e),M(ye,e),M(Je,e),M(ve,e),M(Ze,e),M(Xe,e),M(Ie,e),M(Ve),M(Be),M(H),M(Ce),M(ke),M(We,e),M(xe),M(Re),M($),M(Ne),M(Le),M(Ee,e),M(Fe),M(Qe),M(K),M(Ye),M(Ae),M(Se),M(He),M(ze),M(Pe,e),M($e),M(De),M(ne),M(qe),M(Ke),M(Oe,e),M(et),M(tt,e)}}}const Ga='{"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":"Multimodal Guidance","local":"multimodal-guidance","sections":[],"depth":2},{"title":"Prompt Enhancement","local":"prompt-enhancement","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 Xa(W){return _a(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xa extends Ta{constructor(f){super(),ya(this,f,Xa,Za,fa,{})}}export{xa as component}; | |
Xet Storage Details
- Size:
- 202 kB
- Xet hash:
- 8a48c1f2d5939a4ed6c2bcdc992b70568dae8361922450e2bf7ca97cb185dceb
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.