Open picobyte opened 1 year ago
Thank you for taking note of this repository Of course, please feel free to use it.😊
Thank you!
Is that you want to display the sd-webui-infinite-image-browsing
in gradio.Tab?
This is the relevant section: https://github.com/WSH032/sd-webui-fast-dataset-maker/blob/5bc34f3edd1d6f4040f77cd94db3919b60b10a92/extensions/extensions_ui.py#L49
In fact, sd-webui-fast-dataset-maker
simulates the startup behavior of A1111 WebUI
If you just want to display sd-webui-infinite-image-browsing
in gradio.Tab, you should refer to https://github.com/zanllp/sd-webui-infinite-image-browsing/blob/b29242efc0dc72044e4b7ed439888841ed3ad178/scripts/iib_setup.py#L16
Thanks. It seems that you have the extensions as git submodules, maybe that is the only option, but I was initally thinking about using the extensions from the parent directory. like so, if that is possible, I don't know yet.
Not very understanding
Do you mean importing another independent extension sd-webui-infinite-image-browsing
in stable-diffusion-webui-wd14-tagger
?
I don't think so, because users may change the folder name of iib
, so you won't be able to find and import it.
If you really want to embed iib
into stable-diffusion-webui-wd14-tagger
, I think it's best to control folder names through submodules
I noticed that you seem to be implementing the images deduplication function?
And, you want to display duplicate images in gradio?
You are probably right and a submodule avoids conflicts. I am thinking about several options:
It's a lot but I think it could be beneficial.
Cool !
Duplicates, correct, in particular also removing or moving files if they are, but a bit more than simple duplicate search; also a highly similar search within the set of images for a batch query that has been tagged.
I have an extension for deduplication.
My idea is to mark them by renaming, or move these duplicate images to another folder, and then view and process them through iib
.
But I don't embed iib
into this deduplication extension, but rather adapt to independently running iib
by modifying the deduplication extension
supplement:
I provide users with easy viewing and processing methods through Gradio.Gallery, rather than through iib
If users need more advanced processing, I will provide move or rename functions to mark these images for use in iib
Thanks. It seems that you have the extensions as git submodules, maybe that is the only option, but I was initally thinking about using the extensions from the parent directory. like so, if that is possible, I don't know yet.
If you really want to embed iib
into stable-diffusion-webui-wd14-tagger
, it seems that you don't need to import iib
iib
seems to rely on FastAPI
and JS
to work, which means that if the user has already installed iib
extension, you don't need to import it again when use in A1111-WebUI
. You just need to create your own Gradio components and keep the same elem_id
.
gr.HTML("error", elem_id="infinite_image_browsing_container_wrapper")
I am not sure, I will try later
supplement:
Okay, it does work, but don't do that, it will invalidate the original iib
Perhaps we should ask the author of iib
Thanks for the information. I've already started a bit, but it will take some time, before I understand and then I may have questions. Don't expect this to be included any time soon. It's a slow process. I'll first make a feature branch for this. That's for sure.
Looking forward to it😀
If there is anything I can help, I would be happy to
stable-diffusion-webui-wd14-tagger
is a very useful extension that greatly helped me in SD-lora-training. Thank you for your work
I have just started, and I've already made tons of changes. Though I do a lot of testing, I hope I didn't also break things for others. There were some issues already, e.g. fastapi, but I think I resolved them also. we'll see.. Thanks for the heads up.
The feature branch I started with is here Its addition is just the extensions directory, with English added and some white space changes. I'm not even sure if I'm going to need all plugins, that's for later. If you like to help, you are welcome of course.
Awsome, these English translations are correct
But there is one thing to note.
sd-webui-fast-dataset-maker
only supports running independently of A1111-WebUI, do you know this?
Is that you want to embed iib
here when use in A1111-WebUI?
If so, there would be a better implementation method instead of relying on sd-webui-fast-dataset-make
ok, thanks a lot! yes, I'd like to run it on the tab, like you point out. you wrote about this before, I'll check it out. with lib
you mean the infinite image browser? Or you mean that I can just import this as a library
with
lib
you mean the infinite image browser?
yes, iib
== infinite image browser
I'd like to run it on the tab, like you point out.
In fact, sd-webui-fast-dataset-maker
only provides a runtime environment similar to A1111-WebUI for iib
, rather than embedding iib
into specific tabs
I am sure there is a better way to run iib
on the tab of own extension. I will communicate with the author of iib to see if it is possible.
Well maybe a standalone version is a very interesting idea as well, a second app altogether, but currently I think I'll keep this an automatic1111 extension to keep it a little simple for myself. It's already a lot of changes. If you'd like to include some of the tagging features, then that would be an option as well.
I'll keep this an automatic1111 extension to keep it a little simple for myself.
I agree with you. As an extension, it will be more flexible
like this?
Yes, exactly like that.
That's it, dont change elem_id
But it will make the original iib
unusable
supplement:
But why not let users install an iib extension themselves
ok I'm trying it out now.
It just says error there.
Oh, sorry. forgive me, I overlooked that implementing this requires installing iib
ah ok you install it as a submodule, or an import?
ah ok you install it as a submodule?
Of course, this can be achieved, but it still conflicts with the original iib
I will ask the author of iib
I could just fork the imagebrowser, clone my fork as a submodule and change the elem_ids in javascript, css and ui
This is a feasible solution
Do you konw about how fastapi
and script_callbacks.on_app_started
work?
As far as I know, iib
needs to use this callback to register fastapi
If the user installs the original iib
at the same time, I am not sure if there is a conflict between the two callbacks
And, this is javascript of iib
- This is a file generated using
yarn build
.- If you want to make changes, please modify
index.tpl.js
and run the command to generate it again.
I recently learned about the tagger included a fastapi, I didn;t know before and that was what I broke with my changes, but I believe I've fixed it. I also added a remote unload function. I don't know yet about script_callbacks.on_app_started
, but I'm sure that I can also find out, thanks for all the information, it is very kind of you.
I will test it out, of course, I have the extension as well.
That's how A1111-WebUI script_callbacks.on_app_started
work https://github.com/WSH032/sd-webui-fast-dataset-maker/blob/5bc34f3edd1d6f4040f77cd94db3919b60b10a92/webui.py#L138
May be useful for your understanding
I still think it would be better for users to install iib themselves
The duplicate check function only needs to provide users with a simple gallery, or mark images for independent iib to use
Also I believe your repository would be useful: image-deduplicate-cluster-webui I also implemented something very simple myself, but it's just based on sorted tags + weights with a precision of one digit. That already was kind of working, though and allowing me to find duplicates slight crop, horizontal flip, file rename and rescaled image. It does also list some highly similar photos. But your implementation is more advanced, and why reinvent the wheel?
Thank you for your comment!
But your implementation is more advanced
I didn't write many algorithms. I just used the imagededup
library to check the duplicate and display the results in the gallery
But it is better not to refer to it first. The code of version 1.0.0 is too bad. I am reconstructing it. I will release version 2.0.0 when I am free, probably the day after tomorrow
supplement:
that's alpha for reconstructing https://github.com/WSH032/image-deduplicate-cluster-webui/tree/dev-2.0.0-alpha.1
Hi, check this commit
I almost finished it.
But this still conflicts with the original iib
, and it may not work if the user has already installed iib
. Don’t worry about this, in the last discussion, the author of iib said he would solve the elem_id problem.
Thanks. I'm currently debugging some other ui issues that can improve user experience, but I'll work on the gallery asap.
It seems I'm still missing something, or due to the pending elem_id I still only see the error label and my basic gallery. I fetched your branch: the changes on top of my fast-dataset-maker-gallery, locally named WSH032-fast-dataset-maker-gallery
. Or maybe some of my extensions interfere. I use the dark mode and lobe theme - disabling the lobe theme didn't resolve it. Inspect element shows a few errors. It could also be something that wasn't committed or there's another reason (Linux/cpu-only).
But don't worry, I'll do some more debugging.
or it is pycache, let's try that first..
It should not be a problem with other extensions or UI themes, unless another iib
extension are runing.
Can you check if extensions_ui.on_app_startd() and extensions_ui.on_ui_tabs() are working properly?
Another possible reason is:
JavaScript may not work properly.
What's bad is that, I have never studied JavaScript, so I don’t know how to check it.
This JavaScript file comes from iib
, iib
needs it to work properly, and I don’t know if moving it will affect the normal working of this js code
I can understand javascript, but it can be complex, in particular async and debugging. Both extensions_ui.on_app_startd()
and extensions_ui.on_ui_tabs()
print in the console, no other errors there, by the way.
When I inspect element, in the console (where javascript errors are printed) there are some but they seem unrelated (I already had those). there's a warning:
Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.
Note that this is not an issue if running this frontend on a browser instead of a Tauri window.
(anonymous) @ index-23e5bc7c.js:180
index-23e5bc7c.js:186
Object
index-23e5bc7c.js:190 undefined
index-23e5bc7c.js:190 Splitpanes: Could not resize panes correctly due to their constraints.
(anonymous) @ index-23e5bc7c.js:190
and I vaguely recall that tauri may be something related. EDit: actually no, Tauri is a different frontend, and I run it in a browser. Then, if I click on the gallery tab, I get 5 times in a row:
file=script.js?1688626290.013775:85 error running callback ƒ (){
check_gallery(SP_GALLERY_LABEL)
} : ReferenceError: check_gallery is not defined
at smart_process.js?1688934712.344647:31:5
at executeCallbacks (file=script.js?1688626290.013775:83:13)
at MutationObserver.<anonymous> (file=script.js?1688626290.013775:112:9)
That ReferenceError: check_gallery is not defined
seems suspicious, but I cannot find it anywhere in the stable-diffusion-webui-wd14-tagger or addons/sd_webui_infinite_image_browsing code.
I found something here which indicates the state extension might be the culprit, which I have. I'll try disabling that. Nope.
that javascript fe-static is something also referenced in scripts/iib/api.py
, line 143. I have to call it a day; we'll get there.
OK, let’s take it slow This is a strange problem, I reinstalled the new branch of tagger in A1111-WebUI, and it still works normally. Even though I also have the same inspection element error
This is my env Windows 10
Edit: nevermind, this is for colab, not to run in a jupyter notebook on my pc Edit2: I can confirm that the gallery is working in colab.
I run webui on my own desktop PC and I have the sd-webui-infinite-image-browsing, which just works. Therefore I don't think this issue has to do with packages. This colab seems to install some packages, but my distribution is not ubuntu, so package names differ, but I've installed aria2, I believe I have most. Also, I run on cpu, I don't have a very powerful GPU, and it's AMD. The -xformers and packages are for nvidia. Why does the colab base64 encode all strings, obfuscation against crawlers/machine learning? Before executing anything I'll decode it anyway. It occurred to me that changes in the addons/sd_webui_infinite_image_browsing are not included in the changes that I picked up from your fork, so if there were edits there, then I might still need those.
Thank you for the information, I have some weekend time now so I'll figure it out, don't worry.
This colab seems to install some packages
These packages are irrelevant and do not affect the normal operation of iib. Similarly, GPU does not affect the work of iib.
Why does the colab base64 encode all strings, obfuscation against crawlers/machine learning? Before executing anything I'll decode it anyway.
Colab prohibits running any code with the substring “SD-Webui”, I have to use base64 to encrypt it to deceive colab.
It occurred to me that changes in the addons/sd_webui_infinite_image_browsing are not included in the changes that I picked up from your fork, so if there were edits there, then I might still need those.
I did not modify anything in the submodule. In Colab, I directly pulled the submodule from your fork.
I can confirm that the gallery is working in colab.
This is a strange problem, if it can run normally in Colab, it means the js file works well. You mentioned that you also installed sd-webui-infinite-image-browsing, have you tried disabling sd-webui-infinite-image-browsing extension on A1111-WebUI? Anyway, make sure it does not run with Tagger at the same time.
I also just tried my branch where I already merged the master branch and that works as well in colab.
You mentioned that you also installed sd-webui-infinite-image-browsing, have you tried disabling sd-webui-infinite-image-browsing extension on A1111-WebUI? Anyway, make sure it does not run with Tagger at the same time.
Thanks, this seems to be related, though it is not working yet, locally I do not get the error message, but it is different. interesting!
currently I am seeing:
It seems to have failed to load. You can try refreshing the page.
If that doesn't work, click on FAQ for help
And that means it is at least loading the infinite browser.
Edit: I think I will have it now, I was still on your standalone branch. Awesome! it is working!! So an infinite_image_browsing extension currently does interfere.
currently I am seeing:
It seems to have failed to load. You can try refreshing the page. If that doesn't work, click on FAQ for help
And that means it is at least loading the infinite browser.
You mean, you see this message in the gellery of Tagger on your PC? If so, that’s good news.
Thanks for all the help !
You are welcome.
So an infinite_image_browsing extension currently does interfere.
You solve this problem after disabling iib? That’s good news. I will solve this conflict problem after the author of iib updates the isolation feature.
Forgive me for not trying this before. I was expecting neither or both to work. I think there are some more things desireable though, like configuring what folder iib starts with, and drag and drop is not working, but I'll also work on this. iib needs to work in a special modus, if on a tab, I guess
That’s ok.
like configuring what folder iib starts with
Don’t worry, I can implement these.
Directed from here, it seems you have an extension that includes something very similar to what I would like to implement in the stable-diffusion-webui-wd14-tagger extension that I've recently handed maintainership of. Your license permits it, so I'll pick up some of your changes, unless you disagree. Your code looks pretty good, I'll have to translate some comments I am unable to read. Thanks.