Filter LoRA picker options by engine tokens
This commit is contained in:
@@ -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' }))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user