stable-diffusion-webui
stable-diffusion-webui copied to clipboard
Speed up Images history
1.The original operation mode is improved. Only the pictures of the last few days are loaded each time, so that we don't need to read all the files information on the hard disk and sort it every time when we turn page
The turn page speed is very fast now, This may also be due to the upgraded "gradio"
2.Add a “Reconstruct output directory structure“ option in “setting” page. If it is selected, All pictures in the output directory will be archived by date, In this way, if there's a large number images, It can only sort images for a certain number of days at a time, thus increasing the loading speed. But It will change the original output directory structure, so a mapping file ”webui_log_and_bak\path_mapping.csv" is created to record the structure information of the original directory.
And reconstruct directory structure also can avoid some hidden dangers in the future. Windows has a limit on the total length of path name. Other OS may also have such rules. Webui‘s output image path name usually contains a long string of prompt ,unpredictable system errors may occur, just like what happened here.
3.Images in opts.outdir_save directry add to History page, and add a save button to save current image to opts.outdir_save
Ok so I had to manually add #2790 to make it work in Colab and now it feels way more responsive than before, it takes like 3 seconds instead of 15 seconds to load a page from my Google Drive, just one little detail the send to img2img button doesn't send the actual image, everything else seems to work fine
Ok so I had to manually add #2790 to make it work in Colab and now it feels way more responsive than before, it takes like 3 seconds instead of 15 seconds to load a page from my Google Drive, just one little detail the send to img2img button doesn't send the actual image, everything else seems to work fine
send to img2img button doesn't send the actual image, everything else seems to work fine
this problem comes from "PNG Info" page, I quote functions from the page ,I also hope the author of the page can fix
1.The original operation mode is improved. Only the pictures of the last few days are loaded each time, so that we don't need to read all the files information on the hard disk and sort it every time when we turn page
The turn page speed is very fast now, This may also be due to the upgraded "gradio"
2.Add a “Reconstruct output directory structure“ option in “setting” page. If it is selected, All pictures in the output directory will be archived by date, In this way, if there's a large number images, It can only sort images for a certain number of days at a time, thus increasing the loading speed. But It will change the original output directory structure, so a mapping file ”webui_log_and_bak\path_mapping.csv" is created to record the structure information of the original directory.
And reconstruct directory structure also can avoid some hidden dangers in the future. Windows has a limit on the total length of path name. Other OS may also have such rules. Webui‘s output image path name usually contains a long string of prompt ,unpredictable system errors may occur, just like what happened here.
3.Images in opts.outdir_save directry add to History page, and add a save button to save current image to opts.outdir_save
A browser based on “Images History” is created today, this can be very useful for users running webui on server.
Today, I tested the directory with 20000 pictures processed by my ”Image History“, It only takes 4 seconds to read all the picture information. Therefore, it is unnecessary to reconstruct the directory structure to improve the loading speed. So in the new code, I canceled the setting of reconstruct the directory structure
I have added some new functions. When loading pictures of a certain period in batches, we can switch batches in sequence by "forward" button and "backward", display the information of the batch at the same time
The function of browsing custom paths is added ,so that users can manage pictures in any directories, which is especially useful for server users.
I believe that this image browser will become a very useful and powerful tool after integrating more functions in the future. @AUTOMATIC1111
if you're adding settings, there should be a setting to not list any directories at startup and to not show any pictures in gallery until the user requires it. However optimized your function is, it's still a degradation for people who don't use the history tab, which is an absolutely majority.
Letting users go into any directory and view pictures there can also be quite undesirable, so this should not be enabled until the person who's running the server explicitly decides to enable it.
if you're adding settings, there should be a setting to not list any directories at startup and to not show any pictures in gallery until the user requires it. However optimized your function is, it's still a degradation for people who don't use the history tab, which is an absolutely majority.
Letting users go into any directory and view pictures there can also be quite undesirable, so this should not be enabled until the person who's running the server explicitly decides to enable it.
I see, I will improve
@AUTOMATIC1111 May I merge the "PNG Info" Page into "Image Browser"?
@AUTOMATIC1111 Add a "--browse-all-images" option in cmd_opts to enable browsing custom fold Add a "Preload images at startup" checkbox in setting page to enable preloading Several redundant functions have been removed
I downloaded and ran the code, and while it works, --browse-all-images
only hides the UI elements - you still can make a request to list images in any directory. There needs to be a server side check for functions that list/edit files.
I downloaded and ran the code, and while it works,
--browse-all-images
only hides the UI elements - you still can make a request to list images in any directory. There needs to be a server side check for functions that list/edit files.
Thanks,I am going to improve the functions of browser recently, It is recommended not to merge.
I plan to further optimize the code and make the browser more concise and practical, such as adding the function of searching images by keywords, which should be very useful for explore prompt.
I have perfected detail of "inspiration" today, I hope you can pay attention to this PR
I believe this is a powerful function to improve the user experience of webui
As with your other PR I'd like to move images history to extensions.
If you don't want to/can't, I can remake the current version as an extension, upload it somewhere and you'd copy the repo into your own separate repo where you will maintain and develop it.
And as this won't any longer be a part of the main repo I won't ask you to do any of the security stuff.
I see, I will learn how to move into extension