Only list LoRAs tagged for the selected image engine in the dropdown.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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' }))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user