picobyte / stable-diffusion-webui-wd14-tagger

Labeling extension for Automatic1111's Web UI
540 stars 64 forks source link

improve handling of last edited input field/slider/checkbox #14

Closed picobyte closed 11 months ago

picobyte commented 11 months ago

In Toriato's implementation, upon interrogation all relevant checkboxes, input fields and sliders info was passed upon interrogation. I was wondering whether this and subsequent handling slowed down the interrogation process, so I changed this, and now changing an input field or so is handled when that component loses focus - blur() in gradio terms.

There seems to be a quirk, however, that the last blur and the interrogation button press do not follow one another properly. I think this is a gradio bug, some asynchronous handling that is not the way it should be.

I think this could be fixed either by

I'm not really sure yet which of the two is better. The second could be more optimized, or it could just make things complex.

picobyte commented 11 months ago

I'm taking the first approach, and current behavior is actually buggy. It is not nice to do a large interrogation only then to find out that the last edited input_glob dir was not picked up, or the output directory was still the old one. The tags edits are less of a problem since a second query is cheap. Also the input_glob should always be redone, I guess, it can be that the user changed images in the directory. Also a simple paths check is not enough, user may have cropped files. I'll use the mtimes for all the files.

feature branch

picobyte commented 11 months ago

Fixed in latest release