1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 23:14:49 +08:00

add simple error check to model loading (#4950)

This commit is contained in:
Alex "mcmonkey" Goodwin
2024-09-17 16:57:17 +09:00
committed by GitHub
parent 0b7dfa986d
commit 254838f23c
7 changed files with 31 additions and 23 deletions

View File

@@ -25,7 +25,7 @@ class UpscaleModelLoader:
CATEGORY = "loaders"
def load_model(self, model_name):
model_path = folder_paths.get_full_path("upscale_models", model_name)
model_path = folder_paths.get_full_path_or_raise("upscale_models", model_name)
sd = comfy.utils.load_torch_file(model_path, safe_load=True)
if "module.layers.0.residual_group.blocks.0.norm1.weight" in sd:
sd = comfy.utils.state_dict_prefix_replace(sd, {"module.":""})