2024-11-09 16:46:06 +08:00
|
|
|
|
import { BookBackTaskStatus, BookBackTaskType, BookTaskStatus, BookType, TaskExecuteType, BookRepalceDataType, BookImageCategory } from "../../define/enum/bookEnum"
|
|
|
|
|
|
import { MJAction } from "../../define/enum/bookEnum"
|
|
|
|
|
|
import { MJImageType } from "../../define/enum/mjEnum"
|
2024-11-19 20:28:31 +08:00
|
|
|
|
import { BookTaskDetail } from "./bookTaskDetail"
|
2024-08-03 12:46:12 +08:00
|
|
|
|
|
|
|
|
|
|
declare namespace Book {
|
|
|
|
|
|
type SelectBook = {
|
|
|
|
|
|
id?: string,
|
|
|
|
|
|
no?: number,
|
|
|
|
|
|
name?: string,
|
|
|
|
|
|
bookFolderPath?: string,
|
|
|
|
|
|
type?: BookType,
|
|
|
|
|
|
oldVideoPath?: string,
|
|
|
|
|
|
srtPath?: string,
|
|
|
|
|
|
audioPath?: string,
|
2024-10-23 22:59:29 +08:00
|
|
|
|
draftDepend?: string, // 草稿依赖
|
2024-08-03 12:46:12 +08:00
|
|
|
|
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,
|
2024-10-23 22:59:29 +08:00
|
|
|
|
draftDepend?: string,
|
2024-08-03 12:46:12 +08:00
|
|
|
|
draftSrtStyle?: string | null // 草稿字幕样式
|
|
|
|
|
|
backgroundMusic?: string | null // 背景音乐ID
|
|
|
|
|
|
friendlyReminder?: string | null // 友情提示
|
|
|
|
|
|
imageFolder?: string,
|
|
|
|
|
|
customizeImageStyle?: string[],
|
2024-11-09 16:46:06 +08:00
|
|
|
|
cacheImageList?: string[],
|
2024-08-03 12:46:12 +08:00
|
|
|
|
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 // 子图片文件夹地址,多个
|
2024-11-19 20:28:31 +08:00
|
|
|
|
openVideoGenerate?: boolean // 是否开启视频生成
|
2024-08-03 12:46:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-09-04 19:49:20 +08:00
|
|
|
|
// 添加批次任务
|
|
|
|
|
|
type AddBookTask = {
|
|
|
|
|
|
copyBookTask: boolean // 是否复制旧的小说任务
|
|
|
|
|
|
count: number // 批次数量
|
|
|
|
|
|
prefixPrompt?: string // 前缀提示
|
|
|
|
|
|
suffixPrompt?: string // 后缀提示词
|
|
|
|
|
|
selectBookTask?: string // 选择的旧的小说任务
|
|
|
|
|
|
selectTaskDataCategory?: string[] // 选择复制的数据类型
|
2024-10-18 12:39:40 +08:00
|
|
|
|
selectBookId: string // 选择的小说ID
|
2024-09-04 19:49:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-08-03 12:46:12 +08:00
|
|
|
|
// 字幕相关
|
|
|
|
|
|
type Subtitle = {
|
2024-09-14 09:56:10 +08:00
|
|
|
|
start_time: number
|
|
|
|
|
|
end_time: number
|
|
|
|
|
|
srt_value: string
|
2024-08-03 12:46:12 +08:00
|
|
|
|
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 // 视频地址
|
2024-11-19 20:28:31 +08:00
|
|
|
|
generateVideoPath?: string // 生成的视频地址
|
2024-08-03 12:46:12 +08:00
|
|
|
|
audioPath?: string // 音频地址
|
2024-10-23 22:59:29 +08:00
|
|
|
|
draftDepend?: string // 草稿依赖
|
2024-08-03 12:46:12 +08:00
|
|
|
|
word?: string // 文案
|
|
|
|
|
|
oldImage?: string // 旧图片(用于SD的图生图)
|
|
|
|
|
|
afterGpt?: string // GPT生成的文案
|
|
|
|
|
|
startTime?: number // 开始时间
|
|
|
|
|
|
endTime?: number // 结束时间
|
|
|
|
|
|
timeLimit?: string // 事件实现(0 -- 3000)
|
2024-09-14 09:56:10 +08:00
|
|
|
|
subValue?: Subtitle[] | string // 包含的字幕数据
|
2024-08-03 12:46:12 +08:00
|
|
|
|
characterTags?: string[] // 角色标签
|
2024-09-12 14:13:09 +08:00
|
|
|
|
sceneTags?: string[] // 场景标签
|
2024-08-03 12:46:12 +08:00
|
|
|
|
gptPrompt?: string // GPT提示词
|
|
|
|
|
|
mjMessage?: MJMessage // MJ消息
|
2024-11-19 20:28:31 +08:00
|
|
|
|
videoMessage?: BookTaskDetail.VideoMessage // 视频消息
|
2024-08-03 12:46:12 +08:00
|
|
|
|
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
|
|
|
|
|
|
}
|
2024-09-04 19:49:20 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 裁剪小视频的返回数据类型
|
|
|
|
|
|
*/
|
|
|
|
|
|
type BookFrameShortClip = {
|
|
|
|
|
|
startTime: number
|
|
|
|
|
|
endTime: number
|
|
|
|
|
|
videoPath: string
|
|
|
|
|
|
duration: number
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-28 18:38:11 +08:00
|
|
|
|
type DeleteBookTaskDetailCondition = {
|
|
|
|
|
|
id?: string;
|
|
|
|
|
|
bookId?: string;
|
|
|
|
|
|
bookTaskId?: string;
|
|
|
|
|
|
name?: string;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-09-04 19:49:20 +08:00
|
|
|
|
//#region 替换小说数据
|
|
|
|
|
|
|
|
|
|
|
|
type BookReplaceData = {
|
|
|
|
|
|
before: string,
|
|
|
|
|
|
after: string,
|
|
|
|
|
|
replaceAll?: boolean,
|
|
|
|
|
|
type: BookRepalceDataType
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ReplaceDataRes = {
|
|
|
|
|
|
bookTaskDetailId: string,
|
2024-09-14 09:56:10 +08:00
|
|
|
|
newData: string | Subtitle[],
|
|
|
|
|
|
type?: 'reversePrompt' | 'gptPrompt' | 'afterGpt' | 'prompt' | 'subValue',
|
2024-09-04 19:49:20 +08:00
|
|
|
|
reversePromptType?: 'prompt' | 'promptCN'
|
|
|
|
|
|
reversePromptId?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
2024-08-03 12:46:12 +08:00
|
|
|
|
}
|