(server, dynprompt, caches, current_item, extra_data, executed, prompt_id, execution_list, pending_subgraph_results, pending_async_nodes, ui_outputs)
| 433 | ui_outputs[node_id] = cached.ui |
| 434 | |
| 435 | async def execute(server, dynprompt, caches, current_item, extra_data, executed, prompt_id, execution_list, pending_subgraph_results, pending_async_nodes, ui_outputs): |
| 436 | unique_id = current_item |
| 437 | real_node_id = dynprompt.get_real_node_id(unique_id) |
| 438 | display_node_id = dynprompt.get_display_node_id(unique_id) |
| 439 | parent_node_id = dynprompt.get_parent_node_id(unique_id) |
| 440 | inputs = dynprompt.get_node(unique_id)['inputs'] |
| 441 | class_type = dynprompt.get_node(unique_id)['class_type'] |
| 442 | class_def = nodes.NODE_CLASS_MAPPINGS[class_type] |
| 443 | cached = await caches.outputs.get(unique_id) |
| 444 | if cached is not None: |
| 445 | _send_cached_ui(server, unique_id, display_node_id, cached, prompt_id, ui_outputs) |
| 446 | get_progress_state().finish_progress(unique_id) |
| 447 | execution_list.cache_update(unique_id, cached) |
| 448 | return (ExecutionResult.SUCCESS, None, None) |
| 449 | |
| 450 | input_data_all = None |
| 451 | try: |
| 452 | if unique_id in pending_async_nodes: |
| 453 | results = [] |
| 454 | for r in pending_async_nodes[unique_id]: |
| 455 | if isinstance(r, asyncio.Task): |
| 456 | try: |
| 457 | results.append(r.result()) |
| 458 | except Exception as ex: |
| 459 | # An async task failed - propagate the exception up |
| 460 | del pending_async_nodes[unique_id] |
| 461 | raise ex |
| 462 | else: |
| 463 | results.append(r) |
| 464 | del pending_async_nodes[unique_id] |
| 465 | output_data, output_ui, has_subgraph = get_output_from_returns(results, class_def) |
| 466 | elif unique_id in pending_subgraph_results: |
| 467 | cached_results = pending_subgraph_results[unique_id] |
| 468 | resolved_outputs = [] |
| 469 | for is_subgraph, result in cached_results: |
| 470 | if not is_subgraph: |
| 471 | resolved_outputs.append(result) |
| 472 | else: |
| 473 | resolved_output = [] |
| 474 | for r in result: |
| 475 | if is_link(r): |
| 476 | source_node, source_output = r[0], r[1] |
| 477 | node_cached = execution_list.get_cache(source_node, unique_id) |
| 478 | for o in node_cached.outputs[source_output]: |
| 479 | resolved_output.append(o) |
| 480 | |
| 481 | else: |
| 482 | resolved_output.append(r) |
| 483 | resolved_outputs.append(tuple(resolved_output)) |
| 484 | output_data = merge_result_data(resolved_outputs, class_def) |
| 485 | output_ui = [] |
| 486 | del pending_subgraph_results[unique_id] |
| 487 | has_subgraph = False |
| 488 | else: |
| 489 | get_progress_state().start_progress(unique_id) |
| 490 | input_data_all, missing_keys, v3_data = get_input_data(inputs, class_def, unique_id, execution_list, dynprompt, extra_data) |
| 491 | if server.client_id is not None: |
| 492 | server.last_node_id = display_node_id |
no test coverage detected