mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-29 19:05:05 +08:00
Merge pull request #15600 from AUTOMATIC1111/fix-corrupt-model-loop
Fix corrupt model initial load loop
This commit is contained in:
commit
15245d9d5e
@ -60,18 +60,19 @@ class ExtraNetworksPageLora(ui_extra_networks.ExtraNetworksPage):
|
|||||||
else:
|
else:
|
||||||
sd_version = lora_on_disk.sd_version
|
sd_version = lora_on_disk.sd_version
|
||||||
|
|
||||||
if shared.opts.lora_show_all or not enable_filter:
|
if shared.sd_model is not None: # still show LoRA in case an error occurs during initial model loading
|
||||||
pass
|
if shared.opts.lora_show_all or not enable_filter:
|
||||||
elif sd_version == network.SdVersion.Unknown:
|
pass
|
||||||
model_version = network.SdVersion.SDXL if shared.sd_model.is_sdxl else network.SdVersion.SD2 if shared.sd_model.is_sd2 else network.SdVersion.SD1
|
elif sd_version == network.SdVersion.Unknown:
|
||||||
if model_version.name in shared.opts.lora_hide_unknown_for_versions:
|
model_version = network.SdVersion.SDXL if shared.sd_model.is_sdxl else network.SdVersion.SD2 if shared.sd_model.is_sd2 else network.SdVersion.SD1
|
||||||
|
if model_version.name in shared.opts.lora_hide_unknown_for_versions:
|
||||||
|
return None
|
||||||
|
elif shared.sd_model.is_sdxl and sd_version != network.SdVersion.SDXL:
|
||||||
|
return None
|
||||||
|
elif shared.sd_model.is_sd2 and sd_version != network.SdVersion.SD2:
|
||||||
|
return None
|
||||||
|
elif shared.sd_model.is_sd1 and sd_version != network.SdVersion.SD1:
|
||||||
return None
|
return None
|
||||||
elif shared.sd_model.is_sdxl and sd_version != network.SdVersion.SDXL:
|
|
||||||
return None
|
|
||||||
elif shared.sd_model.is_sd2 and sd_version != network.SdVersion.SD2:
|
|
||||||
return None
|
|
||||||
elif shared.sd_model.is_sd1 and sd_version != network.SdVersion.SD1:
|
|
||||||
return None
|
|
||||||
|
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
@ -659,10 +659,11 @@ def get_empty_cond(sd_model):
|
|||||||
|
|
||||||
|
|
||||||
def send_model_to_cpu(m):
|
def send_model_to_cpu(m):
|
||||||
if m.lowvram:
|
if m is not None:
|
||||||
lowvram.send_everything_to_cpu()
|
if m.lowvram:
|
||||||
else:
|
lowvram.send_everything_to_cpu()
|
||||||
m.to(devices.cpu)
|
else:
|
||||||
|
m.to(devices.cpu)
|
||||||
|
|
||||||
devices.torch_gc()
|
devices.torch_gc()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user