Load only the LoRAs the user picked on Klein; do not require snofs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-28 16:21:32 -05:00
co-authored by Cursor
parent a2f728fe2e
commit f51c3772e5
9 changed files with 192 additions and 25 deletions
+5 -4
View File
@@ -87,6 +87,7 @@ import {
clampLoraStrength,
formatLoraStrength,
loraDisplayName,
loraIdentityKey,
makeLoraStackItem,
type LoraStackItem
} from '~/utils/loras'
@@ -111,8 +112,8 @@ const props = withDefaults(defineProps<{
const model = defineModel<LoraStackItem[]>({ default: () => [] })
const availableNames = computed(() => {
const taken = new Set(model.value.map(item => item.name.replace(/\\/g, '/').toLowerCase()))
return props.names.filter(name => !taken.has(name.replace(/\\/g, '/').toLowerCase()))
const taken = new Set(model.value.map(item => loraIdentityKey(item.name)))
return props.names.filter(name => !taken.has(loraIdentityKey(name)))
})
function onAdd(event: Event) {
@@ -124,8 +125,8 @@ function onAdd(event: Event) {
function addLora(name: string) {
const item = makeLoraStackItem(name)
if (!item || model.value.length >= LORA_STACK_MAX) return
const taken = new Set(model.value.map(entry => entry.name.replace(/\\/g, '/').toLowerCase()))
if (taken.has(item.name.replace(/\\/g, '/').toLowerCase())) return
const taken = new Set(model.value.map(entry => loraIdentityKey(entry.name)))
if (taken.has(loraIdentityKey(item.name))) return
model.value = [...model.value, item]
}