mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-01-27 11:29:46 +00:00
25 lines
711 B
Python
25 lines
711 B
Python
|
|
def initialize_forge():
|
|
import ldm_patched.modules.args_parser as args_parser
|
|
|
|
args_parser.args, _ = args_parser.parser.parse_known_args()
|
|
|
|
import ldm_patched.modules.model_management as model_management
|
|
import torch
|
|
|
|
device = model_management.get_torch_device()
|
|
torch.zeros((1, 1)).to(device, torch.float32)
|
|
model_management.soft_empty_cache()
|
|
|
|
import modules_forge.patch_clip
|
|
modules_forge.patch_clip.patch_all_clip()
|
|
|
|
import modules_forge.patch_precision
|
|
modules_forge.patch_precision.patch_all_precision()
|
|
|
|
if model_management.directml_enabled:
|
|
model_management.lowvram_available = True
|
|
model_management.OOM_EXCEPTION = Exception
|
|
|
|
return
|