Sign In

Patch to speed up loading checkpoints in ComfyUI

Patch to speed up loading checkpoints in ComfyUI

So I had an issue when loading .safetensor checkpoints from my NAS that used slower platter hard drives. This should not affect SSD drives really. They would load around 24-32MB/s and take forever. I was in a hurry and didn't want to code anything and came across this post here https://github.com/comfyanonymous/ComfyUI/issues/1992. It seems their implementation for loading is pretty outdated, they took a patch from Automatic1111 and tried it out. It works. I wen't from an average 30 MB/s or less from the NAS, to an average of around 199MB/s from the NAS. That is an incredible increase in load times, especially if you are loading 10 checkpoints to do block merges lmao. I have attached the patched file with the source being the linked issue tracker. I assume it will be merged soon enough, but I needed it now and figured I would share it. the file is utils.py in ComfyUI\comfy. I put the file structure there so you can just drag it over. Be aware that you will have copy these changes back any time you update as it will over write them.

-5.0 Updated to the newest codebase 04-10-2024

-4.0 Updated to the newest codebase mar 13 2024

-3.0 Updated to the newest codebase Mar 2 2024

-2.0 Updated to the newest codebase Feb 19 2024

7

Comments