93 lines
5.1 KiB
Plaintext
93 lines
5.1 KiB
Plaintext
--- 0.21.1:execute
|
|
+++ 8010:execute
|
|
@@ -1,4 +1,4 @@
|
|
-async def execute(server, dynprompt, caches, current_item, extra_data, executed, prompt_id, execution_list, pending_subgraph_results, pending_async_nodes, ui_outputs):
|
|
+async def execute(server: "ExecutionServer", dynprompt, caches, current_item, extra_data, executed, prompt_id, execution_list, pending_subgraph_results, pending_async_nodes, ui_outputs, asset_manager: AssetManager):
|
|
unique_id = current_item
|
|
real_node_id = dynprompt.get_real_node_id(unique_id)
|
|
display_node_id = dynprompt.get_display_node_id(unique_id)
|
|
@@ -8,7 +8,7 @@
|
|
class_def = nodes.NODE_CLASS_MAPPINGS[class_type]
|
|
cached = await caches.outputs.get(unique_id)
|
|
if cached is not None:
|
|
- _send_cached_ui(server, unique_id, display_node_id, cached, prompt_id, ui_outputs)
|
|
+ emit_cached_output(server, unique_id, display_node_id, cached, prompt_id, ui_outputs, asset_manager)
|
|
get_progress_state().finish_progress(unique_id)
|
|
execution_list.cache_update(unique_id, cached)
|
|
return (ExecutionResult.SUCCESS, None, None)
|
|
@@ -81,6 +81,8 @@
|
|
for i in required_inputs:
|
|
execution_list.make_input_strong_link(unique_id, i)
|
|
return (ExecutionResult.PENDING, None, None)
|
|
+ if execution_list.is_staged_node_blocked():
|
|
+ return (ExecutionResult.PENDING, None, None)
|
|
|
|
def execution_block_cb(block):
|
|
if block.message is not None:
|
|
@@ -108,10 +110,10 @@
|
|
output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
|
|
finally:
|
|
if comfy.memory_management.aimdo_enabled:
|
|
- if args.verbose == "DEBUG":
|
|
+ if get_console_log_level(args.verbose) == "DEBUG":
|
|
comfy_aimdo.control.analyze()
|
|
+ comfy.model_prefetch.cleanup_prefetch_queues()
|
|
comfy.model_management.reset_cast_buffers()
|
|
- comfy.model_prefetch.cleanup_prefetch_queues()
|
|
comfy_aimdo.model_vbar.vbars_reset_watermark_limits()
|
|
|
|
if has_pending_tasks:
|
|
@@ -123,18 +125,20 @@
|
|
unblock()
|
|
asyncio.create_task(await_completion())
|
|
return (ExecutionResult.PENDING, None, None)
|
|
+ cache_ui_value = ui_outputs.get(unique_id)
|
|
if len(output_ui) > 0:
|
|
- ui_outputs[unique_id] = {
|
|
- "meta": {
|
|
- "node_id": unique_id,
|
|
- "display_node": display_node_id,
|
|
- "parent_node": parent_node_id,
|
|
- "real_node_id": real_node_id,
|
|
- },
|
|
- "output": output_ui
|
|
+ output_ui = enrich_output_with_media_metadata(output_ui)
|
|
+ meta = {
|
|
+ "node_id": unique_id,
|
|
+ "display_node": display_node_id,
|
|
+ "parent_node": parent_node_id,
|
|
+ "real_node_id": real_node_id,
|
|
}
|
|
+ enriched_output_ui = register_executed_outputs(output_ui, prompt_id, asset_manager)
|
|
+ ui_outputs[unique_id] = {"meta": meta, "output": enriched_output_ui}
|
|
+ cache_ui_value = {"meta": meta, "output": output_ui}
|
|
if server.client_id is not None:
|
|
- server.send_sync("executed", { "node": unique_id, "display_node": display_node_id, "output": output_ui, "prompt_id": prompt_id }, server.client_id)
|
|
+ server.send_sync("executed", { "node": unique_id, "display_node": display_node_id, "output": enriched_output_ui, "prompt_id": prompt_id }, server.client_id)
|
|
if has_subgraph:
|
|
cached_outputs = []
|
|
new_node_ids = []
|
|
@@ -171,7 +175,7 @@
|
|
pending_subgraph_results[unique_id] = cached_outputs
|
|
return (ExecutionResult.PENDING, None, None)
|
|
|
|
- cache_entry = CacheEntry(ui=ui_outputs.get(unique_id), outputs=output_data)
|
|
+ cache_entry = CacheEntry(ui=cache_ui_value, outputs=output_data)
|
|
execution_list.cache_update(unique_id, cache_entry)
|
|
await caches.outputs.set(unique_id, cache_entry)
|
|
|
|
@@ -199,7 +203,7 @@
|
|
|
|
if comfy.model_management.is_oom(ex):
|
|
tips = "This error means you ran out of memory on your GPU.\n\nTIPS: If the workflow worked before you might have accidentally set the batch_size to a large number."
|
|
- logging.info("Memory summary: {}".format(comfy.model_management.debug_memory_summary()))
|
|
+ logging.info("Memory summary:\n{}".format(comfy.model_management.debug_memory_summary()))
|
|
logging.error("Got an OOM, unloading all loaded models.")
|
|
comfy.model_management.unload_all_models()
|
|
elif isinstance(ex, RuntimeError) and ("mat1 and mat2 shapes" in str(ex)) and "Sampler" in class_type:
|
|
@@ -218,4 +222,4 @@
|
|
get_progress_state().finish_progress(unique_id)
|
|
executed.add(unique_id)
|
|
|
|
- return (ExecutionResult.SUCCESS, None, None)+ return (ExecutionResult.SUCCESS, None, None)
|