Skip to content
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

reduce unnecessary re-indexing extra networks directory #14512

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

w-e-w
Copy link
Collaborator

@w-e-w w-e-w commented Jan 3, 2024

Description

webui calles extra networks refresh() when the webpages loads
the refresh function includes clearing out the existing extra networks list and crawling through the directories again

this is unnecessary
particularly in lots of cases on initial launch of the server followed by loading of web page from the browser when the list was just created seconds before

this possibly would help reduce the issue with #14507

[Issue]: Long wait times before generation and display of Extra Networks after every launch, due to large amounts of Loras and Checkpoints

assuming that the issue is caused by crawling through the large directory


more improvements can be done if we cache the extra networks list and HTML
and only updated them when there is change to the directories

it might be possible to improve the performance by making indexing and creating of html multi-threaded (for each network type)

moveing indexing on to a separate thread might also improved performance


Changes

split the creating of the HTML from the refreshing the list of extra networks
the refresh button still refreshes the list reindexing the directory
but the creating of the HTML triggered by the loading of web page only creates the HTML and not reloads the list

Checklist:

@w-e-w w-e-w force-pushed the remove-excessive-extra-networks-reload branch from 3975058 to 5e8ce3b Compare January 3, 2024 10:15
@w-e-w w-e-w changed the title remove excessive extra networks reload reduce unnecessary re-indexing extra networks directory Jan 3, 2024
@w-e-w w-e-w force-pushed the remove-excessive-extra-networks-reload branch from 5e8ce3b to 312d8e1 Compare January 3, 2024 10:18
@w-e-w w-e-w force-pushed the remove-excessive-extra-networks-reload branch from 312d8e1 to fccd0b0 Compare January 3, 2024 10:25
@AUTOMATIC1111 AUTOMATIC1111 merged commit 04a005f into dev Jan 3, 2024
6 checks passed
@AUTOMATIC1111 AUTOMATIC1111 deleted the remove-excessive-extra-networks-reload branch January 3, 2024 16:15
@w-e-w w-e-w mentioned this pull request Feb 17, 2024
@pawel665j pawel665j mentioned this pull request Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants