mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-22 17:43:33 +08:00
Register output files immediately per-prompt, defer enqueue_enrich to GC
Move register_output_files() out of the periodic GC branch so it runs right after each prompt completes, using the local e.history_result and prompt_id. This prevents stale/overwritten values when multiple prompts finish before GC triggers. Keep enqueue_enrich() in the GC path since it's heavier and benefits from batching via the 10-second interval. Amp-Thread-ID: https://ampcode.com/threads/T-019cfdf4-c52c-771c-a920-57bac15c68be Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
parent
e76689b80c
commit
f9c6076619
8
main.py
8
main.py
@ -318,6 +318,10 @@ def prompt_worker(q, server_instance):
|
||||
else:
|
||||
logging.info("Prompt executed in {:.2f} seconds".format(execution_time))
|
||||
|
||||
if not asset_seeder.is_disabled():
|
||||
paths = _collect_output_absolute_paths(e.history_result)
|
||||
register_output_files(paths, job_id=prompt_id)
|
||||
|
||||
flags = q.get_flags()
|
||||
free_memory = flags.get("free_memory", False)
|
||||
|
||||
@ -341,9 +345,7 @@ def prompt_worker(q, server_instance):
|
||||
hook_breaker_ac10a0.restore_functions()
|
||||
|
||||
if not asset_seeder.is_disabled():
|
||||
paths = _collect_output_absolute_paths(e.history_result)
|
||||
if register_output_files(paths, job_id=prompt_id) > 0:
|
||||
asset_seeder.enqueue_enrich(roots=("output",), compute_hashes=True)
|
||||
asset_seeder.enqueue_enrich(roots=("output",), compute_hashes=True)
|
||||
asset_seeder.resume()
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user