MCPcopy
hub / github.com/pythongosssss/ComfyUI-Custom-Scripts / addNode

Function addNode

web/js/quickNodes.js:22–34  ·  view source on GitHub ↗
(name, nextTo, options)

Source from the content-addressed store, hash-verified

20}
21
22function addNode(name, nextTo, options) {
23 options = { select: true, shiftY: 0, before: false, ...(options || {}) };
24 const node = LiteGraph.createNode(name);
25 app.graph.add(node);
26 node.pos = [
27 options.before ? nextTo.pos[0] - node.size[0] - 30 : nextTo.pos[0] + nextTo.size[0] + 30,
28 nextTo.pos[1] + options.shiftY,
29 ];
30 if (options.select) {
31 app.canvas.selectNode(node, false);
32 }
33 return node;
34}
35
36app.registerExtension({
37 name: "pysssss.QuickNodes",

Callers 3

getOrAddVAELoaderFunction · 0.85
beforeRegisterNodeDefFunction · 0.85
addLoraFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected