From c98e4d1a59bd6e9920ff69140306e83ecbce567f Mon Sep 17 00:00:00 2001 From: karrycharon Date: Mon, 4 Dec 2023 20:46:29 +0800 Subject: [PATCH] fix #46 --- js/appearance.js | 6 +++--- js/seedcontrol.js | 2 +- js/widgethider.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/appearance.js b/js/appearance.js index 1e87498..698bec9 100644 --- a/js/appearance.js +++ b/js/appearance.js @@ -77,9 +77,9 @@ const ext = { name: "efficiency.appearance", nodeCreated(node) { - const title = node.getTitle(); - if (NODE_COLORS.hasOwnProperty(title)) { - let colorKey = NODE_COLORS[title]; + const nclass = node.comfyClass; + if (NODE_COLORS.hasOwnProperty(nclass)) { + let colorKey = NODE_COLORS[nclass]; if (colorKey === "random") { // Check for a valid color key before popping diff --git a/js/seedcontrol.js b/js/seedcontrol.js index fbae407..465d525 100644 --- a/js/seedcontrol.js +++ b/js/seedcontrol.js @@ -18,7 +18,7 @@ const NODE_WIDGET_MAP = { const SPECIFIC_WIDTH = 325; // Set to desired width function setNodeWidthForMappedTitles(node) { - if (NODE_WIDGET_MAP[node.getTitle()]) { + if (NODE_WIDGET_MAP[node.comfyClass]) { node.setSize([SPECIFIC_WIDTH, node.size[1]]); } } diff --git a/js/widgethider.js b/js/widgethider.js index 83b6d6d..82a9fa9 100644 --- a/js/widgethider.js +++ b/js/widgethider.js @@ -123,7 +123,7 @@ function handleInputModeWidgetsVisibility(node, inputModeValue) { } }; - const inputModeVisibilityMap = nodeVisibilityMap[node.getTitle()]; + const inputModeVisibilityMap = nodeVisibilityMap[node.comfyClass]; if (!inputModeVisibilityMap || !inputModeVisibilityMap[inputModeValue]) return; @@ -319,7 +319,7 @@ const nodeWidgetHandlers = { // In the main function where widgetLogic is called function widgetLogic(node, widget) { // Retrieve the handler for the current node title and widget name - const handler = nodeWidgetHandlers[node.getTitle()]?.[widget.name]; + const handler = nodeWidgetHandlers[node.comfyClass]?.[widget.name]; if (handler) { handler(node, widget); }