Python
fixed memory leak
deepbeepmeep336e94118355
diff --git a/README.md b/README.mdindex 2f82828..47736da 100644--- a/README.md+++ b/README.md@@ -20,7 +20,7 @@ WanGP supports the Wan (and derived models), Hunyuan Video and LTV Video models**Follow DeepBeepMeep on Twitter/X to get the Latest News**: https://x.com/deepbeepmeep## 🔥 Latest Updates :-### August 29 2025: WanGP v8.2 - Here Goes Your Weekend+### August 29 2025: WanGP v8.21 - Here Goes Your Weekend- **InfiniteTalk Video to Video**: this feature can be used for Video Dubbing. Keep in mind that it is a *Sparse Video to Video*, that is internally only image is used by Sliding Window. However thanks to the new *Smooth Transition* mode, each new clip is connected to the previous and all the camera work is done by InfiniteTalk. If you dont get any transition, increase the number of frames of a Sliding Window (81 frames recommended)diff --git a/models/wan/any2video.py b/models/wan/any2video.pyindex f8d35c7..ee58c0a 100644--- a/models/wan/any2video.py+++ b/models/wan/any2video.py@@ -778,13 +778,11 @@ class WanAny2V:from preprocessing.face_preprocessor import FaceProcessorstandin_ref_pos = 1 if "K" in video_prompt_type else 0if len(original_input_ref_images) < standin_ref_pos + 1:- if "I" in video_prompt_type:+ if "I" in video_prompt_type and model_type in ["vace_standin_14B"]:print("Warning: Missing Standin ref image, make sure 'Inject only People / Objets' is selected or if there is 'Landscape and then People or Objects' there are at least two ref images.")else:standin_ref_pos = -1image_ref = original_input_ref_images[standin_ref_pos]- image_ref.save("si.png")- # face_processor = FaceProcessor(antelopv2_path="ckpts/antelopev2")face_processor = FaceProcessor()standin_ref = face_processor.process(image_ref, remove_bg = model_type in ["vace_standin_14B"])face_processor = Nonediff --git a/wgp.py b/wgp.pyindex 8cca2ad..4066595 100644--- a/wgp.py+++ b/wgp.py@@ -81,6 +81,7 @@ def clear_gen_cache():def release_model():global wan_model, offloadobj, reload_needed+ wan_model = Noneclear_gen_cache()offload.shared_stateif offloadobj is not None: