LaiTool/src/model/book/book.d.ts
lq1405 82ec437b5d v 3.4.2
1. 新增 图/文转视频 菜单界面,专注实现图/文转视频(目前只集成了 MJ VIDEO)
  1. 全新的界面排列,小说列表和批次任务更加分明
  2. 添加转视频进度,在主界面即可看到转视频的比例
  3. 单独的界面去处理图转视频,避免表格数据过多繁琐
  4. 新增分页显示,界面加载更快,也可切换不分页,需要更多的事件等待加载
  5. 单独操作面板,参数修改处理更加清晰,支持多种模式显示,右侧固定或抽屉模式
  6. 批量设置转视频配置,可以批量修改分类
  7. 友好的选择视频界面
2. 重写 软件导出剪映,修复若干草稿导出问题
  1. 修复导出剪映文案和图片对齐会有些许对不上,时长越长越明显
  2. 修复导出草稿关键帧部分问题
  3. 导出的文案通过分镜自动导入,不再需要手动选择SRT
3. 美化 生成草稿界面 弹窗,优化部分逻辑
  1. 删除选择SRT文件,SRT根据聚合推文中导入的SRT自动生成草稿
  2. 只需选择配音文件即可,配音文件和导入的SRT请自行对应
  3. 背景音乐不在内部设置,自行选择文件夹或者是MP3、WAV文件
  4. 背景音乐选择文件夹则读取文件夹,随机获取一个
  5. 背景音乐选择指定的音乐文件则使用选择的
2025-08-09 18:46:07 +08:00

315 lines
8.5 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 { ImageToVideoModels } from "@/define/enum/video"
import { BookBackTaskStatus, BookBackTaskType, BookTaskStatus, BookType, TaskExecuteType, BookRepalceDataType, BookImageCategory } from "../../define/enum/bookEnum"
import { MJAction } from "../../define/enum/bookEnum"
import { MJImageType } from "../../define/enum/mjEnum"
import { BookTaskDetail } from "./bookTaskDetail"
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[],
cacheImageList?: 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 // 子图片文件夹地址,多个
openVideoGenerate?: boolean // 是否开启视频生成
videoCategory?: ImageToVideoModels
}
// 添加批次任务
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
}
interface subVideoPathModel {
localPath: string,
remotePath: string,
taskId: string,
index?: number,
type: ImageToVideoModels
}
type SelectBookTaskDetail = {
id?: string
no?: number
name?: string
bookId?: string
bookTaskId?: string
videoPath?: string // 视频地址
generateVideoPath?: string // 生成的视频地址
subVideoPath?: string[] // 生成的批次视频的地址
subVideoPathObject?: subVideoPath[] //生成视频的完成结构显示
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消息
videoMessage?: BookTaskDetail.VideoMessage // 视频消息
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
}
type DeleteBookTaskDetailCondition = {
id?: string;
bookId?: string;
bookTaskId?: string;
name?: string;
}
//#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
}