mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-04 13:55:06 +08:00
for live previews, only hide gallery after at least one live previews pic has been received
fix blinking for live previews fix a clientside live previews exception that happens when you kill serverside during sampling match the size of live preview image to gallery image
This commit is contained in:
parent
e8a9d213e4
commit
f6c52f4f41
@ -79,17 +79,17 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre
|
|||||||
divProgress.appendChild(divInner);
|
divProgress.appendChild(divInner);
|
||||||
parentProgressbar.insertBefore(divProgress, progressbarContainer);
|
parentProgressbar.insertBefore(divProgress, progressbarContainer);
|
||||||
|
|
||||||
if (gallery) {
|
var livePreview = null;
|
||||||
var livePreview = document.createElement('div');
|
|
||||||
livePreview.className = 'livePreview';
|
|
||||||
gallery.insertBefore(livePreview, gallery.firstElementChild);
|
|
||||||
}
|
|
||||||
|
|
||||||
var removeProgressBar = function() {
|
var removeProgressBar = function() {
|
||||||
|
if(! divProgress) return;
|
||||||
|
|
||||||
setTitle("");
|
setTitle("");
|
||||||
parentProgressbar.removeChild(divProgress);
|
parentProgressbar.removeChild(divProgress);
|
||||||
if (gallery) gallery.removeChild(livePreview);
|
if (gallery) gallery.removeChild(livePreview);
|
||||||
atEnd();
|
atEnd();
|
||||||
|
|
||||||
|
divProgress = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
var funProgress = function(id_task) {
|
var funProgress = function(id_task) {
|
||||||
@ -149,8 +149,16 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre
|
|||||||
var funLivePreview = function(id_task, id_live_preview) {
|
var funLivePreview = function(id_task, id_live_preview) {
|
||||||
request("./internal/progress", {id_task: id_task, id_live_preview: id_live_preview}, function(res) {
|
request("./internal/progress", {id_task: id_task, id_live_preview: id_live_preview}, function(res) {
|
||||||
if (res.live_preview && gallery) {
|
if (res.live_preview && gallery) {
|
||||||
|
|
||||||
|
|
||||||
var img = new Image();
|
var img = new Image();
|
||||||
img.onload = function() {
|
img.onload = function() {
|
||||||
|
if(!livePreview){
|
||||||
|
livePreview = document.createElement('div');
|
||||||
|
livePreview.className = 'livePreview';
|
||||||
|
gallery.insertBefore(livePreview, gallery.firstElementChild);
|
||||||
|
}
|
||||||
|
|
||||||
livePreview.appendChild(img);
|
livePreview.appendChild(img);
|
||||||
if (livePreview.childElementCount > 2) {
|
if (livePreview.childElementCount > 2) {
|
||||||
livePreview.removeChild(livePreview.firstElementChild);
|
livePreview.removeChild(livePreview.firstElementChild);
|
||||||
@ -168,5 +176,9 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre
|
|||||||
};
|
};
|
||||||
|
|
||||||
funProgress(id_task, 0);
|
funProgress(id_task, 0);
|
||||||
funLivePreview(id_task, 0);
|
|
||||||
|
if(gallery){
|
||||||
|
funLivePreview(id_task, 0);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -541,7 +541,7 @@ table.popup-table .link{
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: calc(100% - 60px); /* to match gradio's height */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fullscreen popup (ie in Lora's (i) button) */
|
/* fullscreen popup (ie in Lora's (i) button) */
|
||||||
|
Loading…
Reference in New Issue
Block a user