From b48bf5236b6534eb8d15600ad4a7a4e17fab9a6b Mon Sep 17 00:00:00 2001 From: CalamitousFelicitousness Date: Mon, 27 Apr 2026 01:13:47 +0100 Subject: [PATCH] fix(ltx): handle PIL list output from refine path in interpolation wiring LTX refine pipe uses output_type='pil' so result.frames[0] returns a list, not a 5-D tensor. Convert via images_to_tensor before the helper sees it, mirroring what save_video already does for the same input. --- modules/ltx/ltx_process.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/ltx/ltx_process.py b/modules/ltx/ltx_process.py index 778b0452b..28c58b2dd 100644 --- a/modules/ltx/ltx_process.py +++ b/modules/ltx/ltx_process.py @@ -563,10 +563,14 @@ def run_ltx(task_id, except Exception: aac_sample_rate = 24000 - if mp4_interpolate > 0: + if mp4_interpolate > 0 and pixels is not None: p.video_interpolate = mp4_interpolate from modules.processing_video import apply_video_interpolation - # pixels is 5-D (N,C,T,H,W); RIFE needs 4-D (T,C,H,W) in [0,1] + # refine path returns PIL list (output_type='pil'); decode path returns 5-D tensor + if isinstance(pixels, list) and len(pixels) > 0 and isinstance(pixels[0], Image.Image): + from modules.video_models.video_save import images_to_tensor + pixels = images_to_tensor(pixels) + # pixels is 5-D (N,C,T,H,W) in [-1,1]; RIFE needs 4-D (T,C,H,W) in [0,1] x = pixels.squeeze(0).permute(1, 0, 2, 3) x = (x.clamp(-1., 1.) + 1.0) * 0.5 x = apply_video_interpolation(p, x, count=mp4_interpolate)