diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-05 04:47:34 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-05 04:47:34 +0000 |
commit | 0ae2767ae6bb775de448b0d8cda1806edb2aef67 (patch) | |
tree | 16057eb7ffc9e081652f68d6ffbf350fa61db1de /modules/shared.py | |
parent | e64263653a3cdce0a46d0578d08dcc962865441f (diff) | |
parent | c09bc2c60856ca1ab2243386176badf909affdbe (diff) | |
download | stable-diffusion-webui-gfx803-0ae2767ae6bb775de448b0d8cda1806edb2aef67.tar.gz stable-diffusion-webui-gfx803-0ae2767ae6bb775de448b0d8cda1806edb2aef67.tar.bz2 stable-diffusion-webui-gfx803-0ae2767ae6bb775de448b0d8cda1806edb2aef67.zip |
Merge pull request #12181 from AUTOMATIC1111/hires_checkpoint
Hires fix change checkpoint
Diffstat (limited to 'modules/shared.py')
-rw-r--r-- | modules/shared.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/modules/shared.py b/modules/shared.py index 55199cb9..86ffb48f 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -220,12 +220,19 @@ class State: return
import modules.sd_samplers
- if opts.show_progress_grid:
- self.assign_current_image(modules.sd_samplers.samples_to_image_grid(self.current_latent))
- else:
- self.assign_current_image(modules.sd_samplers.sample_to_image(self.current_latent))
- self.current_image_sampling_step = self.sampling_step
+ try:
+ if opts.show_progress_grid:
+ self.assign_current_image(modules.sd_samplers.samples_to_image_grid(self.current_latent))
+ else:
+ self.assign_current_image(modules.sd_samplers.sample_to_image(self.current_latent))
+
+ self.current_image_sampling_step = self.sampling_step
+
+ except Exception:
+ # when switching models during genration, VAE would be on CPU, so creating an image will fail.
+ # we silently ignore this error
+ errors.record_exception()
def assign_current_image(self, image):
self.current_image = image
@@ -521,7 +528,7 @@ options_templates.update(options_section(('ui', "User interface"), { "ui_tab_order": OptionInfo([], "UI tab order", ui_components.DropdownMulti, lambda: {"choices": list(tab_names)}).needs_restart(),
"hidden_tabs": OptionInfo([], "Hidden UI tabs", ui_components.DropdownMulti, lambda: {"choices": list(tab_names)}).needs_restart(),
"ui_reorder_list": OptionInfo([], "txt2img/img2img UI item order", ui_components.DropdownMulti, lambda: {"choices": list(shared_items.ui_reorder_categories())}).info("selected items appear first").needs_restart(),
- "hires_fix_show_sampler": OptionInfo(False, "Hires fix: show hires sampler selection").needs_restart(),
+ "hires_fix_show_sampler": OptionInfo(False, "Hires fix: show hires checkpoint and sampler selection").needs_restart(),
"hires_fix_show_prompts": OptionInfo(False, "Hires fix: show hires prompt and negative prompt").needs_restart(),
"disable_token_counters": OptionInfo(False, "Disable prompt token counters").needs_restart(),
}))
|