comfy-env 0.1.14__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 +115 -62
- comfy_env/cli.py +89 -319
- comfy_env/config/__init__.py +18 -8
- comfy_env/config/parser.py +21 -122
- comfy_env/config/types.py +37 -70
- 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 +163 -249
- comfy_env/isolation/__init__.py +33 -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 +2 -2
- comfy_env/isolation/wrap.py +149 -409
- 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 -331
- comfy_env/errors.py +0 -293
- comfy_env/nodes.py +0 -187
- comfy_env/pixi/__init__.py +0 -48
- comfy_env/pixi/core.py +0 -588
- 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 -192
- comfy_env/workers/__init__.py +0 -38
- comfy_env/workers/tensor_utils.py +0 -188
- comfy_env-0.1.14.dist-info/METADATA +0 -291
- comfy_env-0.1.14.dist-info/RECORD +0 -33
- /comfy_env/{workers → isolation/workers}/base.py +0 -0
- {comfy_env-0.1.14.dist-info → comfy_env-0.1.16.dist-info}/WHEEL +0 -0
- {comfy_env-0.1.14.dist-info → comfy_env-0.1.16.dist-info}/entry_points.txt +0 -0
- {comfy_env-0.1.14.dist-info → comfy_env-0.1.16.dist-info}/licenses/LICENSE +0 -0
comfy_env/__init__.py
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"""
|
|
2
|
-
comfy-env
|
|
2
|
+
comfy-env - Environment management for ComfyUI custom nodes.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
- wrap_isolated_nodes(): Wrap nodes for subprocess isolation
|
|
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/)
|
|
9
8
|
"""
|
|
10
9
|
|
|
11
10
|
from importlib.metadata import version, PackageNotFoundError
|
|
@@ -15,49 +14,83 @@ try:
|
|
|
15
14
|
except PackageNotFoundError:
|
|
16
15
|
__version__ = "0.0.0-dev"
|
|
17
16
|
|
|
18
|
-
|
|
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
|
+
|
|
19
37
|
from .config import (
|
|
20
38
|
ComfyEnvConfig,
|
|
21
|
-
|
|
39
|
+
NodeDependency,
|
|
40
|
+
NodeReq, # Backwards compatibility alias
|
|
22
41
|
load_config,
|
|
23
42
|
discover_config,
|
|
24
43
|
CONFIG_FILE_NAME,
|
|
25
44
|
)
|
|
26
45
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
CUDA_WHEELS_INDEX,
|
|
46
|
+
|
|
47
|
+
# =============================================================================
|
|
48
|
+
# Detection Layer
|
|
49
|
+
# =============================================================================
|
|
50
|
+
|
|
51
|
+
from .detection import (
|
|
52
|
+
# CUDA detection
|
|
35
53
|
detect_cuda_version,
|
|
36
54
|
detect_cuda_environment,
|
|
37
55
|
get_recommended_cuda_version,
|
|
56
|
+
# GPU detection
|
|
38
57
|
GPUInfo,
|
|
39
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,
|
|
40
67
|
)
|
|
41
68
|
|
|
42
|
-
# Workers
|
|
43
|
-
from .workers import (
|
|
44
|
-
Worker,
|
|
45
|
-
WorkerError,
|
|
46
|
-
MPWorker,
|
|
47
|
-
SubprocessWorker,
|
|
48
|
-
)
|
|
49
69
|
|
|
50
|
-
#
|
|
51
|
-
|
|
70
|
+
# =============================================================================
|
|
71
|
+
# Packages Layer
|
|
72
|
+
# =============================================================================
|
|
52
73
|
|
|
53
|
-
|
|
54
|
-
|
|
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
|
+
)
|
|
55
86
|
|
|
56
|
-
# Prestartup helpers
|
|
57
|
-
from .prestartup import setup_env
|
|
58
87
|
|
|
59
|
-
#
|
|
60
|
-
|
|
88
|
+
# =============================================================================
|
|
89
|
+
# Environment Layer
|
|
90
|
+
# =============================================================================
|
|
91
|
+
|
|
92
|
+
from .environment import (
|
|
93
|
+
# Cache management
|
|
61
94
|
get_cache_dir,
|
|
62
95
|
cleanup_orphaned_envs,
|
|
63
96
|
resolve_env_path,
|
|
@@ -65,66 +98,86 @@ from .cache import (
|
|
|
65
98
|
MARKER_FILE,
|
|
66
99
|
)
|
|
67
100
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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,
|
|
76
114
|
)
|
|
77
115
|
|
|
116
|
+
|
|
117
|
+
# =============================================================================
|
|
118
|
+
# Exports
|
|
119
|
+
# =============================================================================
|
|
120
|
+
|
|
78
121
|
__all__ = [
|
|
79
122
|
# Install API
|
|
80
123
|
"install",
|
|
81
124
|
"verify_installation",
|
|
125
|
+
"USE_COMFY_ENV_VAR",
|
|
82
126
|
# Prestartup
|
|
83
127
|
"setup_env",
|
|
128
|
+
"copy_files",
|
|
84
129
|
# Isolation
|
|
85
130
|
"wrap_isolated_nodes",
|
|
131
|
+
"wrap_nodes",
|
|
86
132
|
# Config
|
|
87
133
|
"ComfyEnvConfig",
|
|
134
|
+
"NodeDependency",
|
|
88
135
|
"NodeReq",
|
|
89
136
|
"load_config",
|
|
90
137
|
"discover_config",
|
|
91
138
|
"CONFIG_FILE_NAME",
|
|
92
|
-
#
|
|
93
|
-
"ensure_pixi",
|
|
94
|
-
"get_pixi_path",
|
|
95
|
-
"get_pixi_python",
|
|
96
|
-
"pixi_run",
|
|
97
|
-
"pixi_install",
|
|
98
|
-
"CUDA_WHEELS_INDEX",
|
|
99
|
-
# CUDA detection
|
|
139
|
+
# Detection
|
|
100
140
|
"detect_cuda_version",
|
|
101
141
|
"detect_cuda_environment",
|
|
102
142
|
"get_recommended_cuda_version",
|
|
103
143
|
"GPUInfo",
|
|
104
144
|
"CUDAEnvironment",
|
|
105
|
-
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
|
|
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
|
|
118
161
|
"get_cache_dir",
|
|
119
162
|
"cleanup_orphaned_envs",
|
|
120
163
|
"resolve_env_path",
|
|
121
164
|
"CACHE_DIR",
|
|
122
165
|
"MARKER_FILE",
|
|
166
|
+
# Workers
|
|
167
|
+
"Worker",
|
|
168
|
+
"WorkerError",
|
|
169
|
+
"MPWorker",
|
|
170
|
+
"SubprocessWorker",
|
|
171
|
+
"TensorKeeper",
|
|
123
172
|
]
|
|
124
173
|
|
|
125
|
-
|
|
174
|
+
|
|
175
|
+
# =============================================================================
|
|
176
|
+
# Startup cleanup
|
|
177
|
+
# =============================================================================
|
|
178
|
+
|
|
126
179
|
def _run_startup_cleanup():
|
|
127
|
-
"""Clean orphaned envs on startup.
|
|
180
|
+
"""Clean orphaned envs on startup."""
|
|
128
181
|
try:
|
|
129
182
|
cleanup_orphaned_envs(log=lambda x: None) # Silent
|
|
130
183
|
except Exception:
|