aboutsummaryrefslogtreecommitdiff
path: root/modules/sd_samplers_common.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-08-21 15:54:30 +0300
committerAUTOMATIC1111 <16777216c@gmail.com>2023-08-21 15:54:30 +0300
commit953c3eab7b3b952f7e96d728413a531d7fb521a2 (patch)
tree6517f26ae9c702af50c1392de585c04420dc55b3 /modules/sd_samplers_common.py
parent18fb522660a7b521bbd96c91bb55e7ab8be2b3c2 (diff)
forbid Full live preview method for medvram and add a setting to undo the forbidding
Diffstat (limited to 'modules/sd_samplers_common.py')
-rw-r--r--modules/sd_samplers_common.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/sd_samplers_common.py b/modules/sd_samplers_common.py
index feb1a9db..60fa161c 100644
--- a/modules/sd_samplers_common.py
+++ b/modules/sd_samplers_common.py
@@ -35,10 +35,15 @@ 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]'''
+ """Transforms 4-channel latent space images into 3-channel RGB image tensors, with values in range [-1, 1]."""
+
if approximation is None or (shared.state.interrupted and opts.live_preview_fast_interrupt):
approximation = approximation_indexes.get(opts.show_progress_type, 0)
+ from modules import lowvram
+ if approximation == 0 and lowvram.is_enabled(shared.sd_model) and not shared.opts.live_preview_allow_lowvram_full:
+ approximation = 1
+
if approximation == 2:
x_sample = sd_vae_approx.cheap_approximation(sample)
elif approximation == 1: