comfy-env 0.1.4__tar.gz → 0.1.6__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.4 → comfy_env-0.1.6}/PKG-INFO +1 -1
- {comfy_env-0.1.4 → comfy_env-0.1.6}/pyproject.toml +1 -1
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/workers/mp.py +55 -2
- {comfy_env-0.1.4 → comfy_env-0.1.6}/.github/workflows/ci.yml +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/.github/workflows/publish.yml +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/.gitignore +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/LICENSE +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/README.md +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/__init__.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/cli.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/config/__init__.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/config/parser.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/config/types.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/errors.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/install.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/isolation/__init__.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/isolation/wrap.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/nodes.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/pixi/__init__.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/pixi/core.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/pixi/cuda_detection.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/pixi/platform/__init__.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/pixi/platform/base.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/pixi/platform/darwin.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/pixi/platform/linux.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/pixi/platform/windows.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/pixi/resolver.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/prestartup.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/templates/comfy-env-instructions.txt +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/templates/comfy-env.toml +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/workers/__init__.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/workers/base.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/src/comfy_env/workers/subprocess.py +0 -0
- {comfy_env-0.1.4 → comfy_env-0.1.6}/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.6
|
|
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
|
|
@@ -40,7 +40,55 @@ _SHUTDOWN = object()
|
|
|
40
40
|
_CALL_METHOD = "call_method"
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
def
|
|
43
|
+
def _dump_worker_env(worker_name: str = "unknown", print_to_terminal: bool = False):
|
|
44
|
+
"""Dump worker environment to .comfy-env/logs/ (always) and optionally print."""
|
|
45
|
+
import json
|
|
46
|
+
import os
|
|
47
|
+
import platform
|
|
48
|
+
import sys
|
|
49
|
+
from datetime import datetime
|
|
50
|
+
from pathlib import Path
|
|
51
|
+
|
|
52
|
+
log_dir = Path.cwd() / ".comfy-env" / "logs"
|
|
53
|
+
log_dir.mkdir(parents=True, exist_ok=True)
|
|
54
|
+
|
|
55
|
+
debug_info = {
|
|
56
|
+
"timestamp": datetime.now().isoformat(),
|
|
57
|
+
"worker_name": worker_name,
|
|
58
|
+
"pid": os.getpid(),
|
|
59
|
+
"cwd": os.getcwd(),
|
|
60
|
+
"python": {
|
|
61
|
+
"executable": sys.executable,
|
|
62
|
+
"version": sys.version,
|
|
63
|
+
"prefix": sys.prefix,
|
|
64
|
+
},
|
|
65
|
+
"platform": {
|
|
66
|
+
"system": platform.system(),
|
|
67
|
+
"machine": platform.machine(),
|
|
68
|
+
"release": platform.release(),
|
|
69
|
+
},
|
|
70
|
+
"env_vars": dict(os.environ),
|
|
71
|
+
"sys_path": sys.path,
|
|
72
|
+
"modules_loaded": sorted(sys.modules.keys()),
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
log_file = log_dir / f"worker_{worker_name}_{os.getpid()}.json"
|
|
76
|
+
log_file.write_text(json.dumps(debug_info, indent=2, default=str))
|
|
77
|
+
|
|
78
|
+
if print_to_terminal:
|
|
79
|
+
print(f"[comfy-env] === WORKER ENV DEBUG: {worker_name} ===")
|
|
80
|
+
print(f"[comfy-env] Python: {sys.executable}")
|
|
81
|
+
print(f"[comfy-env] Version: {sys.version.split()[0]}")
|
|
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']:
|
|
84
|
+
val = os.environ.get(var, '<unset>')
|
|
85
|
+
if len(val) > 100:
|
|
86
|
+
val = val[:100] + '...'
|
|
87
|
+
print(f"[comfy-env] {var}={val}")
|
|
88
|
+
print(f"[comfy-env] Env dumped to: {log_file}")
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def _worker_loop(queue_in, queue_out, sys_path_additions=None, lib_path=None, env_vars=None, worker_name=None):
|
|
44
92
|
"""
|
|
45
93
|
Worker process main loop.
|
|
46
94
|
|
|
@@ -57,6 +105,7 @@ def _worker_loop(queue_in, queue_out, sys_path_additions=None, lib_path=None, en
|
|
|
57
105
|
sys_path_additions: Paths to add to sys.path
|
|
58
106
|
lib_path: Path to add to LD_LIBRARY_PATH (for conda libraries)
|
|
59
107
|
env_vars: Environment variables to set (from comfy-env.toml)
|
|
108
|
+
worker_name: Name of the worker (for logging)
|
|
60
109
|
"""
|
|
61
110
|
import os
|
|
62
111
|
import sys
|
|
@@ -69,6 +118,10 @@ def _worker_loop(queue_in, queue_out, sys_path_additions=None, lib_path=None, en
|
|
|
69
118
|
# Set worker mode env var
|
|
70
119
|
os.environ["COMFYUI_ISOLATION_WORKER"] = "1"
|
|
71
120
|
|
|
121
|
+
# Always dump env to file, print to terminal if debug enabled
|
|
122
|
+
print_debug = os.environ.get("COMFY_ENV_DEBUG", "").lower() in ("1", "true", "yes")
|
|
123
|
+
_dump_worker_env(worker_name or "unknown", print_to_terminal=print_debug)
|
|
124
|
+
|
|
72
125
|
# DLL/library isolation - match SubprocessWorker's isolation level
|
|
73
126
|
# Filter out conflicting paths from conda/mamba/etc and use proper DLL registration
|
|
74
127
|
path_sep = ";" if sys.platform == "win32" else ":"
|
|
@@ -511,7 +564,7 @@ class MPWorker(Worker):
|
|
|
511
564
|
self._queue_out = ctx.Queue()
|
|
512
565
|
self._process = ctx.Process(
|
|
513
566
|
target=_worker_loop,
|
|
514
|
-
args=(self._queue_in, self._queue_out, self._sys_path, self._lib_path, self._env_vars),
|
|
567
|
+
args=(self._queue_in, self._queue_out, self._sys_path, self._lib_path, self._env_vars, self.name),
|
|
515
568
|
daemon=True,
|
|
516
569
|
)
|
|
517
570
|
self._process.start()
|
|
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
|