comfy-env 0.1.15__py3-none-any.whl → 0.1.16__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/__init__.py +116 -41
- comfy_env/cli.py +89 -317
- comfy_env/config/__init__.py +18 -6
- comfy_env/config/parser.py +22 -76
- comfy_env/config/types.py +37 -0
- comfy_env/detection/__init__.py +77 -0
- comfy_env/detection/cuda.py +61 -0
- comfy_env/detection/gpu.py +230 -0
- comfy_env/detection/platform.py +70 -0
- comfy_env/detection/runtime.py +103 -0
- comfy_env/environment/__init__.py +53 -0
- comfy_env/environment/cache.py +141 -0
- comfy_env/environment/libomp.py +41 -0
- comfy_env/environment/paths.py +38 -0
- comfy_env/environment/setup.py +88 -0
- comfy_env/install.py +127 -329
- comfy_env/isolation/__init__.py +32 -2
- comfy_env/isolation/tensor_utils.py +83 -0
- comfy_env/isolation/workers/__init__.py +16 -0
- comfy_env/{workers → isolation/workers}/mp.py +1 -1
- comfy_env/{workers → isolation/workers}/subprocess.py +1 -1
- comfy_env/isolation/wrap.py +128 -509
- comfy_env/packages/__init__.py +60 -0
- comfy_env/packages/apt.py +36 -0
- comfy_env/packages/cuda_wheels.py +97 -0
- comfy_env/packages/node_dependencies.py +77 -0
- comfy_env/packages/pixi.py +85 -0
- comfy_env/packages/toml_generator.py +88 -0
- comfy_env-0.1.16.dist-info/METADATA +279 -0
- comfy_env-0.1.16.dist-info/RECORD +36 -0
- comfy_env/cache.py +0 -203
- comfy_env/nodes.py +0 -187
- comfy_env/pixi/__init__.py +0 -48
- comfy_env/pixi/core.py +0 -587
- comfy_env/pixi/cuda_detection.py +0 -303
- comfy_env/pixi/platform/__init__.py +0 -21
- comfy_env/pixi/platform/base.py +0 -96
- comfy_env/pixi/platform/darwin.py +0 -53
- comfy_env/pixi/platform/linux.py +0 -68
- comfy_env/pixi/platform/windows.py +0 -284
- comfy_env/pixi/resolver.py +0 -198
- comfy_env/prestartup.py +0 -208
- comfy_env/workers/__init__.py +0 -38
- comfy_env/workers/tensor_utils.py +0 -188
- comfy_env-0.1.15.dist-info/METADATA +0 -291
- comfy_env-0.1.15.dist-info/RECORD +0 -31
- /comfy_env/{workers → isolation/workers}/base.py +0 -0
- {comfy_env-0.1.15.dist-info → comfy_env-0.1.16.dist-info}/WHEEL +0 -0
- {comfy_env-0.1.15.dist-info → comfy_env-0.1.16.dist-info}/entry_points.txt +0 -0
- {comfy_env-0.1.15.dist-info → comfy_env-0.1.16.dist-info}/licenses/LICENSE +0 -0
comfy_env/__init__.py
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""
|
|
2
|
+
comfy-env - Environment management for ComfyUI custom nodes.
|
|
3
|
+
|
|
4
|
+
Features:
|
|
5
|
+
- CUDA wheel resolution (pre-built wheels without compilation)
|
|
6
|
+
- Process isolation (run nodes in separate Python environments)
|
|
7
|
+
- Central environment cache (~/.comfy-env/envs/)
|
|
8
|
+
"""
|
|
2
9
|
|
|
3
10
|
from importlib.metadata import version, PackageNotFoundError
|
|
4
11
|
|
|
@@ -7,49 +14,83 @@ try:
|
|
|
7
14
|
except PackageNotFoundError:
|
|
8
15
|
__version__ = "0.0.0-dev"
|
|
9
16
|
|
|
10
|
-
|
|
17
|
+
|
|
18
|
+
# =============================================================================
|
|
19
|
+
# Primary API (what most users need)
|
|
20
|
+
# =============================================================================
|
|
21
|
+
|
|
22
|
+
# Install API
|
|
23
|
+
from .install import install, verify_installation, USE_COMFY_ENV_VAR
|
|
24
|
+
|
|
25
|
+
# Prestartup helpers
|
|
26
|
+
from .environment.setup import setup_env
|
|
27
|
+
from .environment.paths import copy_files
|
|
28
|
+
|
|
29
|
+
# Isolation
|
|
30
|
+
from .isolation import wrap_isolated_nodes, wrap_nodes
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# =============================================================================
|
|
34
|
+
# Config Layer
|
|
35
|
+
# =============================================================================
|
|
36
|
+
|
|
11
37
|
from .config import (
|
|
12
38
|
ComfyEnvConfig,
|
|
13
|
-
|
|
39
|
+
NodeDependency,
|
|
40
|
+
NodeReq, # Backwards compatibility alias
|
|
14
41
|
load_config,
|
|
15
42
|
discover_config,
|
|
16
43
|
CONFIG_FILE_NAME,
|
|
17
44
|
)
|
|
18
45
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
CUDA_WHEELS_INDEX,
|
|
46
|
+
|
|
47
|
+
# =============================================================================
|
|
48
|
+
# Detection Layer
|
|
49
|
+
# =============================================================================
|
|
50
|
+
|
|
51
|
+
from .detection import (
|
|
52
|
+
# CUDA detection
|
|
27
53
|
detect_cuda_version,
|
|
28
54
|
detect_cuda_environment,
|
|
29
55
|
get_recommended_cuda_version,
|
|
56
|
+
# GPU detection
|
|
30
57
|
GPUInfo,
|
|
31
58
|
CUDAEnvironment,
|
|
59
|
+
detect_gpu,
|
|
60
|
+
get_gpu_summary,
|
|
61
|
+
# Platform detection
|
|
62
|
+
detect_platform,
|
|
63
|
+
get_platform_tag,
|
|
64
|
+
# Runtime detection
|
|
65
|
+
RuntimeEnv,
|
|
66
|
+
detect_runtime,
|
|
32
67
|
)
|
|
33
68
|
|
|
34
|
-
# Workers
|
|
35
|
-
from .workers import (
|
|
36
|
-
Worker,
|
|
37
|
-
WorkerError,
|
|
38
|
-
MPWorker,
|
|
39
|
-
SubprocessWorker,
|
|
40
|
-
)
|
|
41
69
|
|
|
42
|
-
#
|
|
43
|
-
|
|
70
|
+
# =============================================================================
|
|
71
|
+
# Packages Layer
|
|
72
|
+
# =============================================================================
|
|
44
73
|
|
|
45
|
-
|
|
46
|
-
|
|
74
|
+
from .packages import (
|
|
75
|
+
# Pixi
|
|
76
|
+
ensure_pixi,
|
|
77
|
+
get_pixi_path,
|
|
78
|
+
get_pixi_python,
|
|
79
|
+
pixi_run,
|
|
80
|
+
pixi_clean,
|
|
81
|
+
# CUDA wheels
|
|
82
|
+
CUDA_WHEELS_INDEX,
|
|
83
|
+
get_wheel_url,
|
|
84
|
+
get_cuda_torch_mapping,
|
|
85
|
+
)
|
|
47
86
|
|
|
48
|
-
# Prestartup helpers
|
|
49
|
-
from .prestartup import setup_env, copy_files
|
|
50
87
|
|
|
51
|
-
#
|
|
52
|
-
|
|
88
|
+
# =============================================================================
|
|
89
|
+
# Environment Layer
|
|
90
|
+
# =============================================================================
|
|
91
|
+
|
|
92
|
+
from .environment import (
|
|
93
|
+
# Cache management
|
|
53
94
|
get_cache_dir,
|
|
54
95
|
cleanup_orphaned_envs,
|
|
55
96
|
resolve_env_path,
|
|
@@ -57,6 +98,26 @@ from .cache import (
|
|
|
57
98
|
MARKER_FILE,
|
|
58
99
|
)
|
|
59
100
|
|
|
101
|
+
|
|
102
|
+
# =============================================================================
|
|
103
|
+
# Isolation Layer
|
|
104
|
+
# =============================================================================
|
|
105
|
+
|
|
106
|
+
from .isolation import (
|
|
107
|
+
# Workers
|
|
108
|
+
Worker,
|
|
109
|
+
WorkerError,
|
|
110
|
+
MPWorker,
|
|
111
|
+
SubprocessWorker,
|
|
112
|
+
# Tensor utilities
|
|
113
|
+
TensorKeeper,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
# =============================================================================
|
|
118
|
+
# Exports
|
|
119
|
+
# =============================================================================
|
|
120
|
+
|
|
60
121
|
__all__ = [
|
|
61
122
|
# Install API
|
|
62
123
|
"install",
|
|
@@ -70,37 +131,51 @@ __all__ = [
|
|
|
70
131
|
"wrap_nodes",
|
|
71
132
|
# Config
|
|
72
133
|
"ComfyEnvConfig",
|
|
134
|
+
"NodeDependency",
|
|
73
135
|
"NodeReq",
|
|
74
136
|
"load_config",
|
|
75
137
|
"discover_config",
|
|
76
138
|
"CONFIG_FILE_NAME",
|
|
77
|
-
#
|
|
78
|
-
"ensure_pixi",
|
|
79
|
-
"get_pixi_path",
|
|
80
|
-
"get_pixi_python",
|
|
81
|
-
"pixi_run",
|
|
82
|
-
"pixi_install",
|
|
83
|
-
"CUDA_WHEELS_INDEX",
|
|
84
|
-
# CUDA detection
|
|
139
|
+
# Detection
|
|
85
140
|
"detect_cuda_version",
|
|
86
141
|
"detect_cuda_environment",
|
|
87
142
|
"get_recommended_cuda_version",
|
|
88
143
|
"GPUInfo",
|
|
89
144
|
"CUDAEnvironment",
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
|
|
145
|
+
"detect_gpu",
|
|
146
|
+
"get_gpu_summary",
|
|
147
|
+
"detect_platform",
|
|
148
|
+
"get_platform_tag",
|
|
149
|
+
"RuntimeEnv",
|
|
150
|
+
"detect_runtime",
|
|
151
|
+
# Packages
|
|
152
|
+
"ensure_pixi",
|
|
153
|
+
"get_pixi_path",
|
|
154
|
+
"get_pixi_python",
|
|
155
|
+
"pixi_run",
|
|
156
|
+
"pixi_clean",
|
|
157
|
+
"CUDA_WHEELS_INDEX",
|
|
158
|
+
"get_wheel_url",
|
|
159
|
+
"get_cuda_torch_mapping",
|
|
160
|
+
# Environment
|
|
96
161
|
"get_cache_dir",
|
|
97
162
|
"cleanup_orphaned_envs",
|
|
98
163
|
"resolve_env_path",
|
|
99
164
|
"CACHE_DIR",
|
|
100
165
|
"MARKER_FILE",
|
|
166
|
+
# Workers
|
|
167
|
+
"Worker",
|
|
168
|
+
"WorkerError",
|
|
169
|
+
"MPWorker",
|
|
170
|
+
"SubprocessWorker",
|
|
171
|
+
"TensorKeeper",
|
|
101
172
|
]
|
|
102
173
|
|
|
103
|
-
|
|
174
|
+
|
|
175
|
+
# =============================================================================
|
|
176
|
+
# Startup cleanup
|
|
177
|
+
# =============================================================================
|
|
178
|
+
|
|
104
179
|
def _run_startup_cleanup():
|
|
105
180
|
"""Clean orphaned envs on startup."""
|
|
106
181
|
try:
|