comfy-env 0.1.15__py3-none-any.whl → 0.1.17__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 +117 -40
- comfy_env/cli.py +122 -311
- comfy_env/config/__init__.py +12 -4
- comfy_env/config/parser.py +30 -79
- 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 +91 -0
- comfy_env/install.py +134 -331
- 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.17.dist-info/METADATA +225 -0
- comfy_env-0.1.17.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.17.dist-info}/WHEEL +0 -0
- {comfy_env-0.1.15.dist-info → comfy_env-0.1.17.dist-info}/entry_points.txt +0 -0
- {comfy_env-0.1.15.dist-info → comfy_env-0.1.17.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,84 @@ 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,
|
|
39
|
+
NodeDependency,
|
|
13
40
|
NodeReq,
|
|
14
41
|
load_config,
|
|
15
42
|
discover_config,
|
|
16
43
|
CONFIG_FILE_NAME,
|
|
44
|
+
ROOT_CONFIG_FILE_NAME,
|
|
17
45
|
)
|
|
18
46
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
CUDA_WHEELS_INDEX,
|
|
47
|
+
|
|
48
|
+
# =============================================================================
|
|
49
|
+
# Detection Layer
|
|
50
|
+
# =============================================================================
|
|
51
|
+
|
|
52
|
+
from .detection import (
|
|
53
|
+
# CUDA detection
|
|
27
54
|
detect_cuda_version,
|
|
28
55
|
detect_cuda_environment,
|
|
29
56
|
get_recommended_cuda_version,
|
|
57
|
+
# GPU detection
|
|
30
58
|
GPUInfo,
|
|
31
59
|
CUDAEnvironment,
|
|
60
|
+
detect_gpu,
|
|
61
|
+
get_gpu_summary,
|
|
62
|
+
# Platform detection
|
|
63
|
+
detect_platform,
|
|
64
|
+
get_platform_tag,
|
|
65
|
+
# Runtime detection
|
|
66
|
+
RuntimeEnv,
|
|
67
|
+
detect_runtime,
|
|
32
68
|
)
|
|
33
69
|
|
|
34
|
-
# Workers
|
|
35
|
-
from .workers import (
|
|
36
|
-
Worker,
|
|
37
|
-
WorkerError,
|
|
38
|
-
MPWorker,
|
|
39
|
-
SubprocessWorker,
|
|
40
|
-
)
|
|
41
70
|
|
|
42
|
-
#
|
|
43
|
-
|
|
71
|
+
# =============================================================================
|
|
72
|
+
# Packages Layer
|
|
73
|
+
# =============================================================================
|
|
44
74
|
|
|
45
|
-
|
|
46
|
-
|
|
75
|
+
from .packages import (
|
|
76
|
+
# Pixi
|
|
77
|
+
ensure_pixi,
|
|
78
|
+
get_pixi_path,
|
|
79
|
+
get_pixi_python,
|
|
80
|
+
pixi_run,
|
|
81
|
+
pixi_clean,
|
|
82
|
+
# CUDA wheels
|
|
83
|
+
CUDA_WHEELS_INDEX,
|
|
84
|
+
get_wheel_url,
|
|
85
|
+
get_cuda_torch_mapping,
|
|
86
|
+
)
|
|
47
87
|
|
|
48
|
-
# Prestartup helpers
|
|
49
|
-
from .prestartup import setup_env, copy_files
|
|
50
88
|
|
|
51
|
-
#
|
|
52
|
-
|
|
89
|
+
# =============================================================================
|
|
90
|
+
# Environment Layer
|
|
91
|
+
# =============================================================================
|
|
92
|
+
|
|
93
|
+
from .environment import (
|
|
94
|
+
# Cache management
|
|
53
95
|
get_cache_dir,
|
|
54
96
|
cleanup_orphaned_envs,
|
|
55
97
|
resolve_env_path,
|
|
@@ -57,6 +99,26 @@ from .cache import (
|
|
|
57
99
|
MARKER_FILE,
|
|
58
100
|
)
|
|
59
101
|
|
|
102
|
+
|
|
103
|
+
# =============================================================================
|
|
104
|
+
# Isolation Layer
|
|
105
|
+
# =============================================================================
|
|
106
|
+
|
|
107
|
+
from .isolation import (
|
|
108
|
+
# Workers
|
|
109
|
+
Worker,
|
|
110
|
+
WorkerError,
|
|
111
|
+
MPWorker,
|
|
112
|
+
SubprocessWorker,
|
|
113
|
+
# Tensor utilities
|
|
114
|
+
TensorKeeper,
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
# =============================================================================
|
|
119
|
+
# Exports
|
|
120
|
+
# =============================================================================
|
|
121
|
+
|
|
60
122
|
__all__ = [
|
|
61
123
|
# Install API
|
|
62
124
|
"install",
|
|
@@ -70,37 +132,52 @@ __all__ = [
|
|
|
70
132
|
"wrap_nodes",
|
|
71
133
|
# Config
|
|
72
134
|
"ComfyEnvConfig",
|
|
135
|
+
"NodeDependency",
|
|
73
136
|
"NodeReq",
|
|
74
137
|
"load_config",
|
|
75
138
|
"discover_config",
|
|
76
139
|
"CONFIG_FILE_NAME",
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"get_pixi_path",
|
|
80
|
-
"get_pixi_python",
|
|
81
|
-
"pixi_run",
|
|
82
|
-
"pixi_install",
|
|
83
|
-
"CUDA_WHEELS_INDEX",
|
|
84
|
-
# CUDA detection
|
|
140
|
+
"ROOT_CONFIG_FILE_NAME",
|
|
141
|
+
# Detection
|
|
85
142
|
"detect_cuda_version",
|
|
86
143
|
"detect_cuda_environment",
|
|
87
144
|
"get_recommended_cuda_version",
|
|
88
145
|
"GPUInfo",
|
|
89
146
|
"CUDAEnvironment",
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
|
|
147
|
+
"detect_gpu",
|
|
148
|
+
"get_gpu_summary",
|
|
149
|
+
"detect_platform",
|
|
150
|
+
"get_platform_tag",
|
|
151
|
+
"RuntimeEnv",
|
|
152
|
+
"detect_runtime",
|
|
153
|
+
# Packages
|
|
154
|
+
"ensure_pixi",
|
|
155
|
+
"get_pixi_path",
|
|
156
|
+
"get_pixi_python",
|
|
157
|
+
"pixi_run",
|
|
158
|
+
"pixi_clean",
|
|
159
|
+
"CUDA_WHEELS_INDEX",
|
|
160
|
+
"get_wheel_url",
|
|
161
|
+
"get_cuda_torch_mapping",
|
|
162
|
+
# Environment
|
|
96
163
|
"get_cache_dir",
|
|
97
164
|
"cleanup_orphaned_envs",
|
|
98
165
|
"resolve_env_path",
|
|
99
166
|
"CACHE_DIR",
|
|
100
167
|
"MARKER_FILE",
|
|
168
|
+
# Workers
|
|
169
|
+
"Worker",
|
|
170
|
+
"WorkerError",
|
|
171
|
+
"MPWorker",
|
|
172
|
+
"SubprocessWorker",
|
|
173
|
+
"TensorKeeper",
|
|
101
174
|
]
|
|
102
175
|
|
|
103
|
-
|
|
176
|
+
|
|
177
|
+
# =============================================================================
|
|
178
|
+
# Startup cleanup
|
|
179
|
+
# =============================================================================
|
|
180
|
+
|
|
104
181
|
def _run_startup_cleanup():
|
|
105
182
|
"""Clean orphaned envs on startup."""
|
|
106
183
|
try:
|