Unload SD model on process start.

pull/21/head
d8ahazard 2023-01-03 10:47:54 -06:00
parent 0342a88068
commit cffe3c5bb4
1 changed files with 5 additions and 1 deletions

View File

@ -82,6 +82,7 @@ def preprocess(rename,
scaler
):
try:
shared.sd_model.to("cpu")
shared.state.textinfo = "Initializing smart processing..."
safe.RestrictedUnpickler = reallysafe.RestrictedUnpickler
@ -370,7 +371,10 @@ def preprocess(rename,
if caption_wd14:
printi("Unloading wd14 interrogator...")
wd_interrogator.unload()
try:
shared.sd_model.to(shared.device)
except:
pass
return f"Successfully processed {len(files)} images.", f"Successfully processed {len(files)} images."
except Exception as e: