civitai / civitai

A repository of models, textual inversions, and more

Home Page:https://civitai.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Some models' SHA256 are wrong

butaixianran opened this issue · comments

What happened?

When using civitai API, we can get a model's SHA256. but there are some models' SHA256 are totally wrong.

For example:

Monster lora(9mb)
Url: https://civitai.com/models/26342/monster-or-sex-act-lora-79
SHA256 calculated: 494C7433BCDCECAA8971081A988475181F52F0BEBF8CCA91425AC5AE8D62548C
SHA256 from Civitai API: 52E1908E980E3B4267759094E8A3A279D58FF6DDA6F81470155EC3D2A028BAE8

Lego checkpoint(2gb):
Url: https://civitai.com/models/26333
SHA256 calculated: 9A2CA0EF9F0FDDF9F72713853F9BE1E16417042C53CB02DAA31C7AA009E733C5
SHA256 from Civitai API: 494C7433BCDCECAA8971081A988475181F52F0BEBF8CCA91425AC5AE8D62548C

I calculated SHA256 with python, online hash checker and windows get-filehash tool. They all get the same result. So, calculation is correct. That means, the SHA256 saved in civitai's database is wrong.

As you can see, when using Monster lora's SHA256, to get version info from civitai API, it will get Lego checkpoint's version info.

And if I use Lego checkpoint's SHA256, API can not find any model.

For now, I only find these 2 models. But some users of Civitai Helper claim they find more models with wrong SHA256. But I guess those models are all NSFW, so they don't want to give me model's url to test.

I'm not sure how this can be fixed. I don't think you'll re-calculate all model's sha256 again. I guess a better solution could be offer a channel or a topic to let users report all those models with wrong shas256.

Steps to reproduce the problem

  1. Download Monster lora(9mb) from Url: https://civitai.com/models/26342/monster-or-sex-act-lora-79
  2. calculate its sha256, you will get 494C7433BCDCECAA8971081A988475181F52F0BEBF8CCA91425AC5AE8D62548C
  3. use this sha256 with civitai API to get version info: https://civitai.com/api/v1/model-versions/by-hash/:hash
  4. What you get is lego-diffusion checkpoint's version info, not Monster lora's.

What should have happened?

Get the write version info with the right sha256

What platforms do you use to access the site?

Windows

What browsers do you use to access the site?

Google Chrome

Additional information, context and logs

No response

I'll send that back through our scanner in about 12 hours.

I agree about the reporting for wrong hashes. I've just created a thread on our Discord Server.

We probably should make something on-site as well.

Thanks, I'll post that link into civitai helper's document.