aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-08-13 13:45:38 +0000
committerGitHub <noreply@github.com>2023-08-13 13:45:38 +0000
commitd73db17ee330ceb256defeab00a6097b943f923b (patch)
tree55b259f39bc1f3cde6380e138385313a385cdf74
parent127ab9114f364b0af1f224a5eae7b43e8d4e2ddf (diff)
parent69f49c8d394220331eaa6609825b477eed60e0f4 (diff)
downloadstable-diffusion-webui-gfx803-d73db17ee330ceb256defeab00a6097b943f923b.tar.gz
stable-diffusion-webui-gfx803-d73db17ee330ceb256defeab00a6097b943f923b.tar.bz2
stable-diffusion-webui-gfx803-d73db17ee330ceb256defeab00a6097b943f923b.zip
Merge pull request #12515 from catboxanon/fix/gc1
Clear sampler and garbage collect before decoding images to reduce VRAM
-rwxr-xr-xmodules/processing.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/processing.py b/modules/processing.py
index 10749aa2..fdf49359 100755
--- a/modules/processing.py
+++ b/modules/processing.py
@@ -1195,6 +1195,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