sdwebui-w-horde / sd-webui-stable-horde-worker

Stable Horde Unofficial Worker Bridge as Stable Diffusion WebUI (AUTOMATIC1111) Extension
GNU Affero General Public License v3.0
60 stars 19 forks source link

[Bug]: Hash check fails with uppercase hash #115

Closed AimVaguely closed 1 year ago

AimVaguely commented 1 year ago

Is there existing issue for this?

Does this happen on the latest commit?

What happened?

Some of the model hash's in https://github.com/Haidra-Org/AI-Horde-image-model-reference/blob/main/stable_diffusion.json are all uppercase, these models always say that they are not supported, even if the hashes are correct (I checked myself). There are a bunch of models which have capitalised hashes, you can see by just scrolling down the file. I have tested this with 2 models randomly chosen to test that this was my problem. I randomly chose the model used in the steps below.

Steps to reproduce

  1. Download Hassaku model from the link provided in stable_diffusion.json
  2. Confirm hash matches the hash provided in stable_diffusion.json which is D3CD6...
  3. Run Auto1111
  4. Go to "Stable Hoard Worker" tab
  5. Select hassakuHentaiModel_v12.safetensors in "Selected models for sharing"
  6. Console says sha256 for hassakuHentaiModel_v12.safetensors is d3cd6ac55ae99c4848af5bde90b47306b17ee0a3a7b1aff4a7187284d3cdbf0e but it's not supported by StableHorde even though, that is the hash that is in stable_diffusion.json as shown in step 2

What did you expect to happen?

The model detects as supported as the other models do and says it is supported. The steps below are just copied from above, with the message on step 6 manually changed.

  1. Download Hassaku model from the link provided in stable_diffusion.json
  2. Confirm hash matches the hash provided in stable_diffusion.json which is D3CD6...
  3. Run Auto1111
  4. Go to "Stable Hoard Worker" tab
  5. Select hassakuHentaiModel_v12.safetensors in "Selected models for sharing"
  6. Console says sha256 for hassakuHentaiModel_v12.safetensors is d3cd6ac55ae99c4848af5bde90b47306b17ee0a3a7b1aff4a7187284d3cdbf0e and it's supported by StableHorde

Stable Diffusion WebUI Commit SHA

68f336bd994bed5442ad95bad6b6ad5564a5409a

What operating system are you seeing the problem on?

Other Linux

What browsers are you seeing the problem on?

Firefox

Additional information

I changed https://github.com/sdwebui-w-horde/sd-webui-stable-horde-worker/blob/master/stable_horde/horde.py#L139 to if local_hash.casefold() in (hash345.casefold() for hash345 in remote_hashes): (the number is because hash was already taken, and I couldn't be bothered finding a better name) to see if that solved the problem, but I just got an exception on the next line, and as someone who is not a python programmer, that was then outside my abilities.