Apply and print SNOFS from the LoRA dials, not a leftover Concept LoRA row.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-02 21:33:30 -05:00
co-authored by Cursor
parent ca2380f4ae
commit 9fd96cb990
6 changed files with 94 additions and 28 deletions
+8
View File
@@ -197,6 +197,14 @@ export function isImageV2ConsistencyLora(name: string) {
return id === loraIdentityKey(IMAGE_V2_CONSISTENCY_LORA) || /flux2-klein-9b-consistency/i.test(id)
}
/** Strengths that are actually on the stack cards. Separate snofs_* fields are legacy only. */
export function imageV2StackSpecials(stack: unknown, engine?: ImageV2Engine) {
const items = normalizeLoraStack(stack)
const snofs = items.find(item => isImageV2ConceptLora(item.name, engine))
const consistency = items.find(item => isImageV2ConsistencyLora(item.name))
return { items, snofs, consistency }
}
export function upsertImageV2Lora(stack: unknown, name: string, model: number, clip: number): LoraStackItem[] {
const item = makeLoraStackItem(name, model, clip)
const current = normalizeLoraStack(stack)
+29 -7
View File
@@ -1,5 +1,12 @@
import { loraDisplayName, normalizeLoraStack, type LoraStackItem } from '~/utils/loras'
import type { ImageV2Engine, ImageV2Mode, ImageV2Task } from '~/utils/imageV2'
import {
imageV2ConceptLoraName,
imageV2StackSpecials,
upsertImageV2Lora,
type ImageV2Engine,
type ImageV2Mode,
type ImageV2Task
} from '~/utils/imageV2'
import { isXaigenStudio, type VideoWorkflowId } from '~/utils/videoModels'
import { restorePromptParts } from '~/utils/promptParts'
@@ -72,6 +79,16 @@ function formatLoras(stack?: LoraStackItem[], name?: string) {
}).join(', ')
}
function stillDisplayLoraStack(settings: StillGenerationSettings) {
let stack = normalizeLoraStack(settings.loraStack || settings.loraName)
const { snofs } = imageV2StackSpecials(stack, settings.engine)
if (!snofs && isXaigenStudio() && (settings.snofsModel || settings.snofsClip)) {
const name = imageV2ConceptLoraName(settings.engine || 'flux')
if (name) stack = upsertImageV2Lora(stack, name, settings.snofsModel ?? 0, settings.snofsClip ?? 0)
}
return stack
}
export function normalizeStillSettings(raw: unknown): StillGenerationSettings | undefined {
if (!raw || typeof raw !== 'object') return undefined
const value = raw as Record<string, unknown>
@@ -171,13 +188,18 @@ export function stillSettingsRows(still: { prompt?: string; promptPre?: string;
if (settings.engine) {
rows.push({ label: 'Engine', value: settings.engine === 'krea' ? 'Krea' : 'Flux' })
}
if (isXaigenStudio() && (settings.snofsModel != null || settings.snofsClip != null)) {
rows.push({ label: 'Concept LoRA', value: formatPair(settings.snofsModel, settings.snofsClip) })
const displayStack = stillDisplayLoraStack(settings)
const { consistency } = imageV2StackSpecials(displayStack, settings.engine)
if (settings.mode !== 'generate' && (consistency || settings.consistencyModel != null || settings.consistencyClip != null)) {
rows.push({
label: 'Consistency',
value: formatPair(
consistency?.strengthModel ?? settings.consistencyModel,
consistency?.strengthClip ?? settings.consistencyClip
)
})
}
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)
const loras = formatLoras(displayStack)
if (loras) rows.push({ label: 'LoRA', value: loras })
if (settings.mode === 'refine' && settings.strength != null) {
rows.push({ label: 'Strength', value: formatNum(settings.strength) })