-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Add date based folder sorting as default when saving images #6785
base: master
Are you sure you want to change the base?
Conversation
Other relevant PR: #6387 |
Trying to process your response there. Are you saying that these changes are not processed by the backend? Is there any other use case where this change would conflict? I can't really see how there would be. The main issue my PR is aiming at solving is how the current way output is handled with images will, given enough generations, cause that folder to be rendered unusable for Windows OS user due to it trying to handle too many file properties at once. Testing of this issue was done on a system running 2TB PCIe v4 NVME m.2 SSD with the following specs After folder accumulated 4000 images, it took over 2 minutes for it to sort images by date. |
Well this is simply ridiculous though. |
The problem I see is that if a workflow is exported for API use, which means no frontend is in use, the API won't honor that syntax. This is speaking from my own experience as well -- I originally had thought that syntax was handled in the backend, so I was really confused why this was "broken" until I learned it's a frontend only feature. If we modify the node default, in my view that would lead many to believe the behavior of this node would be consistent regardless if they use a frontend that supports it or not, or no frontend at all. |
@catboxanon Have you tested this pull request and confirmed that this is the case with the API? |
@catboxanon My latest commit to this PR should handle cases where the is no Frontend present such as API. |
A workable alternative (for me) would be an option to set the default save string to a custom value. |
I overhauled save_image_path to handle more exceptions, handle exceptions correctly, properly handle cases where "Comfy.SaveImageExtraOutput" is disabled or API use cases where there is no frontend to parse frontend syntax for date formatting, This will handle all variations of user date format input that is used on either web frontend format("%date:yyyy-MM-dd-hh-mm-ss%") or if they choose to use backend format("%year%-%month%-%day%-%hour%-%minute%-%second%") directly.
Remove trailing whitespaces.
…der is specified directly via input
This is to mitigate issues with Windows explorer not being able to handle large amounts of files in a folder.
Without this, on a top end NVMe SSD and 2000 images in output folder, sorting by date can take up to a minute each time output folder is opened.
This can be prevented by automatically sorting images in subdirectories based on date as then it is unlikely that a single folder will accumulate an excessive amount of images.