a1111-sd-webui-tagcomplete
a1111-sd-webui-tagcomplete copied to clipboard
[Feature Request] Only autocomplete if a certain model is used
As the title states, I assume this script is only meant to be used with a certain stable diffusion model, so it would probably be good to add support for via the config file, specifying whitelisted models (aka models that accept these kind of tags) and only autocomplete IF one of these models are being used.
If due to my ignorance, or lack of knowledge this is supposed to be used with all sorts of models, then you can close this issue :)
Some models definitely benefit more from it, but since a lot of tags are pretty general, they can also be used in the standard 1.4 model with decent results (for example tags about body parts & poses, hair styles, image descriptors like landscape, city, etc.)
I do however agree that you sometimes don't want the autocompletion, so I'm currently working on adding a switch in the UI to disable it without needing to restart.
Sure that is a solution, but I think it'd be nice also for it to be able and do it my way too
some pseudo code
function getActiveModelHash() {
// TODO: This doesnt actually work but here you basically get the text of the currently selected model from the settings tab
let activeModelString = document.getElementsByClassName('gr-box gr-input w-full disabled:cursor-not-allowed ')[0].text;
// and here just extract whatever is inbetween the [], which is the model hash
let start = activeModelString.substring("[") + 1;
let end = activeModelString.lastIndexOf("]");
let activeModelHash = activeModelString.substring(start, end);
return activeModelHash;
}
And then just call at the top of autocomplete, checking if acConfig.whitelistedModels (an additional property added to config.json) includes said model hash, and if it does, allow the autocomplete to happen etc
If I knew actually knew javascript i'd write up some proper code that actually works Just my 2 cents, have a good day :)
Now that I think about it, your solution is probably the better way to go about it. What I suggested seems a bit overly complicated
Well, it definitely wouldn't hurt to have the option, I'm just not sure how I want to include it in the config. The popular custom models are nearly all trained with either Danbooru or e621, so it might actually be more sensible to have a blacklist. Especially since it would be a huge pain for users to add dozens of Dreambooth models based on those custom models to a whitelist.
Maybe also a mix of both, so that the blacklist just turns the checkbox off on loading those models, but you still have the option to turn it back on without changing the config.
Yeah that seems like a good solution, if you decide to also go that route instead of having just one permanently visible toggle switch
What I did for myself was to implement all this (managed in the end 😄), working purely on a whitelist as I don't have many models that want those specific tags
Yeah that seems like a good solution, if you decide to also go that route instead of having just one permanently visible toggle switch
What I did for myself was to implement all this (managed in the end 😄), working purely on a whitelist as I don't have many models that want those specific tags
Do u have a download link for the solution?