diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-02 18:53:09 +0300 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-02 18:53:09 +0300 |
commit | ccb92339348f6973de39cde062982a51a4cd0818 (patch) | |
tree | b97a2318ecf8ae22ffe059d1bf0aa3023afc636a /modules/processing.py | |
parent | 10ff071e3368a028ddb6d68d3c3bfd028094aabb (diff) |
add yet another torch_gc to reclaim some of VRAM after the initial stage of img2img
Diffstat (limited to 'modules/processing.py')
-rw-r--r-- | modules/processing.py | 1 |
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")
|