LaiTool/src/model/book.d.ts

250 lines
6.6 KiB
TypeScript
Raw Normal View History

2024-08-03 12:46:12 +08:00
import { BookBackTaskStatus, BookBackTaskType, BookTaskStatus, BookType, TaskExecuteType } from "../define/enum/bookEnum"
import { MJAction } from "../define/enum/bookEnum"
import { MJImageType } from "../define/enum/mjEnum"
declare namespace Book {
type SelectBook = {
id?: string,
no?: number,
name?: string,
bookFolderPath?: string,
type?: BookType,
oldVideoPath?: string,
srtPath?: string,
audioPath?: string,
imageFolder?: string,
draftSrtStyle?: string | null // 草稿字幕样式
backgroundMusic?: string | null // 背景音乐ID
friendlyReminder?: string | null // 友情提示
subtitlePosition?: string,
2024-08-08 16:24:47 +08:00
watermarkPosition?: string
2024-08-03 12:46:12 +08:00
updateTime?: Date,
createTime?: Date,
version?: string,
imageStyle?: string[] | null // 软件内置的样式
autoAnalyzeCharacter?: string | null // 自动分析角色设置
customizeImageStyle?: string[] | null // 自定义的样式
videoConfig?: string | null // 合成视频设置
prefixPrompt?: string | null // 前缀
suffixPrompt?: string | null // 后缀
}
2024-08-18 16:22:19 +08:00
type BookBackTaskList = {
id?: string
bookId?: string
bookTaskId?: string
bookTaskDetailId?: string
name?: string // 任务名称,小说名+批次名+分镜名
type?: BookBackTaskType
status?: BookBackTaskStatus
errorMessage?: string
executeType?: TaskExecuteType // 任务执行类型,手动还是自动
createTime?: Date
updateTime?: Date
startTime?: number
endTime?: number
}
2024-08-03 12:46:12 +08:00
type SelectBookTask = {
no?: number,
id?: string,
bookId?: string,
name?: string,
generateVideoPath?: string,
srtPath?: string,
audioPath?: string,
draftSrtStyle?: string | null // 草稿字幕样式
backgroundMusic?: string | null // 背景音乐ID
friendlyReminder?: string | null // 友情提示
imageFolder?: string,
customizeImageStyle?: string[],
prefixPrompt?: string,
suffixPrompt?: string,
styleList?: BookStyle[] | DefineBookStyle[] // 样式列表,
status?: BookTaskStatus,
errorMsg?: string,
version?: string,
imageCategory?: BookImageCategory
imageStyle?: string[] | null // 软件内置的样式
autoAnalyzeCharacter?: string | null // 自动分析角色设置
customizeImageStyle?: string[] | null // 自定义的样式
videoConfig?: string | null // 合成视频设置
prefixPrompt?: string | null // 前缀
suffixPrompt?: string | null // 后缀
isAuto?: boolean // 是否标记全自动
subImageFolder?: string[] | null // 子图片文件夹地址,多个
}
// 字幕相关
type Subtitle = {
startTime: number
endTime: number
srtValue: string
id: string
}
// 返回的MJ消息
type MJMessage = {
id?: string
mjApiUrl?: string
progress: number
category: MJImageType
imageClick?: string // 图片点击(显示的小的)
imageShow?: string // 图片实际的地址
messageId?: string // 消息ID可以是MJ中的也可以是API中的
action?: MJAction // 动作(生图,反推之类)
status: string // 状态
message?: string // 消息
}
type 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
}
type SDConfig = {
checkpoints: string // 大模型
api: string // api地址
model: string // 生图方式
webuiConfig: WebuiConfig
id: string
}
type ReversePrompt = {
id?: string
bookTaskDetailId?: string
prompt?: string
promptCN?: string
isSelect?: boolean
}
type SelectBookTaskDetail = {
id?: string
no?: number
name?: string
bookId?: string
bookTaskId?: string
videoPath?: string // 视频地址
audioPath?: string // 音频地址
word?: string // 文案
oldImage?: string // 旧图片用于SD的图生图
afterGpt?: string // GPT生成的文案
startTime?: number // 开始时间
endTime?: number // 结束时间
timeLimit?: string // 事件实现0 -- 3000
subValue?: string // 包含的字幕数据
characterTags?: string[] // 角色标签
gptPrompt?: string // GPT提示词
mjMessage?: MJMessage // MJ消息
outImagePath?: string // 输出图片地址
subImagePath?: string[] // 子图片地址
imageLock?: boolean // 图片锁
reversePrompt?: ReversePrompt[] // 反推的提示词数据
prompt?: string // 提示
adetailer?: boolean // 是否开启修脸
sdConifg?: SDConfig // SD配置
subtitlePosition?: string // 字幕位置
status?: BookTaskStatus
createTime?: Date
updateTime?: Date
}
type QueryBookTaskCondition = {
id?: string
no?: number
name?: string
bookId?: string
bookTaskId?: string
page?: number
pageSize?: number
}
type QueryBookTaskDetailCondition = {
id?: string
name?: string
bookId?: string
bookTaskId?: string
page?: number
pageSize?: number
}
type QueryBookBackTaskCondition = {
id: string
bookId: string
bookTaskId: string
name: string
type: string
status: string
executeType: string
count: number
}
type UpdateBookTaskListStatus = {
id: string
status: BookBackTaskStatus
errorMessage?: string,
startTime?: number
endTime?: number
}
type BookTask = {
id: string
bookId: string
bookTaskId: string
bookTaskDetailId: string
name: string // 任务名称,小说名+批次名+分镜名
type: BookBackTaskType
status: BookBackTaskStatus
errorMessage?: string
executeType: TaskExecuteType // 任务执行类型,手动还是自动
createTime: Date
updateTime: Date
startTime?: number
endTime?: number
}
// 获取小说文案的参数
type GetVideoFrameTextParams = {
id: string,
type: SubtitleSavePositionType,
videoPath: string,
subtitlePosition?: string
}
type BookStyle = {
id?: string
label?: string
key?: string
value?: string
children?: string
type?: string
prompt?: string
image_url?: string
cref_cw?: number
lora?: string
chinese_prompt?: string
lora_weight?: number
show_image?: string
isShow?: boolean
}
type DefineBookStyle = {
chinese_style?: string
english_style?: string
id?: string
image?: string
}
}