aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-08-02 18:53:09 +0300
committerAUTOMATIC1111 <16777216c@gmail.com>2023-08-02 18:53:09 +0300
commitccb92339348f6973de39cde062982a51a4cd0818 (patch)
treeb97a2318ecf8ae22ffe059d1bf0aa3023afc636a /modules
parent10ff071e3368a028ddb6d68d3c3bfd028094aabb (diff)
add yet another torch_gc to reclaim some of VRAM after the initial stage of img2img
Diffstat (limited to 'modules')
-rw-r--r--modules/processing.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/processing.py b/modules/processing.py
index b0992ee1..0b66cd2a 100644
--- a/modules/processing.py
+++ b/modules/processing.py
@@ -1348,6 +1348,7 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing):
image = image.to(shared.device, dtype=devices.dtype_vae)
self.init_latent = self.sd_model.get_first_stage_encoding(self.sd_model.encode_first_stage(image))
+ devices.torch_gc()
if self.resize_mode == 3:
self.init_latent = torch.nn.functional.interpolate(self.init_latent, size=(self.height // opt_f, self.width // opt_f), mode="bilinear")