docs(hel-892): bind primary 8010 engine bytes and audit AIO branches
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
+113
@@ -0,0 +1,113 @@
|
||||
--- 0.17.0: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)
|
||||
@@ -6,13 +6,9 @@
|
||||
inputs = dynprompt.get_node(unique_id)['inputs']
|
||||
class_type = dynprompt.get_node(unique_id)['class_type']
|
||||
class_def = nodes.NODE_CLASS_MAPPINGS[class_type]
|
||||
- cached = caches.outputs.get(unique_id)
|
||||
+ cached = await caches.outputs.get(unique_id)
|
||||
if cached is not None:
|
||||
- if server.client_id is not None:
|
||||
- cached_ui = cached.ui or {}
|
||||
- server.send_sync("executed", { "node": unique_id, "display_node": display_node_id, "output": cached_ui.get("output",None), "prompt_id": prompt_id }, server.client_id)
|
||||
- if cached.ui is not None:
|
||||
- ui_outputs[unique_id] = cached.ui
|
||||
+ 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)
|
||||
@@ -62,10 +58,10 @@
|
||||
server.last_node_id = display_node_id
|
||||
server.send_sync("executing", { "node": unique_id, "display_node": display_node_id, "prompt_id": prompt_id }, server.client_id)
|
||||
|
||||
- obj = caches.objects.get(unique_id)
|
||||
+ obj = await caches.objects.get(unique_id)
|
||||
if obj is None:
|
||||
obj = class_def()
|
||||
- caches.objects.set(unique_id, obj)
|
||||
+ await caches.objects.set(unique_id, obj)
|
||||
|
||||
if issubclass(class_def, _ComfyNodeInternal):
|
||||
lazy_status_present = first_real_override(class_def, "check_lazy_status") is not None
|
||||
@@ -85,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:
|
||||
@@ -112,8 +110,9 @@
|
||||
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_aimdo.model_vbar.vbars_reset_watermark_limits()
|
||||
|
||||
@@ -126,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 = []
|
||||
@@ -174,9 +175,9 @@
|
||||
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)
|
||||
- caches.outputs.set(unique_id, cache_entry)
|
||||
+ await caches.outputs.set(unique_id, cache_entry)
|
||||
|
||||
except comfy.model_management.InterruptProcessingException as iex:
|
||||
logging.info("Processing interrupted")
|
||||
@@ -202,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:
|
||||
@@ -221,4 +222,4 @@
|
||||
get_progress_state().finish_progress(unique_id)
|
||||
executed.add(unique_id)
|
||||
|
||||
- return (ExecutionResult.SUCCESS, None, None)+ return (ExecutionResult.SUCCESS, None, None)
|
||||
Reference in New Issue
Block a user