Skip to content

Commit

Permalink
fix reload to default workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ljleb committed Aug 31, 2023
1 parent 33ea102 commit d57e758
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
9 changes: 9 additions & 0 deletions comfyui_custom_scripts/extensions/webuiNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ app.registerExtension({
}
}
},
async setup() {
try {
await iframeRegisteredEvent;
} catch {
return;
}

app.loadGraphData();
},
async nodeCreated(node) {
let iframeInfo = null;

Expand Down
4 changes: 4 additions & 0 deletions comfyui_custom_scripts/extensions/webuiPatches.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ async function patchDefaultGraph(iframeInfo) {
const from_webui = LiteGraph.createNode("FromWebui");
const to_webui = LiteGraph.createNode("ToWebui");

if (!from_webui || !to_webui) {
return;
}

app.graph.add(from_webui);
app.graph.add(to_webui);

Expand Down
5 changes: 1 addition & 4 deletions scripts/comfyui.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ def process(self, p, queue_front, enabled_workflow_type_ids, **kwargs):
patches.patch_processing(p)

def postprocess_batch_list(self, p, pp, *args, **kwargs):
if not (
getattr(global_state, 'enabled', True) and
external_code.is_workflow_type_enabled(default_workflow_types.postprocess_workflow_type.get_ids(self.get_tab())[0])
):
if not external_code.is_workflow_type_enabled(default_workflow_types.postprocess_workflow_type.get_ids(self.get_tab())[0]):
return

all_results = []
Expand Down

0 comments on commit d57e758

Please sign in to comment.