sd: soft_empty_cache on tiler fallback

This doesnt cost a lot and creates the expected VRAM reduction in
resource monitors when you fallback to tiler.
This commit is contained in:
Rattus 2026-03-20 11:35:27 +10:00
parent 8458ae2686
commit 335532c25f

View File

@ -978,6 +978,7 @@ class VAE:
do_tile = True do_tile = True
if do_tile: if do_tile:
comfy.model_management.soft_empty_cache()
dims = samples_in.ndim - 2 dims = samples_in.ndim - 2
if dims == 1 or self.extra_1d_channel is not None: if dims == 1 or self.extra_1d_channel is not None:
pixel_samples = self.decode_tiled_1d(samples_in) pixel_samples = self.decode_tiled_1d(samples_in)
@ -1059,6 +1060,7 @@ class VAE:
do_tile = True do_tile = True
if do_tile: if do_tile:
comfy.model_management.soft_empty_cache()
if self.latent_dim == 3: if self.latent_dim == 3:
tile = 256 tile = 256
overlap = tile // 4 overlap = tile // 4