mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-29 19:05:05 +08:00
fix initial corrupt model loop
if for some reason the initial loading model at loading phase of webui is corrupted after entering this state the user will not be able to load even a good model is selected, due the the unload_model_weights > send_model_to_cpu > m.lowvram attribute check will fail becaules m is None webui will be stuck in the loop unable to recover without manual intervention
This commit is contained in:
parent
ddb28b33a3
commit
2b717bb195
@ -659,10 +659,11 @@ def get_empty_cond(sd_model):
|
||||
|
||||
|
||||
def send_model_to_cpu(m):
|
||||
if m.lowvram:
|
||||
lowvram.send_everything_to_cpu()
|
||||
else:
|
||||
m.to(devices.cpu)
|
||||
if m is not None:
|
||||
if m.lowvram:
|
||||
lowvram.send_everything_to_cpu()
|
||||
else:
|
||||
m.to(devices.cpu)
|
||||
|
||||
devices.torch_gc()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user