Only list LoRAs tagged for the selected image engine in the dropdown.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-02 21:49:21 -05:00
co-authored by Cursor
parent 46629ca51b
commit eccf8c0081
3 changed files with 33 additions and 6 deletions
+6 -1
View File
@@ -105,6 +105,7 @@ import {
clampLoraStrength,
loraFriendlyName,
loraIdentityKey,
loraMatchesImageEngine,
loraTriggerFor,
makeLoraStackItem,
type LoraStackItem
@@ -121,6 +122,7 @@ const props = withDefaults(defineProps<{
clipStrength?: boolean
triggers?: Record<string, string>
aliases?: Record<string, string>
engine?: 'flux' | 'krea' | ''
}>(), {
label: 'LoRA',
emptyLabel: 'None',
@@ -130,7 +132,8 @@ const props = withDefaults(defineProps<{
disabled: false,
clipStrength: true,
triggers: () => ({}),
aliases: () => ({})
aliases: () => ({}),
engine: ''
})
const emit = defineEmits<{
@@ -145,8 +148,10 @@ const dragOverIndex = ref<number | null>(null)
const availableNames = computed(() => {
const taken = new Set(model.value.map(item => loraIdentityKey(item.name)))
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))
.slice()
.sort((a, b) => labelFor(a).localeCompare(labelFor(b), undefined, { sensitivity: 'base' }))
})