Filter LoRA picker options by engine tokens

This commit is contained in:
Towsty
2026-09-12 20:17:58 -05:00
parent e190496eb4
commit 6a6931f04e
2 changed files with 23 additions and 14 deletions
+4 -1
View File
@@ -112,6 +112,8 @@ import {
loraFriendlyName,
loraIdentityKey,
loraMatchesImageEngine,
loraMatchesUse,
type LoraUse,
loraTriggerFor,
makeLoraStackItem,
type LoraStackItem
@@ -130,6 +132,7 @@ const props = withDefaults(defineProps<{
triggers?: Record<string, string>
aliases?: Record<string, string>
engine?: 'flux' | 'krea' | ''
use?: LoraUse
}>(), {
label: 'LoRA',
filenameSubtitle: false,
@@ -159,7 +162,7 @@ const availableNames = computed(() => {
const engine = props.engine === 'flux' || props.engine === 'krea' ? props.engine : null
return props.names
.filter(name => !taken.has(loraIdentityKey(name)))
.filter(name => !engine || loraMatchesImageEngine(name, engine))
.filter(name => props.use ? loraMatchesUse(name, props.use) : !engine || loraMatchesImageEngine(name, engine))
.slice()
.sort((a, b) => labelFor(a).localeCompare(labelFor(b), undefined, { sensitivity: 'base' }))
})