mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-08-19 14:56:43 +08:00
13 lines
424 B
Python
13 lines
424 B
Python
import sys
|
|
import subprocess
|
|
|
|
|
|
def ensure_onnx_package():
|
|
try:
|
|
import onnxruntime # noqa: F401
|
|
except Exception:
|
|
if "python_embeded" in sys.executable or "python_embedded" in sys.executable:
|
|
subprocess.check_call([sys.executable, '-s', '-m', 'pip', 'install', 'onnxruntime'])
|
|
else:
|
|
subprocess.check_call([sys.executable, '-s', '-m', 'pip', 'install', 'onnxruntime'])
|