comfy-env 0.0.56__tar.gz → 0.0.58__tar.gz
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-0.0.56 → comfy_env-0.0.58}/PKG-INFO +1 -1
- {comfy_env-0.0.56 → comfy_env-0.0.58}/pyproject.toml +1 -1
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/pixi.py +134 -66
- {comfy_env-0.0.56 → comfy_env-0.0.58}/.github/workflows/publish.yml +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/.gitignore +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/LICENSE +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/README.md +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/__init__.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/cli.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/decorator.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/env/__init__.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/env/config.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/env/config_file.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/env/cuda_gpu_detection.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/env/manager.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/env/platform/__init__.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/env/platform/base.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/env/platform/darwin.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/env/platform/linux.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/env/platform/windows.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/env/security.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/errors.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/install.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/ipc/__init__.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/ipc/bridge.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/ipc/protocol.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/ipc/tensor.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/ipc/torch_bridge.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/ipc/transport.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/ipc/worker.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/isolation.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/nodes.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/registry.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/resolver.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/stub_imports.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/stubs/__init__.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/stubs/comfy/__init__.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/stubs/comfy/model_management.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/stubs/comfy/utils.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/stubs/folder_paths.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/templates/comfy-env-instructions.txt +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/templates/comfy-env.toml +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/wheel_sources.yml +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/workers/__init__.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/workers/base.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/workers/pool.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/workers/tensor_utils.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/workers/torch_mp.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.58}/src/comfy_env/workers/venv.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: comfy-env
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.58
|
|
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
|
|
@@ -181,6 +181,97 @@ def _parse_pypi_requirement(dep: str) -> Tuple[str, Optional[str], List[str]]:
|
|
|
181
181
|
return name, version_spec, extras
|
|
182
182
|
|
|
183
183
|
|
|
184
|
+
def _build_cuda_vars(env_config: IsolatedEnv) -> dict:
|
|
185
|
+
"""
|
|
186
|
+
Build variable dict for CUDA wheel URL resolution.
|
|
187
|
+
|
|
188
|
+
Returns a dict with CUDA, PyTorch, Python, and platform variables
|
|
189
|
+
for template substitution.
|
|
190
|
+
"""
|
|
191
|
+
# Use fixed CUDA 12.8 / PyTorch 2.8 for pixi environments (modern GPU default)
|
|
192
|
+
vars_dict = {
|
|
193
|
+
"cuda_version": "12.8",
|
|
194
|
+
"cuda_short": "128",
|
|
195
|
+
"cuda_short2": "128",
|
|
196
|
+
"cuda_major": "12",
|
|
197
|
+
"torch_version": "2.8.0",
|
|
198
|
+
"torch_short": "280",
|
|
199
|
+
"torch_mm": "28",
|
|
200
|
+
"torch_dotted_mm": "2.8",
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
# Platform detection
|
|
204
|
+
if sys.platform == "linux":
|
|
205
|
+
vars_dict["platform"] = "linux_x86_64"
|
|
206
|
+
elif sys.platform == "darwin":
|
|
207
|
+
vars_dict["platform"] = "macosx_arm64" if platform.machine() == "arm64" else "macosx_x86_64"
|
|
208
|
+
elif sys.platform == "win32":
|
|
209
|
+
vars_dict["platform"] = "win_amd64"
|
|
210
|
+
|
|
211
|
+
# Python version from env config
|
|
212
|
+
if env_config.python:
|
|
213
|
+
py_parts = env_config.python.split(".")
|
|
214
|
+
py_major = py_parts[0]
|
|
215
|
+
py_minor = py_parts[1] if len(py_parts) > 1 else "0"
|
|
216
|
+
vars_dict["py_version"] = env_config.python
|
|
217
|
+
vars_dict["py_short"] = f"{py_major}{py_minor}"
|
|
218
|
+
vars_dict["py_minor"] = py_minor
|
|
219
|
+
vars_dict["py_tag"] = f"cp{py_major}{py_minor}"
|
|
220
|
+
|
|
221
|
+
return vars_dict
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
def _resolve_cuda_wheel_url(
|
|
225
|
+
req: str,
|
|
226
|
+
vars_dict: dict,
|
|
227
|
+
log: Callable[[str], None] = print,
|
|
228
|
+
) -> Optional[str]:
|
|
229
|
+
"""
|
|
230
|
+
Resolve a CUDA package requirement to a wheel URL.
|
|
231
|
+
|
|
232
|
+
Args:
|
|
233
|
+
req: Package requirement (e.g., "cumesh" or "cumesh==0.0.1")
|
|
234
|
+
vars_dict: Variable dict for URL template substitution
|
|
235
|
+
log: Logging callback
|
|
236
|
+
|
|
237
|
+
Returns:
|
|
238
|
+
Resolved wheel URL, or None if package not in registry.
|
|
239
|
+
"""
|
|
240
|
+
from .registry import PACKAGE_REGISTRY
|
|
241
|
+
|
|
242
|
+
# Parse requirement (e.g., "cumesh" or "cumesh==0.0.1")
|
|
243
|
+
if "==" in req:
|
|
244
|
+
pkg_name, version = req.split("==", 1)
|
|
245
|
+
else:
|
|
246
|
+
pkg_name = req
|
|
247
|
+
version = None
|
|
248
|
+
|
|
249
|
+
pkg_lower = pkg_name.lower()
|
|
250
|
+
if pkg_lower not in PACKAGE_REGISTRY:
|
|
251
|
+
log(f" Warning: CUDA package {pkg_name} not in registry")
|
|
252
|
+
return None
|
|
253
|
+
|
|
254
|
+
config = PACKAGE_REGISTRY[pkg_lower]
|
|
255
|
+
template = config.get("wheel_template")
|
|
256
|
+
if not template:
|
|
257
|
+
log(f" Warning: No wheel template for {pkg_name}")
|
|
258
|
+
return None
|
|
259
|
+
|
|
260
|
+
# Use version from requirement or default
|
|
261
|
+
v = version or config.get("default_version")
|
|
262
|
+
if v:
|
|
263
|
+
vars_dict = vars_dict.copy() # Don't mutate original
|
|
264
|
+
vars_dict["version"] = v
|
|
265
|
+
|
|
266
|
+
# Resolve URL template
|
|
267
|
+
url = template
|
|
268
|
+
for key, value in vars_dict.items():
|
|
269
|
+
if value:
|
|
270
|
+
url = url.replace(f"{{{key}}}", str(value))
|
|
271
|
+
|
|
272
|
+
return url
|
|
273
|
+
|
|
274
|
+
|
|
184
275
|
def create_pixi_toml(
|
|
185
276
|
env_config: IsolatedEnv,
|
|
186
277
|
node_dir: Path,
|
|
@@ -193,7 +284,11 @@ def create_pixi_toml(
|
|
|
193
284
|
- Project metadata
|
|
194
285
|
- Conda channels
|
|
195
286
|
- Conda dependencies
|
|
196
|
-
- PyPI dependencies (from requirements
|
|
287
|
+
- PyPI dependencies (from requirements)
|
|
288
|
+
|
|
289
|
+
Note: CUDA packages (no_deps_requirements) are NOT included in pixi.toml.
|
|
290
|
+
They are installed separately with pip --no-deps after pixi install
|
|
291
|
+
to avoid transitive dependency conflicts.
|
|
197
292
|
|
|
198
293
|
Args:
|
|
199
294
|
env_config: The isolated environment configuration.
|
|
@@ -225,13 +320,13 @@ def create_pixi_toml(
|
|
|
225
320
|
lines.append(f"channels = [{channels_str}]")
|
|
226
321
|
|
|
227
322
|
# Platforms
|
|
323
|
+
# Note: On macOS we always use osx-64 (x86_64) even on ARM64 Macs.
|
|
324
|
+
# This runs under Rosetta 2 but ensures compatibility with packages
|
|
325
|
+
# that only have x86_64 wheels (e.g., embreex for trimesh raytracing).
|
|
228
326
|
if sys.platform == "linux":
|
|
229
327
|
lines.append('platforms = ["linux-64"]')
|
|
230
328
|
elif sys.platform == "darwin":
|
|
231
|
-
|
|
232
|
-
lines.append('platforms = ["osx-arm64"]')
|
|
233
|
-
else:
|
|
234
|
-
lines.append('platforms = ["osx-64"]')
|
|
329
|
+
lines.append('platforms = ["osx-64"]')
|
|
235
330
|
elif sys.platform == "win32":
|
|
236
331
|
lines.append('platforms = ["win-64"]')
|
|
237
332
|
|
|
@@ -247,6 +342,7 @@ def create_pixi_toml(
|
|
|
247
342
|
# Dependencies section (conda packages)
|
|
248
343
|
lines.append("[dependencies]")
|
|
249
344
|
lines.append(f'python = "{env_config.python}.*"')
|
|
345
|
+
lines.append('pip = "*"') # Required for installing CUDA packages with --no-deps
|
|
250
346
|
|
|
251
347
|
# On Windows, use MKL BLAS to avoid OpenBLAS crashes (numpy blas_fpe_check issue)
|
|
252
348
|
if sys.platform == "win32":
|
|
@@ -312,67 +408,9 @@ def create_pixi_toml(
|
|
|
312
408
|
if env_config.requirements:
|
|
313
409
|
pypi_deps.extend(env_config.requirements)
|
|
314
410
|
|
|
315
|
-
#
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
# Use fixed CUDA 12.8 / PyTorch 2.8 for pixi environments (modern GPU default)
|
|
320
|
-
# This ensures wheels match what pixi will install, not what the host has
|
|
321
|
-
vars_dict = {
|
|
322
|
-
"cuda_version": "12.8",
|
|
323
|
-
"cuda_short": "128",
|
|
324
|
-
"cuda_short2": "128",
|
|
325
|
-
"cuda_major": "12",
|
|
326
|
-
"torch_version": "2.8.0",
|
|
327
|
-
"torch_short": "280",
|
|
328
|
-
"torch_mm": "28",
|
|
329
|
-
"torch_dotted_mm": "2.8",
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
# Platform detection
|
|
333
|
-
if sys.platform == "linux":
|
|
334
|
-
vars_dict["platform"] = "linux_x86_64"
|
|
335
|
-
elif sys.platform == "darwin":
|
|
336
|
-
vars_dict["platform"] = "macosx_arm64" if platform.machine() == "arm64" else "macosx_x86_64"
|
|
337
|
-
elif sys.platform == "win32":
|
|
338
|
-
vars_dict["platform"] = "win_amd64"
|
|
339
|
-
|
|
340
|
-
# Python version from pixi env config
|
|
341
|
-
if env_config.python:
|
|
342
|
-
py_parts = env_config.python.split(".")
|
|
343
|
-
py_major = py_parts[0]
|
|
344
|
-
py_minor = py_parts[1] if len(py_parts) > 1 else "0"
|
|
345
|
-
vars_dict["py_version"] = env_config.python
|
|
346
|
-
vars_dict["py_short"] = f"{py_major}{py_minor}"
|
|
347
|
-
vars_dict["py_minor"] = py_minor
|
|
348
|
-
vars_dict["py_tag"] = f"cp{py_major}{py_minor}"
|
|
349
|
-
|
|
350
|
-
for req in env_config.no_deps_requirements:
|
|
351
|
-
# Parse requirement (e.g., "cumesh" or "cumesh==0.0.1")
|
|
352
|
-
if "==" in req:
|
|
353
|
-
pkg_name, version = req.split("==", 1)
|
|
354
|
-
else:
|
|
355
|
-
pkg_name = req
|
|
356
|
-
version = None
|
|
357
|
-
|
|
358
|
-
pkg_lower = pkg_name.lower()
|
|
359
|
-
if pkg_lower in PACKAGE_REGISTRY:
|
|
360
|
-
config = PACKAGE_REGISTRY[pkg_lower]
|
|
361
|
-
template = config.get("wheel_template")
|
|
362
|
-
if template:
|
|
363
|
-
# Use version from requirement or default
|
|
364
|
-
v = version or config.get("default_version")
|
|
365
|
-
if v:
|
|
366
|
-
vars_dict["version"] = v
|
|
367
|
-
|
|
368
|
-
# Resolve URL
|
|
369
|
-
url = template
|
|
370
|
-
for key, value in vars_dict.items():
|
|
371
|
-
if value:
|
|
372
|
-
url = url.replace(f"{{{key}}}", str(value))
|
|
373
|
-
|
|
374
|
-
special_deps[pkg_name] = f'{{ url = "{url}" }}'
|
|
375
|
-
log(f" CUDA package {pkg_name}: resolved wheel URL")
|
|
411
|
+
# NOTE: CUDA packages (no_deps_requirements) are NOT added to pixi.toml.
|
|
412
|
+
# They are installed separately with pip --no-deps after pixi install
|
|
413
|
+
# to avoid transitive dependency conflicts. See pixi_install().
|
|
376
414
|
|
|
377
415
|
# Add platform-specific requirements
|
|
378
416
|
if sys.platform == "linux" and env_config.linux_requirements:
|
|
@@ -557,6 +595,36 @@ def pixi_install(
|
|
|
557
595
|
|
|
558
596
|
log("pixi install completed successfully!")
|
|
559
597
|
|
|
598
|
+
# Phase 2: Install CUDA packages with pip --no-deps
|
|
599
|
+
# These are kept out of pixi.toml to avoid transitive dependency conflicts
|
|
600
|
+
# Skip on macOS - CUDA is not supported
|
|
601
|
+
if env_config.no_deps_requirements:
|
|
602
|
+
if sys.platform == "darwin":
|
|
603
|
+
log("Skipping CUDA packages (not supported on macOS)")
|
|
604
|
+
else:
|
|
605
|
+
log("Installing CUDA packages with --no-deps...")
|
|
606
|
+
python_path = get_pixi_python(node_dir)
|
|
607
|
+
if not python_path:
|
|
608
|
+
raise RuntimeError("Failed to find Python in pixi environment")
|
|
609
|
+
|
|
610
|
+
vars_dict = _build_cuda_vars(env_config)
|
|
611
|
+
|
|
612
|
+
for req in env_config.no_deps_requirements:
|
|
613
|
+
url = _resolve_cuda_wheel_url(req, vars_dict, log)
|
|
614
|
+
if url:
|
|
615
|
+
log(f" Installing {req} (--no-deps)...")
|
|
616
|
+
result = subprocess.run(
|
|
617
|
+
[str(python_path), "-m", "pip", "install", "--no-deps", url],
|
|
618
|
+
capture_output=True,
|
|
619
|
+
text=True,
|
|
620
|
+
)
|
|
621
|
+
if result.returncode != 0:
|
|
622
|
+
log(f" Failed to install {req}:")
|
|
623
|
+
log(result.stderr)
|
|
624
|
+
raise RuntimeError(f"Failed to install {req} with --no-deps: {result.stderr}")
|
|
625
|
+
else:
|
|
626
|
+
log(f" Warning: Could not resolve wheel URL for {req}, skipping")
|
|
627
|
+
|
|
560
628
|
# Create _env_{name} link for compatibility with uv backend
|
|
561
629
|
# This ensures code that expects _env_envname/bin/python works with pixi
|
|
562
630
|
symlink_path = node_dir / f"_env_{env_config.name}"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|