Files
aigen/utils/videoModels.ts
T
TowstyandCursor 08caeb51de 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>
2026-10-27 17:55:59 -05:00

63 lines
2.1 KiB
TypeScript

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 {
const value = String(raw || '').trim()
if (value === 'v2') return 'v2'
if (value === 't2v') return 't2v'
if (value === 'ltx' || value === 'ltx-i2v') return 'ltx'
if (value === 'ltx-t2v') return 'ltx-t2v'
return 'v1'
}
export function videoEngineOf(id: VideoWorkflowId): VideoEngineId {
return 'minimax'
}
export function videoStartOf(id: VideoWorkflowId): VideoStartId {
return id === 't2v' || id === 'ltx-t2v' ? 'text' : 'still'
}
export function isLtxWorkflow(id: VideoWorkflowId) {
return String(id || '').startsWith('ltx')
}
export function isTextToVideo(id: VideoWorkflowId) {
return videoStartOf(id) === 'text'
}
export function minimaxGraphOf(id: VideoWorkflowId): MiniMaxGraphId {
return id === 'v2' ? 'v2' : 'v1'
}
export function workflowForExtension(id: VideoWorkflowId): VideoWorkflowId {
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 (start === 'text') return 't2v'
return graph === 'v2' ? 'v2' : 'v1'
}
/** Remap retired LTX workflows onto MiniMax. */
export function coerceVideoWorkflow(raw: unknown): VideoWorkflowId {
const id = parseVideoWorkflow(raw)
if (!isLtxWorkflow(id)) return id
return composeVideoWorkflow('minimax', videoStartOf(id), 'v1')
}
export function defaultVideoSteps(turbo: boolean, workflow: string = 'v1') {
const id = coerceVideoWorkflow(workflow)
if (!turbo) return 20
return id === 'v2' ? 6 : 8
}