fix issue #10 (inputs widgets reappear)

https://github.com/crystian/ComfyUI-Crystools/issues/10
This commit is contained in:
Crystian
2024-01-09 23:16:50 +01:00
parent 65bdafe91a
commit 68e41f7c02
3 changed files with 11 additions and 4 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
@author: Crystian
@title: Crystools-save
@nickname: Crystools-save
@version: 1.1.1
@version: 1.1.2
@project: "https://github.com/crystian/ComfyUI-Crystools-save",
@description: With this quality of life extension, you can save your workflow with a specific name and include additional details such as the author, a description, and the version (in metadata/json) IG: https://www.instagram.com/crystian.ia
"""
+1 -1
View File
@@ -1 +1 @@
1.1.1
1.1.2
+9 -2
View File
@@ -100,15 +100,22 @@ class CrystoolsSave {
};
setup() {
app.graph.onConfigure = (a) => {
// save the original onConfigure event
const onConfigure = app.graph.onConfigure;
app.graph.onConfigure = () => {
// when load a workflow from file pass here!
// on drops a file on the canvas
this.getInfoOnGraph().then((p) => {
if (!p.workflow.extra.info) {
p.workflow.extra.info = {};
p.workflow.extra.info = {
name: this.defaultProjectNameText,
};
}
app.ui.settings.setSettingValue(this.idProjectNameText, p.workflow.extra.info.name);
this.setInfoOnGraph(p.workflow.extra.info);
onConfigure?.apply(this, arguments); // recall the original event
});
};