From ca9d300a804fd1bfc67b3de9200c2d09b78899d0 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Sun, 16 Jun 2024 11:47:32 -0400 Subject: [PATCH] Better estimation for memory usage during audio VAE encoding/decoding. --- comfy/sd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comfy/sd.py b/comfy/sd.py index 82f9aeab85a..e16cd8e534d 100644 --- a/comfy/sd.py +++ b/comfy/sd.py @@ -237,8 +237,8 @@ def __init__(self, sd=None, device=None, config=None, dtype=None): decoder_config={'target': "comfy.ldm.modules.diffusionmodules.model.Decoder", 'params': ddconfig}) elif "decoder.layers.0.weight_v" in sd: self.first_stage_model = AudioOobleckVAE() - self.memory_used_encode = lambda shape, dtype: (1767 * shape[2]) * model_management.dtype_size(dtype) #TODO: tweak for the audio VAE - self.memory_used_decode = lambda shape, dtype: (2178 * shape[2] * 64) * model_management.dtype_size(dtype) + self.memory_used_encode = lambda shape, dtype: (1000 * shape[2]) * model_management.dtype_size(dtype) + self.memory_used_decode = lambda shape, dtype: (1000 * shape[2] * 2048) * model_management.dtype_size(dtype) self.latent_channels = 64 self.output_channels = 2 self.upscale_ratio = 2048