Add a "History" tab to manage previously generated images conveniently#2267
Add a "History" tab to manage previously generated images conveniently#2267yfszzx wants to merge 0 commit into
Conversation
|
Are you using gradio gallery to show the images? Doesn't gradio severely slow down as high amounts of images are shown in the gallery? At least that's what I noticed when generating images. (High amounts being like >10 and getting into 20s and 30s) |
yes, I use gradio gallery, but I didn't encounter such a problem,It takes about 2 seconds to load 48 pictures on my computer |
moreRGB
left a comment
There was a problem hiding this comment.
i'm not a project collaborator, but i would like this get merged. the js code could be a little bit improved.
| filter: invert(); | ||
| mix-blend-mode: multiply; | ||
| pointer-events: none; | ||
| } |
|
|
||
| img_num = buttons.length / 2 | ||
| if (img_num == 1){ | ||
| setTimeout(function(tabname){ |
| buttons = gradioApp().querySelectorAll('#' + tab + '_images_history .gallery-item') | ||
| buttons.forEach(function(bnt){ | ||
| bnt.addEventListener('click', images_history_button_actions, true) | ||
| }); |
| if (!this.classList.contains("transform")){ | ||
| gallery = this.parentElement | ||
| while(!gallery.classList.contains("images_history_gallery")){gallery = gallery.parentElement} | ||
| buttons = gallery.querySelectorAll(".gallery-item") |
There was a problem hiding this comment.
i would strongly advice against declaring variables implicitly
| }) | ||
|
|
||
| img_num = buttons.length / 2 | ||
| if (img_num == 1){ |
There was a problem hiding this comment.
Thanks, I'm good at python, but not familiar with js.Thank you for your guidance. I will improve the code soon .
This might have been resolved with gradio-app/gradio#2265 |
|
Note: this point from the last PR is still relevant/has yet to be addressed.
Edit:
|
Thanks, I'm good at python, but not familiar with js.Thank you for your guidance. I will improve the code soon . |
Last closed PR is here
Compared with the previous version, the following changes have been made:
About 500 images in directories when I tested, , but it doesn't matter, the browser only load 48 images every page
images in subdirectories will be added next step
——————————————————————————————————
This pull request is trying to build a tab browser of previous pictures in output directory for txt2img and img2img. We can easily browse the previously generated images, display the image generation information in PNG meta, push the image information to "txt2img" or "img2img", or delete the images we no longer need.
I try my best to encapsulate the new code independently to avoid affecting other functions of the project .
To facilitate the operation of HTML controls,I import jQuery Framework in the js script.
OS: both Win10, and Ubuntu Server


Browser Chrome,
Graphics card NVIDIA RTX 2080ti 11GB