Skip to content

Commit 45bcf40

Browse files
AustinMrozDrJKL
andauthored
On adding output matchType, initialize type (#7161)
The output type of a matchType output is initialized to COMFY_MATCHTYPE_V3, but is updated soon after to the value calculated from input types. Under some difficult to reproduce circumstances, this output type may be incorrectly evaluated in connections to other switch nodes. Since the initial type is never a valid connection, this can produce errors. Instead, the output type of a matchtype node is initialized to allow connections to anything to ensure that the subsequent restriction of output types is guaranteed to be directional ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7161-On-adding-output-matchType-initialize-type-2bf6d73d3650819ab169ffe9a4ecfeb4) by [Unito](https://www.unito.io) --------- Co-authored-by: Alexander Brown <[email protected]>
1 parent f800c40 commit 45bcf40

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/services/litegraphService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ export const useLitegraphService = () => {
219219
*/
220220
function addOutputs(node: LGraphNode, outputs: OutputSpec[]) {
221221
for (const output of outputs) {
222-
const { name, type, is_list } = output
222+
const { name, is_list } = output
223+
// TODO: Fix the typing at the node spec level
224+
const type = output.type === 'COMFY_MATCHTYPE_V3' ? '*' : output.type
223225
const shapeOptions = is_list ? { shape: LiteGraph.GRID_SHAPE } : {}
224226
const nameKey = `${nodeKey(node)}.outputs.${output.index}.name`
225227
const typeKey = `dataTypes.${normalizeI18nKey(type)}`

0 commit comments

Comments
 (0)