From a721fe3d0facfe0863af0d09d3e38069f417dc69 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sun, 19 Oct 2025 13:49:40 +0300 Subject: [PATCH] Better (hopefully) FlashVSR frame selection First frame was completely discarded before --- nodes_sampler.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nodes_sampler.py b/nodes_sampler.py index a828943..22c9e5d 100644 --- a/nodes_sampler.py +++ b/nodes_sampler.py @@ -834,11 +834,11 @@ class WanVideoSampler: flashvsr_LQ_images = image_embeds.get("flashvsr_LQ_images", None) flashvsr_strength = image_embeds.get("flashvsr_strength", 1.0) if flashvsr_LQ_images is not None: - if flashvsr_LQ_images.shape[0] < num_frames + 4: - missing_frames = num_frames + 4 - flashvsr_LQ_images.shape[0] - last_frame = flashvsr_LQ_images[-1:].repeat(missing_frames, 1, 1, 1) - flashvsr_LQ_images = torch.cat([flashvsr_LQ_images, last_frame], dim=0) - LQ_images = flashvsr_LQ_images[:num_frames+4].unsqueeze(0).movedim(-1, 1).to(dtype) * 2 - 1 + flashvsr_LQ_images = flashvsr_LQ_images[:num_frames] + first_frame = flashvsr_LQ_images[:1] + last_frame = flashvsr_LQ_images[-1:].repeat(3, 1, 1, 1) + flashvsr_LQ_images = torch.cat([first_frame, flashvsr_LQ_images, last_frame], dim=0) + LQ_images = flashvsr_LQ_images.unsqueeze(0).movedim(-1, 1).to(dtype) * 2 - 1 if context_options is None: flashvsr_LQ_latent = transformer.LQ_proj_in(LQ_images.to(device)) log.info(f"flashvsr_LQ_latent: {flashvsr_LQ_latent[0].shape}")