From 970c107ff8396416162e2c568475b6bdaa8066a7 Mon Sep 17 00:00:00 2001 From: Balladie Date: Sat, 6 Dec 2025 12:25:11 +0000 Subject: [PATCH] add account for reserved VRAM gap by CudaMallocAsync on extra memory --- comfy/model_management.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/comfy/model_management.py b/comfy/model_management.py index aeddbaefe4b9..73b15edda455 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -572,6 +572,9 @@ def offloaded_memory(loaded_models, device): EXTRA_RESERVED_VRAM = args.reserve_vram * 1024 * 1024 * 1024 logging.debug("Reserving {}MB vram for other applications.".format(EXTRA_RESERVED_VRAM / (1024 * 1024))) +if is_nvidia() and not args.disable_cuda_malloc: + EXTRA_RESERVED_VRAM += 32 * 1024 * 1024 + def extra_reserved_memory(): return EXTRA_RESERVED_VRAM