Skip to content

Commit

Permalink
Add warning when using old pytorch versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Jan 17, 2025
1 parent 7fc3ccd commit 2f3ab40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion comfy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class ModelCheckpoint:
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:
Expand Down

0 comments on commit 2f3ab40

Please sign in to comment.