Merge pull request #118 from AIrjen/last_changes_for_checkpoint_stuff

Changed the way model loading unload works
This commit is contained in:
AIrjen
2023-08-11 19:18:02 +02:00
committed by GitHub
+9 -7
View File
@@ -108,15 +108,17 @@ def generateimages(amount = 1, size = "all",model = "currently selected model",s
if(steps > 0 and increasestability == True):
print("")
print("Increase Stability has been turned on.")
print("To prevent a memory issue, we are going to load base 1.5, and then load the chosen model back in")
print("This helps with a memory leak issue.")
print("To prevent a memory issue, we are going to unload and then load the checkpoint back in.")
print("This helps with a memory leak issue. However A1111 is bad with memory management.")
print("")
option_payload = {
"sd_model_checkpoint": tempmodel
}
response = requests.post(url=f'{apiurl}/sdapi/v1/options', json=option_payload)
response = requests.post(url=f'{apiurl}/sdapi/v1/unload-checkpoint')
print("model unloaded")
response = requests.post(url=f'{apiurl}/sdapi/v1/reload-checkpoint')
print("model reloaded")
# build prompt
if(silentmode==True and workprompt == ""):