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

Method removeInput

src/LGraphNode.ts:1558–1573  ·  view source on GitHub ↗

* remove an existing input slot

(slot: number)

Source from the content-addressed store, hash-verified

1556 * remove an existing input slot
1557 */
1558 removeInput(slot: number): void {
1559 this.disconnectInput(slot, true)
1560 const { inputs } = this
1561 const slot_info = inputs.splice(slot, 1)
1562
1563 for (let i = slot; i < inputs.length; ++i) {
1564 const input = inputs[i]
1565 if (!input?.link) continue
1566
1567 if (!this.graph) throw new NullGraphError()
1568 const link = this.graph._links.get(input.link)
1569 if (link) link.target_slot--
1570 }
1571 this.onInputRemoved?.(slot, slot_info[0])
1572 this.setDirtyCanvas(true, true)
1573 }
1574
1575 /**
1576 * computes the minimum size of a node according to its inputs and output slots

Callers 6

Subgraph.test.tsFile · 0.45
SubgraphIO.test.tsFile · 0.45
inner_option_clickedMethod · 0.45

Calls 3

disconnectInputMethod · 0.95
setDirtyCanvasMethod · 0.95
getMethod · 0.80

Tested by

no test coverage detected