mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-26 07:35:44 -03:00
feat(comfyui): fix trigger word toggle widget initialization
Change from loadedGraphNode to nodeCreated lifecycle method to ensure proper widget initialization timing. Wrap widget creation and highlight logic in requestAnimationFrame to prevent race conditions with node setup. This ensures the trigger word toggle widget functions correctly when nodes are created.
This commit is contained in:
@@ -62,7 +62,7 @@ app.registerExtension({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
async loadedGraphNode(node) {
|
async nodeCreated(node) {
|
||||||
if (node.comfyClass === "TriggerWord Toggle (LoraManager)") {
|
if (node.comfyClass === "TriggerWord Toggle (LoraManager)") {
|
||||||
// Enable widget serialization
|
// Enable widget serialization
|
||||||
node.serialize_widgets = true;
|
node.serialize_widgets = true;
|
||||||
@@ -71,6 +71,8 @@ app.registerExtension({
|
|||||||
"shape": 7 // 7 is the shape of the optional input
|
"shape": 7 // 7 is the shape of the optional input
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Wait for node to be properly initialized
|
||||||
|
requestAnimationFrame(async () => {
|
||||||
// Get the wheel sensitivity setting
|
// Get the wheel sensitivity setting
|
||||||
const wheelSensitivity = getWheelSensitivity();
|
const wheelSensitivity = getWheelSensitivity();
|
||||||
|
|
||||||
@@ -200,6 +202,7 @@ app.registerExtension({
|
|||||||
});
|
});
|
||||||
return transformedValue;
|
return transformedValue;
|
||||||
};
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user