mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-02-15 23:52:32 +08:00
retain initial node_versions on serialize
This commit is contained in:
parent
a6cc392473
commit
727f8ad484
@ -65,6 +65,15 @@ class WorkflowMetadataExtension {
|
|||||||
return nodeVersions;
|
return nodeVersions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The node versions embedded in the workflow json's initial state.
|
||||||
|
* @returns {Record<string, string> | undefined} The mapping from node name to version
|
||||||
|
*/
|
||||||
|
get workflowNodeVersions() {
|
||||||
|
return app.extensionManager?.workflow?.activeWorkflow?.initialState?.extra
|
||||||
|
?.node_versions;
|
||||||
|
}
|
||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
const extension = this;
|
const extension = this;
|
||||||
this.installedNodes = await this.getInstalledNodes();
|
this.installedNodes = await this.getInstalledNodes();
|
||||||
@ -81,7 +90,10 @@ class WorkflowMetadataExtension {
|
|||||||
}
|
}
|
||||||
const graph = this;
|
const graph = this;
|
||||||
try {
|
try {
|
||||||
workflow.extra["node_versions"] = extension.getGraphNodeVersions(graph);
|
workflow.extra["node_versions"] = {
|
||||||
|
...extension.workflowNodeVersions,
|
||||||
|
...extension.getGraphNodeVersions(graph),
|
||||||
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user