mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
update gradio
This commit is contained in:
@@ -1,7 +1,27 @@
|
||||
/* global gradioApp, onUiUpdate */
|
||||
// attaches listeners to the txt2img and img2img galleries to update displayed generation param text when the image changes
|
||||
|
||||
let txt2img_gallery; let img2img_gallery; let
|
||||
modal;
|
||||
function attachGalleryListeners(tab_name) {
|
||||
const gallery = gradioApp().querySelector(`#${tab_name}_gallery`);
|
||||
gallery?.addEventListener('click', () => setTimeout(() => {
|
||||
gradioApp()
|
||||
.getElementById(`${tab_name}_generation_info_button`)
|
||||
?.click();
|
||||
}, 500));
|
||||
gallery?.addEventListener('keydown', (e) => {
|
||||
if (e.keyCode == 37 || e.keyCode == 39) { // left or right arrow
|
||||
gradioApp()
|
||||
.getElementById(`${tab_name}_generation_info_button`)
|
||||
.click();
|
||||
}
|
||||
});
|
||||
return gallery;
|
||||
}
|
||||
|
||||
let txt2img_gallery;
|
||||
let img2img_gallery;
|
||||
let modal;
|
||||
|
||||
onUiUpdate(() => {
|
||||
if (!txt2img_gallery) txt2img_gallery = attachGalleryListeners('txt2img');
|
||||
if (!img2img_gallery) img2img_gallery = attachGalleryListeners('img2img');
|
||||
@@ -19,12 +39,3 @@ let modalObserver = new MutationObserver((mutations) => {
|
||||
});
|
||||
});
|
||||
|
||||
function attachGalleryListeners(tab_name) {
|
||||
gallery = gradioApp().querySelector(`#${tab_name}_gallery`);
|
||||
gallery?.addEventListener('click', () => gradioApp().getElementById(`${tab_name}_generation_info_button`).click());
|
||||
gallery?.addEventListener('keydown', (e) => {
|
||||
if (e.keyCode == 37 || e.keyCode == 39) // left or right arrow
|
||||
{ gradioApp().getElementById(`${tab_name}_generation_info_button`).click(); }
|
||||
});
|
||||
return gallery;
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ def reload_model_weights(sd_model=None, info=None):
|
||||
current_checkpoint_info = None
|
||||
else:
|
||||
current_checkpoint_info = sd_model.sd_checkpoint_info
|
||||
if sd_model.sd_model_checkpoint == checkpoint_info.filename:
|
||||
if checkpoint_info is not None and sd_model.sd_model_checkpoint == checkpoint_info.filename:
|
||||
return
|
||||
if shared.cmd_opts.lowvram or shared.cmd_opts.medvram:
|
||||
lowvram.send_everything_to_cpu()
|
||||
|
||||
+2
-1
@@ -51,9 +51,10 @@ accelerate==0.18.0
|
||||
opencv-python==4.7.0.72
|
||||
diffusers==0.16.1
|
||||
einops==0.4.1
|
||||
gradio==3.29.0
|
||||
gradio==3.31.0
|
||||
numexpr==2.8.4
|
||||
numpy==1.24.3
|
||||
numba==0.57.0
|
||||
pandas==1.5.3
|
||||
protobuf==3.20.3
|
||||
pytorch_lightning==1.9.4
|
||||
|
||||
Reference in New Issue
Block a user