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

Method findInputSlot

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

Source from the content-addressed store, hash-verified

2079 findInputSlot<TReturn extends false>(name: string, returnObj?: TReturn): number
2080 findInputSlot<TReturn extends true>(name: string, returnObj?: TReturn): INodeInputSlot
2081 findInputSlot(name: string, returnObj: boolean = false) {
2082 const { inputs } = this
2083 if (!inputs) return -1
2084
2085 for (const [i, input] of inputs.entries()) {
2086 if (name == input.name) {
2087 return !returnObj ? i : input
2088 }
2089 }
2090 return -1
2091 }
2092
2093 /**
2094 * returns the output slot with a given name (used for dynamic slots), -1 if not found

Callers 7

getInputDataByNameMethod · 0.95
addOnTriggerInputMethod · 0.95
disconnectInputMethod · 0.95
connectMethod · 0.80
showConnectionMenuMethod · 0.80
selectMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected