A1111 Webui
webui-user.batset COMMANDLINE_ARGS= --xformers --no-hashing --opt-channelslast --no-download-sd-model --lowram
set SAFETENSORS_FAST_GPU=1
stable-diffusion-webui/modules/sd_models.py
Switchpl_sd = safetensors.torch.load_file(checkpoint_file, device=device)
bypl_sd = safetensors.torch.load(open(checkpoint_file, 'rb').read())
pl_sd = safetensors.torch.load(open(checkpoint_file, 'rb').read())
pl_sd = {k: v.to(device) for k, v in pl_sd.items()}
Comfyui
Comfyui/Comfyui/comfy/utils.pyreplacingsd = safetensors.torch.load_file(ckpt, device=device.type)
bysd = safetensors.torch.load(open(ckpt, 'rb').read())
It will increased the speed from the HDD x6 times, from 15M/s to 200MB/s