zanllp / sd-webui-infinite-image-browsing

A fast and powerful image/video browser for Stable Diffusion webui / ComfyUI / Fooocus / NovelAI / StableSwarmUI, featuring infinite scrolling and advanced search capabilities using image parameters. It also supports standalone operation.
MIT License
933 stars 117 forks source link

Sorting options clarity and improvement suggestion. #460

Open silveroxides opened 9 months ago

silveroxides commented 9 months ago

I am a bit confused about the sorting system. I recently transferred my backup back into my sd-webui outputs folder due to finally having space again. But no sorting method returns the correct expected order. Created date i can understand is based on when the file was created and thus that would be the time that i copied the backup. But the updated date sorting makes no sense. Mostly cause I did a search in the code files and it does not sort by the property I would expect an updated date option to sort by, It just sorts by 'Date'? Meanwhile all my files have the 'date modified' date correct but the sorting either priorities folder dates over files (kind of useless in this case). It could just group the images based on last modified date within respective txt2img-images, img2img-images etc. subdirectories recursively and ignore the folder dates.

EDIT: I just now noticed how when browsing it displays the correct date just below each image and no matter what sorting mode it still puts them way out of order. Is it really prioritizing the folder date even when not browsing folders directly??

silveroxides commented 9 months ago

Will add a temporary solution for anyone else copying in folders from a backup or old webui install. In powershell run this command and make sure to adjust based on what folder you want to edit as well as the date. (Get-Item -Path "C:\path-to\webui\outputs\txt2img-images\2023-05-29").LastWriteTime = "2023-05-29 00:00:01"

tddschn commented 6 months ago

I am confused too...

I tried changing the fastapi's /files route defined by get_target_folder_files's code to return files list in a dir in different orders, but the web interface doesn't respect the order returned by the /files API at all. I don't know how a certain image ends up in a totally unexpected location on the page.

When running as an extention of SD Web UI, the order is perfect, but when I transferred the images to another machine with rsync, preserving mtime, ctime etc, and tried the experienment above, nothing gives the correct order.

@zanllp Could you explain exactly how the sorting works? An answer is much appreciated. :)

zanllp commented 6 months ago

I am confused too...

I tried changing the fastapi's /files route defined by get_target_folder_files's code to return files list in a dir in different orders, but the web interface doesn't respect the order returned by the /files API at all. I don't know how a certain image ends up in a totally unexpected location on the page.

When running as an extention of SD Web UI, the order is perfect, but when I transferred the images to another machine with rsync, preserving mtime, ctime etc, and tried the experienment above, nothing gives the correct order.

The UI part of this project isn't actually open source, only bundled code is published.

@zanllp Could you explain exactly how the sorting works? An answer is much appreciated. :)

https://github.com/zanllp/sd-webui-infinite-image-browsing/blob/main/vue/src/page/fileTransfer/fileSort.ts

https://github.com/zanllp/sd-webui-infinite-image-browsing/blob/ffc834ada6c58a6f45a1bccbeb82b56ef8f9c43c/vue/src/page/fileTransfer/hook.tsx#L75-L93

tddschn commented 6 months ago

Thank you for your quick reply! I just found the sorting option under Global Setings. It works as expected now.