1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 15:04:50 +08:00

Add support for sqlite database (#8444)

* Add support for sqlite database

* fix
This commit is contained in:
pythongosssss
2025-06-11 21:43:39 +01:00
committed by GitHub
parent 9685d4f3c3
commit 50c605e957
11 changed files with 345 additions and 13 deletions

10
main.py
View File

@@ -238,6 +238,15 @@ def cleanup_temp():
shutil.rmtree(temp_dir, ignore_errors=True)
def setup_database():
try:
from app.database.db import init_db, dependencies_available
if dependencies_available():
init_db()
except Exception as e:
logging.error(f"Failed to initialize database. Please ensure you have installed the latest requirements. If the error persists, please report this as in future the database will be required: {e}")
def start_comfyui(asyncio_loop=None):
"""
Starts the ComfyUI server using the provided asyncio event loop or creates a new one.
@@ -266,6 +275,7 @@ def start_comfyui(asyncio_loop=None):
hook_breaker_ac10a0.restore_functions()
cuda_malloc_warning()
setup_database()
prompt_server.add_routes()
hijack_progress(prompt_server)