MCPcopy Index your code
hub / github.com/pythongosssss/ComfyUI-Custom-Scripts / addMenuHandler

Function addMenuHandler

web/js/quickNodes.js:5–12  ·  view source on GitHub ↗
(nodeType, cb)

Source from the content-addressed store, hash-verified

3// Adds a bunch of context menu entries for quickly adding common steps
4
5function addMenuHandler(nodeType, cb) {
6 const getOpts = nodeType.prototype.getExtraMenuOptions;
7 nodeType.prototype.getExtraMenuOptions = function () {
8 const r = getOpts.apply(this, arguments);
9 cb.apply(this, arguments);
10 return r;
11 };
12}
13
14function getOrAddVAELoader(node) {
15 let vaeNode = app.graph._nodes.find((n) => n.type === "VAELoader");

Callers 1

beforeRegisterNodeDefFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected