diff options
author | catboxanon <122327233+catboxanon@users.noreply.github.com> | 2023-08-18 00:03:26 +0000 |
---|---|---|
committer | catboxanon <122327233+catboxanon@users.noreply.github.com> | 2023-08-18 00:03:26 +0000 |
commit | 3ce5fb8e5c3a6577172e89e964d570f8b31a998b (patch) | |
tree | 31a5d2ec15c318d8f4928a5e1ea7dfcddd6e2790 | |
parent | 541ef9247cfe8785c12f7142ad02cd5310fc5925 (diff) | |
download | stable-diffusion-webui-gfx803-3ce5fb8e5c3a6577172e89e964d570f8b31a998b.tar.gz stable-diffusion-webui-gfx803-3ce5fb8e5c3a6577172e89e964d570f8b31a998b.tar.bz2 stable-diffusion-webui-gfx803-3ce5fb8e5c3a6577172e89e964d570f8b31a998b.zip |
Add option for faster live interrupt
-rw-r--r-- | modules/sd_samplers_common.py | 2 | ||||
-rw-r--r-- | modules/shared_options.py | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/modules/sd_samplers_common.py b/modules/sd_samplers_common.py index 7dc79ea8..f0bc8e6a 100644 --- a/modules/sd_samplers_common.py +++ b/modules/sd_samplers_common.py @@ -36,7 +36,7 @@ approximation_indexes = {"Full": 0, "Approx NN": 1, "Approx cheap": 2, "TAESD": def samples_to_images_tensor(sample, approximation=None, model=None):
'''latents -> images [-1, 1]'''
- if approximation is None:
+ if approximation is None or (shared.state.interrupted and opts.live_preview_fast_interrupt):
approximation = approximation_indexes.get(opts.show_progress_type, 0)
if approximation == 2:
diff --git a/modules/shared_options.py b/modules/shared_options.py index 79cbb92e..3e4bcaef 100644 --- a/modules/shared_options.py +++ b/modules/shared_options.py @@ -281,6 +281,7 @@ options_templates.update(options_section(('ui', "Live previews"), { "show_progress_type": OptionInfo("Approx NN", "Live preview method", gr.Radio, {"choices": ["Full", "Approx NN", "Approx cheap", "TAESD"]}).info("Full = slow but pretty; Approx NN and TAESD = fast but low quality; Approx cheap = super fast but terrible otherwise"),
"live_preview_content": OptionInfo("Prompt", "Live preview subject", gr.Radio, {"choices": ["Combined", "Prompt", "Negative prompt"]}),
"live_preview_refresh_period": OptionInfo(1000, "Progressbar and preview update period").info("in milliseconds"),
+ "live_preview_fast_interrupt": OptionInfo(False, "Return image with chosen live preview method on interrupt").info("makes interrupts faster"),
}))
options_templates.update(options_section(('sampler-params', "Sampler parameters"), {
|