Let Image v2 pick a LoRA or LoRA chain.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-29 17:28:32 -05:00
co-authored by Cursor
parent 852b07bb97
commit cdc69d2bd6
8 changed files with 159 additions and 13 deletions
+21
View File
@@ -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.`
}