comfy-env 0.0.51__tar.gz → 0.0.52__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.0.51 → comfy_env-0.0.52}/PKG-INFO +1 -1
- {comfy_env-0.0.51 → comfy_env-0.0.52}/pyproject.toml +1 -1
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/pixi.py +4 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/stub_imports.py +18 -11
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/workers/venv.py +62 -1
- {comfy_env-0.0.51 → comfy_env-0.0.52}/.github/workflows/publish.yml +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/.gitignore +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/LICENSE +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/README.md +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/__init__.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/cli.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/decorator.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/env/__init__.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/env/config.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/env/config_file.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/env/cuda_gpu_detection.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/env/manager.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/env/platform/__init__.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/env/platform/base.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/env/platform/darwin.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/env/platform/linux.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/env/platform/windows.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/env/security.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/errors.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/install.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/ipc/__init__.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/ipc/bridge.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/ipc/protocol.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/ipc/tensor.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/ipc/torch_bridge.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/ipc/transport.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/ipc/worker.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/isolation.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/nodes.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/registry.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/resolver.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/stubs/__init__.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/stubs/comfy/__init__.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/stubs/comfy/model_management.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/stubs/comfy/utils.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/stubs/folder_paths.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/templates/comfy-env-instructions.txt +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/templates/comfy-env.toml +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/wheel_sources.yml +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/workers/__init__.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/workers/base.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/workers/pool.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/workers/tensor_utils.py +0 -0
- {comfy_env-0.0.51 → comfy_env-0.0.52}/src/comfy_env/workers/torch_mp.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: comfy-env
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.52
|
|
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
|
|
@@ -246,6 +246,10 @@ def create_pixi_toml(
|
|
|
246
246
|
lines.append("[dependencies]")
|
|
247
247
|
lines.append(f'python = "{env_config.python}.*"')
|
|
248
248
|
|
|
249
|
+
# On Windows, use MKL BLAS to avoid OpenBLAS crashes (numpy blas_fpe_check issue)
|
|
250
|
+
if sys.platform == "win32":
|
|
251
|
+
lines.append('libblas = { version = "*", build = "*mkl" }')
|
|
252
|
+
|
|
249
253
|
for pkg in conda.packages:
|
|
250
254
|
# Parse package spec (name=version or name>=version or just name)
|
|
251
255
|
if "=" in pkg and not pkg.startswith("="):
|
|
@@ -156,19 +156,26 @@ def _get_import_names_from_pixi(node_dir: Path) -> Set[str]:
|
|
|
156
156
|
"""
|
|
157
157
|
import_names = set()
|
|
158
158
|
|
|
159
|
-
|
|
160
|
-
pixi_lib = node_dir / ".pixi" / "envs" / "default" / "lib"
|
|
159
|
+
pixi_base = node_dir / ".pixi" / "envs" / "default"
|
|
161
160
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
python_dirs = list(pixi_lib.glob("python3.*"))
|
|
167
|
-
if not python_dirs:
|
|
168
|
-
return import_names
|
|
161
|
+
# Find site-packages (different paths on Windows vs Linux)
|
|
162
|
+
# Linux: .pixi/envs/default/lib/python3.x/site-packages
|
|
163
|
+
# Windows: .pixi/envs/default/Lib/site-packages
|
|
164
|
+
site_packages = None
|
|
169
165
|
|
|
170
|
-
|
|
171
|
-
|
|
166
|
+
# Try Windows path first (Lib/site-packages)
|
|
167
|
+
win_site = pixi_base / "Lib" / "site-packages"
|
|
168
|
+
if win_site.exists():
|
|
169
|
+
site_packages = win_site
|
|
170
|
+
else:
|
|
171
|
+
# Try Linux path (lib/python3.x/site-packages)
|
|
172
|
+
pixi_lib = pixi_base / "lib"
|
|
173
|
+
if pixi_lib.exists():
|
|
174
|
+
python_dirs = list(pixi_lib.glob("python3.*"))
|
|
175
|
+
if python_dirs:
|
|
176
|
+
site_packages = python_dirs[0] / "site-packages"
|
|
177
|
+
|
|
178
|
+
if site_packages is None or not site_packages.exists():
|
|
172
179
|
return import_names
|
|
173
180
|
|
|
174
181
|
# Scan for importable modules
|
|
@@ -252,10 +252,29 @@ def _serialize_for_ipc(obj, visited=None):
|
|
|
252
252
|
# Worker script template - minimal, runs in target venv
|
|
253
253
|
_WORKER_SCRIPT = '''
|
|
254
254
|
import sys
|
|
255
|
+
import os
|
|
255
256
|
import json
|
|
256
257
|
import traceback
|
|
257
258
|
from types import SimpleNamespace
|
|
258
259
|
|
|
260
|
+
# On Windows, add DLL directories for proper library loading
|
|
261
|
+
if sys.platform == "win32" and hasattr(os, "add_dll_directory"):
|
|
262
|
+
_host_python_dir = os.environ.get("COMFYUI_HOST_PYTHON_DIR")
|
|
263
|
+
if _host_python_dir:
|
|
264
|
+
try:
|
|
265
|
+
os.add_dll_directory(_host_python_dir)
|
|
266
|
+
_dlls_dir = os.path.join(_host_python_dir, "DLLs")
|
|
267
|
+
if os.path.isdir(_dlls_dir):
|
|
268
|
+
os.add_dll_directory(_dlls_dir)
|
|
269
|
+
except Exception:
|
|
270
|
+
pass
|
|
271
|
+
_pixi_library_bin = os.environ.get("COMFYUI_PIXI_LIBRARY_BIN")
|
|
272
|
+
if _pixi_library_bin:
|
|
273
|
+
try:
|
|
274
|
+
os.add_dll_directory(_pixi_library_bin)
|
|
275
|
+
except Exception:
|
|
276
|
+
pass
|
|
277
|
+
|
|
259
278
|
def _deserialize_isolated_objects(obj):
|
|
260
279
|
"""Reconstruct objects serialized with __isolated_object__ marker."""
|
|
261
280
|
if isinstance(obj, dict):
|
|
@@ -475,12 +494,29 @@ class VenvWorker(Worker):
|
|
|
475
494
|
env.update(self.extra_env)
|
|
476
495
|
env["COMFYUI_ISOLATION_WORKER"] = "1"
|
|
477
496
|
|
|
478
|
-
# For conda/pixi environments, add lib dir to LD_LIBRARY_PATH
|
|
497
|
+
# For conda/pixi environments, add lib dir to LD_LIBRARY_PATH (Linux)
|
|
479
498
|
lib_dir = self.python.parent.parent / "lib"
|
|
480
499
|
if lib_dir.is_dir():
|
|
481
500
|
existing = env.get("LD_LIBRARY_PATH", "")
|
|
482
501
|
env["LD_LIBRARY_PATH"] = f"{lib_dir}:{existing}" if existing else str(lib_dir)
|
|
483
502
|
|
|
503
|
+
# On Windows, pass host Python directory and pixi Library/bin for DLL loading
|
|
504
|
+
if sys.platform == "win32":
|
|
505
|
+
env["COMFYUI_HOST_PYTHON_DIR"] = str(Path(sys.executable).parent)
|
|
506
|
+
|
|
507
|
+
# For pixi environments with MKL, add Library/bin to PATH for DLL loading
|
|
508
|
+
# Pixi has python.exe directly in env dir, not in Scripts/
|
|
509
|
+
env_dir = self.python.parent
|
|
510
|
+
library_bin = env_dir / "Library" / "bin"
|
|
511
|
+
if library_bin.is_dir():
|
|
512
|
+
existing_path = env.get("PATH", "")
|
|
513
|
+
env["PATH"] = f"{env_dir};{library_bin};{existing_path}"
|
|
514
|
+
env["COMFYUI_PIXI_LIBRARY_BIN"] = str(library_bin)
|
|
515
|
+
# Allow duplicate OpenMP libraries (MKL's libiomp5md.dll + PyTorch's libomp.dll)
|
|
516
|
+
env["KMP_DUPLICATE_LIB_OK"] = "TRUE"
|
|
517
|
+
# Use UTF-8 encoding for stdout/stderr to handle Unicode symbols
|
|
518
|
+
env["PYTHONIOENCODING"] = "utf-8"
|
|
519
|
+
|
|
484
520
|
# Run subprocess
|
|
485
521
|
cmd = [
|
|
486
522
|
str(self.python),
|
|
@@ -592,6 +628,15 @@ if sys.platform == "win32":
|
|
|
592
628
|
except Exception:
|
|
593
629
|
pass
|
|
594
630
|
|
|
631
|
+
# For pixi environments with MKL, add Library/bin for MKL DLLs
|
|
632
|
+
_pixi_library_bin = os.environ.get("COMFYUI_PIXI_LIBRARY_BIN")
|
|
633
|
+
if _pixi_library_bin and hasattr(os, "add_dll_directory"):
|
|
634
|
+
try:
|
|
635
|
+
os.add_dll_directory(_pixi_library_bin)
|
|
636
|
+
print(f"[worker] Added pixi Library/bin to DLL search: {_pixi_library_bin}", flush=True)
|
|
637
|
+
except Exception as e:
|
|
638
|
+
print(f"[worker] Failed to add pixi Library/bin: {e}", flush=True)
|
|
639
|
+
|
|
595
640
|
# =============================================================================
|
|
596
641
|
# Object Reference System - keep complex objects in worker, pass refs to host
|
|
597
642
|
# =============================================================================
|
|
@@ -977,6 +1022,22 @@ class PersistentVenvWorker(Worker):
|
|
|
977
1022
|
if sys.platform == "win32":
|
|
978
1023
|
env["COMFYUI_HOST_PYTHON_DIR"] = str(Path(sys.executable).parent)
|
|
979
1024
|
|
|
1025
|
+
# For pixi environments with MKL, add Library/bin to PATH for DLL loading
|
|
1026
|
+
# MKL DLLs are in .pixi/envs/default/Library/bin/
|
|
1027
|
+
# Pixi has python.exe directly in env dir, not in Scripts/
|
|
1028
|
+
env_dir = self.python.parent
|
|
1029
|
+
library_bin = env_dir / "Library" / "bin"
|
|
1030
|
+
if library_bin.is_dir():
|
|
1031
|
+
existing_path = env.get("PATH", "")
|
|
1032
|
+
# Add env dir and Library/bin to PATH
|
|
1033
|
+
env["PATH"] = f"{env_dir};{library_bin};{existing_path}"
|
|
1034
|
+
# Also pass as env var so worker can use os.add_dll_directory()
|
|
1035
|
+
env["COMFYUI_PIXI_LIBRARY_BIN"] = str(library_bin)
|
|
1036
|
+
# Allow duplicate OpenMP libraries (MKL's libiomp5md.dll + PyTorch's libomp.dll)
|
|
1037
|
+
env["KMP_DUPLICATE_LIB_OK"] = "TRUE"
|
|
1038
|
+
# Use UTF-8 encoding for stdout/stderr to handle Unicode symbols
|
|
1039
|
+
env["PYTHONIOENCODING"] = "utf-8"
|
|
1040
|
+
|
|
980
1041
|
# Find ComfyUI base and set env var for folder_paths stub
|
|
981
1042
|
comfyui_base = self._find_comfyui_base()
|
|
982
1043
|
if comfyui_base:
|
|
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
|
|
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
|