[Bug] Fix converted widget compression on export (#3354)

This commit is contained in:
Chenlei Hu
2025-04-08 20:20:19 -04:00
committed by GitHub
parent fa132e4106
commit e9a98161ca
3 changed files with 113 additions and 7 deletions

View File

@@ -6,6 +6,8 @@ import type {
ComfyWorkflowJSON
} from '@/schemas/comfyWorkflowSchema'
import { compressWidgetInputSlots } from './litegraphUtil'
/**
* Converts the current graph workflow for sending to the API.
* Note: Node widgets are updated before serialization to prepare queueing.
@@ -38,12 +40,7 @@ export const graphToPrompt = async (
}
}
// Remove all unconnected widget input slots
for (const node of workflow.nodes) {
node.inputs = node.inputs?.filter(
(input) => !(input.widget && input.link === null)
)
}
compressWidgetInputSlots(workflow)
const output: ComfyApiWorkflow = {}
// Process nodes in order of execution