Skip to content

Commit

Permalink
Free memory before doing tiled decode.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Nov 7, 2024
1 parent b49616f commit 2865f91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion comfy/sd.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ def decode(self, samples_in):
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:
Expand Down

0 comments on commit 2865f91

Please sign in to comment.