From c801a0c8548fa127b890be99adaa420e7726d254 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Thu, 10 Apr 2025 14:19:54 -0400 Subject: [PATCH] Attach frontend version metadata on workflow export (#3386) --- src/schemas/comfyWorkflowSchema.ts | 1 + src/utils/executionUtil.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/schemas/comfyWorkflowSchema.ts b/src/schemas/comfyWorkflowSchema.ts index 2b67dcf0c7..74f7c7a8d0 100644 --- a/src/schemas/comfyWorkflowSchema.ts +++ b/src/schemas/comfyWorkflowSchema.ts @@ -224,6 +224,7 @@ const zConfig = z const zExtra = z .object({ ds: zDS.optional(), + frontendVersion: z.string().optional(), linkExtensions: z.array(zComfyLinkExtension).optional(), reroutes: z.array(zReroute).optional() }) diff --git a/src/utils/executionUtil.ts b/src/utils/executionUtil.ts index 018e3b1c07..b630be5398 100644 --- a/src/utils/executionUtil.ts +++ b/src/utils/executionUtil.ts @@ -41,6 +41,8 @@ export const graphToPrompt = async ( } compressWidgetInputSlots(workflow) + workflow.extra ??= {} + workflow.extra.frontendVersion = __COMFYUI_FRONTEND_VERSION__ const output: ComfyApiWorkflow = {} // Process nodes in order of execution