comfy-env 0.1.23__py3-none-any.whl → 0.1.25__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/environment/cache.py +6 -3
- comfy_env/isolation/workers/subprocess.py +6 -1
- comfy_env/packages/apt.py +25 -19
- {comfy_env-0.1.23.dist-info → comfy_env-0.1.25.dist-info}/METADATA +1 -1
- {comfy_env-0.1.23.dist-info → comfy_env-0.1.25.dist-info}/RECORD +8 -8
- {comfy_env-0.1.23.dist-info → comfy_env-0.1.25.dist-info}/WHEEL +0 -0
- {comfy_env-0.1.23.dist-info → comfy_env-0.1.25.dist-info}/entry_points.txt +0 -0
- {comfy_env-0.1.23.dist-info → comfy_env-0.1.25.dist-info}/licenses/LICENSE +0 -0
comfy_env/environment/cache.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import glob
|
|
4
4
|
import hashlib
|
|
5
|
+
import os
|
|
5
6
|
import shutil
|
|
6
7
|
import sys
|
|
7
8
|
from datetime import datetime
|
|
@@ -16,14 +17,16 @@ try:
|
|
|
16
17
|
except ImportError:
|
|
17
18
|
__version__ = "0.0.0-dev"
|
|
18
19
|
|
|
19
|
-
CACHE_DIR = Path.home() / ".comfy-env" / "envs"
|
|
20
|
+
CACHE_DIR = Path.home() / ".comfy-env" / "envs" # Default, use get_cache_dir() for dynamic lookup
|
|
20
21
|
MARKER_FILE = ".comfy-env-marker.toml"
|
|
21
22
|
METADATA_FILE = ".comfy-env-metadata.toml"
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
def get_cache_dir() -> Path:
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
"""Get cache dir, checking COMFY_ENV_CACHE_DIR env var each time."""
|
|
27
|
+
cache_dir = Path(os.environ.get("COMFY_ENV_CACHE_DIR", Path.home() / ".comfy-env" / "envs"))
|
|
28
|
+
cache_dir.mkdir(parents=True, exist_ok=True)
|
|
29
|
+
return cache_dir
|
|
27
30
|
|
|
28
31
|
|
|
29
32
|
def compute_config_hash(config_path: Path) -> str:
|
|
@@ -668,7 +668,10 @@ def _to_shm(obj, registry, visited=None):
|
|
|
668
668
|
visited = {}
|
|
669
669
|
obj_id = id(obj)
|
|
670
670
|
if obj_id in visited:
|
|
671
|
-
|
|
671
|
+
cached = visited[obj_id]
|
|
672
|
+
if isinstance(cached, dict) and cached.get("__type__") == "TensorRef":
|
|
673
|
+
print(f"[SHM DEBUG] _to_shm CACHE HIT: id={obj_id} -> storage_key=...{cached.get('storage_key','?')[-20:]}, tensor_size={cached.get('tensor_size')}", file=sys.stderr)
|
|
674
|
+
return cached
|
|
672
675
|
t = type(obj).__name__
|
|
673
676
|
|
|
674
677
|
# Tensor -> use PyTorch's native shared memory (bypasses resource_tracker)
|
|
@@ -676,6 +679,7 @@ def _to_shm(obj, registry, visited=None):
|
|
|
676
679
|
import torch
|
|
677
680
|
tensor = obj.detach().cpu().contiguous()
|
|
678
681
|
result = _serialize_tensor_native(tensor, registry)
|
|
682
|
+
print(f"[SHM DEBUG] _to_shm Tensor: id={obj_id}, orig_shape={list(obj.shape)}, new_shape={list(tensor.shape)} -> storage_key=...{result.get('storage_key','?')[-20:]}, tensor_size={result.get('tensor_size')}", file=sys.stderr)
|
|
679
683
|
visited[obj_id] = result
|
|
680
684
|
return result
|
|
681
685
|
|
|
@@ -769,6 +773,7 @@ def _from_shm(obj):
|
|
|
769
773
|
# TensorRef -> use PyTorch's native deserialization (new format, worker->parent)
|
|
770
774
|
if obj.get("__type__") == "TensorRef":
|
|
771
775
|
tensor = _deserialize_tensor_native(obj)
|
|
776
|
+
print(f"[SHM DEBUG] _from_shm TensorRef: storage_key=...{obj.get('storage_key','?')[-20:]}, expected_size={obj.get('tensor_size')} -> actual_shape={list(tensor.shape)}", file=sys.stderr)
|
|
772
777
|
# Convert back to numpy if it was originally numpy
|
|
773
778
|
if obj.get("__was_numpy__"):
|
|
774
779
|
return tensor.numpy()
|
comfy_env/packages/apt.py
CHANGED
|
@@ -32,29 +32,35 @@ def apt_install(packages: List[str], log: Callable[[str], None] = print) -> bool
|
|
|
32
32
|
else:
|
|
33
33
|
log("[apt] apt-get update succeeded")
|
|
34
34
|
|
|
35
|
-
# Install
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
# Install packages ONE BY ONE so one failure doesn't block others
|
|
36
|
+
installed = []
|
|
37
|
+
failed = []
|
|
38
|
+
for pkg in missing:
|
|
39
|
+
log(f"[apt] Installing: {pkg}")
|
|
40
|
+
result = subprocess.run(
|
|
41
|
+
["sudo", "apt-get", "install", "-y", pkg],
|
|
42
|
+
capture_output=True, text=True
|
|
43
|
+
)
|
|
44
|
+
if result.returncode != 0:
|
|
45
|
+
log(f"[apt] FAILED: {pkg} - {result.stderr.strip()}")
|
|
46
|
+
failed.append(pkg)
|
|
47
|
+
else:
|
|
48
|
+
log(f"[apt] OK: {pkg}")
|
|
49
|
+
installed.append(pkg)
|
|
47
50
|
|
|
48
|
-
|
|
51
|
+
# Summary
|
|
52
|
+
if installed:
|
|
53
|
+
log(f"[apt] Successfully installed: {installed}")
|
|
54
|
+
if failed:
|
|
55
|
+
log(f"[apt] Failed to install: {failed}")
|
|
49
56
|
|
|
50
|
-
# Verify
|
|
51
|
-
still_missing = check_apt_packages(
|
|
57
|
+
# Verify what's actually installed now
|
|
58
|
+
still_missing = check_apt_packages(packages)
|
|
52
59
|
if still_missing:
|
|
53
|
-
log(f"[apt] WARNING: These packages
|
|
54
|
-
return False
|
|
60
|
+
log(f"[apt] WARNING: These packages are not available: {still_missing}")
|
|
55
61
|
|
|
56
|
-
|
|
57
|
-
return
|
|
62
|
+
# Return True if we installed at least something (partial success is OK)
|
|
63
|
+
return len(installed) > 0 or len(missing) == len(failed)
|
|
58
64
|
|
|
59
65
|
|
|
60
66
|
def check_apt_packages(packages: List[str]) -> List[str]:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: comfy-env
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.25
|
|
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
|
|
@@ -10,7 +10,7 @@ comfy_env/detection/gpu.py,sha256=Rf7pgtZXzUbJqcXzZXQi-yK5naeuSP1FiL6SdreeADM,83
|
|
|
10
10
|
comfy_env/detection/platform.py,sha256=Xe01dIZm7JT19kIH-j11h7KIBVRaKTLh8u4TzI3uZ6E,2127
|
|
11
11
|
comfy_env/detection/runtime.py,sha256=gDplni7ZPGW7WjNJuqWbtgSwkWz27kBWSFvYbhXun6o,3756
|
|
12
12
|
comfy_env/environment/__init__.py,sha256=WfZnyOvbI0MrDQPYTtOG2kHn0XCSCrqKcOlJcmB29nU,1009
|
|
13
|
-
comfy_env/environment/cache.py,sha256=
|
|
13
|
+
comfy_env/environment/cache.py,sha256=pRhY9xafWELu47evSfnKEJ3Ha-7OqpZulcg5lJpUbNA,4799
|
|
14
14
|
comfy_env/environment/libomp.py,sha256=nzr3kDnRLgcf9CZ_WF4ItWskqEDS2S0geqZS43XoKig,1319
|
|
15
15
|
comfy_env/environment/paths.py,sha256=5TFFAkOZXa8R3cHfVHDEFnwy6_JcHilVBOHJuy-yqR0,1129
|
|
16
16
|
comfy_env/environment/setup.py,sha256=KQgeqlEaqB_tOVhsR2RQF76-LuPud2EPtkQWUM3AJ5Y,3231
|
|
@@ -19,17 +19,17 @@ comfy_env/isolation/tensor_utils.py,sha256=2_f4jjylqCPaPldD1Jw-es5CyOtuF5I1ROdyE
|
|
|
19
19
|
comfy_env/isolation/wrap.py,sha256=d-JLGHHBfb6NerAtETMZouqqCSmQD3CsPpgsN8FVCac,8412
|
|
20
20
|
comfy_env/isolation/workers/__init__.py,sha256=rmfSuH03_BbFFy0TSBTBL9UthhzP69o3Ou8p5R0WBrw,264
|
|
21
21
|
comfy_env/isolation/workers/base.py,sha256=feRCKtjVtTVh1r3efZJ1cJ3rH9D1xKBCbbwLlckcBJk,2348
|
|
22
|
-
comfy_env/isolation/workers/subprocess.py,sha256=
|
|
22
|
+
comfy_env/isolation/workers/subprocess.py,sha256=uw3yvbDtIY5OADAntViAD3bGQCk8Oe1zWf-KjAJPD2M,65325
|
|
23
23
|
comfy_env/packages/__init__.py,sha256=4pRCUnfcVFVgy7hkbPz9BPVXELtSFHha6L7n-hqNuZA,1155
|
|
24
|
-
comfy_env/packages/apt.py,sha256=
|
|
24
|
+
comfy_env/packages/apt.py,sha256=FOQ4c7cKhu3W3K3LEreLxLIQ4QEHR1sPMVMZ1rsE2mo,2356
|
|
25
25
|
comfy_env/packages/cuda_wheels.py,sha256=G_CnlwNcfeWlEU24aCVBpeqQQ05y8_02dDLBwBFNwII,3980
|
|
26
26
|
comfy_env/packages/node_dependencies.py,sha256=AX_CY6j43tTY5KhyPfU7Wz6zgLAfWF0o0JkTrcNSecg,2966
|
|
27
27
|
comfy_env/packages/pixi.py,sha256=RPu8x5sSOLE1CYAhWMMjoQrbFGGt00fdsbqtRcTz7LQ,3871
|
|
28
28
|
comfy_env/packages/toml_generator.py,sha256=Vhc8F9euHhMTwH1TV6t96-D9Pjrn9jIN4e9WXrCIFE8,3414
|
|
29
29
|
comfy_env/templates/comfy-env-instructions.txt,sha256=ve1RAthW7ouumU9h6DM7mIRX1MS8_Tyonq2U4tcrFu8,1031
|
|
30
30
|
comfy_env/templates/comfy-env.toml,sha256=ROIqi4BlPL1MEdL1VgebfTHpdwPNYGHwWeigI9Kw-1I,4831
|
|
31
|
-
comfy_env-0.1.
|
|
32
|
-
comfy_env-0.1.
|
|
33
|
-
comfy_env-0.1.
|
|
34
|
-
comfy_env-0.1.
|
|
35
|
-
comfy_env-0.1.
|
|
31
|
+
comfy_env-0.1.25.dist-info/METADATA,sha256=XfGNXJwUNG4OIdnmwhSG2aiRI1_NUIziDqX6IY3wRt4,4829
|
|
32
|
+
comfy_env-0.1.25.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
33
|
+
comfy_env-0.1.25.dist-info/entry_points.txt,sha256=J4fXeqgxU_YenuW_Zxn_pEL7J-3R0--b6MS5t0QmAr0,49
|
|
34
|
+
comfy_env-0.1.25.dist-info/licenses/LICENSE,sha256=E68QZMMpW4P2YKstTZ3QU54HRQO8ecew09XZ4_Vn870,1093
|
|
35
|
+
comfy_env-0.1.25.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|