-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboilerplate.py
33 lines (28 loc) · 1 KB
/
boilerplate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
# boilerplate generated by the comfy python extension
def find_path(name: str, path: str = None) -> str:
if path is None:
path = os.getcwd()
if name in os.listdir(path):
path_name = os.path.join(path, name)
return path_name
parent_directory = os.path.dirname(path)
if parent_directory == path:
return None
return find_path(name, parent_directory)
def add_extra_model_paths() -> None:
from main import load_extra_path_config
extra_model_paths = find_path("extra_model_paths.yaml")
if extra_model_paths is not None:
load_extra_path_config(extra_model_paths)
def import_custom_and_start() -> None:
import asyncio
import execution
import server
# FIXME - this was using the wrong name
from nodes import init_custom_nodes as init_extra_nodes
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
server_instance = server.PromptServer(loop)
execution.PromptQueue(server_instance)
init_extra_nodes()