Hash performance #17130
ghost
started this conversation in
Optimization
Hash performance
#17130
Replies: 1 comment
-
|
This is another version (the best solution) to replace the previous code (not compatible), this one also resolve the hash perf on refresh and start loading when new models are added. Also remove the access to metadata in the models. But require to overwrite the entire core sd_models.py in modules folder. I found no other easy solution because loading models from webui come before any user scripts are executed. To use this new version, create a backup of your original sd_models.py and overwrite the original with the code below: modules/sd_models.py: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I created a little patch to bypass models hashing in a1111 to gain substantial loading performance.
This patch work like an extension and return a fake deterministic hash and must work like original ones but without the strain from hashing gigabyts from models.
The limits of this patch come with extensions that use the original hash as public hash to retrieve models from civitai by example. If you do not use this functionality, this patch offers you a nice performance gain. The second limit is the hash use just the filename instead of full path + filename. If you have the same filename for a model in two different folder the hash will colide. In this case you must use a different name to separate the hash. If you want reduce the colisions you can replace os.path.basename() by os.path.abspath() in the code. If you replace the code then moving the model to another folder will start a new fast (instant) hash.
To install this patch on a1111: create a file in your a1111 root in: extensions\nohash_patch\scripts\nohash_patch.py and copy paste the following code in your nohash_patch.py
Beta Was this translation helpful? Give feedback.
All reactions