comfy-env 0.1.6__tar.gz → 0.1.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {comfy_env-0.1.6 → comfy_env-0.1.8}/PKG-INFO +1 -1
- {comfy_env-0.1.6 → comfy_env-0.1.8}/pyproject.toml +1 -1
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/prestartup.py +59 -1
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/workers/mp.py +8 -2
- {comfy_env-0.1.6 → comfy_env-0.1.8}/.github/workflows/ci.yml +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/.github/workflows/publish.yml +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/.gitignore +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/LICENSE +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/README.md +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/__init__.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/cli.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/config/__init__.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/config/parser.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/config/types.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/errors.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/install.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/isolation/__init__.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/isolation/wrap.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/nodes.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/pixi/__init__.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/pixi/core.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/pixi/cuda_detection.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/pixi/platform/__init__.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/pixi/platform/base.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/pixi/platform/darwin.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/pixi/platform/linux.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/pixi/platform/windows.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/pixi/resolver.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/templates/comfy-env-instructions.txt +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/templates/comfy-env.toml +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/workers/__init__.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/workers/base.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/workers/subprocess.py +0 -0
- {comfy_env-0.1.6 → comfy_env-0.1.8}/src/comfy_env/workers/tensor_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: comfy-env
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.8
|
|
4
4
|
Summary: Environment management for ComfyUI custom nodes - CUDA wheel resolution and process isolation
|
|
5
5
|
Project-URL: Homepage, https://github.com/PozzettiAndrea/comfy-env
|
|
6
6
|
Project-URL: Repository, https://github.com/PozzettiAndrea/comfy-env
|
|
@@ -39,6 +39,56 @@ def _load_env_vars(config_path: str) -> Dict[str, str]:
|
|
|
39
39
|
return {}
|
|
40
40
|
|
|
41
41
|
|
|
42
|
+
def _dedupe_libomp_macos():
|
|
43
|
+
"""
|
|
44
|
+
macOS: Dedupe libomp.dylib to prevent OpenMP runtime conflicts.
|
|
45
|
+
|
|
46
|
+
Torch and other packages (PyMeshLab, etc.) bundle their own libomp.
|
|
47
|
+
Two OpenMP runtimes in same process = crash.
|
|
48
|
+
Fix: symlink all libomp copies to torch's (canonical source).
|
|
49
|
+
"""
|
|
50
|
+
if sys.platform != "darwin":
|
|
51
|
+
return
|
|
52
|
+
|
|
53
|
+
# Find torch's libomp (canonical source) via introspection
|
|
54
|
+
try:
|
|
55
|
+
import torch
|
|
56
|
+
torch_libomp = os.path.join(os.path.dirname(torch.__file__), 'lib', 'libomp.dylib')
|
|
57
|
+
if not os.path.exists(torch_libomp):
|
|
58
|
+
return
|
|
59
|
+
except ImportError:
|
|
60
|
+
return # No torch, skip
|
|
61
|
+
|
|
62
|
+
# Find site-packages for scanning
|
|
63
|
+
site_packages = os.path.dirname(os.path.dirname(torch.__file__))
|
|
64
|
+
|
|
65
|
+
# Find other libomp files and symlink to torch's
|
|
66
|
+
patterns = [
|
|
67
|
+
os.path.join(site_packages, '*', 'Frameworks', 'libomp.dylib'),
|
|
68
|
+
os.path.join(site_packages, '*', '.dylibs', 'libomp.dylib'),
|
|
69
|
+
os.path.join(site_packages, '*', 'lib', 'libomp.dylib'),
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
for pattern in patterns:
|
|
73
|
+
for libomp in glob.glob(pattern):
|
|
74
|
+
# Skip torch's own copy
|
|
75
|
+
if 'torch' in libomp:
|
|
76
|
+
continue
|
|
77
|
+
# Skip if already a symlink pointing to torch
|
|
78
|
+
if os.path.islink(libomp):
|
|
79
|
+
if os.path.realpath(libomp) == os.path.realpath(torch_libomp):
|
|
80
|
+
continue
|
|
81
|
+
# Replace with symlink to torch's
|
|
82
|
+
try:
|
|
83
|
+
if os.path.islink(libomp):
|
|
84
|
+
os.unlink(libomp)
|
|
85
|
+
else:
|
|
86
|
+
os.rename(libomp, libomp + '.bak')
|
|
87
|
+
os.symlink(torch_libomp, libomp)
|
|
88
|
+
except OSError:
|
|
89
|
+
pass # Permission denied, etc.
|
|
90
|
+
|
|
91
|
+
|
|
42
92
|
def setup_env(node_dir: Optional[str] = None) -> None:
|
|
43
93
|
"""
|
|
44
94
|
Set up environment for pixi conda libraries.
|
|
@@ -56,6 +106,9 @@ def setup_env(node_dir: Optional[str] = None) -> None:
|
|
|
56
106
|
from comfy_env import setup_env
|
|
57
107
|
setup_env()
|
|
58
108
|
"""
|
|
109
|
+
# macOS: Dedupe libomp to prevent OpenMP conflicts (torch vs pymeshlab, etc.)
|
|
110
|
+
_dedupe_libomp_macos()
|
|
111
|
+
|
|
59
112
|
# Auto-detect node_dir from caller
|
|
60
113
|
if node_dir is None:
|
|
61
114
|
import inspect
|
|
@@ -78,8 +131,13 @@ def setup_env(node_dir: Optional[str] = None) -> None:
|
|
|
78
131
|
lib_dir = os.path.join(pixi_env, "Library", "bin")
|
|
79
132
|
if os.path.exists(lib_dir):
|
|
80
133
|
os.environ["PATH"] = lib_dir + ";" + os.environ.get("PATH", "")
|
|
134
|
+
elif sys.platform == "darwin":
|
|
135
|
+
# macOS: DYLD_LIBRARY_PATH
|
|
136
|
+
lib_dir = os.path.join(pixi_env, "lib")
|
|
137
|
+
if os.path.exists(lib_dir):
|
|
138
|
+
os.environ["DYLD_LIBRARY_PATH"] = lib_dir + ":" + os.environ.get("DYLD_LIBRARY_PATH", "")
|
|
81
139
|
else:
|
|
82
|
-
# Linux
|
|
140
|
+
# Linux: LD_LIBRARY_PATH
|
|
83
141
|
lib_dir = os.path.join(pixi_env, "lib")
|
|
84
142
|
if os.path.exists(lib_dir):
|
|
85
143
|
os.environ["LD_LIBRARY_PATH"] = lib_dir + ":" + os.environ.get("LD_LIBRARY_PATH", "")
|
|
@@ -80,7 +80,7 @@ def _dump_worker_env(worker_name: str = "unknown", print_to_terminal: bool = Fal
|
|
|
80
80
|
print(f"[comfy-env] Python: {sys.executable}")
|
|
81
81
|
print(f"[comfy-env] Version: {sys.version.split()[0]}")
|
|
82
82
|
print(f"[comfy-env] PID: {os.getpid()}, CWD: {os.getcwd()}")
|
|
83
|
-
for var in ['PATH', 'LD_LIBRARY_PATH', 'PYTHONPATH', 'OMP_NUM_THREADS', 'KMP_DUPLICATE_LIB_OK']:
|
|
83
|
+
for var in ['PATH', 'LD_LIBRARY_PATH', 'DYLD_LIBRARY_PATH', 'PYTHONPATH', 'OMP_NUM_THREADS', 'KMP_DUPLICATE_LIB_OK']:
|
|
84
84
|
val = os.environ.get(var, '<unset>')
|
|
85
85
|
if len(val) > 100:
|
|
86
86
|
val = val[:100] + '...'
|
|
@@ -143,8 +143,14 @@ def _worker_loop(queue_in, queue_out, sys_path_additions=None, lib_path=None, en
|
|
|
143
143
|
if lib_path:
|
|
144
144
|
clean_parts.insert(0, lib_path)
|
|
145
145
|
os.environ["PATH"] = path_sep.join(clean_parts)
|
|
146
|
+
elif sys.platform == "darwin":
|
|
147
|
+
# macOS: ONLY use the isolated lib_path, don't inherit
|
|
148
|
+
if lib_path:
|
|
149
|
+
os.environ["DYLD_LIBRARY_PATH"] = lib_path
|
|
150
|
+
else:
|
|
151
|
+
os.environ.pop("DYLD_LIBRARY_PATH", None)
|
|
146
152
|
else:
|
|
147
|
-
# Linux
|
|
153
|
+
# Linux: Use LD_LIBRARY_PATH
|
|
148
154
|
current = os.environ.get("LD_LIBRARY_PATH", "")
|
|
149
155
|
clean_parts = [
|
|
150
156
|
p for p in current.split(path_sep) if p
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|