Add WanVideo Lora Select node and related functionality. Fixes #266

- Implemented the WanVideo Lora Select node in Python with input handling for low memory loading and LORA syntax processing.
- Updated the JavaScript side to register the new node and manage its widget interactions.
- Enhanced constants files to include the new node type and its corresponding ID.
- Modified existing Lora Loader and Stacker references to accommodate the new node in various workflows and UI components.
- Added example workflow JSON for the new node to demonstrate its usage.
This commit is contained in:
Will Miao
2025-06-30 15:10:34 +08:00
parent 71762d788f
commit fc4327087b
11 changed files with 245 additions and 11 deletions

View File

@@ -76,7 +76,9 @@ app.registerExtension({
// Standard mode - update a specific node
const node = app.graph.getNodeById(+id);
if (!node || (node.comfyClass !== "Lora Loader (LoraManager)" && node.comfyClass !== "Lora Stacker (LoraManager)")) {
if (!node || (node.comfyClass !== "Lora Loader (LoraManager)" &&
node.comfyClass !== "Lora Stacker (LoraManager)" &&
node.comfyClass !== "WanVideo Lora Select (LoraManager)")) {
console.warn("Node not found or not a LoraLoader:", id);
return;
}
@@ -87,7 +89,7 @@ app.registerExtension({
// Helper method to update a single node's lora code
updateNodeLoraCode(node, loraCode, mode) {
// Update the input widget with new lora code
const inputWidget = node.widgets[0];
const inputWidget = node.inputWidget;
if (!inputWidget) return;
// Get the current lora code
@@ -182,6 +184,7 @@ app.registerExtension({
// Update input widget callback
const inputWidget = this.widgets[0];
this.inputWidget = inputWidget;
inputWidget.callback = (value) => {
if (isUpdating) return;
isUpdating = true;