Merge branch 'clean-current-state' of https://github.com/FaridSafi/ComfyUI
This commit is contained in:
commit
f13c0cefaa
|
@ -721,6 +721,8 @@ class ComfyApp {
|
|||
* @param {*} graphData A serialized graph object
|
||||
*/
|
||||
loadGraphData(graphData) {
|
||||
this.clean();
|
||||
|
||||
if (!graphData) {
|
||||
graphData = defaultGraph;
|
||||
}
|
||||
|
@ -903,6 +905,13 @@ class ComfyApp {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean current state
|
||||
*/
|
||||
clean() {
|
||||
this.nodeOutputs = {};
|
||||
}
|
||||
}
|
||||
|
||||
export const app = new ComfyApp();
|
||||
|
|
|
@ -388,7 +388,10 @@ export class ComfyUI {
|
|||
}),
|
||||
$el("button", { textContent: "Load", onclick: () => fileInput.click() }),
|
||||
$el("button", { textContent: "Refresh", onclick: () => app.refreshComboInNodes() }),
|
||||
$el("button", { textContent: "Clear", onclick: () => app.graph.clear() }),
|
||||
$el("button", { textContent: "Clear", onclick: () => {
|
||||
app.clean();
|
||||
app.graph.clear();
|
||||
}}),
|
||||
$el("button", { textContent: "Load Default", onclick: () => app.loadGraphData() }),
|
||||
]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue