DiffusionToolkit icon indicating copy to clipboard operation
DiffusionToolkit copied to clipboard

Support metadata cache (via diskcache library) from A1111 sd-webui >= 1.9

Open brendanhoar opened this issue 1 year ago • 5 comments

Is your feature request related to a problem? Please describe. Through A1111 version 1.8, the sd-webui model metadata was stored in a cache.json file. From 1.9 onward, it is now stored using the python diskcache library. I believe DT still relies on cache.json.

Describe the solution you'd like Read model metadata using the diskcache method.

Describe alternatives you've considered Keep an older version of A1111 around, and ensure every model is opened in that version at some point, pointing DT toward that particular cache.json for model hashes.

brendanhoar avatar Jun 09 '24 02:06 brendanhoar

Do you have more details about diskcache and how it's used in A1111? Not familiar with it. I really need to update my A1111 install.

RupertAvery avatar Jun 09 '24 13:06 RupertAvery

Here's the PR for the change in A1111: https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/15287 and the changes https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/15287/files

And the docs: https://pypi.org/project/diskcache/

brendanhoar avatar Jun 11 '24 04:06 brendanhoar

It looks like diskcache uses sqlite as a backend, so going to that directly would probably be easier than replicating/porting the diskcache api

RupertAvery avatar Jun 11 '24 23:06 RupertAvery

Probably. You might run into some issues w/r/t database locks, however.

E.g. I've had DT crash itself repeatedly with database locking errors when internal timer threads try to access DT's own db during images scans. That case might be solvable with a catch/back-off/retry methodology.

B

brendanhoar avatar Jun 12 '24 00:06 brendanhoar

Any update on this?

StylusEcho avatar Jul 27 '24 00:07 StylusEcho