mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-23 04:40:15 +08:00
Remove hard error in ReplaceVideoLatentFrames -node
This commit is contained in:
parent
54b77e140f
commit
4462fab1c8
@ -4,7 +4,7 @@ import torch
|
|||||||
import nodes
|
import nodes
|
||||||
from typing_extensions import override
|
from typing_extensions import override
|
||||||
from comfy_api.latest import ComfyExtension, io
|
from comfy_api.latest import ComfyExtension, io
|
||||||
|
import logging
|
||||||
|
|
||||||
def reshape_latent_to(target_shape, latent, repeat_batch=True):
|
def reshape_latent_to(target_shape, latent, repeat_batch=True):
|
||||||
if latent.shape[1:] != target_shape[1:]:
|
if latent.shape[1:] != target_shape[1:]:
|
||||||
@ -407,9 +407,11 @@ class ReplaceVideoLatentFrames(io.ComfyNode):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def execute(cls, source, destination, index) -> io.NodeOutput:
|
def execute(cls, source, destination, index) -> io.NodeOutput:
|
||||||
if index > destination["samples"].shape[2]:
|
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]:
|
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.copy()
|
||||||
s_source = source["samples"]
|
s_source = source["samples"]
|
||||||
s_destination = destination["samples"].clone()
|
s_destination = destination["samples"].clone()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user