sd-library-notes icon indicating copy to clipboard operation
sd-library-notes copied to clipboard

Use custom model/VAE path if chosen

Open arcum42 opened this issue 2 years ago • 5 comments

Looking at another extension's code, model toolkit, I can see that they find the model and vae path with: from modules import shared MODEL_SAVE_PATH = shared.cmd_opts.ckpt_dir or os.path.join("models", "Stable-diffusion") VAE_SAVE_PATH = shared.cmd_opts.vae_dir or os.path.join("models", "VAE")

We can probably do the same. Just felt lazy and made an issue instead of a pr. :P

https://github.com/arenatemp/stable-diffusion-webui-model-toolkit

arcum42 avatar Mar 20 '23 05:03 arcum42

Now having actually had a chance to try setting ckpt_dir, it looks like it loads the models there in addition to the normal ones, if they exist. (You set it in webui-user.sh/bat, in the command line arguments.)

It also seems like besides ckpt_dir and vae_dir, there's embeddings_dir, hypernetwork_dir, & lora_dir. The current model is in ckpt, btw. (Doing "print(shared.cmd_opts)" gets you the full list.)

I'm thinking we can check to see if each of those variables have anything in them, and scan them if they do, but also scan the base directories.

arcum42 avatar Mar 25 '23 00:03 arcum42

I'll look into it, currently dealing with both of my extensions (and others I rely on) being broken with the latest Automatic updates lol

Zetaphor avatar Mar 26 '23 03:03 Zetaphor

Yeah, commented before that last update wrecked havoc on it. Not sure how much will have to be fixed on the extension side and how much on the A1111 side, too, since they did a big gradio update...

arcum42 avatar Mar 27 '23 01:03 arcum42

Is your idea about auto-selecting appropriate notes file in the corresponding select box extension field according to the current selections in the main UI? Sorry, if this function is already implemented and has been broken by the last main UI updates.

Eugenii10 avatar Mar 28 '23 08:03 Eugenii10

@Eugenii10 That'd be a separate idea, and should be a separate issue. This issue is about the fact that right now, the extension assumes all the models and such are in the default places, so if you've specified different places by command line arguments, it'll ignore that.

Auto selecting the notes for a model when you choose it would be nice, it's just a different issue.

arcum42 avatar Mar 31 '23 20:03 arcum42