From 474f343a201cfc2ec133be3bfa1d9be5ecd294fd Mon Sep 17 00:00:00 2001 From: sn0w <105451515+sn0w12@users.noreply.github.com> Date: Mon, 6 Oct 2025 00:55:55 +0200 Subject: [PATCH] Remove type system --- web/js/simpleKSampler.js | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/web/js/simpleKSampler.js b/web/js/simpleKSampler.js index b9822f4..2b4f744 100644 --- a/web/js/simpleKSampler.js +++ b/web/js/simpleKSampler.js @@ -1,36 +1,17 @@ -import { app } from '../../../scripts/app.js'; +import { app } from "../../../scripts/app.js"; app.registerExtension({ - name: 'sn0w.SimpleKSampler', + name: "sn0w.SimpleKSampler", async beforeRegisterNodeDef(nodeType, nodeData, app) { - if (nodeData.name === 'Sn0w KSampler') { - const onConnectInput = nodeType.prototype.onConnectInput; - nodeType.prototype.onConnectInput = function (targetSlot, type) { - if (targetSlot === 3 || targetSlot === 4) { - if (type == 'STRING' || type == 'CONDITIONING') { - this.inputs[targetSlot].color_on = - app.canvas.default_connection_color_byType[type]; - } else { - console.error( - `The input type has to be STRING or CONDITIONING, it cannot be ${type}.` - ); - this.inputs[targetSlot].color_on = - app.canvas.default_connection_color_byType['VAE']; - } - } - - onConnectInput.apply(this, arguments); - }; - - // Remove old array input types to prevernt new frontend complaining. + if (nodeData.name === "Sn0w KSampler") { nodeType.prototype.onNodeCreated = function () { - this.inputs[3].type = '*'; - this.inputs[4].type = '*'; + this.inputs[3].type = "*"; + this.inputs[4].type = "*"; }; nodeType.prototype.onConfigure = function () { - this.inputs[3].type = '*'; - this.inputs[4].type = '*'; + this.inputs[3].type = "*"; + this.inputs[4].type = "*"; }; } },