[Bug]: Model hashes begin to repeat
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What happened?
I have four ckpt models that all show the very same hash. They are, of course, different files.
Steps to reproduce the problem
- Put several models in the SD model folder
- Reload models
- Several of the models show the same hash
What should have happened?
They should have unique hashes.
Commit where the problem happens
d61f0de
What platforms do you use to access UI ?
Windows
What browsers do you use to access the UI ?
Microsoft Edge
Command Line Arguments
--xformers --autolaunch --gradio-img2img-tool color-sketch
Additional information, context and logs
How do you get the server to reassign hashes?
I experience the same issue. I think becuase it only calculates model hash only from the first 0x10000 bytes at offset 0x100000, as shown here. So if two models have the same content in this region, they will show the same hash, which is quite common in merged checkpoints.
Hmm, yeah, that's probably the reason we're seeing duplicate hashes. It needs to read more of the ckpt file or calculate the hash differently to generate a unique hash.
I made a PR #2459 about that, feel free to take a look.
Potentially related:
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/2459
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/4478
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/4546
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/2180
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/2468

It's really a big issue here. literally 75% of my models have duplicate hashes rn
PR #4546 would fix it.
PR #4546 would fix it.
As would this one, which came first:
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/2459
Issue solved by https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/a95f1353089bdeaccd7c266b40cdd79efedfe632