mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-20 03:13:30 +00:00
Allow running with non working
This commit is contained in:
parent
7bf381bc9e
commit
fde9fdddff
@ -111,6 +111,8 @@ def init_db():
|
|||||||
|
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
|
def can_create_session():
|
||||||
|
return Session is not None
|
||||||
|
|
||||||
def create_session():
|
def create_session():
|
||||||
return Session()
|
return Session()
|
||||||
|
7
main.py
7
main.py
@ -138,7 +138,7 @@ import server
|
|||||||
from server import BinaryEventTypes
|
from server import BinaryEventTypes
|
||||||
import nodes
|
import nodes
|
||||||
import comfy.model_management
|
import comfy.model_management
|
||||||
from app.database.db import init_db
|
from app.database.db import can_create_session, init_db
|
||||||
from app.model_processor import model_processor
|
from app.model_processor import model_processor
|
||||||
|
|
||||||
def cuda_malloc_warning():
|
def cuda_malloc_warning():
|
||||||
@ -264,7 +264,11 @@ def start_comfyui(asyncio_loop=None):
|
|||||||
|
|
||||||
cuda_malloc_warning()
|
cuda_malloc_warning()
|
||||||
|
|
||||||
|
try:
|
||||||
init_db()
|
init_db()
|
||||||
|
except Exception as e:
|
||||||
|
logging.error(f"Failed to initialize database. Please report this error as in future the database will be required: {e}")
|
||||||
|
|
||||||
prompt_server.add_routes()
|
prompt_server.add_routes()
|
||||||
hijack_progress(prompt_server)
|
hijack_progress(prompt_server)
|
||||||
|
|
||||||
@ -274,6 +278,7 @@ def start_comfyui(asyncio_loop=None):
|
|||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
# Scan for changed model files and update db
|
# Scan for changed model files and update db
|
||||||
|
if can_create_session():
|
||||||
model_processor.run()
|
model_processor.run()
|
||||||
|
|
||||||
os.makedirs(folder_paths.get_temp_directory(), exist_ok=True)
|
os.makedirs(folder_paths.get_temp_directory(), exist_ok=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user