mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-13 11:27:08 +08:00
Hard-enforce ultralytics <= 8.3.40.
This commit is contained in:
parent
e2fafe0686
commit
fd7287fe61
17
main.py
17
main.py
@ -7,6 +7,23 @@ import folder_paths
|
|||||||
import time
|
import time
|
||||||
from comfy.cli_args import args
|
from comfy.cli_args import args
|
||||||
from app.logger import setup_logger
|
from app.logger import setup_logger
|
||||||
|
from packaging.version import Version
|
||||||
|
|
||||||
|
|
||||||
|
# Security: Hard-pin ultralytics to 8.3.40, enforce as a test during ComfyUI startup. If ultralytics exists, 8.3.40 is last "okay" version.
|
||||||
|
# Refer to following:
|
||||||
|
# - https://github.com/ultralytics/ultralytics/issues/18027
|
||||||
|
# - https://blog.comfy.org/comfyui-statement-on-the-ultralytics-crypto-miner-situation/
|
||||||
|
try:
|
||||||
|
from ultralytics import __version__ as ultralytics_version
|
||||||
|
if Version(ultralytics_version) > Version('8.3.40'):
|
||||||
|
raise EnvironmentError("[SECURITY ALERT] Unsafe malicious versions of Ultralytics detected, last known good version 8.3.40.")
|
||||||
|
except ModuleNotFound:
|
||||||
|
pass
|
||||||
|
except Exception:
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
#NOTE: These do not do anything on core ComfyUI which should already have no communication with the internet, they are for custom nodes.
|
#NOTE: These do not do anything on core ComfyUI which should already have no communication with the internet, they are for custom nodes.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user