- Add enable_output_asset_scanning() to __init__.py - Calls seed_assets(["output"]) when extension loads - Output images now appear in Media Assets "Imported" tab - No manual ComfyUI patching required - works automatically Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
55 lines
1.5 KiB
Python
55 lines
1.5 KiB
Python
"""
|
|
ComfyUI-ModelSync: Model Auto-Update & Multi-GPU Sync
|
|
|
|
A custom node extension for ComfyUI that provides:
|
|
- Model version tracking for HuggingFace and CivitAI
|
|
- Automatic model updates with configurable scheduling
|
|
- Multi-GPU synchronization with VRAM-based filtering
|
|
- Metadata management with hash verification
|
|
|
|
Repository: https://github.com/benfinklea/ComfyUI-ModelSync
|
|
License: MIT
|
|
"""
|
|
|
|
__version__ = "0.1.0"
|
|
__author__ = "Ben Finklea"
|
|
|
|
# Node class mappings (empty - this extension provides API endpoints, not nodes)
|
|
NODE_CLASS_MAPPINGS = {}
|
|
NODE_DISPLAY_NAME_MAPPINGS = {}
|
|
|
|
# Web extension directory
|
|
WEB_DIRECTORY = "./js"
|
|
|
|
|
|
def setup_api():
|
|
"""Initialize the ModelSync API endpoints."""
|
|
try:
|
|
from .server import setup_routes
|
|
setup_routes()
|
|
except Exception as e:
|
|
print(f"[ModelSync] Failed to setup API routes: {e}")
|
|
|
|
|
|
def enable_output_asset_scanning():
|
|
"""
|
|
Enable scanning of output folder for Media Assets panel.
|
|
|
|
By default, ComfyUI only scans the models folder. This adds the output
|
|
folder so generated images appear in the Media Assets "Imported" tab.
|
|
"""
|
|
try:
|
|
from app.assets.scanner import seed_assets
|
|
seed_assets(["output"], enable_logging=False)
|
|
print("[ModelSync] Output folder asset scanning enabled")
|
|
except ImportError:
|
|
# Older ComfyUI version without assets system
|
|
pass
|
|
except Exception as e:
|
|
print(f"[ModelSync] Could not enable output asset scanning: {e}")
|
|
|
|
|
|
# Initialize when loaded by ComfyUI
|
|
setup_api()
|
|
enable_output_asset_scanning()
|