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

Method removeOutput

src/LGraphNode.ts:1510–1529  ·  view source on GitHub ↗

* remove an existing output slot

(slot: number)

Source from the content-addressed store, hash-verified

1508 * remove an existing output slot
1509 */
1510 removeOutput(slot: number): void {
1511 this.disconnectOutput(slot)
1512 const { outputs } = this
1513 outputs.splice(slot, 1)
1514
1515 for (let i = slot; i < outputs.length; ++i) {
1516 const output = outputs[i]
1517 if (!output || !output.links) continue
1518
1519 for (const linkId of output.links) {
1520 if (!this.graph) throw new NullGraphError()
1521
1522 const link = this.graph._links.get(linkId)
1523 if (link) link.origin_slot--
1524 }
1525 }
1526
1527 this.onOutputRemoved?.(slot)
1528 this.setDirtyCanvas(true, true)
1529 }
1530
1531 /**
1532 * add a new input slot to use in this node

Callers 6

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

Calls 3

disconnectOutputMethod · 0.95
setDirtyCanvasMethod · 0.95
getMethod · 0.80

Tested by

no test coverage detected