Skip to content

Commit

Permalink
only check for unmuted nodes when validating
Browse files Browse the repository at this point in the history
  • Loading branch information
PladsElsker committed Nov 19, 2023
1 parent f463e41 commit d90501a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib_comfyui/comfyui/iframe_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ def validate_amount_of_nodes_or_throw(
raise RuntimeError(f'Expected a sequence of length 2 for argument "max_amount_of_nodes", got {len(max_amount_of_nodes)} instead')

workflow_graph = get_workflow_graph(workflow_type_id)
node_types = [node['type'] for node in workflow_graph['nodes']]
all_nodes = workflow_graph['nodes']
enabled_nodes = [node for node in all_nodes if node['mode'] != 2]
node_types = [node['type'] for node in enabled_nodes]
amount_of_from_webui_nodes = len([t for t in node_types if t == 'FromWebui'])
amount_of_to_webui_nodes = len([t for t in node_types if t == 'ToWebui'])
max_from_webui_nodes = max_amount_of_io_nodes[0] if max_amount_of_io_nodes[0] is not None else amount_of_from_webui_nodes
Expand Down
2 changes: 2 additions & 0 deletions lib_comfyui/default_workflow_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@
display_name='Postprocess image',
default_workflow=external_code.AUTO_WORKFLOW,
types='IMAGE',
max_amount_of_io_nodes=[None, 1],
)
before_save_image_workflow_type = external_code.WorkflowType(
base_id='before_save_image',
display_name='Before save image',
default_workflow=external_code.AUTO_WORKFLOW,
types='IMAGE',
max_amount_of_io_nodes=[None, 1],
)


Expand Down
1 change: 0 additions & 1 deletion lib_comfyui/webui/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def on_before_image_saved(params):
tab=tab,
batch_input=type_conversion.webui_image_to_comfyui([params.image]),
identity_on_error=True,
max_amount_of_io_nodes=[None, 1]
)

params.image = type_conversion.comfyui_image_to_webui(results[0], return_tensors=False)[0]
1 change: 0 additions & 1 deletion scripts/comfyui.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def postprocess_image(self, p, pp, *args):
tab=self.get_tab(),
batch_input=type_conversion.webui_image_to_comfyui([pp.image]),
identity_on_error=True,
max_amount_of_io_nodes=[None, 1]
)

pp.image = type_conversion.comfyui_image_to_webui(results[0], return_tensors=False)[0]
Expand Down

0 comments on commit d90501a

Please sign in to comment.