-
Notifications
You must be signed in to change notification settings - Fork 910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reactivated the old hashing that work for civitai #1647
base: main
Are you sure you want to change the base?
Conversation
bump since this is obviously a PR that should get added |
thanks i tested it like this: |
and there is another fix more user friendly 😊 |
Afaik that doesn't help since it uses the hash forge generates, it doesn't work for me at least.. |
thanks! |
for me both methods worked and civitai extension took like 10 minutes to load all the correct hashes from civitai and worked |
I'm no expert, but I am pretty sure the civitai extension does not change the hashes in the local database, only add civitai description and other info, and dowload pictures etc. I have used that plugin since forever when I started using forge, still had the incorrect hashes, I just did not realize until very recently. (for me, LORA:s were detected, but not SD 1.5 (I think) or SDXL models) Applying this patch worked for me and civitai now recognizes my models from the meta tags after removing the database and recalculating them in settings > actions > calculate hashes.... Took a few seconds to calculate. |
I wonder if there is any reason this change in the new forge isn't reverted or fixed yet. Hashing is a fundamental part of any software and it does break the use of Forge. @lllyasviel please take time to review the change needed. I don't know what this affects in the code but if not fixed it does affect the working of plugins. |
bump I saw users complaining about strange hashing issues in a web community today, so I thought of this PR again. Fake hash not just breaking Civitai but also many other AI image viewing tools that relay on hash to sort images. Silently using fake hashes can cause great confusion to end users who are not aware of the situation. (It's not just lack of hash in the metadata, it's a fake hash... "Is my checkpoint/SSD/memory broken?", "Why the hash changed?"...) Normally hashing a checkpoint takes 5~20s depends what checkpoint and computer. It's a bit long but is totally fine I guess. There is a hash cache, so as long as the checkpoint path does not change, the hash will just calculate once. I'm using forge on local computer, not sure about other env, like on Colab. From I saw today, "fake hash" bring way more confusion to normal users than benefits. My suggestion is to add a new startup parameter, such as "--fake-hash", to "explicitly" disable hashing. Or just "--no-hash", dont include hash info in metadata (which needs to changes more code). If users know that they do not need hash and want to speed up the first time running, they can add this startup parameter. |
It's utterly baffling that this is still an issue. Saving a few seconds the first time you use a model is so insignificant compared to the annoyance it causes. |
This pull request reactivates existing code in _hashes.py that was previously commented out or disabled.
Issue
The current hashing function does not correctly identify resources on Civitai. As a result, checkpoints (both Stable Diffusion and Flux) and Loras (only Stable Diffusion) are not recognized.
Fix:
By reactivating the original hashing function, the recognition of these resources is restored:
Flux Checkpoints: Now recognized correctly.
Stable Diffusion Models: Both checkpoints and Loras are correctly recognized.
Impact
Before the Fix:
Using the current fake hashing function, no resources are recognized.
After the Fix: