diff --git a/__init__.py b/__init__.py index 0bbbcfa..05089de 100644 --- a/__init__.py +++ b/__init__.py @@ -31,5 +31,24 @@ def setup_api(): 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()