Fix inverting error for label from BV Control Center widget.

This commit is contained in:
BlackVortexAI
2025-12-31 15:15:08 +01:00
parent ce3429481b
commit 41219acfa8
5 changed files with 18 additions and 50 deletions
+1
View File
@@ -243,6 +243,7 @@ Here is an example if, for example, Only Preview is active
### CHANGE LOG
* 2025-12-31 - v0.0.13: Fix inverting error for label from `BV Control Center` widget.
* 2025-12-31 - v0.0.12: Fix input error by node `BV Control Center`.
* 2025-12-31 - v0.0.11: Reimplementation of renaming logic for they are connected to `BV Control Center`. Add logik for deleted Groups.
* 2025-12-30 - v0.0.10: Fix onWidgetCreate event for subgraphs linked to `BV Control Center`.
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "bv_nodepack"
version = "0.0.12"
version = "0.0.13"
description = "A ComfyUI node pack providing advanced utility and workflow nodes, including a config-driven Control Center for muting and bypassing node groups, a flexible Pipe system, and Subgraph-friendly UI nodes (Heading, Spacer, Divider) with dynamic JavaScript rendering."
authors = [
{name = "BlackVortex", email = "blackvortexx@proton.me"}
+15 -8
View File
@@ -48,7 +48,7 @@ function startConfigWatcher() {
}, 500);
}
function hookSubgraphWidgetChanged(node: SubgraphNode) {
function hookSubgraphWidgetChanged(node: SubgraphNode, name?: string) {
let found = false
let foundNode: LGraphNode | undefined;
@@ -73,7 +73,7 @@ function hookSubgraphWidgetChanged(node: SubgraphNode) {
let retries = 0;
const maxRetries = 200;
const retry = () => {
const success = updateSingleControlNode(foundNode, config);
const success = updateSingleControlNode(foundNode, config, undefined, true, name);
if (success || retries >= maxRetries) {
return;
}
@@ -84,7 +84,7 @@ function hookSubgraphWidgetChanged(node: SubgraphNode) {
retry();
}
function updateSingleControlNode(node: any, config: BVControlConfig, savedValuesOverride?: any[], overrideValue: boolean = true): boolean {
function updateSingleControlNode(node: any, config: BVControlConfig, savedValuesOverride?: any[], overrideValue: boolean = true, name?: string): boolean {
if (!node || !config) return false;
let changed = false;
@@ -182,12 +182,19 @@ function updateSingleControlNode(node: any, config: BVControlConfig, savedValues
const gNode = getNodeHelper(node.id, node.graph)
if (gNode) {
let subgraphLabelInvert = label.split(" - ")[0]
if (label.split(" - ")[1] === ACTIVE){
subgraphLabelInvert = label.split(" - ")[0] + " - " + MUTE
}else {
subgraphLabelInvert = label.split(" - ")[0] + " - " + ACTIVE
let success = false
if(name != w.name){
if (label.split(" - ")[1] === ACTIVE){
subgraphLabelInvert = label.split(" - ")[0] + " - " + MUTE
}else {
subgraphLabelInvert = label.split(" - ")[0] + " - " + ACTIVE
}
success = renameSubGraphInputSlot(node, i, subgraphLabelInvert)
}else{
success = renameSubGraphInputSlot(node, i, label)
}
const success = renameSubGraphInputSlot(node, i, subgraphLabelInvert)
if (!success) {
allSlotsRenamed = false;
}
+1 -1
View File
@@ -107,7 +107,7 @@ export function patchSubgraphContainerPrototype(subgraphNode: any, hookSubgraphW
const node = getNodeHelper(this.id, graph, true) as SubgraphNode
if (node) {
console.debug("Subgraph container widget changed", name, value, old_value, widget, node, widget.label)
hookSubgraphWidgetChanged(node)
hookSubgraphWidgetChanged(node, name)
}
if (widget?.label) {