add yet another torch_gc to reclaim some of VRAM after the initial stage of img2img

This commit is contained in:
AUTOMATIC1111 2023-08-02 18:53:09 +03:00
parent 10ff071e33
commit ccb9233934

View File

@ -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")