mirror of
https://github.com/Comfy-Org/ComfyUI.git
synced 2026-08-25 18:32:35 +08:00
fix(assets): don't hit uninitialized database from /view hash resolution
With --disable-assets (or after a database init failure) init_db() never runs and Session stays None, but /view?filename=blake3:<hash> still called resolve_hash_to_path(), raising TypeError and returning a 500. Workflows saved while assets were enabled trigger this on preview render in disabled mode. Gate the hash branch on live assets availability and return 404, which also fixes the pre-existing 500 on the degraded path. Also copy output_ui in the disabled enrichment fast path so the 'returns a new dict' contract holds in both modes.
This commit is contained in:
@@ -13,7 +13,7 @@ def enrich_output_with_assets(output_ui: dict) -> dict:
|
||||
"""
|
||||
from comfy.cli_args import args
|
||||
if args.disable_assets:
|
||||
return output_ui
|
||||
return dict(output_ui)
|
||||
|
||||
import folder_paths
|
||||
from app.assets.services.ingest import register_file_in_place, DependencyMissingError
|
||||
|
||||
Reference in New Issue
Block a user