mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-11 02:15:17 +00:00
Merge 1f6ab7dbfb
into 2ff3104f70
This commit is contained in:
commit
acf81c0c9d
8
main.py
8
main.py
@ -166,6 +166,14 @@ def prompt_worker(q, server_instance):
|
|||||||
queue_item = q.get(timeout=timeout)
|
queue_item = q.get(timeout=timeout)
|
||||||
if queue_item is not None:
|
if queue_item is not None:
|
||||||
item, item_id = queue_item
|
item, item_id = queue_item
|
||||||
|
|
||||||
|
if item[3].get("unload_models"):
|
||||||
|
# For those cases where the flag is set, to clear memory before execution
|
||||||
|
comfy.model_management.unload_all_models()
|
||||||
|
gc.collect()
|
||||||
|
comfy.model_management.soft_empty_cache()
|
||||||
|
last_gc_collect = time.perf_counter()
|
||||||
|
|
||||||
execution_start_time = time.perf_counter()
|
execution_start_time = time.perf_counter()
|
||||||
prompt_id = item[1]
|
prompt_id = item[1]
|
||||||
server_instance.last_prompt_id = prompt_id
|
server_instance.last_prompt_id = prompt_id
|
||||||
|
Loading…
Reference in New Issue
Block a user