Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was also working on this in parallel
it's also includes some fixes
unless I'm very much mistaken you should not create your own
DeepDanbooru
as this what basically result in multiple instances of the model being loaded in memory for no reason, just reused instance already created by web UIdoing stuff in
Scripts
__init__
is potentially dangerous, before prevent crash due to Script __init__ exception AUTOMATIC1111/stable-diffusion-webui#14407 if a exception occurs it could potentially cause webui to crushsuper().__init__()
even though this is fine now but this can also be potentially dangerous in the futureadd stuff to .gitignore
reformat the code to keep me sane, also because with a clean code is easier to see potential issues
if I'm reading code correctly you can potentially perform multiple Deepbooru tag image categorization but you are calling the method, designed for single images which includes loading and unloading of the model, switch to use https://github.com/Inzaniak/sd-webui-ranbooru/pull/25/files#diff-bb8da7333492e655e1365f7c6738ba7931190021b89c090e91b63964086f4cb8R792-R795
not fix
your code logic here is rather weird
https://github.com/Inzaniak/sd-webui-ranbooru/pull/25/files#diff-bb8da7333492e655e1365f7c6738ba7931190021b89c090e91b63964086f4cb8L792-L793
maybe it will work sometimes but I think it will cause issues under certain situations