mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
feat(video): route video pipelines through interpolation helper
LTX, video_run, and framepack_worker bypass process_images_inner, so they call apply_video_interpolation explicitly before save_video. Save receives already-inflated frames; the sentinel guard skips its own pass. - LTX and video_run scale mp4_fps by interpolation_factor(p) so duration is preserved instead of stretched (LTX is conditioned on source fps) - FramePack pre-divides at gen time per get_latent_paddings, so save fps stays at mp4_fps; worker passes p=None so save call uses mp4_interpolate=0 to skip directly - replaces the inline (mp4_interpolate+1) fps math at LTX with the helper-driven equivalent
This commit is contained in:
@@ -322,6 +322,15 @@ def worker(
|
||||
if is_last_section:
|
||||
break
|
||||
|
||||
if mp4_interpolate > 0:
|
||||
from modules.processing_video import apply_video_interpolation
|
||||
# history_pixels is 5-D (N,C,T,H,W) in [-1,1]; RIFE needs 4-D (T,C,H,W) in [0,1]
|
||||
x = history_pixels.squeeze(0).permute(1, 0, 2, 3)
|
||||
x = (x.clamp(-1., 1.) + 1.0) * 0.5
|
||||
x = apply_video_interpolation(None, x, count=mp4_interpolate)
|
||||
x = x * 2.0 - 1.0
|
||||
history_pixels = x.permute(1, 0, 2, 3).unsqueeze(0)
|
||||
|
||||
total_generated_frames, _video_filename, _thumb = save_video(
|
||||
p=None,
|
||||
pixels=history_pixels,
|
||||
@@ -334,7 +343,7 @@ def worker(
|
||||
mp4_sf=mp4_sf,
|
||||
mp4_video=mp4_video,
|
||||
mp4_frames=mp4_frames,
|
||||
mp4_interpolate=mp4_interpolate,
|
||||
mp4_interpolate=0,
|
||||
pbar=pbar,
|
||||
stream=stream,
|
||||
metadata=metadata,
|
||||
|
||||
Reference in New Issue
Block a user