From d547482ad67c9ecbe740de0e19a5eefd0fbe21e8 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sun, 18 May 2025 21:09:36 +0300 Subject: [PATCH] Update nodes.py --- nodes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nodes.py b/nodes.py index 4dd4051..5c58d93 100644 --- a/nodes.py +++ b/nodes.py @@ -1554,6 +1554,8 @@ class WanVideoImageToVideoEncode: "fun_or_fl2v_model": ("BOOLEAN", {"default": True, "tooltip": "Enable when using official FLF2V or Fun model"}), "temporal_mask": ("MASK", {"tooltip": "mask"}), "extra_latents": ("LATENT", {"tooltip": "Extra latents to add to the input front, used for Skyreels A2 reference images"}), + "tiled_vae": ("BOOLEAN", {"default": False, "tooltip": "Use tiled VAE encoding for reduced memory use"}), + } } @@ -1564,7 +1566,7 @@ class WanVideoImageToVideoEncode: def process(self, vae, width, height, num_frames, force_offload, noise_aug_strength, start_latent_strength, end_latent_strength, start_image=None, end_image=None, control_embeds=None, fun_or_fl2v_model=False, - temporal_mask=None, extra_latents=None, clip_embeds=None): + temporal_mask=None, extra_latents=None, clip_embeds=None, tiled_vae=False): device = mm.get_torch_device() offload_device = mm.unet_offload_device() @@ -1642,7 +1644,7 @@ class WanVideoImageToVideoEncode: temporal_mask = common_upscale(temporal_mask.unsqueeze(1), W, H, "nearest", "disabled").squeeze(1) concatenated = resized_start_image[:,:num_frames] * temporal_mask[:num_frames].unsqueeze(0) - y = vae.encode([concatenated.to(device=device, dtype=vae.dtype)], device, end_=(end_image is not None and not fun_or_fl2v_model))[0] + y = vae.encode([concatenated.to(device=device, dtype=vae.dtype)], device, end_=(end_image is not None and not fun_or_fl2v_model),tiled=tiled_vae)[0] has_ref = False if extra_latents is not None: samples = extra_latents["samples"].squeeze(0)