diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-05-01 11:39:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-01 11:39:46 +0000 |
commit | 50f63e22472dd532ddd76adb28f29aef46a71a86 (patch) | |
tree | 6f9c37f302e6bcaf1ce3e1f1913f2db54f3b184e | |
parent | c714300265919e325ae1340459c4866541940687 (diff) | |
parent | b463b8a12672e010a8c86ea1c73b2c14ae5555d5 (diff) | |
download | stable-diffusion-webui-gfx803-50f63e22472dd532ddd76adb28f29aef46a71a86.tar.gz stable-diffusion-webui-gfx803-50f63e22472dd532ddd76adb28f29aef46a71a86.tar.bz2 stable-diffusion-webui-gfx803-50f63e22472dd532ddd76adb28f29aef46a71a86.zip |
Merge branch 'dev' into js-misc-fixes
-rw-r--r-- | javascript/ui.js | 10 | ||||
-rw-r--r-- | modules/processing.py | 7 | ||||
-rw-r--r-- | modules/ui.py | 5 | ||||
-rw-r--r-- | scripts/xyz_grid.py | 2 |
4 files changed, 18 insertions, 6 deletions
diff --git a/javascript/ui.js b/javascript/ui.js index e2b9bfe4..b63b84b2 100644 --- a/javascript/ui.js +++ b/javascript/ui.js @@ -208,17 +208,23 @@ function submit_img2img(){ } function restoreProgressTxt2img(){ + showRestoreProgressButton("txt2img", false) var id = localStorage.getItem("txt2img_task_id") + id = localStorage.getItem("txt2img_task_id") + if(id) { requestProgress(id, gradioApp().getElementById('txt2img_gallery_container'), gradioApp().getElementById('txt2img_gallery'), function(){ showSubmitButtons('txt2img', true) }, null, 0) } - return [id] + return id } + function restoreProgressImg2img(){ + showRestoreProgressButton("img2img", false) + var id = localStorage.getItem("img2img_task_id") if(id) { @@ -227,7 +233,7 @@ function restoreProgressImg2img(){ }, null, 0) } - return [id] + return id } diff --git a/modules/processing.py b/modules/processing.py index a48fff99..e8808beb 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -498,6 +498,11 @@ def process_images(p: StableDiffusionProcessing) -> Processed: stored_opts = {k: opts.data[k] for k in p.override_settings.keys()}
try:
+ # if no checkpoint override or the override checkpoint can't be found, remove override entry and load opts checkpoint
+ if sd_models.checkpoint_alisases.get(p.override_settings.get('sd_model_checkpoint')) is None:
+ p.override_settings.pop('sd_model_checkpoint', None)
+ sd_models.reload_model_weights()
+
for k, v in p.override_settings.items():
setattr(opts, k, v)
@@ -514,8 +519,6 @@ def process_images(p: StableDiffusionProcessing) -> Processed: if p.override_settings_restore_afterwards:
for k, v in stored_opts.items():
setattr(opts, k, v)
- if k == 'sd_model_checkpoint':
- sd_models.reload_model_weights()
if k == 'sd_vae':
sd_vae.reload_vae_weights()
diff --git a/modules/ui.py b/modules/ui.py index 9ff4bcd9..7b45f131 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -810,7 +810,10 @@ def create_ui(): scale_by.release(**on_change_args)
button_update_resize_to.click(**on_change_args)
- for component in img2img_image_inputs:
+ # the code below is meant to update the resolution label after the image in the image selection UI has changed.
+ # as it is now the event keeps firing continuously for inpaint edits, which ruins the page with constant requests.
+ # I assume this must be a gradio bug and for now we'll just do it for non-inpaint inputs.
+ for component in [init_img, sketch]:
component.change(fn=lambda: None, _js="updateImg2imgResizeToTextAfterChangingImage", inputs=[], outputs=[], show_progress=False)
tab_scale_to.select(fn=lambda: 0, inputs=[], outputs=[selected_scale_tab])
diff --git a/scripts/xyz_grid.py b/scripts/xyz_grid.py index 398065d9..cfc7737b 100644 --- a/scripts/xyz_grid.py +++ b/scripts/xyz_grid.py @@ -86,7 +86,7 @@ def apply_checkpoint(p, x, xs): info = modules.sd_models.get_closet_checkpoint_match(x)
if info is None:
raise RuntimeError(f"Unknown checkpoint: {x}")
- modules.sd_models.reload_model_weights(shared.sd_model, info)
+ p.override_settings['sd_model_checkpoint'] = info.hash
def confirm_checkpoints(p, xs):
|