Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,8 +37,8 @@ def find_path(name: str, path: str = None) -> str:
|
|
| 37 |
def add_comfyui_directory_to_sys_path() -> None:
|
| 38 |
comfyui_path = find_path("ComfyUI")
|
| 39 |
if comfyui_path is not None and os.path.isdir(comfyui_path):
|
| 40 |
-
sys.path.
|
| 41 |
-
print(f"'{comfyui_path}'
|
| 42 |
|
| 43 |
def add_extra_model_paths() -> None:
|
| 44 |
try:
|
|
@@ -55,13 +55,13 @@ def add_extra_model_paths() -> None:
|
|
| 55 |
def import_custom_nodes() -> None:
|
| 56 |
import asyncio
|
| 57 |
import execution
|
| 58 |
-
from nodes import
|
| 59 |
import server
|
| 60 |
loop = asyncio.new_event_loop()
|
| 61 |
asyncio.set_event_loop(loop)
|
| 62 |
server_instance = server.PromptServer(loop)
|
| 63 |
execution.PromptQueue(server_instance)
|
| 64 |
-
|
| 65 |
|
| 66 |
# Setup ComfyUI and custom nodes
|
| 67 |
if not os.path.exists("ComfyUI"):
|
|
@@ -106,7 +106,7 @@ if not os.path.exists(esrgan_x4_path):
|
|
| 106 |
add_comfyui_directory_to_sys_path()
|
| 107 |
add_extra_model_paths()
|
| 108 |
from folder_paths import add_model_folder_path
|
| 109 |
-
add_model_folder_path("unet", "ComfyUI/models/diffusion_models")
|
| 110 |
import_custom_nodes()
|
| 111 |
|
| 112 |
from nodes import NODE_CLASS_MAPPINGS
|
|
|
|
| 37 |
def add_comfyui_directory_to_sys_path() -> None:
|
| 38 |
comfyui_path = find_path("ComfyUI")
|
| 39 |
if comfyui_path is not None and os.path.isdir(comfyui_path):
|
| 40 |
+
sys.path.insert(0, comfyui_path)
|
| 41 |
+
print(f"'{comfyui_path}' inserted to sys.path")
|
| 42 |
|
| 43 |
def add_extra_model_paths() -> None:
|
| 44 |
try:
|
|
|
|
| 55 |
def import_custom_nodes() -> None:
|
| 56 |
import asyncio
|
| 57 |
import execution
|
| 58 |
+
from nodes import init_custom_nodes
|
| 59 |
import server
|
| 60 |
loop = asyncio.new_event_loop()
|
| 61 |
asyncio.set_event_loop(loop)
|
| 62 |
server_instance = server.PromptServer(loop)
|
| 63 |
execution.PromptQueue(server_instance)
|
| 64 |
+
init_custom_nodes()
|
| 65 |
|
| 66 |
# Setup ComfyUI and custom nodes
|
| 67 |
if not os.path.exists("ComfyUI"):
|
|
|
|
| 106 |
add_comfyui_directory_to_sys_path()
|
| 107 |
add_extra_model_paths()
|
| 108 |
from folder_paths import add_model_folder_path
|
| 109 |
+
add_model_folder_path("unet", find_path("ComfyUI/models/diffusion_models"))
|
| 110 |
import_custom_nodes()
|
| 111 |
|
| 112 |
from nodes import NODE_CLASS_MAPPINGS
|