From a2cccddee0dc3f0972f4eb2537de1aaf259f8b80 Mon Sep 17 00:00:00 2001 From: CalamitousFelicitousness Date: Sat, 25 Apr 2026 21:15:06 +0100 Subject: [PATCH] fix(ltx): scale fps to preserve duration with RIFE interpolation LTX conditions the model on mp4_fps as the source frame rate, then RIFE inflates frame count at save. Without compensation, save fps stays equal to source fps and the video becomes (mp4_interpolate+1)x slow-motion (e.g. 121 frames at 24 fps with mp4_interpolate=1 saved as 242 frames at 24 fps = 10s instead of the intended 5s). Scale the saved fps by the interpolation factor at the LTX call site so output duration matches user intent. FramePack already pre-divides mp4_fps at generation time (compute- saving semantic baked into UI math), so it does not need this fix. The pipelines now produce duration-correct output via two different mechanisms; standardization is tracked for the RIFE-in-processing follow-up. --- modules/ltx/ltx_process.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/ltx/ltx_process.py b/modules/ltx/ltx_process.py index 6717b63ab..1ec2ff53a 100644 --- a/modules/ltx/ltx_process.py +++ b/modules/ltx/ltx_process.py @@ -563,11 +563,14 @@ def run_ltx(task_id, except Exception: aac_sample_rate = 24000 + # LTX conditions the model on mp4_fps as the source frame rate; RIFE inflates frames at save time. + # Scale the saved fps by the interpolation factor so the output preserves the user's intended duration. + save_fps = mp4_fps * (mp4_interpolate + 1) if mp4_interpolate > 0 else mp4_fps num_frames, video_file, _thumb = save_video( p=p, pixels=pixels, audio=audio, - mp4_fps=mp4_fps, + mp4_fps=save_fps, mp4_codec=mp4_codec, mp4_opt=mp4_opt, mp4_ext=mp4_ext,