diff --git a/__init__.py b/__init__.py index f31a72f..55424b4 100644 --- a/__init__.py +++ b/__init__.py @@ -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 """ diff --git a/version b/version index 524cb55..45a1b3f 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.1.1 +1.1.2 diff --git a/web/js/workflow.js b/web/js/workflow.js index 93cbb41..7d0d7e6 100644 --- a/web/js/workflow.js +++ b/web/js/workflow.js @@ -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 }); };