From 2865f913f754710922370fc1f332ef1bf53baab4 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Thu, 7 Nov 2024 04:01:24 -0500 Subject: [PATCH] Free memory before doing tiled decode. --- comfy/sd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comfy/sd.py b/comfy/sd.py index 7e76f6fa..95fc6d27 100644 --- a/comfy/sd.py +++ b/comfy/sd.py @@ -362,7 +362,8 @@ class VAE: return pixel_samples def decode_tiled(self, samples, tile_x=None, tile_y=None, overlap=None): - model_management.load_model_gpu(self.patcher) + memory_used = self.memory_used_decode(samples.shape, self.vae_dtype) #TODO: calculate mem required for tile + model_management.load_models_gpu([self.patcher], memory_required=memory_used) dims = samples.ndim - 2 args = {} if tile_x is not None: