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:
@@ -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]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user