diff --git a/lora_iterator.js b/lora_iterator.js index 1b5f08e..d9fdef2 100644 --- a/lora_iterator.js +++ b/lora_iterator.js @@ -17,7 +17,11 @@ app.registerExtension({ }, get: () => { if (dirWidget.value === "[All]") return fullLoraList; - return fullLoraList.filter(x => x.startsWith(dirWidget.value + "/") || x.startsWith(dirWidget.value + "\\")); + // Compare only the parent folder of each lora path + return fullLoraList.filter(x => { + const parts = x.split(/[\\/]/); + return parts.length > 1 && parts[0] === dirWidget.value; + }); } }); }