LaiTool/src/define/db/model/Book/bookTaskDetail.ts

166 lines
4.3 KiB
TypeScript
Raw Normal View History

2024-06-24 13:11:19 +08:00
import Realm, { ObjectSchema } from 'realm'
import {
BookBackTaskStatus,
BookBackTaskType,
BookTaskStatus,
BookType,
MJAction,
MJCategroy
} from '../../../enum/bookEnum'
export class Subtitle extends Realm.Object<Subtitle> {
startTime: number
endTime: number
srtValue: string
id: string
static schema = {
name: 'Subtitle',
properties: {
startTime: 'int',
endTime: 'int',
srtValue: 'string',
id: 'string'
},
primaryKey: 'id'
}
}
export class MJMessage extends Realm.Object<MJMessage> {
id: string
mjApiUrl: string | null
progress: number
category: MJCategroy
imageClick: string | null // 图片点击(显示的小的)
imageShow: string | null // 图片实际的地址
messageId: string // 消息ID可以是MJ中的也可以是API中的
action: MJAction // 动作(生图,反推之类)
status: string // 状态
message: string | null // 消息
static schema: ObjectSchema = {
name: 'MJMessage',
properties: {
id: 'string',
mjApiUrl: 'string?',
progress: 'int',
category: 'string',
imageClick: 'string?',
imageShow: 'string?',
messageId: 'string',
action: 'string',
status: 'string',
message: 'string?'
},
primaryKey: 'id'
}
}
export class WebuiConfig extends Realm.Object<WebuiConfig> {
sampler_name: string // 采样器名称
negative_prompt: string // 负面提示
batch_size: number // 批次大小
steps: number // 步数
cfg_scale: number // 提示词相关性
denoising_strength: number // 降噪强度
width: number // 宽度
height: number // 高度
seed: number // 种子
init_images: string // 初始图片(垫图的图片地址)
id: string
static schema: ObjectSchema = {
name: 'WebuiConfig',
properties: {
sampler_name: 'string',
negative_prompt: 'string',
batch_size: 'int',
steps: 'int',
cfg_scale: 'int',
denoising_strength: 'int',
width: 'int',
height: 'int',
seed: 'int',
init_images: 'string',
id: 'string'
},
primaryKey: 'id'
}
}
export class SDConfig extends Realm.Object<SDConfig> {
checkpoints: string // 大模型
api: string // api地址
model: string // 生图方式
webuiConfig: WebuiConfig
id: string
static schema: ObjectSchema = {
name: 'SDConfig',
properties: {
checkpoints: 'string',
api: 'string',
model: 'string',
webuiConfig: 'WebuiConfig',
id: 'string'
},
primaryKey: 'id'
}
}
export class BookTaskDetailModel extends Realm.Object<BookTaskDetailModel> {
id: string
no: number
name: string
bookId: string
bookTaskId: string
videoPath: string | null // 视频地址
2024-06-27 16:24:41 +08:00
audioPath: string | null // 音频地址
2024-06-24 13:11:19 +08:00
word: string | null // 文案
oldImage: string | null // 旧图片用于SD的图生图
afterGpt: string | null // GPT生成的文案
startTime: number | null // 开始时间
endTime: number | null // 结束时间
timeLimit: string | null // 事件实现0 -- 3000
subValue: Realm.List<Subtitle> | null // 包含的字幕数据
characterTags: string[] | null // 角色标签
gptPrompt: string | null // GPT提示词
mjMessage: MJMessage | null // MJ消息
outImagePath: string | null // 输出图片地址
2024-06-27 16:24:41 +08:00
subImagePath: string[] | null // 子图片地址
2024-06-24 13:11:19 +08:00
prompt: string | null // 提示
adetailer: boolean // 是否开启修脸
sdConifg: SDConfig | null // SD配置
createTime: Date
updateTime: Date
static schema: ObjectSchema = {
name: 'BookTaskDetail',
properties: {
id: 'string',
no: 'int',
name: 'string',
bookId: { type: 'string', indexed: true },
bookTaskId: { type: 'string', indexed: true },
videoPath: 'string?',
2024-06-27 16:24:41 +08:00
audioPath: 'string?',
2024-06-24 13:11:19 +08:00
word: 'string?',
oldImage: 'string?',
afterGpt: 'string?',
startTime: 'int?',
endTime: 'int?',
timeLimit: 'string?',
subValue: { type: 'list', objectType: 'Subtitle' },
characterTags: { type: 'list', objectType: 'string' },
gptPrompt: 'string?',
mjMessage: 'MJMessage?',
outImagePath: 'string?',
subImagePath: 'string[]',
prompt: 'string?',
adetailer: 'bool',
sdConifg: 'SDConfig?',
createTime: 'date',
updateTime: 'date'
},
// 主键为_id
primaryKey: 'id'
}
}