Skip to content

Commit 811c79d

Browse files
committed
fix
1 parent 89fcf08 commit 811c79d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

fastvideo/models/dits/ltx2.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2907,6 +2907,7 @@ def forward(
29072907
skip_cross_modal_attn: bool = False,
29082908
skip_video_self_attn_blocks: list[int] | None = None,
29092909
skip_audio_self_attn_blocks: list[int] | None = None,
2910+
video_position_offset_sec: float = 0.0,
29102911
**kwargs,
29112912
) -> torch.Tensor:
29122913
if isinstance(encoder_hidden_states, list):
@@ -2959,7 +2960,10 @@ def forward(
29592960
DEFAULT_LTX2_SCALE_FACTORS,
29602961
fps=fps,
29612962
causal_fix=True,
2962-
).to(hidden_states.dtype)
2963+
)
2964+
if video_position_offset_sec:
2965+
positions[:, 0, ...] = positions[:, 0, ...] + float(video_position_offset_sec)
2966+
positions = positions.to(hidden_states.dtype)
29632967

29642968
# Pad positions to match padded sequence length for SP cross-attention
29652969
if sp_world_size > 1 and video_padded_seq_len > video_original_seq_len:

0 commit comments

Comments
 (0)