mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-03-14 13:17:32 +00:00
move clean to handleFile and loadGraphData functions
This commit is contained in:
parent
393084877c
commit
40a377775e
@ -721,6 +721,8 @@ class ComfyApp {
|
|||||||
* @param {*} graphData A serialized graph object
|
* @param {*} graphData A serialized graph object
|
||||||
*/
|
*/
|
||||||
loadGraphData(graphData) {
|
loadGraphData(graphData) {
|
||||||
|
this.clean();
|
||||||
|
|
||||||
if (!graphData) {
|
if (!graphData) {
|
||||||
graphData = defaultGraph;
|
graphData = defaultGraph;
|
||||||
}
|
}
|
||||||
|
@ -306,7 +306,6 @@ export class ComfyUI {
|
|||||||
style: { display: "none" },
|
style: { display: "none" },
|
||||||
parent: document.body,
|
parent: document.body,
|
||||||
onchange: () => {
|
onchange: () => {
|
||||||
app.clean();
|
|
||||||
app.handleFile(fileInput.files[0]);
|
app.handleFile(fileInput.files[0]);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -393,10 +392,7 @@ export class ComfyUI {
|
|||||||
app.clean();
|
app.clean();
|
||||||
app.graph.clear();
|
app.graph.clear();
|
||||||
}}),
|
}}),
|
||||||
$el("button", { textContent: "Load Default", onclick: () => {
|
$el("button", { textContent: "Load Default", onclick: () => app.loadGraphData() }),
|
||||||
app.clean();
|
|
||||||
app.loadGraphData();
|
|
||||||
}}),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
dragElement(this.menuContainer);
|
dragElement(this.menuContainer);
|
||||||
|
Loading…
Reference in New Issue
Block a user