[GH-ISSUE #14] [Feature Request] Only autocomplete if a certain model is used #11

Closed
opened 2026-10-30 21:16:54 +00:00 by bsakaguchi · 6 comments
Owner

Originally created by @TetteDev on GitHub (Oct 15, 2022).
Original GitHub issue: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/issues/14

Originally assigned to: @DominikDoom on GitHub.

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 :)

Originally created by @TetteDev on GitHub (Oct 15, 2022). Original GitHub issue: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/issues/14 Originally assigned to: @DominikDoom on GitHub. 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 :)
bsakaguchi 2026-10-30 21:16:54 +00:00
Author
Owner

@DominikDoom commented on GitHub (Oct 15, 2022):

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.

<!-- gh-comment-id:1279717355 --> @DominikDoom commented on GitHub (Oct 15, 2022): 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.
Author
Owner

@TetteDev commented on GitHub (Oct 15, 2022):

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 :)

<!-- gh-comment-id:1279755775 --> @TetteDev commented on GitHub (Oct 15, 2022): 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 ```js 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 :)
Author
Owner

@TetteDev commented on GitHub (Oct 15, 2022):

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

<!-- gh-comment-id:1279756083 --> @TetteDev commented on GitHub (Oct 15, 2022): 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
Author
Owner

@DominikDoom commented on GitHub (Oct 15, 2022):

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.

<!-- gh-comment-id:1279759196 --> @DominikDoom commented on GitHub (Oct 15, 2022): 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.
Author
Owner

@TetteDev commented on GitHub (Oct 15, 2022):

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

<!-- gh-comment-id:1279767724 --> @TetteDev commented on GitHub (Oct 15, 2022): 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
Author
Owner

@ice051128 commented on GitHub (Dec 3, 2022):

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?

<!-- gh-comment-id:1336094374 --> @ice051128 commented on GitHub (Dec 3, 2022): > 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?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DominikDoom/a1111-sd-webui-tagcomplete#11
No description provided.