Skip to content
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

[Bug]: Model hash no longer returned in model information from API #12150

Closed
1 task done
Straafe opened this issue Jul 28, 2023 · 8 comments
Closed
1 task done

[Bug]: Model hash no longer returned in model information from API #12150

Straafe opened this issue Jul 28, 2023 · 8 comments
Labels
bug-report Report of a bug, yet to be confirmed cannot-reproduce I can't reproduce this, so I can't fix it. Add steps for reproduction and remove this tag.

Comments

@Straafe
Copy link

Straafe commented Jul 28, 2023

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

Model hash no longer returned in model information from API. It returns "null" for all most hashes now, but before it returned a hash for every model. This is for the sdapi/v1/sd-models api.

Steps to reproduce the problem

Use the API to request model information and notice that no hashes are returned.

What should have happened?

Hashes should be returned.

Version or Commit where the problem happens

68f336b

What Python version are you running on ?

Python 3.10.x

What platforms do you use to access the UI ?

Windows

What device are you running WebUI on?

Nvidia GPUs (RTX 20 above)

Cross attention optimization

xformers

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

--xformers --api

List of extensions

None

Console logs

None necessary. API functions, it just no longer returns hash information for models. which my program uses and relies on.

Additional information

I have discord bots running SD using A1111 as the backend, and they interact with it through the API. It has been many months since I have updated A1111 or the bots, so it is unknown when the hashes actually stopped being returned, but I updated A1111 yesterday to take advantage of the SDXL support and hashes are now returned as null.

@Straafe Straafe added the bug-report Report of a bug, yet to be confirmed label Jul 28, 2023
@w-e-w
Copy link
Collaborator

w-e-w commented Jul 28, 2023

if the model hasn't been loaded before or if the cache.json has been cleared for some reason then it will not have the hash

@akx akx added the sdxl Related to SDXL label Jul 31, 2023
@catboxanon catboxanon added cannot-reproduce I can't reproduce this, so I can't fix it. Add steps for reproduction and remove this tag. and removed sdxl Related to SDXL labels Aug 11, 2023
@catboxanon
Copy link
Collaborator

Can't reproduce. Likely related to what w-e-w mentioned above. Feel free to re-open if you still think it's an issue.

@Straafe
Copy link
Author

Straafe commented Sep 5, 2023

@w-e-w @catboxanon Sorry for late response. cache.json was still there and still had hashes in it. I updated again to latest as of today (5ef669d) , then deleted venv, and deleted cache,json and let it reinitialize the entire environment. It also generated a new cache.json. For some reason, I am still just not seeing a hash on several models through the API. Is this something I need to manually add to cache.json? I've always been able to get hashes through the API for all models up until recently.

@catboxanon
Copy link
Collaborator

Well, as of now, you need to load the model at least once in the webui for the hash to be generated. If hashing it not disabled, and it's not generating the hash and writing it back to the cache file, then something is going wrong.

@Straafe
Copy link
Author

Straafe commented Sep 5, 2023

I see, I did not know that. I use it entirely headless with --api and never actually load the webui in a browser at all, so that is likely causing my issue. Is there some way to avoid that? Starting the webui in a browser and clicking through loading all models 1 by 1 just to ensure they have caches available in the API seems a bit much, but perhaps I can figure out how to do this automatically.

@catboxanon
Copy link
Collaborator

I've made a script to do so here: https://gist.github.com/catboxanon/4f56fdd1dd0ab207c6231eef3006c012

@Straafe
Copy link
Author

Straafe commented Sep 5, 2023

Thanks, cat! Awesome

@w-e-w
Copy link
Collaborator

w-e-w commented Sep 5, 2023

I've made a script to do so here: https://gist.github.com/catboxanon/4f56fdd1dd0ab207c6231eef3006c012

@catboxanon I made a PR to do it too #12909
any suggestions on the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed cannot-reproduce I can't reproduce this, so I can't fix it. Add steps for reproduction and remove this tag.
Projects
None yet
Development

No branches or pull requests

4 participants