diff --git a/comfy/sd.py b/comfy/sd.py index accacdc6e..905c81ac9 100644 --- a/comfy/sd.py +++ b/comfy/sd.py @@ -920,6 +920,7 @@ class VAE: do_tile = True if do_tile: + torch.cuda.empty_cache() dims = samples_in.ndim - 2 if dims == 1 or self.extra_1d_channel is not None: pixel_samples = self.decode_tiled_1d(samples_in) @@ -995,6 +996,7 @@ class VAE: do_tile = True if do_tile: + torch.cuda.empty_cache() if self.latent_dim == 3: tile = 256 overlap = tile // 4