From 4462fab1c8c9d395c4e53ca9abc666eeaf5f58bb Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Tue, 2 Dec 2025 14:28:50 +0200 Subject: [PATCH] Remove hard error in ReplaceVideoLatentFrames -node --- comfy_extras/nodes_latent.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/comfy_extras/nodes_latent.py b/comfy_extras/nodes_latent.py index 5b63cb14c..51f6d6a6b 100644 --- a/comfy_extras/nodes_latent.py +++ b/comfy_extras/nodes_latent.py @@ -4,7 +4,7 @@ import torch import nodes from typing_extensions import override from comfy_api.latest import ComfyExtension, io - +import logging def reshape_latent_to(target_shape, latent, repeat_batch=True): if latent.shape[1:] != target_shape[1:]: @@ -407,9 +407,11 @@ class ReplaceVideoLatentFrames(io.ComfyNode): @classmethod def execute(cls, source, destination, index) -> io.NodeOutput: if index > destination["samples"].shape[2]: - raise RuntimeError(f"ReplaceVideoLatentFrames: Index {index} is out of bounds for destination latent frames {destination['samples'].shape[2]}.") + logging.warning(f"ReplaceVideoLatentFrames: Index {index} is out of bounds for destination latent frames {destination['samples'].shape[2]}.") + return io.NodeOutput(destination) if index + source["samples"].shape[2] > destination["samples"].shape[2]: - raise RuntimeError(f"ReplaceVideoLatentFrames: Source latent frames {source['samples'].shape[2]} do not fit within destination latent frames {destination['samples'].shape[2]} at the specified index {index}.") + logging.warning(f"ReplaceVideoLatentFrames: Source latent frames {source['samples'].shape[2]} do not fit within destination latent frames {destination['samples'].shape[2]} at the specified index {index}.") + return io.NodeOutput(destination) s = source.copy() s_source = source["samples"] s_destination = destination["samples"].clone()