comfy-env 0.0.39__py3-none-any.whl → 0.0.40__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/stubs/comfy/__init__.py +6 -0
- comfy_env/stubs/comfy/model_management.py +58 -0
- comfy_env/stubs/comfy/utils.py +29 -0
- {comfy_env-0.0.39.dist-info → comfy_env-0.0.40.dist-info}/METADATA +1 -1
- {comfy_env-0.0.39.dist-info → comfy_env-0.0.40.dist-info}/RECORD +8 -5
- {comfy_env-0.0.39.dist-info → comfy_env-0.0.40.dist-info}/WHEEL +0 -0
- {comfy_env-0.0.39.dist-info → comfy_env-0.0.40.dist-info}/entry_points.txt +0 -0
- {comfy_env-0.0.39.dist-info → comfy_env-0.0.40.dist-info}/licenses/LICENSE +0 -0
|
@@ -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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: comfy-env
|
|
3
|
-
Version: 0.0.
|
|
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
|
|
@@ -28,6 +28,9 @@ comfy_env/ipc/transport.py,sha256=XQlRcfQsd4nd909KIYnZKvsS3ksGpGjyVucn8jvmLIU,96
|
|
|
28
28
|
comfy_env/ipc/worker.py,sha256=oxTLF9xXrl8CRx_JVNBdkxZh35NuzfkdxhaUtUuXogs,6661
|
|
29
29
|
comfy_env/stubs/__init__.py,sha256=jMeWEKY30y8QqYX9AUyuZbmm607erQTc4N7YaDoAH00,38
|
|
30
30
|
comfy_env/stubs/folder_paths.py,sha256=K90J34EG6LD4eZP8YG-xMeBmqwpp_wA8E92DKMXd1GQ,2189
|
|
31
|
+
comfy_env/stubs/comfy/__init__.py,sha256=-y4L6gX21vrI2V8MvNaMeHOcAn5kUNK3jUyLvtXRmJQ,173
|
|
32
|
+
comfy_env/stubs/comfy/model_management.py,sha256=Khx8Qa3NutKPLTn9oSM3VLeATUOg1fe4QCjxdxXd6eE,1462
|
|
33
|
+
comfy_env/stubs/comfy/utils.py,sha256=s3t_KLj_-w1Uj3A3iAy69wIk4Ggklojw5hsDNb69Pcc,776
|
|
31
34
|
comfy_env/workers/__init__.py,sha256=IKZwOvrWOGqBLDUIFAalg4CdqzJ_YnAdxo2Ha7gZTJ0,1467
|
|
32
35
|
comfy_env/workers/base.py,sha256=ZILYXlvGCWuCZXmjKqfG8VeD19ihdYaASdlbasl2BMo,2312
|
|
33
36
|
comfy_env/workers/pool.py,sha256=MtjeOWfvHSCockq8j1gfnxIl-t01GSB79T5N4YB82Lg,6956
|
|
@@ -35,8 +38,8 @@ comfy_env/workers/tensor_utils.py,sha256=TCuOAjJymrSbkgfyvcKtQ_KbVWTqSwP9VH_bCaF
|
|
|
35
38
|
comfy_env/workers/torch_mp.py,sha256=4YSNPn7hALrvMVbkO4RkTeFTcc0lhfLMk5QTWjY4PHw,22134
|
|
36
39
|
comfy_env/workers/venv.py,sha256=PmsVOu5i89tBYkGRupo2bjOLPBmk06q4GNUwDWsd9F8,32088
|
|
37
40
|
comfy_env/wheel_sources.yml,sha256=IEyi3JnySo4sXTRkYR0VjtCdXaCsF5Q5c0nU0S9LC8I,9143
|
|
38
|
-
comfy_env-0.0.
|
|
39
|
-
comfy_env-0.0.
|
|
40
|
-
comfy_env-0.0.
|
|
41
|
-
comfy_env-0.0.
|
|
42
|
-
comfy_env-0.0.
|
|
41
|
+
comfy_env-0.0.40.dist-info/METADATA,sha256=eJYprZ_ULUXc7vWu10nqRaMntOuerWRSJpBYf4zXUwc,5400
|
|
42
|
+
comfy_env-0.0.40.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
43
|
+
comfy_env-0.0.40.dist-info/entry_points.txt,sha256=J4fXeqgxU_YenuW_Zxn_pEL7J-3R0--b6MS5t0QmAr0,49
|
|
44
|
+
comfy_env-0.0.40.dist-info/licenses/LICENSE,sha256=E68QZMMpW4P2YKstTZ3QU54HRQO8ecew09XZ4_Vn870,1093
|
|
45
|
+
comfy_env-0.0.40.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|