MCPcopy Create free account
hub / github.com/Comfy-Org/litegraph.js / findOutputSlot

Method findOutputSlot

src/LGraphNode.ts:2101–2111  ·  view source on GitHub ↗
(name: string, returnObj: boolean = false)

Source from the content-addressed store, hash-verified

2099 findOutputSlot<TReturn extends false>(name: string, returnObj?: TReturn): number
2100 findOutputSlot<TReturn extends true>(name: string, returnObj?: TReturn): INodeOutputSlot
2101 findOutputSlot(name: string, returnObj: boolean = false) {
2102 const { outputs } = this
2103 if (!outputs) return -1
2104
2105 for (const [i, output] of outputs.entries()) {
2106 if (name == output.name) {
2107 return !returnObj ? i : output
2108 }
2109 }
2110 return -1
2111 }
2112
2113 /**
2114 * Finds the first free input slot.

Callers 8

addOnExecutedOutputMethod · 0.95
onAfterExecuteNodeMethod · 0.95
connectMethod · 0.95
disconnectOutputMethod · 0.95
showConnectionMenuMethod · 0.45
selectMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected