DominikDoom / a1111-sd-webui-tagcomplete

Booru style tag autocompletion for AUTOMATIC1111's Stable Diffusion web UI
MIT License
2.58k stars 307 forks source link

Feature request, include tag popularity count next to tag name in list #60

Closed thojmr closed 1 year ago

thojmr commented 1 year ago

I think it would be very useful to have the tag count next to the tag name when selecting from the list. This would allow us to select a tag based on its popularity when there are multiple similar tags to choose from.

Not sure how much extra work that would be though.

DominikDoom commented 1 year ago

The coding work in this plugin would be very little, the bigger problem is getting the data. At least the program I used to build the tag file (Grabber) sadly doesn't include the tag count in the offline tag database you can build. So I would have to replicate its functionality using the official API. It's definitely possible and I agree that it would be useful, but not quick to do for now.

Just for choosing which tag is more popular, it's a lot simpler though: Tags in the default tag files are ordered by count, and since the script doesn't sort them at any point, tags higher in the list will always be more popular than those below. You just can't compare by how much.

DominikDoom commented 1 year ago

Small update: I have found the official danbooru tag dump on its public cloud console in the meantime, which contains post count and a few other interesting infos. I'll have a look at it and see if I can process it to work with the script.

byzod commented 1 year ago

There's some tag builder have similar feature on github, for example this one, if it helps

DominikDoom commented 1 year ago

I was already able to convert the data to the form the script needs, so now I only need to implement it. Since the public data also included the tag aliases, I am currently trying to add those too, which would be very useful as well. Just need to make it work alongside translations now.

byzod commented 1 year ago

Since the public data also included the tag aliases, I am currently trying to add those too, which would be very useful as well. Just need to make it work alongside translations now.

1

You mean this? It is useful, can't wait to see that implemented :D

DominikDoom commented 1 year ago

Yes, exactly. It already works similar to the translation feature, so I think it'll be possible without much reworking. I just need to be careful to not break existing translations.

DominikDoom commented 1 year ago

Small preview: image

At least for danbooru tags the work is almost done, just need to do a bit of cleanup and update how translations are handled. I tried to find similar public tag data for e621 tags, but wasn't able to get anything so far. So I'll have to get them using the API, which will probably take a bit longer.

thojmr commented 1 year ago

This has been working great, thanks for the work