fix/workaround for potential memory leak (#2315)

unload old models, based on reference count <= 2
(in practise only noticed extra copies of JointTextEncoder, never KModel or IntegratedAutoencoderKL)
#2281 #2308 and others
This commit is contained in:
DenOfEquity
2024-11-14 22:05:54 +00:00
committed by GitHub
parent 98e0adcc78
commit 19a9a78c9b
2 changed files with 6 additions and 1 deletions

View File

@@ -450,7 +450,7 @@ def reload_model_weights(sd_model=None, info=None, forced_reload=False):
def unload_model_weights(sd_model=None, info=None):
memory_management.unload_all_models()
pass
return
def apply_token_merging(sd_model, token_merging_ratio):