ComfyUI/app/assets/services
Luke Mino-Altherr b1ebcd0ca3
Some checks are pending
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Build package / Build Test (3.10) (push) Waiting to run
Build package / Build Test (3.11) (push) Waiting to run
Build package / Build Test (3.12) (push) Waiting to run
Build package / Build Test (3.13) (push) Waiting to run
Build package / Build Test (3.14) (push) Waiting to run
feat(assets): register output files as assets after prompt execution
Add ingest_existing_file() to services/ingest.py as a public wrapper for
registering on-disk files (stat, BLAKE3 hash, MIME detection, path-based
tag derivation).

After each prompt execution in the main loop, iterate
history_result['outputs'] and register files with type 'output' as
assets. Runs while the asset seeder is paused, gated behind
asset_seeder.is_disabled(). Populates job_id on the asset_references
table for provenance tracking.

Ingest uses a two-phase approach: insert a stub record (hash=NULL) first
for instant visibility, then defer hashing to the background seeder
enrich phase to avoid blocking the prompt worker thread.

When multiple enrich scans are enqueued while the seeder is busy, roots
are now unioned and compute_hashes uses sticky-true (OR) logic so no
queued work is silently dropped.

Extract _reset_to_idle helper in the asset seeder to deduplicate the
state reset pattern shared by _run_scan and mark_missing_outside_prefixes.

Separate history parsing from output file registration: move generic
file registration logic into register_output_files() in
app/assets/services/ingest.py, keeping only the ComfyUI history format
parsing (_collect_output_absolute_paths) in main.py.

Amp-Thread-ID: https://ampcode.com/threads/T-019cf842-5199-71f0-941d-b420b5cf4d57
Co-authored-by: Amp <amp@ampcode.com>
2026-03-16 18:13:25 -04:00
..
__init__.py feat(assets): register output files as assets after prompt execution 2026-03-16 18:13:25 -04:00
asset_management.py feat(assets): align local API with cloud spec (#12863) 2026-03-16 12:34:04 -07:00
bulk_ingest.py feat(assets): register output files as assets after prompt execution 2026-03-16 18:13:25 -04:00
file_utils.py refactor(assets): modular architecture + async two-phase scanner & background seeder (#12621) 2026-03-07 20:37:25 -05:00
hashing.py Import assets seeder later, print some package versions. (#12841) 2026-03-08 16:25:30 -04:00
ingest.py feat(assets): register output files as assets after prompt execution 2026-03-16 18:13:25 -04:00
metadata_extract.py refactor(assets): modular architecture + async two-phase scanner & background seeder (#12621) 2026-03-07 20:37:25 -05:00
path_utils.py refactor(assets): modular architecture + async two-phase scanner & background seeder (#12621) 2026-03-07 20:37:25 -05:00
schemas.py feat(assets): align local API with cloud spec (#12863) 2026-03-16 12:34:04 -07:00
tagging.py feat(assets): align local API with cloud spec (#12863) 2026-03-16 12:34:04 -07:00