From a8aeef670b3f288303f956bf94385cb87978ea93 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sun, 2 Feb 2025 00:32:18 +0200 Subject: [PATCH] Update nodes.py --- nodes/nodes.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nodes/nodes.py b/nodes/nodes.py index 730106b..e620885 100644 --- a/nodes/nodes.py +++ b/nodes/nodes.py @@ -2252,8 +2252,11 @@ class LeapfusionHunyuanI2V: inp, timestep, c = args["input"], args["timestep"], args["c"] current_step_index = (steps == timestep).nonzero().item() current_percent = current_step_index / (len(steps) - 1) - if samples is not None and start_percent <= current_percent <= end_percent: - inp[:, :, [index], :, :] = samples[:, :, [0], :, :].to(inp) + if samples is not None: + if start_percent <= current_percent <= end_percent: + inp[:, :, [index], :, :] = samples[:, :, [0], :, :].to(inp) + else: + inp[:, :, [index], :, :] = torch.zeros(1) return apply_model(inp, timestep, **c) return unet_wrapper