From 6c1ad0cc35d87f0e7ec1855e18bd4a0e12140865 Mon Sep 17 00:00:00 2001 From: Ben Finklea Date: Mon, 26 Jan 2026 15:34:11 -0600 Subject: [PATCH] Enable output folder asset scanning automatically - 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 --- __init__.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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()