comfy-env 0.0.17__py3-none-any.whl → 0.0.18__py3-none-any.whl
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/cli.py +2 -2
- comfy_env/decorator.py +6 -1
- comfy_env/env/config.py +1 -1
- comfy_env/install.py +5 -5
- comfy_env/workers/torch_mp.py +17 -3
- {comfy_env-0.0.17.dist-info → comfy_env-0.0.18.dist-info}/METADATA +1 -1
- {comfy_env-0.0.17.dist-info → comfy_env-0.0.18.dist-info}/RECORD +10 -10
- {comfy_env-0.0.17.dist-info → comfy_env-0.0.18.dist-info}/WHEEL +0 -0
- {comfy_env-0.0.17.dist-info → comfy_env-0.0.18.dist-info}/entry_points.txt +0 -0
- {comfy_env-0.0.17.dist-info → comfy_env-0.0.18.dist-info}/licenses/LICENSE +0 -0
comfy_env/cli.py
CHANGED
|
@@ -47,7 +47,7 @@ def main(args: Optional[List[str]] = None) -> int:
|
|
|
47
47
|
install_parser = subparsers.add_parser(
|
|
48
48
|
"install",
|
|
49
49
|
help="Install dependencies from config",
|
|
50
|
-
description="Install CUDA wheels and dependencies from
|
|
50
|
+
description="Install CUDA wheels and dependencies from comfy-env.toml",
|
|
51
51
|
)
|
|
52
52
|
install_parser.add_argument(
|
|
53
53
|
"--config", "-c",
|
|
@@ -450,7 +450,7 @@ def cmd_list_packages(args) -> int:
|
|
|
450
450
|
print("=" * 60)
|
|
451
451
|
print()
|
|
452
452
|
print("These packages can be installed without specifying wheel_sources.")
|
|
453
|
-
print("Just add them to your
|
|
453
|
+
print("Just add them to your comfy-env.toml:")
|
|
454
454
|
print()
|
|
455
455
|
print(" [cuda]")
|
|
456
456
|
print(" torch-scatter = \"2.1.2\"")
|
comfy_env/decorator.py
CHANGED
|
@@ -153,7 +153,7 @@ def _get_or_create_worker(config: WorkerConfig, log_fn: Callable):
|
|
|
153
153
|
# Same Python - use TorchMPWorker (fast, zero-copy)
|
|
154
154
|
from .workers import TorchMPWorker
|
|
155
155
|
log_fn(f"Creating TorchMPWorker (same Python, zero-copy tensors)")
|
|
156
|
-
worker = TorchMPWorker(name=config.env_name)
|
|
156
|
+
worker = TorchMPWorker(name=config.env_name, sys_path=config.sys_path)
|
|
157
157
|
else:
|
|
158
158
|
# Different Python - use PersistentVenvWorker
|
|
159
159
|
from .workers.venv import PersistentVenvWorker
|
|
@@ -369,6 +369,11 @@ def isolated(
|
|
|
369
369
|
# Get module name for import in worker
|
|
370
370
|
module_name = cls.__module__
|
|
371
371
|
|
|
372
|
+
# Handle ComfyUI's dynamic import which can set __module__ to a path
|
|
373
|
+
if module_name.startswith('/') or module_name.startswith('\\'):
|
|
374
|
+
# Module name is a filesystem path - use the source file stem instead
|
|
375
|
+
module_name = source_file.stem
|
|
376
|
+
|
|
372
377
|
# Call worker using appropriate method
|
|
373
378
|
if worker_config.python is None:
|
|
374
379
|
# TorchMPWorker - use call_method protocol (avoids pickle issues)
|
comfy_env/env/config.py
CHANGED
comfy_env/install.py
CHANGED
|
@@ -12,10 +12,10 @@ Example:
|
|
|
12
12
|
install()
|
|
13
13
|
|
|
14
14
|
# In-place with explicit config
|
|
15
|
-
install(config="
|
|
15
|
+
install(config="comfy-env.toml", mode="inplace")
|
|
16
16
|
|
|
17
17
|
# Isolated environment
|
|
18
|
-
install(config="
|
|
18
|
+
install(config="comfy-env.toml", mode="isolated")
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
21
|
import shutil
|
|
@@ -42,7 +42,7 @@ def install(
|
|
|
42
42
|
verify_wheels: bool = False,
|
|
43
43
|
) -> bool:
|
|
44
44
|
"""
|
|
45
|
-
Install dependencies from a
|
|
45
|
+
Install dependencies from a comfy-env.toml configuration.
|
|
46
46
|
|
|
47
47
|
This is the main entry point for installing CUDA dependencies.
|
|
48
48
|
|
|
@@ -67,7 +67,7 @@ def install(
|
|
|
67
67
|
install()
|
|
68
68
|
|
|
69
69
|
# Explicit config file
|
|
70
|
-
install(config="
|
|
70
|
+
install(config="comfy-env.toml")
|
|
71
71
|
|
|
72
72
|
# Isolated mode
|
|
73
73
|
install(mode="isolated")
|
|
@@ -83,7 +83,7 @@ def install(
|
|
|
83
83
|
if full_config is None:
|
|
84
84
|
raise FileNotFoundError(
|
|
85
85
|
"No configuration file found. "
|
|
86
|
-
"Create
|
|
86
|
+
"Create comfy-env.toml or specify path explicitly."
|
|
87
87
|
)
|
|
88
88
|
|
|
89
89
|
# Install tools first (e.g., Blender)
|
comfy_env/workers/torch_mp.py
CHANGED
|
@@ -40,7 +40,7 @@ _SHUTDOWN = object()
|
|
|
40
40
|
_CALL_METHOD = "call_method"
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
def _worker_loop(queue_in, queue_out):
|
|
43
|
+
def _worker_loop(queue_in, queue_out, sys_path_additions=None):
|
|
44
44
|
"""
|
|
45
45
|
Worker process main loop.
|
|
46
46
|
|
|
@@ -54,10 +54,22 @@ def _worker_loop(queue_in, queue_out):
|
|
|
54
54
|
import importlib
|
|
55
55
|
import os
|
|
56
56
|
import sys
|
|
57
|
+
from pathlib import Path
|
|
57
58
|
|
|
58
59
|
# Set worker mode env var
|
|
59
60
|
os.environ["COMFYUI_ISOLATION_WORKER"] = "1"
|
|
60
61
|
|
|
62
|
+
# Add stubs directory for folder_paths etc. (same as PersistentVenvWorker)
|
|
63
|
+
stubs_dir = Path(__file__).parent.parent / "stubs"
|
|
64
|
+
if str(stubs_dir) not in sys.path:
|
|
65
|
+
sys.path.insert(0, str(stubs_dir))
|
|
66
|
+
|
|
67
|
+
# Add custom paths to sys.path for module discovery
|
|
68
|
+
if sys_path_additions:
|
|
69
|
+
for path in sys_path_additions:
|
|
70
|
+
if path not in sys.path:
|
|
71
|
+
sys.path.insert(0, path)
|
|
72
|
+
|
|
61
73
|
while True:
|
|
62
74
|
try:
|
|
63
75
|
item = queue_in.get()
|
|
@@ -151,14 +163,16 @@ class TorchMPWorker(Worker):
|
|
|
151
163
|
interpreter without inherited state from the parent.
|
|
152
164
|
"""
|
|
153
165
|
|
|
154
|
-
def __init__(self, name: Optional[str] = None):
|
|
166
|
+
def __init__(self, name: Optional[str] = None, sys_path: Optional[list] = None):
|
|
155
167
|
"""
|
|
156
168
|
Initialize the worker.
|
|
157
169
|
|
|
158
170
|
Args:
|
|
159
171
|
name: Optional name for logging/debugging.
|
|
172
|
+
sys_path: Optional list of paths to add to sys.path in worker process.
|
|
160
173
|
"""
|
|
161
174
|
self.name = name or "TorchMPWorker"
|
|
175
|
+
self._sys_path = sys_path or []
|
|
162
176
|
self._process = None
|
|
163
177
|
self._queue_in = None
|
|
164
178
|
self._queue_out = None
|
|
@@ -185,7 +199,7 @@ class TorchMPWorker(Worker):
|
|
|
185
199
|
self._queue_out = ctx.Queue()
|
|
186
200
|
self._process = ctx.Process(
|
|
187
201
|
target=_worker_loop,
|
|
188
|
-
args=(self._queue_in, self._queue_out),
|
|
202
|
+
args=(self._queue_in, self._queue_out, self._sys_path),
|
|
189
203
|
daemon=True,
|
|
190
204
|
)
|
|
191
205
|
self._process.start()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: comfy-env
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.18
|
|
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
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
comfy_env/__init__.py,sha256=76gIAh7qFff_v_bAolXVzuWzcgvD3bp-yQGCNzba_Iw,3287
|
|
2
|
-
comfy_env/cli.py,sha256=
|
|
3
|
-
comfy_env/decorator.py,sha256=
|
|
2
|
+
comfy_env/cli.py,sha256=X-GCQMP0mtMcE3ZgkT-VLQ4Gq3UUvcb_Ux_NClEFhgI,15975
|
|
3
|
+
comfy_env/decorator.py,sha256=FwM6O0eIYK1FlKmniE4sJyzLLIr4mVg3ON-PnuTF2cw,16056
|
|
4
4
|
comfy_env/errors.py,sha256=8hN8NDlo8oBUdapc-eT3ZluigI5VBzfqsSBvQdfWlz4,9943
|
|
5
|
-
comfy_env/install.py,sha256=
|
|
5
|
+
comfy_env/install.py,sha256=K0sayQ8HVG5t7XpxrAouhicFYnqSXpaQeDa5DgHO6L4,21064
|
|
6
6
|
comfy_env/registry.py,sha256=uFCtGmWYvwGCqObXgzmArX7o5JsFNsHXxayofk3m6no,2569
|
|
7
7
|
comfy_env/resolver.py,sha256=l-AnmCE1puG6CvdpDB-KrsfG_cn_3uO2DryYizUnG_4,12474
|
|
8
8
|
comfy_env/tools.py,sha256=mFNB_uq64ON5hlreH_0wTLONahDo3pBHxhQYTcTHxXE,6554
|
|
9
9
|
comfy_env/env/__init__.py,sha256=imQdoQEQvrRT-QDtyNpFlkVbm2fBzgACdpQwRPd09fI,1157
|
|
10
|
-
comfy_env/env/config.py,sha256=
|
|
10
|
+
comfy_env/env/config.py,sha256=h2EJqg1bf5GamBwXV2uXeYZ4fBpW9nqs0WG1Xzlqjmc,5978
|
|
11
11
|
comfy_env/env/config_file.py,sha256=tJ9xfmf2RghzK6PUxwTrhpvqV_5pecjC6IYYBoZ0U58,21890
|
|
12
12
|
comfy_env/env/cuda_gpu_detection.py,sha256=YLuXUdWg6FeKdNyLlQAHPlveg4rTenXJ2VbeAaEi9QE,9755
|
|
13
13
|
comfy_env/env/manager.py,sha256=bbV1MpURNGuBJ1sSWg_2oSU0J-dW-FhBCuHHHQxgrSM,24785
|
|
@@ -30,11 +30,11 @@ comfy_env/workers/__init__.py,sha256=IKZwOvrWOGqBLDUIFAalg4CdqzJ_YnAdxo2Ha7gZTJ0
|
|
|
30
30
|
comfy_env/workers/base.py,sha256=ZILYXlvGCWuCZXmjKqfG8VeD19ihdYaASdlbasl2BMo,2312
|
|
31
31
|
comfy_env/workers/pool.py,sha256=MtjeOWfvHSCockq8j1gfnxIl-t01GSB79T5N4YB82Lg,6956
|
|
32
32
|
comfy_env/workers/tensor_utils.py,sha256=TCuOAjJymrSbkgfyvcKtQ_KbVWTqSwP9VH_bCaFLLq8,6409
|
|
33
|
-
comfy_env/workers/torch_mp.py,sha256=
|
|
33
|
+
comfy_env/workers/torch_mp.py,sha256=1cNhcrCWZ9E6AHCIEMC3vDLo_qjyV2wuQh5iZslg0Hg,13222
|
|
34
34
|
comfy_env/workers/venv.py,sha256=_ekHfZPqBIPY08DjqiXm6cTBQH4DrbxRWR3AAv3mit8,31589
|
|
35
35
|
comfy_env/wheel_sources.yml,sha256=nSZ8XB_I5JXQGB7AgC6lHs_IXMd9Kcno10artNL8BKw,7775
|
|
36
|
-
comfy_env-0.0.
|
|
37
|
-
comfy_env-0.0.
|
|
38
|
-
comfy_env-0.0.
|
|
39
|
-
comfy_env-0.0.
|
|
40
|
-
comfy_env-0.0.
|
|
36
|
+
comfy_env-0.0.18.dist-info/METADATA,sha256=2AL5DPZlU5EXPmtM9OhEt-FZ8wlIw6lzs5kGMGW4dKI,5399
|
|
37
|
+
comfy_env-0.0.18.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
38
|
+
comfy_env-0.0.18.dist-info/entry_points.txt,sha256=J4fXeqgxU_YenuW_Zxn_pEL7J-3R0--b6MS5t0QmAr0,49
|
|
39
|
+
comfy_env-0.0.18.dist-info/licenses/LICENSE,sha256=E68QZMMpW4P2YKstTZ3QU54HRQO8ecew09XZ4_Vn870,1093
|
|
40
|
+
comfy_env-0.0.18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|