alexandersokol / sd-model-organizer

model organizer extension for stablediffusion-web-ui
94 stars 13 forks source link

civitai-helper integration? #37

Open tranzmatt opened 1 year ago

tranzmatt commented 1 year ago

The civitai-helper extension auto generates a json .info file when you download a model from civit ai. Being able to scan for those files and parse the info needed would a wonderful thing.

alexandersokol commented 1 year ago

In case you have already downloaded model with civitai-helper and .info file (json data) this file will be visible as local file in model organizer, and when you presses "Add" button, a new record fields will be prefilled from this file.

angryptonX commented 1 year ago

unfortanely nothing is loaded and prefilled in my case. that's a pity because it's impossible for me to collect the web pages and redownload around 740GB of data. In overall your extension is so much better then any other, i hope there will be a solution.

alexandersokol commented 1 year ago

Yes, redownloading isn't an option, thats why it should scan for local files. Do you have any errors in the console while pressing Reload button in model organizer tab?

angryptonX commented 1 year ago

No there is nothing even when i turn on all points like 'Show warnings in the console' in the System-Settings.

alexandersokol commented 1 year ago

Looks kinda interesting are using custom directories arguments or symlinks?

angryptonX commented 1 year ago

Yes, I use Dir-Junctions, but I've also tried with Sym, Hard and un-linked Directorys at default and custom path as well. actually every possibility. Unfortunately I wasn't clear enough. Everything works as it should, the only problem is that the 'description, prompts and additional thumbnails' are not transferred. The thumbnails are understandable, they are not included in civitai.info, but the description and the prompts are. It might be a solution to implement just an "update" function that compares only the local content with the content of the Civitai link and downloads missing content if necessary.

i.e. This is what fetched over ADD: add_local

..and this just from Import Civitai URL: add_civit

alexandersokol commented 1 year ago

If your model file has .info file with same name it should take all possible data from it. Could you share one of your .info files that doesn't have it?

I also can see that you have dark theme but fields are white but should be grey, feels like something wrong with theme detection, are you using ?__theme=dark address argument or you are starting webui with --theme dark?

angryptonX commented 1 year ago

Sure. My args are: --administrator --allow-code --api --opt-sdp-attention --no-half-vae --upcast-sampling --update-check --update-all-extensions --embeddings-dir "G:\\Dokumente\\AI\\models\\embeddings" --enable-insecure-extension-access

I don't have any UI extensions and the settings are default except for German localization. no dark-theme. But I don't use the Main Branch of Civitai-Helper because the original developer won't add the Lyco path. Its this: https://github.com/goldmojo/Stable-Diffusion-Webui-Civitai-Helper

info.zip

alexandersokol commented 1 year ago

Thanks! I found a bug - I really skipped "description" field to import, I will fix it as soon as possible. But from other hand .info file contains only short description "description": "<p>More details added<br />Blue saturation improved<br />All colors have been balanced</p>", and seems this is not what are you looking for...

I planned new feature that allows to prefill model record by its hash from civitai, but unfotunely currently I don't have enough time even to start it. I guess It might be usefull in case like yours.

And I finnaly figured out why model organizer uses incorect color theme - seems you are using dark theme in Windows, and by default it applies to webui without any paramenters, I need to investigate how to deal with it too.

angryptonX commented 1 year ago

The hash feature sounds very promising, I think it could be a good solution, will look forward. Ah no hurry, its ok.

Yes you're right, I'm using the Win11 dark theme but I'm not only getting false colours with your extension, maybe it's because of Chrome, I don't know.

Thank you.

Mange commented 1 year ago

In addition, having the ability to re-import the same information from Civitai on an already existing record (essentially "refresh metadata") could give users a way to migrate away from the civitai-helper extension and into this one.

First import the JSON data like we do currently, then refresh the metadata from Civitai on the record to then populate the thumbnails, descriptions, etc.