-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
feat: Scan wildcard subdirectories #2466
Conversation
Adds a method for getting the top-most occurrence of a given file in a directory tree
When using the `name-filter` parameter in `get_model_filenames`, it doesn't guarantee the best match to be in the first index. This change adds a step to ensure the correct wildcard is being loaded.
…h files, rename button variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Cruxial0 i've added the ability to configure wildcards filepaths incl. caching as the wildcard filepaths were collected every time a wildcard was processed (in the max. 64 iterations for loop).
Please double check so we can merge this feature to develop for the next release.
Looks good, however I'm not sure how much I like having to refresh files every time a wildcard is added. When I work with wildcards, I tend to add new files frequently. It's by no means a deal-breaker, but I believe it would be more user friendly to update it automatically. Maybe a function that compares the number of files in the wildcard directory at the start of every generation, and only updates if files were added/removed? |
@Cruxial0 the options are
The changes of this MR now also allow nested directory structures and recursive collection, which is why file counting is not going to work, also one file can be deleted and another added, which is why a simple count isn't sufficient here. I think the currently implemented option offers the best compromise between performance and flexibility. |
# Conflicts: # webui.py
Closes #2461
Allows users to sort their wildcards in folders. Previously Fooocus would only search the base directory.