LaiTool/src/model/book.d.ts
lq1405 0c5988ed41 V3.1.8
1. 添加软件高清倍率设置,实现自定义高清倍率(支持两倍、三倍和四倍,默认是两倍)
2. (聚合推文)新增导出草稿。可以依赖做好的草稿文件,只替换图片文件
3. (聚合推文)新增批量生成草稿
4. (聚合推文)修改小说批次任务进行详细界面操作为双击
2024-10-23 22:59:29 +08:00

294 lines
7.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { BookBackTaskStatus, BookBackTaskType, BookTaskStatus, BookType, TaskExecuteType, BookRepalceDataType, BookImageCategory } 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,
draftDepend?: string, // 草稿依赖
imageFolder?: string,
draftSrtStyle?: string | null // 草稿字幕样式
backgroundMusic?: string | null // 背景音乐ID
friendlyReminder?: string | null // 友情提示
subtitlePosition?: string,
watermarkPosition?: string
updateTime?: Date,
createTime?: Date,
version?: string,
imageStyle?: string[] | null // 软件内置的样式
autoAnalyzeCharacter?: string | null // 自动分析角色设置
customizeImageStyle?: string[] | null // 自定义的样式
videoConfig?: string | null // 合成视频设置
prefixPrompt?: string | null // 前缀
suffixPrompt?: string | null // 后缀
}
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
}
type SelectBookTask = {
no?: number,
id?: string,
bookId?: string,
name?: string,
generateVideoPath?: string,
srtPath?: string,
audioPath?: string,
draftDepend?: 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 AddBookTask = {
copyBookTask: boolean // 是否复制旧的小说任务
count: number // 批次数量
prefixPrompt?: string // 前缀提示
suffixPrompt?: string // 后缀提示词
selectBookTask?: string // 选择的旧的小说任务
selectTaskDataCategory?: string[] // 选择复制的数据类型
selectBookId: string // 选择的小说ID
}
// 字幕相关
type Subtitle = {
start_time: number
end_time: number
srt_value: 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 // 音频地址
draftDepend?: string // 草稿依赖
word?: string // 文案
oldImage?: string // 旧图片用于SD的图生图
afterGpt?: string // GPT生成的文案
startTime?: number // 开始时间
endTime?: number // 结束时间
timeLimit?: string // 事件实现0 -- 3000
subValue?: Subtitle[] | string // 包含的字幕数据
characterTags?: string[] // 角色标签
sceneTags?: 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
}
/**
* 裁剪小视频的返回数据类型
*/
type BookFrameShortClip = {
startTime: number
endTime: number
videoPath: string
duration: number
}
//#region 替换小说数据
type BookReplaceData = {
before: string,
after: string,
replaceAll?: boolean,
type: BookRepalceDataType
}
type ReplaceDataRes = {
bookTaskDetailId: string,
newData: string | Subtitle[],
type?: 'reversePrompt' | 'gptPrompt' | 'afterGpt' | 'prompt' | 'subValue',
reversePromptType?: 'prompt' | 'promptCN'
reversePromptId?: string
}
//#endregion
}