-
Notifications
You must be signed in to change notification settings - Fork 26.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExtraNetworks: Performance Updates and Improvements #15530
base: dev
Are you sure you want to change the base?
ExtraNetworks: Performance Updates and Improvements #15530
Conversation
…l load of tree view.
…tml. maybe should only update the data json. also maybe look into sharing data json between img2img and txt2img to reduce size of dom.
@MrKuenning I think I've fixed your issues |
Seems to work now. |
Performance is still great and everything seems good. Kinda stopped testing because everything looked ok on my side and bugfixing seemed to be shifting to the mobile UI, which I couldn't really provide feedback on, so was just waiting for the merge. I did find a couple of very small issues though. Embeddings tab seems to have infinite scrolling, it goes back to the top after scrolling all the way down. Only seems to happen on that tab. Recording.2024-06-22.124119.mp4On the checkpoints tab, there's a weird issue that prevents scrolling all the way down. Only seems to happen when there are two full rows at the bottom, say: XXXXX XXXXX Untitled.mp4Seems to be fixed by making the very bottom row uneven by disabling dir view, or also by resizing the Extra Networks frame from the bottom. Untitled2.mp4Only seems to happen on the Checkpoints tab, couldn't reproduce on the Lora tab. No visible errors on any console. |
@freecoderwaifu Go ahead and test it out again. I fixed a few bugs with scrolling. I think both your issues stemmed from the same problem so I'm hoping they're both fixed now. I don't think your issues were necessarily related to the specific tabs, I think it was just that you had just the right number of models in each of those individual tabs for the problem to show itself. |
@Sj-Si Thank you, it's fixed, everything else still looking good. |
Unsure how recent it is as I only noticed it yesterday but the tree view seems to...collapse its previous state when you go back to it from the txt2img tab (i.e. if you have folder A and A-A expanded and come back, it will all be collapsed down to just the root A). I didnt see any obvious settings that might cause it. I actually see the folders compact themselves back up when i flip back to the lora tab. No console errors appear and the actual card display view doesnt change from the previous selection, its only on the tree pane. |
Fixed. I moved a variable around and missed it when updating references to it. |
Seems to be fixed now, thanks! |
Any timeline for this being merged in? |
no idea. that is all up to A1111 but I don't want to pressure them since this is so big and they aren't being paid to do any of this. |
@Sj-Si I have some changes that I like to push I find it extremely annoying that the additional elements added into the in order to stop the changing of tab bar height I made some changes to the css also since for it's not possible to squeeze in the befor 2024-07-24.00_55_21_028.chrome.mp4after 2024-07-24.00_55_51_151.chrome.mp4 |
This comment was marked as resolved.
This comment was marked as resolved.
I also found a potential issue with this whole rework PR after this PR when there's lots of
if I switch to a different while this does not impact functionality it is very annoying and distracting current dev branch without this PR, no flash / blank when swiching to webui 2024-07-24.01_34_04_765.chrome.mp4with this PR - webpage flash / blank when swiching to webui when extra networks tab selected (Lora tab which has lots of items) 2024-07-24.01_33_00_311.chrome.mp4 |
ahhh my mistake I had disabled cache turned on outdatred my mistake
another issue that impacts user experience from what I can observe you seems to be splitting the extra networks tab into multiple chunks and load / updates the HTML chunks sequentially as the user scrolls down while I like the concept but the implementation has some issues maybe when the cache images is above a certain amount then the cash should be thrown away to clear out memory 2024-07-24.02_29_30_723.chrome.mp4 |
153a22f
to
8bf4548
Compare
@w-e-w Hey I'm sorry for goin AWOL for a bit. By all means go ahead and make improvements to this PR. I'm a bit tied up at the moment so I can't really dedicate any time to this project until I get things sorted irl first. Also your understanding of how the model cards are loaded (loaded in chunks) is correct. |
Thanks I don't know if AUTO has reviewed this or not |
#15530 (comment)
Description
This PR is a complete overhaul of the code that I previously wrote for the ExtraNetworksTreeView PR (#14588) in response to the negative feedback such as in #15164 and various issues that have been posted.
The goal of this PR is to improve performance and reduce resource use across ExtraNetworks tabs.
I have tested these changes with up to 100,000 models at a time. With this many models, the initial load is slow but as soon as the server fully generates the dataset it performs very well. Before, my browser would just crash if I even tried to load the page with more than 50k models. The real limiting factor here is the server (though it takes quite a bit to reach the limit). Right now,
ui_extra_networks.py
is generating the HTML for all of the files it discovers in any of the models directories. It then waits for requests from the client and sends only the requested items HTML back to the client. This way the client doesn't have massive amounts of DOM elements constantly loaded. So as long as the device running the server can load the generated HTML for every single item in the models folders then it should be fine. I don't see this being an issue until some psycho comes along with 10 million models but I don't really think we should be pandering to such a niche audience. Even then, I think other things will crash before this new code does.Sorry ahead of time... this is a big one.
The following has changed:
utils.js
file and added a lot of helpful utility functions that could probably be used elsewhere if needed.resizeHandle.js
handle is double clicked.UI Changes
Below is an example of what the new format looks like:
Controls
The controls have been grouped with a header to hopefully make their intent more obvious.
Directory View
Directory view buttons have been styled a bit better and now the selected directory will be highlighted.
Tree View
Slightly modified the appearance of the tree view and simplified the code that generates it. Also directories in the tree view are no longer expanded when the item itself is clicked. Now the user must click the chevron on a directory in order to expand it.
Checklist:
Additional Notes
Someone suggested that we use emojis for the controls in the extra networks tabs. Personally I hate emojis and they look disgusting. On top of that, I couldn't find any that really fit the purpose of each of the controls. If someone has a theme (like lobo or whatever) then they can handle replacing these SVGs if they want. The SVGs are all easy to query so they can handle a find/replace if they want.
One thing that I couldn't figure out is how to manually trigger the gradio loading icon within the extra networks pane (see below):
This loading page appears whenever the page is reloaded or refreshed but I would have liked to have been able to manually trigger it to show up and stay there until the data is fully loaded but I couldn't figure out where this loading pane was even coming from. I'd really like to be able to put one in the Tree View and one in the Cards View. Then I would trigger each manually whenever I need to load more data.
Also at some point someone requested that clicking one of the directory view buttons to filter cards should only show direct children of that directory and not any of the nested directory content. What was the consensus on this? Should that be the behavior or do we prefer to show all nested items? The current behavior is the same as it always has been and it is a pretty simple implementation where clicking a button simply adds that path to the search box and updates the filter based on the search box text. Changing the behavior of clicking directory buttons would definitely require a bit of redesign and I think this change has already had enough scope creep as is.
Needs Testing
I would like to have this feature undergo a bit more testing than the last time in order to avoid having so many people get upset at the same time. I'd really appreciate feedback for this PR so that we can catch as many problems as possible before merging.
I have really only tested in the following environment: