Hermes Bot commited on
Commit ·
68fa46a
1
Parent(s): 55e1756
Remove stray plus signs from CUDA stubs
Browse files- comfy_integration/setup.py +12 -12
comfy_integration/setup.py
CHANGED
|
@@ -86,18 +86,18 @@ def initialize_comfyui():
|
|
| 86 |
# Ensure torch treats CUDA as unavailable on CPU‑only environment.
|
| 87 |
import torch
|
| 88 |
torch.cuda.is_available = lambda: False
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
|
| 102 |
|
| 103 |
# Apply patch to the external ComfyUI model_management before import.
|
|
|
|
| 86 |
# Ensure torch treats CUDA as unavailable on CPU‑only environment.
|
| 87 |
import torch
|
| 88 |
torch.cuda.is_available = lambda: False
|
| 89 |
+
# Additional CUDA stubs to prevent calls like torch.cuda.get_device_properties
|
| 90 |
+
class _DummyDeviceProps:
|
| 91 |
+
def __init__(self):
|
| 92 |
+
self.major = 0
|
| 93 |
+
self.minor = 0
|
| 94 |
+
self.total_memory = 0
|
| 95 |
+
def _dummy_get_device_properties(device):
|
| 96 |
+
return _DummyDeviceProps()
|
| 97 |
+
torch.cuda.get_device_properties = _dummy_get_device_properties
|
| 98 |
+
torch.cuda.device_count = lambda: 0
|
| 99 |
+
torch.cuda.current_device = lambda: 0
|
| 100 |
+
torch.cuda.get_device_name = lambda device: "cpu"
|
| 101 |
|
| 102 |
|
| 103 |
# Apply patch to the external ComfyUI model_management before import.
|