diff --git a/lib_comfyui/webui/accordion.py b/lib_comfyui/webui/accordion.py index 307b9b6..67865ae 100644 --- a/lib_comfyui/webui/accordion.py +++ b/lib_comfyui/webui/accordion.py @@ -52,7 +52,7 @@ def __init__(self, get_elem_id, tab): self.enabled_display_names = gradio_utils.ExtensionDynamicProperty( value=[], ) - self.enabled_type_ids = gradio_utils.ExtensionDynamicProperty( + self.enabled_ids = gradio_utils.ExtensionDynamicProperty( value={ workflow_type_id: False for workflow_type_id in self.workflow_type_ids.values() @@ -108,7 +108,7 @@ def arrange_components(self): self.refresh_button.render() self.enabled_display_names.render() - self.enabled_type_ids.render() + self.enabled_ids.render() self.clear_enabled_display_names_button.render() def connect_events(self): @@ -129,7 +129,7 @@ def connect_events(self): self._rendered = True def get_script_ui_components(self) -> Tuple[gr.components.Component, ...]: - return self.queue_front, self.enabled_type_ids + return self.queue_front, self.enabled_ids def setup_infotext_fields(self, script): workflows_infotext_field = gr.HTML(visible=False) @@ -158,9 +158,9 @@ def activate_current_workflow_type(self): def activate_enabled_workflow_types(self): self.enabled_display_names.change( - fn=self.display_names_to_enabled_type_ids, + fn=self.display_names_to_enabled_ids, inputs=[self.enabled_display_names], - outputs=[self.enabled_type_ids], + outputs=[self.enabled_ids], ) self.activate_enabled_checkbox() @@ -212,7 +212,7 @@ def activate_enabled_checkbox(self): outputs=[self.enabled_display_names] ) - def display_names_to_enabled_type_ids(self, enabled_display_names): + def display_names_to_enabled_ids(self, enabled_display_names): return { self.workflow_type_ids[workflow_type.display_name]: workflow_type.display_name in enabled_display_names for workflow_type in self.workflow_types @@ -223,7 +223,7 @@ def on_infotext_change(self, serialized_graphs, current_workflow_display_name) - return (gr.skip(),) * 3 if not hasattr(global_state, 'enabled_workflow_type_ids'): - global_state.enabled_type_ids = {} + global_state.enabled_workflow_type_ids = {} serialized_graphs = json.loads(serialized_graphs) workflow_graphs = { @@ -237,7 +237,7 @@ def on_infotext_change(self, serialized_graphs, current_workflow_display_name) - new_enabled_display_names = [] for workflow_type_id, (graph, workflow_type) in workflow_graphs.items(): is_custom_workflow = workflow_type.base_id in serialized_graphs - global_state.enabled_type_ids[workflow_type_id] = is_custom_workflow + global_state.enabled_workflow_type_ids[workflow_type_id] = is_custom_workflow if is_custom_workflow: new_enabled_display_names.append(workflow_type.display_name) iframe_requests.set_workflow_graph(graph, workflow_type_id) diff --git a/scripts/comfyui.py b/scripts/comfyui.py index 283e24b..c43ed84 100644 --- a/scripts/comfyui.py +++ b/scripts/comfyui.py @@ -44,9 +44,9 @@ def process(self, p, queue_front, enabled_workflow_type_ids, **kwargs): return if not hasattr(global_state, 'enabled_workflow_type_ids'): - global_state.enabled_type_ids = {} + global_state.enabled_workflow_type_ids = {} - global_state.enabled_type_ids.update(enabled_workflow_type_ids) + global_state.enabled_workflow_type_ids.update(enabled_workflow_type_ids) global_state.queue_front = queue_front workflow_patcher.patch_processing(p)