The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
cli_args: Default comfy to DynamicVram mode (#12658)
rattus48bb0bd18aa9
diff --git a/comfy/cli_args.py b/comfy/cli_args.pyindex 63daca861..13079c7bc 100644--- a/comfy/cli_args.py+++ b/comfy/cli_args.py@@ -146,6 +146,7 @@ parser.add_argument("--reserve-vram", type=float, default=None, help="Set the amparser.add_argument("--async-offload", nargs='?', const=2, type=int, default=None, metavar="NUM_STREAMS", help="Use async weight offloading. An optional argument controls the amount of offload streams. Default is 2. Enabled by default on Nvidia.")parser.add_argument("--disable-async-offload", action="store_true", help="Disable async weight offloading.")+parser.add_argument("--disable-dynamic-vram", action="store_true", help="Disable dynamic VRAM and use estimate based model loading.")parser.add_argument("--force-non-blocking", action="store_true", help="Force ComfyUI to use non-blocking operations for all applicable tensors. This may improve performance on some non-Nvidia systems but can cause issues with some workflows.")@@ -159,7 +160,6 @@ class PerformanceFeature(enum.Enum):Fp8MatrixMultiplication = "fp8_matrix_mult"CublasOps = "cublas_ops"AutoTune = "autotune"- DynamicVRAM = "dynamic_vram"parser.add_argument("--fast", nargs="*", type=PerformanceFeature, help="Enable some untested and potentially quality deteriorating optimizations. This is used to test new features so using it might crash your comfyui. --fast with no arguments enables everything. You can pass a list specific optimizations if you only want to enable specific ones. Current valid optimizations: {}".format(" ".join(map(lambda c: c.value, PerformanceFeature))))@@ -260,4 +260,4 @@ else:args.fast = set(args.fast)def enables_dynamic_vram():- return PerformanceFeature.DynamicVRAM in args.fast and not args.highvram and not args.gpu_only+ return not args.disable_dynamic_vram and not args.highvram and not args.gpu_only and not args.novram and not args.cpudiff --git a/main.py b/main.pyindex 3fe8f0589..a0545d9b3 100644--- a/main.py+++ b/main.py@@ -192,7 +192,7 @@ import hook_breaker_ac10a0import comfy.memory_managementimport comfy.model_patcher-if enables_dynamic_vram():+if enables_dynamic_vram() and comfy.model_management.is_nvidia():if comfy.model_management.torch_version_numeric < (2, 8):logging.warning("Unsupported Pytorch detected. DynamicVRAM support requires Pytorch version 2.8 or later. Falling back to legacy ModelPatcher. VRAM estimates may be unreliable especially on Windows")elif comfy_aimdo.control.init_device(comfy.model_management.get_torch_device().index):