Eliminate xAIGen and LTX; AIGen is the only studio.
Drop the studio split, backup-to-xAIGen link, and LTX engine option. Show all LoRAs on AIGen and remove the Photos show/hide inputs toggle so slots stay visible. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,24 +1,17 @@
|
||||
import { isXaigenStudio } from '~/utils/videoModels'
|
||||
|
||||
const PREF_KEY = 'aigen-notify-complete'
|
||||
const TAG = 'aigen-generation-complete'
|
||||
|
||||
function appName() {
|
||||
try {
|
||||
const pub = useRuntimeConfig().public as { instanceName?: string; studio?: string }
|
||||
return String(pub.instanceName || (isXaigenStudio(pub) ? 'xAIGen' : 'AIGen'))
|
||||
const pub = useRuntimeConfig().public as { instanceName?: string }
|
||||
return String(pub.instanceName || 'AIGen')
|
||||
} catch {
|
||||
return 'AIGen'
|
||||
}
|
||||
}
|
||||
|
||||
function appIcon() {
|
||||
try {
|
||||
const pub = useRuntimeConfig().public as { instanceName?: string; studio?: string }
|
||||
return isXaigenStudio(pub) ? '/favicon.svg' : '/favicon-aigen.svg'
|
||||
} catch {
|
||||
return '/favicon-aigen.svg'
|
||||
}
|
||||
return '/favicon-aigen.svg'
|
||||
}
|
||||
|
||||
export function generationNotifySupported() {
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
type ImageV2Mode,
|
||||
type ImageV2Task
|
||||
} from '~/utils/imageV2'
|
||||
import { isXaigenStudio, type VideoWorkflowId } from '~/utils/videoModels'
|
||||
import type { VideoWorkflowId } from '~/utils/videoModels'
|
||||
import { restorePromptParts } from '~/utils/promptParts'
|
||||
|
||||
export type StillGenerationKind = 'image' | 'imagev2'
|
||||
@@ -102,7 +102,7 @@ function formatLoras(stack?: LoraStackItem[], name?: string) {
|
||||
function stillDisplayLoraStack(settings: StillGenerationSettings) {
|
||||
let stack = normalizeLoraStack(settings.loraStack || settings.loraName)
|
||||
const { snofs } = imageV2StackSpecials(stack, settings.engine)
|
||||
if (!snofs && isXaigenStudio() && (settings.snofsModel || settings.snofsClip)) {
|
||||
if (!snofs && (settings.snofsModel || settings.snofsClip)) {
|
||||
const name = imageV2ConceptLoraName(settings.engine || 'flux')
|
||||
if (name) stack = upsertImageV2Lora(stack, name, settings.snofsModel ?? 0, settings.snofsClip ?? 0)
|
||||
}
|
||||
|
||||
+6
-8
@@ -232,22 +232,21 @@ export function loraStacksEqual(a?: unknown, b?: unknown) {
|
||||
))
|
||||
}
|
||||
|
||||
/** User LoRA picker only. `xaigen-*` names are visible only on xAIGen. */
|
||||
export function filterLorasForStudio(names: string[], xaigenStudio: boolean) {
|
||||
/** User LoRA picker: dedupe Comfy-relative paths; all site trees stay visible on AIGen. */
|
||||
export function filterLorasForStudio(names: string[]) {
|
||||
const seen = new Set<string>()
|
||||
const out: string[] = []
|
||||
for (const raw of names) {
|
||||
const name = String(raw || '').trim()
|
||||
if (!name || seen.has(name)) continue
|
||||
if (!xaigenStudio && isXaigenOnlyLora(name)) continue
|
||||
seen.add(name)
|
||||
out.push(name)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
export function filterLoraStackForStudio(stack: unknown, xaigenStudio: boolean) {
|
||||
return normalizeLoraStack(stack).filter(item => xaigenStudio || !isXaigenOnlyLora(item.name))
|
||||
export function filterLoraStackForStudio(stack: unknown) {
|
||||
return normalizeLoraStack(stack)
|
||||
}
|
||||
|
||||
/** Klein / Flux.2 Klein adapters. Must not load on a Krea graph. */
|
||||
@@ -363,9 +362,8 @@ export function loraMatchesUse(name: string, use: LoraUse) {
|
||||
}
|
||||
|
||||
/** Saved stacks may contain unlabelled adapters; never carry a known wrong engine. */
|
||||
export function filterLoraStackForUse(stack: unknown, use: LoraUse, xaigen: boolean) {
|
||||
if (use === 'ltx' && !xaigen) return []
|
||||
return filterLoraStackForStudio(stack, xaigen).filter(item => {
|
||||
export function filterLoraStackForUse(stack: unknown, use: LoraUse) {
|
||||
return filterLoraStackForStudio(stack).filter(item => {
|
||||
if (isSystemGraphLora(item.name)) return false
|
||||
const folder = loraEngineFolder(item.name)
|
||||
if (folder) return folder === use
|
||||
|
||||
+16
-35
@@ -1,6 +1,11 @@
|
||||
export type VideoEngineId = 'minimax' | 'ltx'
|
||||
export const LTX_NEGATIVE =
|
||||
'blurry, low quality, jitter, deformed, static frame, freeze, watermark, bad anatomy, text, subtitles'
|
||||
export const LTX_DISTILLED_LORA = 'ltx-2.3-22b-distilled.safetensors'
|
||||
|
||||
export type VideoEngineId = 'minimax'
|
||||
export type VideoStartId = 'still' | 'text'
|
||||
export type MiniMaxGraphId = 'v1' | 'v2'
|
||||
/** Legacy `ltx` / `ltx-t2v` ids may still appear on old library rows; they coerce to MiniMax. */
|
||||
export type VideoWorkflowId = 'v1' | 'v2' | 't2v' | 'ltx' | 'ltx-t2v'
|
||||
|
||||
export function parseVideoWorkflow(raw: unknown): VideoWorkflowId {
|
||||
@@ -12,27 +17,8 @@ export function parseVideoWorkflow(raw: unknown): VideoWorkflowId {
|
||||
return 'v1'
|
||||
}
|
||||
|
||||
export const LTX_DISABLED_MESSAGE = 'LTX Pink Cherry is not available on this instance'
|
||||
|
||||
export function isXaigenStudio(publicConfig?: { studio?: unknown; instanceName?: unknown }) {
|
||||
let pub = publicConfig
|
||||
if (!pub) {
|
||||
try {
|
||||
pub = useRuntimeConfig().public as { studio?: unknown; instanceName?: unknown }
|
||||
} catch {
|
||||
pub = {}
|
||||
}
|
||||
}
|
||||
return /^xaigen$/i.test(String(pub.studio || '').trim())
|
||||
|| /xaigen/i.test(String(pub.instanceName || '').trim())
|
||||
}
|
||||
|
||||
export function ltxWorkflowEnabled(publicConfig?: { studio?: unknown; instanceName?: unknown }) {
|
||||
return isXaigenStudio(publicConfig)
|
||||
}
|
||||
|
||||
export function videoEngineOf(id: VideoWorkflowId): VideoEngineId {
|
||||
return id.startsWith('ltx') ? 'ltx' : 'minimax'
|
||||
return 'minimax'
|
||||
}
|
||||
|
||||
export function videoStartOf(id: VideoWorkflowId): VideoStartId {
|
||||
@@ -40,7 +26,7 @@ export function videoStartOf(id: VideoWorkflowId): VideoStartId {
|
||||
}
|
||||
|
||||
export function isLtxWorkflow(id: VideoWorkflowId) {
|
||||
return videoEngineOf(id) === 'ltx'
|
||||
return String(id || '').startsWith('ltx')
|
||||
}
|
||||
|
||||
export function isTextToVideo(id: VideoWorkflowId) {
|
||||
@@ -52,30 +38,25 @@ export function minimaxGraphOf(id: VideoWorkflowId): MiniMaxGraphId {
|
||||
}
|
||||
|
||||
export function workflowForExtension(id: VideoWorkflowId): VideoWorkflowId {
|
||||
if (id === 't2v') return 'v1'
|
||||
if (id === 'ltx-t2v') return 'ltx'
|
||||
if (id === 't2v' || id === 'ltx-t2v') return 'v1'
|
||||
if (isLtxWorkflow(id)) return 'v1'
|
||||
return id
|
||||
}
|
||||
|
||||
export function composeVideoWorkflow(engine: VideoEngineId, start: VideoStartId, graph: MiniMaxGraphId = 'v1'): VideoWorkflowId {
|
||||
if (engine === 'ltx') return start === 'text' ? 'ltx-t2v' : 'ltx'
|
||||
export function composeVideoWorkflow(_engine: VideoEngineId, start: VideoStartId, graph: MiniMaxGraphId = 'v1'): VideoWorkflowId {
|
||||
if (start === 'text') return 't2v'
|
||||
return graph === 'v2' ? 'v2' : 'v1'
|
||||
}
|
||||
|
||||
export function coerceVideoWorkflow(raw: unknown, allowLtx?: boolean): VideoWorkflowId {
|
||||
/** Remap retired LTX workflows onto MiniMax. */
|
||||
export function coerceVideoWorkflow(raw: unknown): VideoWorkflowId {
|
||||
const id = parseVideoWorkflow(raw)
|
||||
if ((allowLtx ?? ltxWorkflowEnabled()) || !isLtxWorkflow(id)) return id
|
||||
if (!isLtxWorkflow(id)) return id
|
||||
return composeVideoWorkflow('minimax', videoStartOf(id), 'v1')
|
||||
}
|
||||
|
||||
export function defaultVideoSteps(turbo: boolean, workflow: string = 'v1') {
|
||||
const id = parseVideoWorkflow(workflow)
|
||||
if (!turbo) return isLtxWorkflow(id) ? 12 : 20
|
||||
if (isLtxWorkflow(id)) return 8
|
||||
const id = coerceVideoWorkflow(workflow)
|
||||
if (!turbo) return 20
|
||||
return id === 'v2' ? 6 : 8
|
||||
}
|
||||
|
||||
export const LTX_UNET = 'PinkCherry_FineTune_int8_v1_8_LTX23.safetensors'
|
||||
export const LTX_DISTILLED_LORA = 'ltx-2.3-22b-distilled-lora-384-1.1.safetensors'
|
||||
export const LTX_NEGATIVE = 'blurry, low quality, jitter, deformed, static frame, freeze, watermark, bad anatomy, text, subtitles'
|
||||
|
||||
Reference in New Issue
Block a user