Compare commits

..
5 Commits
Author SHA1 Message Date
Dr.Lt.Data f5467e1a37 fixed: torch_wrapper – When weights_only is explicitly provided, pass the arg as is. 2025-01-04 10:08:34 +09:00
Dr.Lt.Data 769bc0f14a add a note for torch.load 2025-01-04 03:27:54 +09:00
Dr.Lt.Data 3345986dd7 version marker 2025-01-03 22:38:25 +09:00
Dr.Lt.Data d21517351d Merge pull request #20 from gremlation/add-dill-dep
Add the `dill` dependency
2025-01-03 22:33:22 +09:00
Gremlation 3d54756136 Add the dill dependency 2025-01-03 19:58:39 +08:00
4 changed files with 21 additions and 7 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
import importlib
import logging
version_code = [1, 2, 4]
version_code = [1, 2, 7]
version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
logging.info(f"### Loading: ComfyUI-Impact-Subpack ({version_str})")
+17 -4
View File
@@ -137,11 +137,24 @@ except Exception as e:
# HOTFIX: https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/754
# importing YOLO breaking original torch.load capabilities
def torch_wrapper(*args, **kwargs):
if hasattr(torch.serialization, 'safe_globals'):
return orig_torch_load(*args, **kwargs)
# NOTE: A trick to support code based on `'weights_only' in torch.load.__code__.co_varnames`.
if 'weights_only' in kwargs:
weights_only = kwargs.pop('weights_only')
else:
logging.warning("[Impact Subpack] Your torch version is outdated, and security features cannot be applied properly.")
kwargs['weights_only'] = False
weights_only = None
if hasattr(torch.serialization, 'safe_globals'):
if weights_only is not None:
kwargs['weights_only'] = weights_only
return orig_torch_load(*args, **kwargs) # NOTE: This code simply delegates the call to torch.load, and any errors that occur here are not the responsibility of Subpack.
else:
if weights_only is not None:
kwargs['weights_only'] = weights_only
else:
logging.warning("[Impact Subpack] Your torch version is outdated, and security features cannot be applied properly.")
kwargs['weights_only'] = False
return orig_torch_load(*args, **kwargs)
torch.load = torch_wrapper
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui-impact-subpack"
description = "This node pack provides nodes that complement the Impact Pack, such as the UltralyticsDetectorProvider."
version = "1.2.4"
version = "1.2.7"
license = { file = "LICENSE.txt" }
dependencies = ["matplotlib", "ultralytics==8.3.40"]
+2 -1
View File
@@ -1,4 +1,5 @@
matplotlib
ultralytics==8.3.40
numpy==1.26.4
opencv-python-headless
opencv-python-headless
dill