Compare commits

...

3 Commits

Author SHA1 Message Date
w-e-w
82bf9a3730 Fix issue with modal image viewer with low live_preview_refresh_period (#16981) 2025-05-02 15:09:38 -04:00
Nick Richardson
ebbc56b4ec Add random number generator source to filename (#16928) 2025-05-02 13:02:05 -04:00
Jose Pablo Mora
6d664438ba Add python3.11-venv package to Ubuntu instructions (#16533) 2025-05-02 12:38:53 -04:00
6 changed files with 7 additions and 2 deletions

View File

@@ -88,6 +88,7 @@ module.exports = {
// imageviewer.js
modalPrevImage: "readonly",
modalNextImage: "readonly",
updateModalImageIfVisible: "readonly",
// localStorage.js
localSet: "readonly",
localGet: "readonly",

View File

@@ -133,7 +133,7 @@ If your system is very new, you need to install python3.11 or python3.10:
# Ubuntu 24.04
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.11
sudo apt install python3.11 python3.11-venv
# Manjaro/Arch
sudo pacman -S yay

View File

@@ -54,6 +54,7 @@ function updateOnBackgroundChange() {
updateModalImage();
}
}
const updateModalImageIfVisible = updateOnBackgroundChange;
function modalImageSwitch(offset) {
var galleryButtons = all_gallery_buttons();
@@ -164,6 +165,7 @@ function modalLivePreviewToggle(event) {
const modalToggleLivePreview = gradioApp().getElementById("modal_toggle_live_preview");
opts.js_live_preview_in_modal_lightbox = !opts.js_live_preview_in_modal_lightbox;
modalToggleLivePreview.innerHTML = opts.js_live_preview_in_modal_lightbox ? "🗇" : "🗆";
updateModalImageIfVisible();
event.stopPropagation();
}

View File

@@ -190,7 +190,7 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre
livePreview.className = 'livePreview';
gallery.insertBefore(livePreview, gallery.firstElementChild);
}
updateModalImageIfVisible();
livePreview.appendChild(img);
if (livePreview.childElementCount > 2) {
livePreview.removeChild(livePreview.firstElementChild);

View File

@@ -409,6 +409,7 @@ class FilenameGenerator:
'generation_number': lambda self: NOTHING_AND_SKIP_PREVIOUS_TEXT if (self.p.n_iter == 1 and self.p.batch_size == 1) or self.zip else self.p.iteration * self.p.batch_size + self.p.batch_index + 1,
'hasprompt': lambda self, *args: self.hasprompt(*args), # accepts formats:[hasprompt<prompt1|default><prompt2>..]
'clip_skip': lambda self: opts.data["CLIP_stop_at_last_layers"],
'randn_source': lambda self: opts.data["randn_source"],
'denoising': lambda self: self.p.denoising_strength if self.p and self.p.denoising_strength else NOTHING_AND_SKIP_PREVIOUS_TEXT,
'user': lambda self: self.p.user,
'vae_filename': lambda self: self.get_vae_filename(),

View File

@@ -602,6 +602,7 @@ table.popup-table .link{
background: var(--background-fill-primary);
width: 100%;
height: 100%;
pointer-events: none;
}
.livePreview img{