comfy-env 0.0.26__tar.gz → 0.0.28__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.
Files changed (43) hide show
  1. {comfy_env-0.0.26 → comfy_env-0.0.28}/PKG-INFO +1 -1
  2. {comfy_env-0.0.26 → comfy_env-0.0.28}/pyproject.toml +1 -1
  3. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/install.py +75 -10
  4. {comfy_env-0.0.26 → comfy_env-0.0.28}/.github/workflows/publish.yml +0 -0
  5. {comfy_env-0.0.26 → comfy_env-0.0.28}/.gitignore +0 -0
  6. {comfy_env-0.0.26 → comfy_env-0.0.28}/LICENSE +0 -0
  7. {comfy_env-0.0.26 → comfy_env-0.0.28}/README.md +0 -0
  8. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/__init__.py +0 -0
  9. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/cli.py +0 -0
  10. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/decorator.py +0 -0
  11. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/env/__init__.py +0 -0
  12. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/env/config.py +0 -0
  13. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/env/config_file.py +0 -0
  14. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/env/cuda_gpu_detection.py +0 -0
  15. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/env/manager.py +0 -0
  16. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/env/platform/__init__.py +0 -0
  17. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/env/platform/base.py +0 -0
  18. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/env/platform/darwin.py +0 -0
  19. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/env/platform/linux.py +0 -0
  20. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/env/platform/windows.py +0 -0
  21. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/env/security.py +0 -0
  22. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/errors.py +0 -0
  23. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/ipc/__init__.py +0 -0
  24. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/ipc/bridge.py +0 -0
  25. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/ipc/protocol.py +0 -0
  26. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/ipc/tensor.py +0 -0
  27. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/ipc/torch_bridge.py +0 -0
  28. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/ipc/transport.py +0 -0
  29. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/ipc/worker.py +0 -0
  30. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/nodes.py +0 -0
  31. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/pixi.py +0 -0
  32. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/registry.py +0 -0
  33. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/resolver.py +0 -0
  34. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/stubs/__init__.py +0 -0
  35. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/stubs/folder_paths.py +0 -0
  36. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/wheel_sources.yml +0 -0
  37. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/workers/__init__.py +0 -0
  38. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/workers/base.py +0 -0
  39. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/workers/pool.py +0 -0
  40. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/workers/tensor_utils.py +0 -0
  41. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/workers/torch_mp.py +0 -0
  42. {comfy_env-0.0.26 → comfy_env-0.0.28}/src/comfy_env/workers/venv.py +0 -0
  43. {comfy_env-0.0.26 → comfy_env-0.0.28}/untitled.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: comfy-env
3
- Version: 0.0.26
3
+ Version: 0.0.28
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "comfy-env"
3
- version = "0.0.26"
3
+ version = "0.0.28"
4
4
  description = "Environment management for ComfyUI custom nodes - CUDA wheel resolution and process isolation"
5
5
  readme = "README.md"
6
6
  license = {text = "MIT"}
@@ -24,7 +24,7 @@ import sys
24
24
  from pathlib import Path
25
25
  from typing import Any, Callable, Dict, List, Optional, Set, Union
26
26
 
27
- from .env.config import IsolatedEnv, NodeReq, SystemConfig
27
+ from .env.config import IsolatedEnv, LocalConfig, NodeReq, SystemConfig
28
28
  from .env.config_file import load_config, discover_config
29
29
  from .env.manager import IsolatedEnvManager
30
30
  from .errors import CUDANotFoundError, DependencyError, InstallError, WheelNotFoundError
@@ -175,20 +175,23 @@ def _install_node_dependencies(
175
175
 
176
176
  def install(
177
177
  config: Optional[Union[str, Path]] = None,
178
- mode: str = "inplace",
179
178
  node_dir: Optional[Path] = None,
180
179
  log_callback: Optional[Callable[[str], None]] = None,
181
180
  dry_run: bool = False,
182
181
  verify_wheels: bool = False,
182
+ **kwargs, # Accept but ignore deprecated 'mode' parameter
183
183
  ) -> bool:
184
184
  """
185
185
  Install dependencies from a comfy-env.toml configuration.
186
186
 
187
187
  This is the main entry point for installing CUDA dependencies.
188
+ Mode is auto-detected from config:
189
+ - [envname] with python = "X.X" → isolated (creates separate venv)
190
+ - [envname] without python → inplace (installs into current env)
191
+ - [local.cuda] → local (installs into current env)
188
192
 
189
193
  Args:
190
194
  config: Path to config file. If None, auto-discovers in node_dir.
191
- mode: Installation mode - "inplace" (current env) or "isolated" (new venv).
192
195
  node_dir: Directory to search for config. Defaults to current directory.
193
196
  log_callback: Optional callback for logging. Defaults to print.
194
197
  dry_run: If True, show what would be installed without installing.
@@ -209,9 +212,6 @@ def install(
209
212
  # Explicit config file
210
213
  install(config="comfy-env.toml")
211
214
 
212
- # Isolated mode
213
- install(mode="isolated")
214
-
215
215
  # Dry run to see what would be installed
216
216
  install(dry_run=True)
217
217
  """
@@ -250,10 +250,18 @@ def install(
250
250
  log(f"Environment uses conda packages - using pixi backend")
251
251
  return pixi_install(env_config, node_dir, log, dry_run)
252
252
 
253
- if mode == "isolated" and env_config:
254
- return _install_isolated(env_config, node_dir, log, dry_run)
255
- elif env_config:
256
- return _install_inplace(env_config, node_dir, log, dry_run, verify_wheels)
253
+ # Auto-detect mode based on config:
254
+ # - env_config.python set isolated (creates separate venv)
255
+ # - env_config without python → inplace (installs into current env)
256
+ # - only [local.cuda] → local (installs into current env)
257
+ if env_config:
258
+ if env_config.python:
259
+ return _install_isolated(env_config, node_dir, log, dry_run)
260
+ else:
261
+ return _install_inplace(env_config, node_dir, log, dry_run, verify_wheels)
262
+ elif full_config.has_local:
263
+ # Handle [local.cuda] and [local.packages] without isolated env
264
+ return _install_local(full_config.local, node_dir, log, dry_run)
257
265
  else:
258
266
  return True
259
267
 
@@ -353,6 +361,63 @@ def _install_inplace(
353
361
  return True
354
362
 
355
363
 
364
+ def _install_local(
365
+ local_config: LocalConfig,
366
+ node_dir: Path,
367
+ log: Callable[[str], None],
368
+ dry_run: bool,
369
+ ) -> bool:
370
+ """Install local packages into current environment (no isolated venv)."""
371
+ log("Installing local packages into host environment")
372
+
373
+ # Install MSVC runtime on Windows (required for CUDA/PyTorch native extensions)
374
+ if sys.platform == "win32":
375
+ log("Installing MSVC runtime for Windows...")
376
+ if not dry_run:
377
+ _pip_install(["msvc-runtime"], no_deps=False, log=log)
378
+
379
+ # Detect runtime environment
380
+ env = RuntimeEnv.detect()
381
+ log(f"Detected environment: {env}")
382
+
383
+ # Check CUDA requirement
384
+ if not env.cuda_version and local_config.cuda_packages:
385
+ raise CUDANotFoundError(package=", ".join(local_config.cuda_packages.keys()))
386
+
387
+ # Convert cuda_packages dict to list of specs
388
+ cuda_packages = []
389
+ for pkg, ver in local_config.cuda_packages.items():
390
+ if ver:
391
+ cuda_packages.append(f"{pkg}=={ver}")
392
+ else:
393
+ cuda_packages.append(pkg)
394
+
395
+ if dry_run:
396
+ log("\nDry run - would install:")
397
+ for pkg in cuda_packages:
398
+ log(f" {pkg}")
399
+ if local_config.requirements:
400
+ log(" Regular packages:")
401
+ for pkg in local_config.requirements:
402
+ log(f" {pkg}")
403
+ return True
404
+
405
+ # Install CUDA packages
406
+ if cuda_packages:
407
+ log(f"\nInstalling {len(cuda_packages)} CUDA packages...")
408
+ for req in cuda_packages:
409
+ package, version = parse_wheel_requirement(req)
410
+ _install_cuda_package(package, version, env, [], log)
411
+
412
+ # Install regular packages
413
+ if local_config.requirements:
414
+ log(f"\nInstalling {len(local_config.requirements)} regular packages...")
415
+ _pip_install(local_config.requirements, no_deps=False, log=log)
416
+
417
+ log("\nLocal installation complete!")
418
+ return True
419
+
420
+
356
421
  def _get_install_info(
357
422
  package: str,
358
423
  version: Optional[str],
File without changes
File without changes
File without changes
File without changes