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

Support DiffBIR SwinIR models.

This commit is contained in:
comfyanonymous
2023-09-07 03:31:43 -04:00
parent cb080e771e
commit 8be46438be
2 changed files with 18 additions and 1 deletions

View File

@@ -18,6 +18,8 @@ class UpscaleModelLoader:
def load_model(self, model_name):
model_path = folder_paths.get_full_path("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.":""})
out = model_loading.load_state_dict(sd).eval()
return (out, )