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

Method changeMode

src/LGraphNode.ts:1231–1257  ·  view source on GitHub ↗
(modeTo: number)

Source from the content-addressed store, hash-verified

1229 }
1230
1231 changeMode(modeTo: number): boolean {
1232 switch (modeTo) {
1233 case LGraphEventMode.ON_EVENT:
1234 break
1235
1236 case LGraphEventMode.ON_TRIGGER:
1237 this.addOnTriggerInput()
1238 this.addOnExecutedOutput()
1239 break
1240
1241 case LGraphEventMode.NEVER:
1242 break
1243
1244 case LGraphEventMode.ALWAYS:
1245 break
1246
1247 // @ts-expect-error Not impl.
1248 case LiteGraph.ON_REQUEST:
1249 break
1250
1251 default:
1252 return false
1253 break
1254 }
1255 this.mode = modeTo
1256 return true
1257 }
1258
1259 /**
1260 * Triggers the node code execution, place a boolean/counter to mark the node as being executed

Callers 3

connectMethod · 0.80
fApplyMultiNodeMethod · 0.80
fUpdateMethod · 0.80

Calls 2

addOnTriggerInputMethod · 0.95
addOnExecutedOutputMethod · 0.95

Tested by

no test coverage detected