Harden MSR against stale text and slot blending
This commit is contained in:
@@ -1684,7 +1684,16 @@ def _build_reference_mode_outputs(
|
|||||||
if slot < len(char_slot_images):
|
if slot < len(char_slot_images):
|
||||||
selected.extend(char_slot_images[slot])
|
selected.extend(char_slot_images[slot])
|
||||||
if not selected:
|
if not selected:
|
||||||
selected = char_images
|
populated_slots = [i for i, images in enumerate(char_slot_images) if images]
|
||||||
|
if len(populated_slots) > 1:
|
||||||
|
selected = list(char_slot_images[populated_slots[0]])
|
||||||
|
log.info(
|
||||||
|
"[LTXDirector] MSR slideshow subjects: no explicit slot tag, defaulting to first populated slot=%s (%d images).",
|
||||||
|
populated_slots[0],
|
||||||
|
len(selected),
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
selected = char_images
|
||||||
log.info("[LTXDirector] MSR slideshow subjects: referenced slots=%s, images=%d", referenced_slots, len(selected))
|
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 = [prepare_tensor_image(c, latent_w, latent_h) for c in selected]
|
||||||
@@ -2114,6 +2123,15 @@ class LTXDirector(io.ComfyNode):
|
|||||||
image_cache=image_cache,
|
image_cache=image_cache,
|
||||||
input_dir=input_dir,
|
input_dir=input_dir,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# MSR identity should come from images, not stale text descriptions carried in
|
||||||
|
# timeline data or external character payloads.
|
||||||
|
if reference_mode == "Licon MSR (Prefix)":
|
||||||
|
characters = [
|
||||||
|
{**character, "description": ""}
|
||||||
|
for character in characters
|
||||||
|
]
|
||||||
|
|
||||||
char_slot_images = [list(character.get("images") or []) for character in characters]
|
char_slot_images = [list(character.get("images") or []) for character in characters]
|
||||||
char_images = [img for slot_images in char_slot_images for img in slot_images]
|
char_images = [img for slot_images in char_slot_images for img in slot_images]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user