From 958ddbca860fe3adbe5a8e5daaff9b81adcf5cba Mon Sep 17 00:00:00 2001 From: Will Miao <13051207myq@gmail.com> Date: Tue, 13 May 2025 12:27:18 +0800 Subject: [PATCH] Fix workaround for saved value retrieval in Loras widget to address custom nodes issue. Fixes https://github.com/willmiao/ComfyUI-Lora-Manager/issues/176 --- web/comfyui/lora_loader.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/comfyui/lora_loader.js b/web/comfyui/lora_loader.js index f2e7d4a6..01e0a90b 100644 --- a/web/comfyui/lora_loader.js +++ b/web/comfyui/lora_loader.js @@ -107,7 +107,9 @@ app.registerExtension({ // Restore saved value if exists let existingLoras = []; if (node.widgets_values && node.widgets_values.length > 0) { - const savedValue = node.widgets_values[1]; + // TODO: This is a workaround for the issue caused by [AlekPet custom nodes](https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet) + // TODO: Need to be revisited when the issue is fixed. https://github.com/willmiao/ComfyUI-Lora-Manager/issues/176 + const savedValue = node.widgets_values[node.widgets_values.length - 1]; existingLoras = savedValue || []; } // Merge the loras data