Buckets:
| import { app } from "../../../scripts/app.js"; | |
| import { addMenuHandler, addNode } from "./common/utils.js"; | |
| const nodePxOffsets = 80; | |
| function getXYInputNodes() { | |
| return [ | |
| "XY Input: Seeds++ Batch", | |
| "XY Input: Add/Return Noise", | |
| "XY Input: Steps", | |
| "XY Input: CFG Scale", | |
| "XY Input: Sampler/Scheduler", | |
| "XY Input: Denoise", | |
| "XY Input: VAE", | |
| "XY Input: Prompt S/R", | |
| "XY Input: Aesthetic Score", | |
| "XY Input: Refiner On/Off", | |
| "XY Input: Checkpoint", | |
| "XY Input: Clip Skip", | |
| "XY Input: LoRA", | |
| "XY Input: LoRA Plot", | |
| "XY Input: LoRA Stacks", | |
| "XY Input: Control Net", | |
| "XY Input: Control Net Plot", | |
| "XY Input: Manual XY Entry" | |
| ]; | |
| } | |
| function showAddXYInputMenu(type, e, menu, node) { | |
| const specialNodes = [ | |
| "XY Input: LoRA Plot", | |
| "XY Input: Control Net Plot", | |
| "XY Input: Manual XY Entry" | |
| ]; | |
| const values = getXYInputNodes().map(nodeType => { | |
| return { | |
| content: nodeType, | |
| callback: function() { | |
| const newNode = addNode(nodeType, node); | |
| // Calculate the left shift based on the width of the new node | |
| const shiftX = -(newNode.size[0] + 35); | |
| newNode.pos[0] += shiftX; | |
| if (specialNodes.includes(nodeType)) { | |
| newNode.pos[1] += 20; | |
| // Connect both outputs to the XY Plot's 2nd and 3rd input. | |
| newNode.connect(0, node, 1); | |
| newNode.connect(1, node, 2); | |
| } else if (type === 'X') { | |
| newNode.pos[1] += 20; | |
| newNode.connect(0, node, 1); // Connect to 2nd input | |
| } else { | |
| newNode.pos[1] += node.size[1] + 45; | |
| newNode.connect(0, node, 2); // Connect to 3rd input | |
| } | |
| } | |
| }; | |
| }); | |
| new LiteGraph.ContextMenu(values, { | |
| event: e, | |
| callback: null, | |
| parentMenu: menu, | |
| node: node | |
| }); | |
| return false; | |
| } | |
| app.registerExtension({ | |
| name: "efficiency.addXYinputs", | |
| async beforeRegisterNodeDef(nodeType, nodeData, app) { | |
| if (nodeData.name === "XY Plot") { | |
| addMenuHandler(nodeType, function(insertOption) { | |
| insertOption({ | |
| content: "โ๏ธ Add ๐ input...", | |
| has_submenu: true, | |
| callback: (value, options, e, menu, node) => showAddXYInputMenu('X', e, menu, node) | |
| }); | |
| insertOption({ | |
| content: "โ๏ธ Add ๐ input...", | |
| has_submenu: true, | |
| callback: (value, options, e, menu, node) => showAddXYInputMenu('Y', e, menu, node) | |
| }); | |
| }); | |
| } | |
| }, | |
| }); | |
Xet Storage Details
- Size:
- 3 kB
- Xet hash:
- 9ed99c51660c0fc77ec13adc4ced589766d383718c613c903072177aaa01fc8c
ยท
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.