From beb089279370adcd4f652f845164ec5059c3199b Mon Sep 17 00:00:00 2001 From: OpenClaw Agent Date: Wed, 22 Jul 2026 10:31:10 +0000 Subject: [PATCH] Normalize MSR slideshow frame sizes --- ltx_director.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ltx_director.py b/ltx_director.py index 7971973..bd1d018 100644 --- a/ltx_director.py +++ b/ltx_director.py @@ -1661,6 +1661,12 @@ def _build_reference_mode_outputs( if vae is None: raise ValueError("Licon MSR (Prefix) ref option requires connecting the VAE to LTX Director!") + def _normalize_msr_slide(tensor: torch.Tensor) -> torch.Tensor: + if tensor.shape[1] != latent_h or tensor.shape[2] != latent_w: + # MSR slideshow frames must all match exactly before stacking. + tensor = _resize_image(tensor, latent_w, latent_h, "stretch to fit", divisible_by) + return tensor + prompt_text = (global_prompt or "") + " " + (local_prompts or "") tag_groups = _build_character_tag_groups(characters) referenced_slots = [i for i, tags in enumerate(tag_groups) if any(t in prompt_text for t in tags)] @@ -1672,12 +1678,10 @@ def _build_reference_mode_outputs( selected = char_images log.info("[LTXDirector] MSR slideshow subjects: referenced slots=%s, images=%d", referenced_slots, len(selected)) - identity_images = [prepare_tensor_image(c, latent_w, latent_h) for c in selected] + identity_images = [_normalize_msr_slide(prepare_tensor_image(c, latent_w, latent_h)) for c in selected] scene_images = list(guide_data["images"]) if scene_images: - bg_slide = scene_images[0] - if bg_slide.shape[1] != latent_h or bg_slide.shape[2] != latent_w: - bg_slide = _resize_image(bg_slide, latent_w, latent_h, resize_method, divisible_by) + bg_slide = _normalize_msr_slide(scene_images[0]) else: bg_slide = torch.zeros((1, latent_h, latent_w, 3), dtype=torch.float32)