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.
Files changed (50) hide show
  1. comfy_env/__init__.py +116 -41
  2. comfy_env/cli.py +89 -317
  3. comfy_env/config/__init__.py +18 -6
  4. comfy_env/config/parser.py +22 -76
  5. comfy_env/config/types.py +37 -0
  6. comfy_env/detection/__init__.py +77 -0
  7. comfy_env/detection/cuda.py +61 -0
  8. comfy_env/detection/gpu.py +230 -0
  9. comfy_env/detection/platform.py +70 -0
  10. comfy_env/detection/runtime.py +103 -0
  11. comfy_env/environment/__init__.py +53 -0
  12. comfy_env/environment/cache.py +141 -0
  13. comfy_env/environment/libomp.py +41 -0
  14. comfy_env/environment/paths.py +38 -0
  15. comfy_env/environment/setup.py +88 -0
  16. comfy_env/install.py +127 -329
  17. comfy_env/isolation/__init__.py +32 -2
  18. comfy_env/isolation/tensor_utils.py +83 -0
  19. comfy_env/isolation/workers/__init__.py +16 -0
  20. comfy_env/{workers → isolation/workers}/mp.py +1 -1
  21. comfy_env/{workers → isolation/workers}/subprocess.py +1 -1
  22. comfy_env/isolation/wrap.py +128 -509
  23. comfy_env/packages/__init__.py +60 -0
  24. comfy_env/packages/apt.py +36 -0
  25. comfy_env/packages/cuda_wheels.py +97 -0
  26. comfy_env/packages/node_dependencies.py +77 -0
  27. comfy_env/packages/pixi.py +85 -0
  28. comfy_env/packages/toml_generator.py +88 -0
  29. comfy_env-0.1.16.dist-info/METADATA +279 -0
  30. comfy_env-0.1.16.dist-info/RECORD +36 -0
  31. comfy_env/cache.py +0 -203
  32. comfy_env/nodes.py +0 -187
  33. comfy_env/pixi/__init__.py +0 -48
  34. comfy_env/pixi/core.py +0 -587
  35. comfy_env/pixi/cuda_detection.py +0 -303
  36. comfy_env/pixi/platform/__init__.py +0 -21
  37. comfy_env/pixi/platform/base.py +0 -96
  38. comfy_env/pixi/platform/darwin.py +0 -53
  39. comfy_env/pixi/platform/linux.py +0 -68
  40. comfy_env/pixi/platform/windows.py +0 -284
  41. comfy_env/pixi/resolver.py +0 -198
  42. comfy_env/prestartup.py +0 -208
  43. comfy_env/workers/__init__.py +0 -38
  44. comfy_env/workers/tensor_utils.py +0 -188
  45. comfy_env-0.1.15.dist-info/METADATA +0 -291
  46. comfy_env-0.1.15.dist-info/RECORD +0 -31
  47. /comfy_env/{workers → isolation/workers}/base.py +0 -0
  48. {comfy_env-0.1.15.dist-info → comfy_env-0.1.16.dist-info}/WHEEL +0 -0
  49. {comfy_env-0.1.15.dist-info → comfy_env-0.1.16.dist-info}/entry_points.txt +0 -0
  50. {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
- """Environment management for ComfyUI custom nodes."""
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
- # Config types and parsing
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
- NodeReq,
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
- # Pixi integration
20
- from .pixi import (
21
- ensure_pixi,
22
- get_pixi_path,
23
- get_pixi_python,
24
- pixi_run,
25
- pixi_install,
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
- # Isolation
43
- from .isolation import wrap_isolated_nodes, wrap_nodes
70
+ # =============================================================================
71
+ # Packages Layer
72
+ # =============================================================================
44
73
 
45
- # Install API
46
- from .install import install, verify_installation, USE_COMFY_ENV_VAR
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
- # Cache management
52
- from .cache import (
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
- # Pixi
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
- # Workers
91
- "Worker",
92
- "WorkerError",
93
- "MPWorker",
94
- "SubprocessWorker",
95
- # Cache
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
- # Run orphan cleanup once on module load (silently)
174
+
175
+ # =============================================================================
176
+ # Startup cleanup
177
+ # =============================================================================
178
+
104
179
  def _run_startup_cleanup():
105
180
  """Clean orphaned envs on startup."""
106
181
  try: