Prevent PuLID preprocessor unload. Temp Fix VRAM leak. (#2882)

pull/2888/head
Chenlei Hu 2024-05-10 23:49:01 -04:00 committed by GitHub
parent b30f0ac4a1
commit 04024b4c82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 0 deletions

View File

@ -176,7 +176,21 @@ class Preprocessor(ABC):
@classmethod
def unload_unused(cls, active_processors: Set["Preprocessor"]):
# Prevent unloading for following preprocessors.
# https://github.com/Mikubill/sd-webui-controlnet/issues/2862
# TODO: Investigate proper way to unload PuLID.
# Current unloading method will cause VRAM leak. It is suspected
# the current unload method causes new model to load each time
# preprocessor is called.
prevent_unload = [
"EVA02-CLIP-L-14-336",
"facexlib",
"ip-adapter_pulid",
]
for p in cls.all_processors.values():
if p.label in prevent_unload:
continue
if p not in active_processors:
success = p.unload()
if success: