This repository has been archived on 2026-10-21. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
imagelab_v3_extension/__init__.py
T

37 lines
1.2 KiB
Python

from server import PromptServer
from .progress import patched_send_sync
from .routes import SetupRoutes
from .workflows import *
from . import resources
# Apply the send_sync patch
PromptServer.instance.send_sync = patched_send_sync
print("[ImageLab] progress patch applied successfully")
# Register API routes
SetupRoutes(PromptServer.instance)
print("[ImageLab] routes registered successfully")
# Optional: Index all new models at startup (set to True to enable)
AUTO_INDEX_ON_STARTUP = True
if AUTO_INDEX_ON_STARTUP:
import threading
def index_on_startup():
print("[ImageLab] Starting background indexing of new models...")
try:
indexed = resources.index_all_new_models()
if indexed:
print(f"[ImageLab] Indexed models: {indexed}")
else:
print("[ImageLab] No new models to index")
except Exception as e:
print(f"[ImageLab] Error during startup indexing: {e}")
# Run in background thread to not block startup
threading.Thread(target=index_on_startup, daemon=True).start()
print("[ImageLab] Initialization complete")
NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}