41 lines
938 B
TypeScript
41 lines
938 B
TypeScript
import type { LoraStackItem } from '~/utils/loras'
|
|
import type { VideoWorkflowId } from '~/utils/videoModels'
|
|
|
|
export type GenerationPresetKind = 'video' | 'image'
|
|
|
|
export type VideoPresetSettings = {
|
|
workflow?: VideoWorkflowId
|
|
turbo?: boolean
|
|
cfg?: number
|
|
fps?: number
|
|
samplerName?: string
|
|
scheduler?: string
|
|
duration?: number
|
|
aspect?: string
|
|
sound?: boolean
|
|
}
|
|
|
|
export type ImagePresetSettings = {
|
|
steps?: number
|
|
cfg?: number
|
|
negative?: string
|
|
}
|
|
|
|
export type GenerationPreset = {
|
|
id: string
|
|
name: string
|
|
kind: GenerationPresetKind
|
|
createdAt: number
|
|
updatedAt: number
|
|
loraStack: LoraStackItem[]
|
|
settings: VideoPresetSettings | ImagePresetSettings
|
|
}
|
|
|
|
export function parseGenerationPresetKind(raw: unknown): GenerationPresetKind {
|
|
return raw === 'image' ? 'image' : 'video'
|
|
}
|
|
|
|
export function normalizePresetName(raw: unknown) {
|
|
return String(raw || '').trim().replace(/\s+/g, ' ').slice(0, 80)
|
|
}
|