comfy-env 0.0.38__tar.gz → 0.0.40__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 (47) hide show
  1. {comfy_env-0.0.38 → comfy_env-0.0.40}/PKG-INFO +1 -1
  2. {comfy_env-0.0.38 → comfy_env-0.0.40}/pyproject.toml +1 -1
  3. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/__init__.py +1 -1
  4. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/install.py +40 -0
  5. comfy_env-0.0.40/src/comfy_env/stubs/comfy/__init__.py +6 -0
  6. comfy_env-0.0.40/src/comfy_env/stubs/comfy/model_management.py +58 -0
  7. comfy_env-0.0.40/src/comfy_env/stubs/comfy/utils.py +29 -0
  8. {comfy_env-0.0.38 → comfy_env-0.0.40}/.github/workflows/publish.yml +0 -0
  9. {comfy_env-0.0.38 → comfy_env-0.0.40}/.gitignore +0 -0
  10. {comfy_env-0.0.38 → comfy_env-0.0.40}/LICENSE +0 -0
  11. {comfy_env-0.0.38 → comfy_env-0.0.40}/README.md +0 -0
  12. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/cli.py +0 -0
  13. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/decorator.py +0 -0
  14. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/env/__init__.py +0 -0
  15. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/env/config.py +0 -0
  16. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/env/config_file.py +0 -0
  17. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/env/cuda_gpu_detection.py +0 -0
  18. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/env/manager.py +0 -0
  19. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/env/platform/__init__.py +0 -0
  20. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/env/platform/base.py +0 -0
  21. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/env/platform/darwin.py +0 -0
  22. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/env/platform/linux.py +0 -0
  23. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/env/platform/windows.py +0 -0
  24. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/env/security.py +0 -0
  25. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/errors.py +0 -0
  26. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/index_resolver.py +0 -0
  27. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/ipc/__init__.py +0 -0
  28. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/ipc/bridge.py +0 -0
  29. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/ipc/protocol.py +0 -0
  30. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/ipc/tensor.py +0 -0
  31. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/ipc/torch_bridge.py +0 -0
  32. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/ipc/transport.py +0 -0
  33. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/ipc/worker.py +0 -0
  34. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/nodes.py +0 -0
  35. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/pixi.py +0 -0
  36. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/registry.py +0 -0
  37. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/resolver.py +0 -0
  38. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/stubs/__init__.py +0 -0
  39. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/stubs/folder_paths.py +0 -0
  40. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/wheel_sources.yml +0 -0
  41. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/workers/__init__.py +0 -0
  42. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/workers/base.py +0 -0
  43. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/workers/pool.py +0 -0
  44. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/workers/tensor_utils.py +0 -0
  45. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/workers/torch_mp.py +0 -0
  46. {comfy_env-0.0.38 → comfy_env-0.0.40}/src/comfy_env/workers/venv.py +0 -0
  47. {comfy_env-0.0.38 → comfy_env-0.0.40}/untitled.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: comfy-env
3
- Version: 0.0.38
3
+ Version: 0.0.40
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.38"
3
+ version = "0.0.40"
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"}
@@ -31,7 +31,7 @@ from .ipc.worker import BaseWorker, register
31
31
  from .decorator import isolated, shutdown_all_processes
32
32
 
33
33
  # New in-place installation API
34
- from .install import install, verify_installation
34
+ from .install import install, verify_installation, setup
35
35
  from .resolver import RuntimeEnv, WheelResolver
36
36
 
37
37
  # Pixi integration (for conda packages)
@@ -18,6 +18,7 @@ Example:
18
18
  install(config="comfy-env.toml", mode="isolated")
19
19
  """
20
20
 
21
+ import inspect
21
22
  import shutil
22
23
  import subprocess
23
24
  import sys
@@ -828,3 +829,42 @@ def verify_installation(
828
829
  all_ok = False
829
830
 
830
831
  return all_ok
832
+
833
+
834
+ def setup(
835
+ log_callback: Optional[Callable[[str], None]] = None,
836
+ dry_run: bool = False,
837
+ ) -> bool:
838
+ """
839
+ One-liner setup that auto-discovers config from caller's directory.
840
+
841
+ This is the simplest way to install dependencies - just call setup()
842
+ from your install.py and it will find the comfy-env.toml in the same
843
+ directory as the calling script.
844
+
845
+ Example:
846
+ # install.py (entire file)
847
+ from comfy_env import setup
848
+ setup()
849
+
850
+ Args:
851
+ log_callback: Optional callback for logging. Defaults to print.
852
+ dry_run: If True, show what would be installed without installing.
853
+
854
+ Returns:
855
+ True if installation succeeded.
856
+
857
+ Raises:
858
+ FileNotFoundError: If no config file found.
859
+ InstallError: If installation fails.
860
+ """
861
+ # Get the caller's directory by inspecting the stack
862
+ frame = inspect.stack()[1]
863
+ caller_file = frame.filename
864
+ caller_dir = Path(caller_file).parent.resolve()
865
+
866
+ return install(
867
+ node_dir=caller_dir,
868
+ log_callback=log_callback,
869
+ dry_run=dry_run,
870
+ )
@@ -0,0 +1,6 @@
1
+ """
2
+ Comfy stubs package for isolated worker processes.
3
+
4
+ Provides minimal implementations of commonly used comfy modules
5
+ without requiring the full ComfyUI installation.
6
+ """
@@ -0,0 +1,58 @@
1
+ """
2
+ Stub for comfy.model_management in isolated worker processes.
3
+
4
+ Provides device detection and memory management functions without
5
+ requiring the full ComfyUI installation.
6
+ """
7
+
8
+ import torch
9
+
10
+
11
+ def get_torch_device():
12
+ """Return the best available torch device."""
13
+ if torch.cuda.is_available():
14
+ return torch.device("cuda")
15
+ elif hasattr(torch.backends, "mps") and torch.backends.mps.is_available():
16
+ return torch.device("mps")
17
+ return torch.device("cpu")
18
+
19
+
20
+ def get_free_memory(device=None, torch_free_too=False):
21
+ """Return free VRAM in bytes."""
22
+ if device is None:
23
+ device = get_torch_device()
24
+ if device.type == "cuda":
25
+ free, total = torch.cuda.mem_get_info(device)
26
+ return free
27
+ return 0
28
+
29
+
30
+ def get_total_memory(device=None, torch_total_too=False):
31
+ """Return total VRAM in bytes."""
32
+ if device is None:
33
+ device = get_torch_device()
34
+ if device.type == "cuda":
35
+ free, total = torch.cuda.mem_get_info(device)
36
+ return total
37
+ return 0
38
+
39
+
40
+ def soft_empty_cache(force=False):
41
+ """Clear CUDA cache."""
42
+ if torch.cuda.is_available():
43
+ torch.cuda.empty_cache()
44
+
45
+
46
+ def unload_all_models():
47
+ """No-op in isolated worker - models managed by the node itself."""
48
+ pass
49
+
50
+
51
+ def interrupt_current_processing(value=True):
52
+ """No-op in isolated worker."""
53
+ pass
54
+
55
+
56
+ def processing_interrupted():
57
+ """Always returns False in isolated worker."""
58
+ return False
@@ -0,0 +1,29 @@
1
+ """
2
+ Stub for comfy.utils in isolated worker processes.
3
+
4
+ Provides utility classes like ProgressBar without requiring
5
+ the full ComfyUI installation.
6
+ """
7
+
8
+
9
+ class ProgressBar:
10
+ """
11
+ No-op progress bar for isolated workers.
12
+
13
+ In isolated subprocess, we can't update the main ComfyUI progress bar,
14
+ so this just tracks progress internally. Nodes can still use the same API.
15
+ """
16
+
17
+ def __init__(self, total):
18
+ self.total = total
19
+ self.current = 0
20
+
21
+ def update(self, value):
22
+ """Increment progress by value."""
23
+ self.current += value
24
+
25
+ def update_absolute(self, value, total=None, preview=None):
26
+ """Set progress to absolute value."""
27
+ self.current = value
28
+ if total is not None:
29
+ self.total = total
File without changes
File without changes
File without changes
File without changes