Spaces:
Running on Zero
Running on Zero
Commit ·
bd4fb2d
1
Parent(s): 0bc6d3a
Fix Comfy utils import resolution
Browse files
app.py
CHANGED
|
@@ -236,8 +236,12 @@ def _init_comfy_nodes() -> None:
|
|
| 236 |
if _nodes_ready:
|
| 237 |
return
|
| 238 |
|
| 239 |
-
|
| 240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
os.chdir(COMFY)
|
| 242 |
|
| 243 |
import execution
|
|
|
|
| 236 |
if _nodes_ready:
|
| 237 |
return
|
| 238 |
|
| 239 |
+
comfy_path = str(COMFY)
|
| 240 |
+
sys.path = [p for p in sys.path if p != comfy_path]
|
| 241 |
+
sys.path.insert(0, comfy_path)
|
| 242 |
+
for module_name in list(sys.modules):
|
| 243 |
+
if module_name == "utils" or module_name.startswith("utils."):
|
| 244 |
+
del sys.modules[module_name]
|
| 245 |
os.chdir(COMFY)
|
| 246 |
|
| 247 |
import execution
|