Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mlx_video/models/ltx_2/conditioning/latent.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ def apply_conditioning(
frame_idx = cond.frame_idx
strength = cond.strength

# Normalize negative indices (e.g. -1 -> last frame)
if frame_idx < 0:
frame_idx = frame_idx % f
Comment on lines +108 to +110
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apply_conditioning now supports negative frame_idx values via modulo normalization, but VideoConditionByLatentIndex’s docstring still describes frame_idx only as “0 = first frame”. Consider updating the public-facing documentation (class docstring and/or apply_conditioning doc) to explicitly state that negative indices are accepted (e.g., -1 = last frame).

Copilot uses AI. Check for mistakes.

# Validate shapes
_, cond_c, cond_f, cond_h, cond_w = cond_latent.shape
if (cond_c, cond_h, cond_w) != (c, h, w):
Expand Down
Loading
Loading