From 54f745bb63e3c2d65979fb373ead30f763d5d7c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Sepp=C3=A4nen?= <40791699+kijai@users.noreply.github.com> Date: Sun, 24 Aug 2025 02:03:32 +0300 Subject: [PATCH] Update nodes.py --- nodes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nodes.py b/nodes.py index 54b2f94..d458982 100644 --- a/nodes.py +++ b/nodes.py @@ -3223,6 +3223,7 @@ class WanVideoSampler: else: cond_ = cond_image if is_first_clip else cond_frame latent_motion_frames = vae.encode(cond_.to(device, vae.dtype), device=device, tiled=tiled_vae, pbar=False).to(dtype)[0] + vae.model.clear_cache() vae.to(offload_device) y = torch.concat([msk, y], dim=1).squeeze(0) # 4+C T H W mm.soft_empty_cache() @@ -3377,6 +3378,7 @@ class WanVideoSampler: transformer.to(offload_device) vae.to(device) videos = vae.decode(latent.unsqueeze(0).to(device, vae.dtype), device=device, tiled=tiled_vae, pbar=False)[0].cpu() + vae.model.clear_cache() vae.to(offload_device) sampling_pbar.close()