mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-02-15 07:32:31 +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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
const extension = this;
|
||||
this.installedNodes = await this.getInstalledNodes();
|
||||
@ -81,7 +90,10 @@ class WorkflowMetadataExtension {
|
||||
}
|
||||
const graph = this;
|
||||
try {
|
||||
workflow.extra["node_versions"] = extension.getGraphNodeVersions(graph);
|
||||
workflow.extra["node_versions"] = {
|
||||
...extension.workflowNodeVersions,
|
||||
...extension.getGraphNodeVersions(graph),
|
||||
};
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user