diff options
author | catboxanon <122327233+catboxanon@users.noreply.github.com> | 2023-08-13 08:40:34 +0000 |
---|---|---|
committer | catboxanon <122327233+catboxanon@users.noreply.github.com> | 2023-08-13 08:40:34 +0000 |
commit | 69f49c8d394220331eaa6609825b477eed60e0f4 (patch) | |
tree | 98e5e9d9187534e6db61149835759ceb7e473d04 | |
parent | da80d649fd6a6083be02aca5695367bd25abf0d5 (diff) | |
download | stable-diffusion-webui-gfx803-69f49c8d394220331eaa6609825b477eed60e0f4.tar.gz stable-diffusion-webui-gfx803-69f49c8d394220331eaa6609825b477eed60e0f4.tar.bz2 stable-diffusion-webui-gfx803-69f49c8d394220331eaa6609825b477eed60e0f4.zip |
Clear sampler before decoding images
More significant VRAM reduction.
-rwxr-xr-x | modules/processing.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/processing.py b/modules/processing.py index 007a4e05..16104f92 100755 --- a/modules/processing.py +++ b/modules/processing.py @@ -1192,6 +1192,9 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): sd_models.apply_token_merging(self.sd_model, self.get_token_merging_ratio())
+ self.sampler = None
+ devices.torch_gc()
+
decoded_samples = decode_latent_batch(self.sd_model, samples, target_device=devices.cpu, check_for_nans=True)
self.is_hr_pass = False
|