mirror of
https://github.com/Comfy-Org/ComfyUI.git
synced 2026-08-24 18:10:27 +08:00
Add model management and database
- use sqlalchemy + alembic + sqlite for db - extract model data and previews - endpoints for db interactions - add tests
This commit is contained in:
6
main.py
6
main.py
@@ -138,6 +138,8 @@ import server
|
||||
from server import BinaryEventTypes
|
||||
import nodes
|
||||
import comfy.model_management
|
||||
from app.database.db import init_db
|
||||
from app.model_processor import model_processor
|
||||
|
||||
def cuda_malloc_warning():
|
||||
device = comfy.model_management.get_torch_device()
|
||||
@@ -262,6 +264,7 @@ def start_comfyui(asyncio_loop=None):
|
||||
|
||||
cuda_malloc_warning()
|
||||
|
||||
init_db()
|
||||
prompt_server.add_routes()
|
||||
hijack_progress(prompt_server)
|
||||
|
||||
@@ -269,6 +272,9 @@ def start_comfyui(asyncio_loop=None):
|
||||
|
||||
if args.quick_test_for_ci:
|
||||
exit(0)
|
||||
|
||||
# Scan for changed model files and update db
|
||||
model_processor.run()
|
||||
|
||||
os.makedirs(folder_paths.get_temp_directory(), exist_ok=True)
|
||||
call_on_start = None
|
||||
|
||||
Reference in New Issue
Block a user