Free WebUI from its Prison

Congratulations WebUI. Say Hello to freedom.
This commit is contained in:
layerdiffusion
2024-08-05 03:58:34 -07:00
parent aafe11b14c
commit bccf9fb23a
26 changed files with 2053 additions and 4392 deletions
@@ -19,7 +19,6 @@ import cv2
import logging
from typing import Any, Callable, Dict, List
from modules.safe import unsafe_torch_load
from lib_controlnet.logging import logger
@@ -28,7 +27,7 @@ def load_state_dict(ckpt_path, location="cpu"):
if extension.lower() == ".safetensors":
state_dict = safetensors.torch.load_file(ckpt_path, device=location)
else:
state_dict = unsafe_torch_load(ckpt_path, map_location=torch.device(location))
state_dict = torch.load(ckpt_path, map_location=torch.device(location))
state_dict = get_state_dict(state_dict)
logger.info(f"Loaded state_dict from [{ckpt_path}]")
return state_dict