mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-10 05:22:34 +08:00
pep 8
This commit is contained in:
parent
6986e4c361
commit
5b61c4f953
10
execution.py
10
execution.py
@ -56,6 +56,7 @@ class QueueItem:
|
|||||||
"""
|
"""
|
||||||
queue_tuple: QueueTuple
|
queue_tuple: QueueTuple
|
||||||
completed: asyncio.Future | None
|
completed: asyncio.Future | None
|
||||||
|
|
||||||
def __lt__(self, other: QueueItem):
|
def __lt__(self, other: QueueItem):
|
||||||
return self.queue_tuple[0] < other.queue_tuple[0]
|
return self.queue_tuple[0] < other.queue_tuple[0]
|
||||||
|
|
||||||
@ -123,8 +124,8 @@ def map_node_over_list(obj, input_data_all, func, allow_interrupt=False):
|
|||||||
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
|
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
|
||||||
return results
|
return results
|
||||||
|
|
||||||
def get_output_data(obj, input_data_all):
|
|
||||||
|
|
||||||
|
def get_output_data(obj, input_data_all):
|
||||||
results = []
|
results = []
|
||||||
uis = []
|
uis = []
|
||||||
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
|
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
|
||||||
@ -157,6 +158,7 @@ def get_output_data(obj, input_data_all):
|
|||||||
ui = {k: [y for x in uis for y in x[k]] for k in uis[0].keys()}
|
ui = {k: [y for x in uis for y in x[k]] for k in uis[0].keys()}
|
||||||
return output, ui
|
return output, ui
|
||||||
|
|
||||||
|
|
||||||
def format_value(x):
|
def format_value(x):
|
||||||
if x is None:
|
if x is None:
|
||||||
return None
|
return None
|
||||||
@ -202,7 +204,8 @@ def recursive_execute(server, prompt, outputs, current_item, extra_data, execute
|
|||||||
if len(output_ui) > 0:
|
if len(output_ui) > 0:
|
||||||
outputs_ui[unique_id] = output_ui
|
outputs_ui[unique_id] = output_ui
|
||||||
if server.client_id is not None:
|
if server.client_id is not None:
|
||||||
server.send_sync("executed", {"node": unique_id, "output": output_ui, "prompt_id": prompt_id}, server.client_id)
|
server.send_sync("executed", {"node": unique_id, "output": output_ui, "prompt_id": prompt_id},
|
||||||
|
server.client_id)
|
||||||
except comfy.model_management.InterruptProcessingException as iex:
|
except comfy.model_management.InterruptProcessingException as iex:
|
||||||
print("Processing interrupted")
|
print("Processing interrupted")
|
||||||
|
|
||||||
@ -424,7 +427,8 @@ class PromptExecutor:
|
|||||||
# This call shouldn't raise anything if there's an error deep in
|
# This call shouldn't raise anything if there's an error deep in
|
||||||
# the actual SD code, instead it will report the node where the
|
# the actual SD code, instead it will report the node where the
|
||||||
# error was raised
|
# error was raised
|
||||||
success, error, ex = recursive_execute(self.server, prompt, self.outputs, output_node_id, extra_data, executed, prompt_id, self.outputs_ui, self.object_storage)
|
success, error, ex = recursive_execute(self.server, prompt, self.outputs, output_node_id, extra_data, executed, prompt_id,
|
||||||
|
self.outputs_ui, self.object_storage)
|
||||||
if success is not True:
|
if success is not True:
|
||||||
self.handle_execution_error( prompt_id,
|
self.handle_execution_error( prompt_id,
|
||||||
prompt, current_outputs, executed, error, ex)
|
prompt, current_outputs, executed, error, ex)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user