Downloads · 30 days
0
linoyts/ltx2-audio-video-conditioning
ltx2-audio-video-conditioning is a machine learning model from linoyts. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for diffusers. The card lists the license as apache-2.0.
A custom diffusers pipeline for LTX-2 that extends audio-to-video generation with video conditioning support.
Downloads · 30 days
0
Access
Public
Updated Feb 12, 2026
Repo size
—
Likes
4
Public
Click a slice to open those files.
.py65.1 KB · 93%
From the Hugging Face model README
A custom diffusers pipeline for LTX-2 that extends audio-to-video generation with video conditioning support.
pip install diffusers transformers torch torchaudio av
import torch
from diffusers import DiffusionPipeline
from diffusers.utils import load_image
# Load pipeline with custom video conditioning support
pipe = DiffusionPipeline.from_pretrained(
"Lightricks/LTX-2",
custom_pipeline="linoyts/ltx2-audio-video-conditioning",
torch_dtype=torch.bfloat16
)
pipe.to("cuda")
# Optional: Load a LoRA (e.g., face-swap)
# pipe.load_lora_weights("Alissonerdx/BFS-Best-Face-Swap-Video",
# weight_name="ltx-2/head_swap_v1_13500_first_frame.safetensors")
# pipe.fuse_lora(lora_scale=1.1)
# Load inputs
image = load_image("input_face.png")
# Generate with video conditioning
video, audio = pipe(
image=image, # Frame 0 appearance
video="reference_motion.mp4", # Video for motion conditioning
video_conditioning_strength=1.0, # How strongly to follow motion (0-1)
video_conditioning_frame_idx=1, # Start video conditioning at frame 1
audio="audio.wav", # Audio for lip-sync
prompt="a person speaking naturally, smooth animation",
negative_prompt="low quality, blurry, distorted",
width=512,
height=768,
num_frames=121,
frame_rate=24.0,
num_inference_steps=40,
guidance_scale=4.0,
return_dict=False,
)
| Parameter | Type | Default | Description |
|---|---|---|---|
image | PIL.Image | None | Input image for frame 0 conditioning |
video | str/List/Tensor | None | Reference video for motion conditioning |
video_conditioning_strength | float | 1.0 | Strength of video conditioning (0.0-1.0) |
video_conditioning_frame_idx | int | 1 | Frame index where video conditioning starts |
audio | str/Tensor | None | Audio input for lip-sync |
0: Video conditioning replaces all frames1 (default): Frame 0 = image, frames 1+ = video motionN: Frames 0 to N-1 = image/noise, frames N+ = video conditioningFor faster generation with the distilled model:
pipe = DiffusionPipeline.from_pretrained(
"rootonchair/LTX-2-19b-distilled",
custom_pipeline="linoyts/ltx2-audio-video-conditioning",
torch_dtype=torch.bfloat16
)
pipe.to("cuda")
DISTILLED_SIGMAS = [1.0, 0.99375, 0.9875, 0.98125, 0.975, 0.909375, 0.725, 0.421875]
video, audio = pipe(
image=image,
video="reference.mp4",
audio="audio.wav",
prompt="...",
num_inference_steps=8,
sigmas=DISTILLED_SIGMAS,
guidance_scale=1.0,
return_dict=False,
)
Apache 2.0