The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Fix Aimdo fallback on probe to not use zero-copy sft (#12634)
rattus4f5b7dbf1f9e
diff --git a/comfy/ops.py b/comfy/ops.pyindex 34f72ff17..98fec1e1d 100644--- a/comfy/ops.py+++ b/comfy/ops.py@@ -19,7 +19,7 @@import torchimport loggingimport comfy.model_management-from comfy.cli_args import args, PerformanceFeature, enables_dynamic_vram+from comfy.cli_args import args, PerformanceFeatureimport comfy.floatimport jsonimport comfy.memory_management@@ -296,7 +296,7 @@ class disable_weight_init:class Linear(torch.nn.Linear, CastWeightBiasOp):def __init__(self, in_features, out_features, bias=True, device=None, dtype=None):- if not comfy.model_management.WINDOWS or not enables_dynamic_vram():+ if not comfy.model_management.WINDOWS or not comfy.memory_management.aimdo_enabled:super().__init__(in_features, out_features, bias, device, dtype)return@@ -317,7 +317,7 @@ class disable_weight_init:def _load_from_state_dict(self, state_dict, prefix, local_metadata,strict, missing_keys, unexpected_keys, error_msgs):- if not comfy.model_management.WINDOWS or not enables_dynamic_vram():+ if not comfy.model_management.WINDOWS or not comfy.memory_management.aimdo_enabled:return super()._load_from_state_dict(state_dict, prefix, local_metadata, strict,missing_keys, unexpected_keys, error_msgs)assign_to_params_buffers = local_metadata.get("assign_to_params_buffers", False)diff --git a/comfy/utils.py b/comfy/utils.pyindex 5fe66ecdb..0769cef44 100644--- a/comfy/utils.py+++ b/comfy/utils.py@@ -29,7 +29,7 @@ import itertoolsfrom torch.nn.functional import interpolatefrom tqdm.auto import trangefrom einops import rearrange-from comfy.cli_args import args, enables_dynamic_vram+from comfy.cli_args import argsimport jsonimport timeimport mmap@@ -113,7 +113,7 @@ def load_torch_file(ckpt, safe_load=False, device=None, return_metadata=False):metadata = Noneif ckpt.lower().endswith(".safetensors") or ckpt.lower().endswith(".sft"):try:- if enables_dynamic_vram():+ if comfy.memory_management.aimdo_enabled:sd, metadata = load_safetensors(ckpt)if not return_metadata:metadata = None