lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
8.72k stars 865 forks source link

No "Live preview in full page image viewer" #1167

Open MathDC99 opened 3 months ago

MathDC99 commented 3 months ago

Live preview in full page image viewer doesn't work when clicked. It only displays as a thumbnail in UI.

EvanGuanSF commented 2 months ago

Quick and potentially dirty fix for those interested: in javascript/imageviewer.js, change line 180: var fullImg_preview = gradioApp().querySelectorAll('.gradio-gallery > button > button > img'); to var fullImg_preview = gradioApp().querySelectorAll('.gradio-gallery > button > button > img, .gradio-gallery > .livePreview');

Almost everything seems to already be in place in terms of code, it's just that the "toggle full screen gallery" event was never associated with the live preview element.

There is one side effect in the quick testing I've done: There's some incorrect buffering/temporary showing of the currently generating image when Show Live preview in full page image viewer is disabled (it should only show the last round of generated images I think), but the gallery image does comes up after a delay. (Possibly after a 'Live preview display period' number of steps and image update to force update the gallery?)

I'll leave it to people who actually know what's going on under the hood with options/flags and for more thorough testing and verification, I just wanted something that worked.

zeittresor commented 1 month ago

Quick and potentially dirty fix for those interested: in javascript/imageviewer.js, change line 180: var fullImg_preview = gradioApp().querySelectorAll('.gradio-gallery > button > button > img'); to var fullImg_preview = gradioApp().querySelectorAll('.gradio-gallery > button > button > img, .gradio-gallery > .livePreview');

Almost everything seems to already be in place in terms of code, it's just that the "toggle full screen gallery" event was never associated with the live preview element.

There is one side effect in the quick testing I've done: There's some incorrect buffering/temporary showing of the currently generating image when Show Live preview in full page image viewer is disabled (it should only show the last round of generated images I think), but the gallery image does comes up after a delay. (Possibly after a 'Live preview display period' number of steps and image update to force update the gallery?)

I'll leave it to people who actually know what's going on under the hood with options/flags and for more thorough testing and verification, I just wanted something that worked.

nice, thanks,.. hope there will be a final solution for this some time but how ever your solution is working good for me (somehow) and btw. more stable as my attempt to "find a workaround" -> https://github.com/lllyasviel/stable-diffusion-webui-forge/discussions/1158