From 2f3ab40b62b44f874264b8bfae3756546a96ab44 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Fri, 17 Jan 2025 18:47:27 -0500 Subject: [PATCH] Add warning when using old pytorch versions. --- comfy/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comfy/utils.py b/comfy/utils.py index bcefa180..b3506282 100644 --- a/comfy/utils.py +++ b/comfy/utils.py @@ -43,7 +43,8 @@ if hasattr(torch.serialization, "add_safe_globals"): # TODO: this was added in torch.serialization.add_safe_globals([ModelCheckpoint, scalar, dtype, Float64DType, encode]) ALWAYS_SAFE_LOAD = True logging.info("Checkpoint files will always be loaded safely.") - +else: + logging.info("Warning, you are using an old pytorch version and some ckpt/pt files might be loaded unsafely. Upgrading to 2.4 or above is recommended.") def load_torch_file(ckpt, safe_load=False, device=None): if device is None: