Let Image v2 pick a LoRA or LoRA chain.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -160,6 +160,8 @@ export function stillSettingsRows(still: { width?: number; height?: number; sett
|
||||
if (settings.mode !== 'generate' && (settings.consistencyModel != null || settings.consistencyClip != null)) {
|
||||
rows.push({ label: 'Consistency', value: formatPair(settings.consistencyModel, settings.consistencyClip) })
|
||||
}
|
||||
const loras = formatLoras(settings.loraStack, settings.loraName)
|
||||
if (loras) rows.push({ label: 'LoRA', value: loras })
|
||||
if (settings.mode === 'refine' && settings.strength != null) {
|
||||
rows.push({ label: 'Strength', value: formatNum(settings.strength) })
|
||||
}
|
||||
|
||||
@@ -213,3 +213,24 @@ export function filterLorasForStudio(names: string[], xaigenStudio: boolean) {
|
||||
export function filterLoraStackForStudio(stack: unknown, xaigenStudio: boolean) {
|
||||
return normalizeLoraStack(stack).filter(item => xaigenStudio || !isXaigenOnlyLora(item.name))
|
||||
}
|
||||
|
||||
/** Klein / Flux.2 Klein adapters. Must not load on a Krea graph. */
|
||||
export function isKleinImageLora(name: string) {
|
||||
const id = loraIdentityKey(name)
|
||||
return /flux-?2-klein|klein_snofs|flux2-klein-9b-consistency|(^|[^a-z0-9])klein([^a-z0-9]|$)/i.test(id)
|
||||
}
|
||||
|
||||
export function filterLorasForImageEngine(names: string[], engine: 'flux' | 'krea') {
|
||||
if (engine !== 'krea') return names
|
||||
return names.filter(name => !isKleinImageLora(name))
|
||||
}
|
||||
|
||||
export function filterLoraStackForImageEngine(stack: unknown, engine: 'flux' | 'krea') {
|
||||
const items = normalizeLoraStack(stack)
|
||||
if (engine !== 'krea') return items
|
||||
return items.filter(item => !isKleinImageLora(item.name))
|
||||
}
|
||||
|
||||
export function kleinLoraOnKreaMessage(name: string) {
|
||||
return `${loraDisplayName(name)} is a Flux LoRA and cannot be used with Krea.`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user